Merged with conflicts, reduced warnings

clean build
main
AdamSBlack 2022-01-07 17:49:15 +00:00
commit ad5bf47515
No known key found for this signature in database
GPG Key ID: E66E51A97D150E28
11 changed files with 42 additions and 43 deletions

View File

@ -2,5 +2,8 @@
"extends": [
"react-app",
"react-app/jest"
]
],
"rules": {
"no-trailing-spaces": "warn"
}
}

2
license.gpg 100644
View File

@ -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Õ m­6%h sU«é Ìê¤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©ÍfM2«¹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 Æ –à¡<>bȺÂñ±ç:„:<3A>!0³0½‰ÏBO±Œ8
è#n Aˆ4|ăø"ÒbøU 2ß'.×a4DèÉñ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ÿâìš{

View File

@ -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%",

View File

@ -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>

View File

@ -1,6 +1,6 @@
{
"short_name": "React App",
"name": "Create React App Sample",
"short_name": "RetroPilot",
"name": "RetroPilot Client",
"icons": [
{
"src": "favicon.ico",

View File

@ -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>
);
}

View File

@ -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%' }}>

View File

@ -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'
/*

View File

@ -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])

View File

@ -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!"

View File

@ -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%' }}>