1 line
19 KiB
Plaintext
1 line
19 KiB
Plaintext
{"version":3,"sources":["components/StatusChip.tsx","api/index.ts","pages/Dashboard.tsx","components/SessionPictures.tsx","pages/Session.tsx","App.tsx","reportWebVitals.ts","index.tsx"],"names":["Status","createClient","body","a","axios","post","res","data","client_id","getClient","id","get","startSession","clientId","message","error","getSession","killSession","delete","restartSession","getStatus","status","Dashboard","history","useHistory","useState","setError","handleSubmit","values","phone","length","name","email","parseInt","replace","push","Title","className","level","Text","onFinish","labelCol","span","wrapperCol","label","minLength","type","justify","danger","onClick","htmlType","SessionPictures","urls","setUrls","activeUrl","setActiveUrl","useEffect","interval","setInterval","photos","clearInterval","closeModal","u","visible","onOk","cancelText","onCancel","width","src","alt","align","style","background","Math","floor","sort","b","split","localeCompare","map","title","colors","StatusChip","poll","setStatus","color","display","margin","Session","props","match","params","client","setClient","active","setActive","handleStartSession","loading","handleRestartSession","handleExit","handleNuke","success","has_photos","disabled","onConfirm","console","log","process","App","path","component","exact","reportWebVitals","onPerfEntry","Function","then","getCLS","getFID","getFCP","getLCP","getTTFB","ReactDOM","render","document","getElementById"],"mappings":"yJAKYA,E,yMCSCC,EAAY,uCAAG,WAAOC,GAAP,eAAAC,EAAA,4FAERC,IAAMC,KAAN,eAAkDH,GAF1C,cAEpBI,EAFoB,yBAGnBA,EAAIC,KAAKC,WAHU,2CAAH,sDAMZC,EAAS,uCAAG,WAAOC,GAAP,eAAAP,EAAA,4FAQLC,IAAMO,IAAN,uBAAkCD,IAR7B,cAQjBJ,EARiB,yBAShBA,EAAIC,MATY,2CAAH,sDAWTK,EAAY,uCAAG,WAAOC,GAAP,eAAAV,EAAA,+EAENC,IAAMC,KAAN,uBAA2BQ,EAA3B,aAFM,cAElBP,EAFkB,yBAGjBA,EAAIC,MAHa,uCAKxBO,IAAQC,MAAM,2DALU,iFAAH,sDAUZC,EAAU,uCAAG,WAAOH,GAAP,eAAAV,EAAA,sEACNC,IAAMO,IAAN,uBACAE,EADA,aADM,cAClBP,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AJb,SAME,cAAC,IAAD,CAAQpD,KAAK,UAAUyD,UAAWT,EAAlC,4BAJI,SAQN,cAAC,IAAD,CAEES,UAAWT,EACXd,MAAM,6CACNwB,UAAWJ,EAJb,SAME,cAAC,IAAD,CAAQpD,QAAM,EAACuD,UAAWT,EAA1B,4BALI,QAUN,cAAC,EAAD,CAAYX,MAAM,OAGpB,cAAC,IAAD,IACA,cAAC,IAAD,CAAK9C,UAAU,WAAf,SACGyD,GAAU,cAAC,EAAD,CAAiBjF,SAAUA,UCvG9C4F,QAAQC,IAAI,MAAOC,cAeJC,MAbf,WACE,OACE,cAAC,IAAD,UACE,qBAAKvE,UAAU,MAAf,SACE,eAAC,IAAD,WACE,cAAC,IAAD,CAAOwE,KAAK,sBAAsBC,UAAWtB,IAC7C,cAAC,IAAD,CAAOuB,OAAK,EAACF,KAAK,IAAIC,UAAWxF,YCD5B0F,EAZS,SAACC,GACnBA,GAAeA,aAAuBC,UACxC,8BAAqBC,MAAK,YAAkD,IAA/CC,EAA8C,EAA9CA,OAAQC,EAAsC,EAAtCA,OAAQC,EAA8B,EAA9BA,OAAQC,EAAsB,EAAtBA,OAAQC,EAAc,EAAdA,QAC3DJ,EAAOH,GACPI,EAAOJ,GACPK,EAAOL,GACPM,EAAON,GACPO,EAAQP,OCFdQ,IAASC,OAAO,cAAC,EAAD,IAASC,SAASC,eAAe,SAKjDZ,M","file":"static/js/main.4e85c3ca.chunk.js","sourcesContent":["import { Tag } from 'antd'\nimport { PresetColorType } from 'antd/lib/_util/colors'\nimport { useEffect, useState } from 'react'\nimport { getStatus } from '../api'\n\nexport enum Status {\n 'Standing By...',\n 'Warming Up...',\n 'Capturing Photo',\n 'Capturing Grid',\n 'Writing To Disk',\n 'Downloading!',\n}\n\nconst colors: Partial<PresetColorType>[] = [\n 'lime',\n 'gold',\n 'volcano',\n 'magenta',\n 'geekblue',\n]\n\ntype Props = {\n poll: boolean\n}\n\nexport const StatusChip = ({ poll }: Props) => {\n const [status, setStatus] = useState<Status>(Status['Standing By...'])\n\n useEffect(() => {\n const get = async () => {\n if (!poll) return\n const status = await getStatus()\n setStatus(status)\n }\n\n const interval = setInterval(get, 1000 / 4)\n\n return () => clearInterval(interval)\n }, [poll])\n\n return (\n <Tag color={colors[status]} style={{ display: 'flex' }}>\n <span style={{ margin: 'auto' }}>{Status[status]}</span>\n </Tag>\n )\n}\n","import { Client } from '../types'\nimport axios from 'axios'\nimport { message } from 'antd'\nimport { Status } from '../components/StatusChip'\n\nconst dev = process.env.NODE_ENV === 'development'\n\nif (dev) {\n const host = 'http://192.168.1.107:5000'\n axios.defaults.baseURL = host\n}\n\nconst mock = false\n\nexport const createClient = async (body: Omit<Client, 'has_photos'>) => {\n if (mock) return 'test'\n const res = await axios.post<{ client_id: string }>(`/api/clients`, body)\n return res.data.client_id\n}\n\nexport const getClient = async (id: string): Promise<Client> => {\n if (mock)\n return {\n name: 'Test Client',\n has_photos: false,\n email: 'test@test.test',\n phone: 1234567890,\n }\n const res = await axios.get<Client>(`/api/clients/${id}`)\n return res.data\n}\nexport const startSession = async (clientId: string) => {\n try {\n const res = await axios.post(`/api/clients/${clientId}/session`)\n return res.data\n } catch (err) {\n message.error('Something went wrong, check connection with the machine')\n return err\n }\n}\n\nexport const getSession = async (clientId: string) => {\n const res = await axios.get<{ photos: string[] }>(\n `/api/clients/${clientId}/session`,\n )\n return res.data // session data\n}\n\nexport const killSession = async (clientId: string) => {\n await axios.delete(`/api/clients/${clientId}/session`)\n}\n\nexport const restartSession = async (clientId: string) => {\n await killSession(clientId)\n await startSession(clientId)\n}\n\n// TOOD: Get status\n\nexport const getStatus = async (): Promise<Status> => {\n const res = await axios.get<{ status: Status }>('/api/status')\n return res.data.status\n}\n\n// Someday\n\nexport const getClients = async (): Promise<Client[]> => {\n const res = await axios.get<Client[]>(`/api/clients`)\n return res.data\n}\n\nexport const cleanup = () => {\n // send\n}\n","import { Button, Divider, Form, Input, message, Row, Typography } from 'antd'\nimport FormItem from 'antd/lib/form/FormItem'\nimport { Store } from 'antd/lib/form/interface'\nimport { Content } from 'antd/lib/layout/layout'\nimport React from 'react'\nimport { useState } from 'react'\nimport { useHistory } from 'react-router-dom'\nimport { createClient } from '../api'\n\nexport const Dashboard = () => {\n const history = useHistory()\n const [error, setError] = useState<string | null>(null)\n\n const handleReset = () => {}\n\n const handleSubmit = async (values: Store) => {\n if (values.phone.length < 10) {\n // helpful message\n message.error('Check all fields!')\n setError('Phone number needs to be a length of at least 10')\n return\n }\n\n const client_id = await createClient({\n name: values.name,\n email: values.email,\n phone: parseInt(values.phone.replace(/\\D/g, '')),\n })\n\n history.push(`/sessions/${client_id}`)\n }\n\n return (\n <Content>\n <Typography.Title className=\"page-head\" level={3}>\n Dashboard\n </Typography.Title>\n <Typography.Text>\n Enter the name, email and phone number of the subject\n </Typography.Text>\n <Divider />\n <Form\n className=\"dashboard-form\"\n onFinish={handleSubmit}\n labelCol={{ span: 8 }}\n wrapperCol={{ span: 16 }}\n >\n <FormItem label=\"name\" name=\"name\">\n <Input minLength={3} />\n </FormItem>\n <FormItem label=\"email\" name=\"email\">\n <Input type=\"email\" />\n </FormItem>\n <FormItem label=\"phone\" name=\"phone\">\n <Input type=\"tel\" minLength={10} />\n </FormItem>\n <Row justify=\"space-between\">\n <Button danger onClick={handleReset}>\n Reset\n </Button>\n <Button htmlType=\"submit\" type=\"primary\">\n Start Session\n </Button>\n </Row>\n {error && <p className=\"error\">{error}</p>}\n </Form>\n </Content>\n )\n}\n","import React, { useEffect, useState } from 'react'\nimport { Card, Modal, Row, Spin, Typography } from 'antd'\nimport { getSession } from '../api'\n\ntype Props = {\n clientId: string\n}\n\nexport const SessionPictures = ({ clientId }: Props) => {\n const [urls, setUrls] = useState<string[] | null>(null)\n const [activeUrl, setActiveUrl] = useState<string | null>(null)\n\n useEffect(() => {\n const get = async () => {\n if (urls && urls.length >= 89 * 1) {\n return\n }\n\n const { photos } = await getSession(clientId)\n if (photos.length) setUrls(photos)\n }\n\n const interval = setInterval(get, 250)\n\n return () => clearInterval(interval)\n }, [clientId, urls])\n\n const closeModal = () => setActiveUrl(null)\n\n const host =\n process.env.NODE_ENV === 'development' ? 'http://192.168.1.107:5000' : ''\n\n if (!urls?.length) return null\n\n const u = urls.length / 89\n\n return (\n <>\n <Modal\n visible={!!activeUrl}\n onOk={closeModal}\n cancelText={null}\n onCancel={closeModal}\n width=\"50%\"\n >\n <img\n width=\"100%\"\n onClick={closeModal}\n src={`${host}/output/${clientId}/${activeUrl}`}\n alt=\"large modal\"\n ></img>\n </Modal>\n <Row align=\"middle\" justify=\"center\">\n <Typography.Title level={3}>Session Pictures</Typography.Title>\n <Typography.Text>{urls.length}/ 89 loaded</Typography.Text>\n </Row>\n\n <div className=\"loading-bar-container\">\n <div\n className=\"loading-bar\"\n style={{\n width: `${u * 100}%`,\n background: `hsl(${Math.floor(1 * 120)}, 90%, 70%)`,\n }}\n ></div>\n </div>\n <div className=\"photo-wall\">\n {urls ? (\n urls\n .sort((a, b) => a.split('_')[0].localeCompare(b.split('_')[0]))\n .map((src) => (\n <Card key={src} className=\"photo\" title={src.split('_')[0]}>\n <img\n onClick={() => setActiveUrl(src)}\n src={`${host}/output/${clientId}/${src}`}\n alt=\"lol\"\n />\n </Card>\n ))\n ) : (\n <Spin />\n )}\n </div>\n </>\n )\n}\n","import React, { useEffect, useState } from 'react'\nimport { RouteComponentProps, useHistory } from 'react-router-dom'\nimport { getClient, killSession, restartSession, startSession } from '../api'\nimport { SessionPictures } from '../components/SessionPictures'\nimport { StatusChip } from '../components/StatusChip'\n\nimport { Button, Divider, message, Popconfirm, Row, Typography } from 'antd'\nimport { Content } from 'antd/lib/layout/layout'\nimport { Client } from '../types'\n\ntype Props = RouteComponentProps<{ clientId: string }>\n\nexport const Session = (props: Props) => {\n const history = useHistory()\n const { clientId } = props.match.params\n const [client, setClient] = useState<Client | null>(null)\n const [active, setActive] = useState(false)\n\n const handleStartSession = async () => {\n message.loading('Photo sequence starting! Stand by...')\n await startSession(clientId)\n setActive(true)\n }\n\n const handleRestartSession = async () => {\n setActive(false)\n message.loading(\n 'Deleting photos & restarting capture sequence! Stand by...',\n )\n await restartSession(clientId)\n setActive(true)\n }\n\n const handleExit = async () => {\n history.push('/')\n }\n\n const handleNuke = async () => {\n await killSession(clientId)\n message.success('Photos Deleted! Going back to dashboard')\n history.push('/')\n }\n\n useEffect(() => {\n const get = async () => {\n const client = await getClient(clientId)\n setClient(client)\n if (client.has_photos) setActive(true)\n }\n\n get()\n }, [clientId])\n\n return (\n <Content>\n <Typography.Title className=\"page-head\" level={3}>\n Session View\n </Typography.Title>\n\n <Row justify=\"space-around\" style={{ width: '60%', margin: 'auto' }}>\n <Typography.Text>\n <strong>Name:</strong> {client?.name}\n </Typography.Text>\n <Typography.Text>\n <strong>Email:</strong> {client?.email}\n </Typography.Text>\n <Typography.Text>\n <strong>Phone:</strong> {client?.phone}\n </Typography.Text>\n </Row>\n <Divider />\n\n <Row justify=\"center\" className=\"session-toolbar\">\n <Button key=\"finish\" onClick={handleExit}>\n Back To Dashboard\n </Button>\n <Button\n key=\"startsession\"\n disabled={active}\n type=\"primary\"\n onClick={handleStartSession}\n >\n Capture\n </Button>\n <Popconfirm\n disabled={!active}\n key=\"retry\"\n title=\"Re-capture set?\"\n onConfirm={handleRestartSession}\n >\n <Button type=\"default\" disabled={!active}>\n Retry Capture\n </Button>\n </Popconfirm>\n <Popconfirm\n key=\"nuke\"\n disabled={!active}\n title=\"Delete all photos and return to dashboard?\"\n onConfirm={handleNuke}\n >\n <Button danger disabled={!active}>\n Abort Session\n </Button>\n </Popconfirm>\n\n <StatusChip poll={true} />\n </Row>\n\n <Divider />\n <Row className=\"controls\">\n {active && <SessionPictures clientId={clientId} />}\n </Row>\n </Content>\n )\n}\n","import React from 'react'\nimport './App.css'\n\nimport { BrowserRouter, Switch, Route } from 'react-router-dom'\nimport { Dashboard } from './pages/Dashboard'\nimport { Session } from './pages/Session'\n\nconsole.log('ENV', process.env.NODE_ENV)\n\nfunction App() {\n return (\n <BrowserRouter>\n <div className=\"App\">\n <Switch>\n <Route path=\"/sessions/:clientId\" component={Session} />\n <Route exact path=\"/\" component={Dashboard} />\n </Switch>\n </div>\n </BrowserRouter>\n )\n}\n\nexport default App\n","import { ReportHandler } from 'web-vitals';\n\nconst reportWebVitals = (onPerfEntry?: ReportHandler) => {\n if (onPerfEntry && onPerfEntry instanceof Function) {\n import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {\n getCLS(onPerfEntry);\n getFID(onPerfEntry);\n getFCP(onPerfEntry);\n getLCP(onPerfEntry);\n getTTFB(onPerfEntry);\n });\n }\n};\n\nexport default reportWebVitals;\n","import React from 'react'\nimport ReactDOM from 'react-dom'\nimport './index.css'\nimport 'antd/dist/antd.css'\nimport App from './App'\nimport reportWebVitals from './reportWebVitals'\n\nReactDOM.render(<App />, document.getElementById('root'))\n\n// If you want to start measuring performance in your app, pass a function\n// to log results (for example: reportWebVitals(console.log))\n// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals\nreportWebVitals()\n"],"sourceRoot":""} |