commit
ad5bf47515
|
@ -2,5 +2,8 @@
|
|||
"extends": [
|
||||
"react-app",
|
||||
"react-app/jest"
|
||||
]
|
||||
],
|
||||
"rules": {
|
||||
"no-trailing-spaces": "warn"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
£]TÍ‹#E<14>:"64ìinÊsÃ.4;º7W¬$•Ii§+twvB§»:)ítµ]ÃüŽ{ÐËâ¢wQ„=©ïîI¼¸ÊœDð"ˆˆ¬{qßë$»®ïë÷ñ^Ñïº<C3AF>tœÝßNoÿ|ë<>¿ú|g4}¬Ð©*J~´³‘ˆÁ_‡®ã:=S<>Ôz6oà|z.=}é`Y²€n‘¤¯SÃXÕm6%hsU«é Ìê¤lTæA^+&‡tžÔ3åAc )O RµÅ3m]êr ¤Hä:ØÚÌÇš¼Y%µÂîkMª„̤˅*›¤!Â\ÊÂùf®`/ÚLì]hY2•®£K â¶+ÝÌͲ<C38D>ZÙ¦Ö)<29>x Ë´Xf¤b[.ôBo(h¼õo]a—M<>T&Ó9ý«ÖYµœÚÎ=È4aO—
&-%Û]zääÀÔ`U<>ÂB£ôÖî}}m©¯h©ÍfM–2«¹Y<èE£¢|Y—HªÚ¡ÌàÚZÎ×TÚP†úsSfEîRSfšLÙËt¸‹ÉÔ¼©Z?ë—¦A¹kt†êþq7%;OŠ¦j³5dÆ'ÿµT“ÛàÐI•©[Êÿ[½ØJrˆä >b!Á8”WEŸ÷a<C3B7>Eïyp$⡜Ā!âc<C3A2>`Á1¼$‚¾üåqÈ£dè:b4öǤzþ¤/‚Cèâ` ñ9|ÔˆK Æ
–à¡<>xØbȺÂñ±ç:„:<3A>!0³0½‰ÏBO±Œ8
|
||||
è#n ‚Aˆ4|ăø"ÒbøU 2ß'.×a4’DèÉñq(‡1¥ßç˜ìrÔƺ>_s¡¯žÏÄȃ>±CÞNI„A{Ô·GCN9bdøëÅBä¤'ƒ8ÄÐC£a|oöHDÜŠˆv2å=ÒNqD¶(8ð5í8¶P<‰ø=Dèsæ#XDÃËm7^õåNg×é<±ûÔÎí;×?½rkòÜÍ+×·ß›G¦<>LÇyüÜ6óÞ¯<C39E>_¸ñÁ÷曯ªêÎþ³_¿sò›|åïê»ý<C2BB>÷oÂóΫ½ø>v¼ýÙ
çÚŸÿœ¾üð<C3BC>Ó':ýE~rvù™Ÿû6ÿâìš{
|
14
package.json
14
package.json
|
@ -1,7 +1,13 @@
|
|||
{
|
||||
"name": "app",
|
||||
"name": "retropilot-client",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"start": "react-scripts start",
|
||||
"build": "react-scripts build",
|
||||
"test": "react-scripts test",
|
||||
"eject": "react-scripts eject"
|
||||
},
|
||||
"dependencies": {
|
||||
"@emotion/react": "^11.7.1",
|
||||
"@emotion/styled": "^11.6.0",
|
||||
|
@ -26,12 +32,6 @@
|
|||
"styled-components": "^5.3.3",
|
||||
"web-vitals": "^1.1.2"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "react-scripts start",
|
||||
"build": "react-scripts build",
|
||||
"test": "react-scripts test",
|
||||
"eject": "react-scripts eject"
|
||||
},
|
||||
"browserslist": {
|
||||
"production": [
|
||||
">0.2%",
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
work correctly both with client-side routing and a non-root public URL.
|
||||
Learn how to configure a non-root public URL by running `npm run build`.
|
||||
-->
|
||||
<title>React App</title>
|
||||
<title>RetroPilot Client</title>
|
||||
</head>
|
||||
<body>
|
||||
<noscript>You need to enable JavaScript to run this app.</noscript>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"short_name": "React App",
|
||||
"name": "Create React App Sample",
|
||||
"short_name": "RetroPilot",
|
||||
"name": "RetroPilot Client",
|
||||
"icons": [
|
||||
{
|
||||
"src": "favicon.ico",
|
||||
|
|
24
src/App.js
24
src/App.js
|
@ -43,25 +43,23 @@ function App() {
|
|||
return (
|
||||
<div className="App">
|
||||
|
||||
<ThemeProvider theme={theme}>
|
||||
<CssBaseline />
|
||||
|
||||
<UserProvider>
|
||||
<DeviceStore>
|
||||
<ToastStore>
|
||||
<ThemeProvider theme={theme}>
|
||||
<CssBaseline />
|
||||
|
||||
<GlobalSnack />
|
||||
<UserProvider>
|
||||
<DeviceStore>
|
||||
<ToastStore>
|
||||
|
||||
{session ? <UserAdmin/> : <Login />}
|
||||
<GlobalSnack />
|
||||
|
||||
</ToastStore>
|
||||
</DeviceStore>
|
||||
{session ? <UserAdmin /> : <Login />}
|
||||
|
||||
</UserProvider>
|
||||
</ToastStore>
|
||||
</DeviceStore>
|
||||
|
||||
</UserProvider>
|
||||
</ThemeProvider>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -33,19 +33,20 @@ function loading() {
|
|||
|
||||
export default function EnhancedTable(props) {
|
||||
const [state, dispatch] = useContext(DeviceContext)
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const [ notifState, notifdispatch ] = useContext(SnackbarContext)
|
||||
|
||||
const [, notifDispatch] = useContext(SnackbarContext)
|
||||
>>>>>>> daa27768571b3535403613585ca93a3532ea51d2
|
||||
|
||||
useEffect(() => {
|
||||
deviceController.getBootlogs(props.dongleId).then((res) => {
|
||||
setTimeout(() => {
|
||||
dispatch({ type: "update_dongle_bootlogs", dongle_id: props.dongleId, bootlogs: res.data })
|
||||
}, 1)
|
||||
}).catch((err) => {
|
||||
notifdispatch({type: "NEW_TOAST", msg: 'Failed to load bootlogs'})
|
||||
}).catch(() => {
|
||||
notifDispatch({type: "NEW_TOAST", msg: 'Failed to load bootlogs'})
|
||||
})
|
||||
|
||||
}, [dispatch, notifdispatch, props]);
|
||||
}, [dispatch, notifDispatch, props.dongleId])
|
||||
|
||||
return (
|
||||
<Box sx={{ width: '100%' }}>
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
|
||||
import React from 'react';
|
||||
import Box from '@mui/material/Box';
|
||||
import Paper from '@mui/material/Paper';
|
||||
import React, { } from 'react';
|
||||
//import { JsonFormatter } from 'react-json-formatter'
|
||||
|
||||
/*
|
||||
|
|
|
@ -77,8 +77,7 @@ export default function EnhancedTable(props) {
|
|||
deviceController.getCrashlogs(props.dongleId).then((res) => {
|
||||
dispatch({ type: "update_dongle_bootlogs", dongle_id: props.dongleId, bootlogs: res.data })
|
||||
})
|
||||
|
||||
}, [dispatch, props]);
|
||||
}, [dispatch, props.dongleId]);
|
||||
|
||||
console.log("drives", state.dongles[props.dongleId])
|
||||
console.log("drives", typeof state.dongles[props.dongleId])
|
||||
|
|
|
@ -19,18 +19,17 @@ import * as helpers from "./../../../controllers/helpers"
|
|||
export default function SignIn(props) {
|
||||
|
||||
const [state] = useContext(DeviceContext)
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const [notifState, notifdispatch] = useContext(SnackbarContext)
|
||||
const [, notifDispatch] = useContext(SnackbarContext)
|
||||
|
||||
function pubKeyClipboard(newClip) {
|
||||
navigator.clipboard.writeText(newClip).then(function () {
|
||||
notifdispatch({
|
||||
notifDispatch({
|
||||
type: "NEW_TOAST",
|
||||
open: true,
|
||||
msg: "Successfully copied to clipboard!"
|
||||
})
|
||||
}, function () {
|
||||
notifdispatch({
|
||||
notifDispatch({
|
||||
type: "NEW_TOAST",
|
||||
open: true,
|
||||
msg: "Failed to write to clipboard!"
|
||||
|
|
|
@ -25,8 +25,7 @@ import ViewDrive from "./view_drive"
|
|||
|
||||
export default function EnhancedTable(props) {
|
||||
const [deviceState, dispatch] = useContext(DeviceContext)
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const [ notifState, notifdispatch ] = useContext(SnackbarContext)
|
||||
const [, notifDispatch] = useContext(SnackbarContext)
|
||||
const [state, setState] = useState({selectedSegment: null})
|
||||
|
||||
useEffect(() => {
|
||||
|
@ -34,11 +33,10 @@ export default function EnhancedTable(props) {
|
|||
setTimeout(() => {
|
||||
dispatch({ type: "update_dongle_drive", dongle_id: props.dongleId, drives: res.data })
|
||||
}, 1)
|
||||
}).catch((err) => {
|
||||
notifdispatch({type: "NEW_TOAST", msg: 'Failed to load drives'})
|
||||
}).catch(() => {
|
||||
notifDispatch({type: "NEW_TOAST", msg: 'Failed to load drives'})
|
||||
})
|
||||
|
||||
}, [dispatch, props, notifdispatch]);
|
||||
}, [dispatch, notifDispatch, props.dongleId])
|
||||
|
||||
return (
|
||||
<Box sx={{ width: '100%' }}>
|
||||
|
|
Loading…
Reference in New Issue