Reduced warnings
parent
95136b6cb0
commit
2c8e86a4c3
|
@ -37,7 +37,7 @@ function App() {
|
||||||
mode: window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light',
|
mode: window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light',
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
[true],
|
[],
|
||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -33,6 +33,7 @@ function loading() {
|
||||||
|
|
||||||
export default function EnhancedTable(props) {
|
export default function EnhancedTable(props) {
|
||||||
const [state, dispatch] = useContext(DeviceContext)
|
const [state, dispatch] = useContext(DeviceContext)
|
||||||
|
// eslint-disable-next-line no-unused-vars
|
||||||
const [ notifState, notifdispatch ] = useContext(SnackbarContext)
|
const [ notifState, notifdispatch ] = useContext(SnackbarContext)
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
@ -44,7 +45,7 @@ export default function EnhancedTable(props) {
|
||||||
notifdispatch({type: "NEW_TOAST", msg: 'Failed to load bootlogs'})
|
notifdispatch({type: "NEW_TOAST", msg: 'Failed to load bootlogs'})
|
||||||
})
|
})
|
||||||
|
|
||||||
}, []);
|
}, [dispatch, notifdispatch, props]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Box sx={{ width: '100%' }}>
|
<Box sx={{ width: '100%' }}>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
|
|
||||||
import Box from '@mui/material/Box';
|
import Box from '@mui/material/Box';
|
||||||
import Paper from '@mui/material/Paper';
|
import Paper from '@mui/material/Paper';
|
||||||
import React, { useContext } from 'react';
|
import React, { } from 'react';
|
||||||
//import { JsonFormatter } from 'react-json-formatter'
|
//import { JsonFormatter } from 'react-json-formatter'
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
|
|
||||||
import DeleteIcon from '@mui/icons-material/Delete';
|
import DeleteIcon from '@mui/icons-material/Delete';
|
||||||
import FavoriteBorderIcon from '@mui/icons-material/FavoriteBorder';
|
import FavoriteBorderIcon from '@mui/icons-material/FavoriteBorder';
|
||||||
import OpenInNewIcon from '@mui/icons-material/OpenInNew';
|
import OpenInNewIcon from '@mui/icons-material/OpenInNew';
|
||||||
|
@ -69,14 +71,14 @@ function loading() {
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function EnhancedTable(props) {
|
export default function EnhancedTable(props) {
|
||||||
|
// eslint-disable-next-line no-unused-vars
|
||||||
const [state, dispatch] = useContext(DeviceContext)
|
const [state, dispatch] = useContext(DeviceContext)
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
deviceController.getCrashlogs(props.dongleId).then((res) => {
|
deviceController.getCrashlogs(props.dongleId).then((res) => {
|
||||||
dispatch({ type: "update_dongle_bootlogs", dongle_id: props.dongleId, bootlogs: res.data })
|
dispatch({ type: "update_dongle_bootlogs", dongle_id: props.dongleId, bootlogs: res.data })
|
||||||
})
|
})
|
||||||
|
|
||||||
}, []);
|
}, [dispatch, props]);
|
||||||
|
|
||||||
console.log("drives", state.dongles[props.dongleId])
|
console.log("drives", state.dongles[props.dongleId])
|
||||||
console.log("drives", typeof state.dongles[props.dongleId])
|
console.log("drives", typeof state.dongles[props.dongleId])
|
||||||
|
|
|
@ -19,6 +19,7 @@ import * as helpers from "./../../../controllers/helpers"
|
||||||
export default function SignIn(props) {
|
export default function SignIn(props) {
|
||||||
|
|
||||||
const [state] = useContext(DeviceContext)
|
const [state] = useContext(DeviceContext)
|
||||||
|
// eslint-disable-next-line no-unused-vars
|
||||||
const [notifState, notifdispatch] = useContext(SnackbarContext)
|
const [notifState, notifdispatch] = useContext(SnackbarContext)
|
||||||
|
|
||||||
function pubKeyClipboard(newClip) {
|
function pubKeyClipboard(newClip) {
|
||||||
|
|
|
@ -25,6 +25,7 @@ import ViewDrive from "./view_drive"
|
||||||
|
|
||||||
export default function EnhancedTable(props) {
|
export default function EnhancedTable(props) {
|
||||||
const [deviceState, dispatch] = useContext(DeviceContext)
|
const [deviceState, dispatch] = useContext(DeviceContext)
|
||||||
|
// eslint-disable-next-line no-unused-vars
|
||||||
const [ notifState, notifdispatch ] = useContext(SnackbarContext)
|
const [ notifState, notifdispatch ] = useContext(SnackbarContext)
|
||||||
const [state, setState] = useState({selectedSegment: null})
|
const [state, setState] = useState({selectedSegment: null})
|
||||||
|
|
||||||
|
@ -37,7 +38,7 @@ export default function EnhancedTable(props) {
|
||||||
notifdispatch({type: "NEW_TOAST", msg: 'Failed to load drives'})
|
notifdispatch({type: "NEW_TOAST", msg: 'Failed to load drives'})
|
||||||
})
|
})
|
||||||
|
|
||||||
}, []);
|
}, [dispatch, props, notifdispatch]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Box sx={{ width: '100%' }}>
|
<Box sx={{ width: '100%' }}>
|
||||||
|
|
|
@ -1,7 +1,4 @@
|
||||||
import DeleteIcon from '@mui/icons-material/Delete';
|
|
||||||
import FavoriteBorderIcon from '@mui/icons-material/FavoriteBorder';
|
|
||||||
import OpenInNewIcon from '@mui/icons-material/OpenInNew';
|
import OpenInNewIcon from '@mui/icons-material/OpenInNew';
|
||||||
import { Skeleton } from '@mui/material';
|
|
||||||
import Box from '@mui/material/Box';
|
import Box from '@mui/material/Box';
|
||||||
import IconButton from '@mui/material/IconButton';
|
import IconButton from '@mui/material/IconButton';
|
||||||
import Paper from '@mui/material/Paper';
|
import Paper from '@mui/material/Paper';
|
||||||
|
@ -12,19 +9,16 @@ import TableContainer from '@mui/material/TableContainer';
|
||||||
import TableHead from '@mui/material/TableHead';
|
import TableHead from '@mui/material/TableHead';
|
||||||
import TableRow from '@mui/material/TableRow';
|
import TableRow from '@mui/material/TableRow';
|
||||||
import Tooltip from '@mui/material/Tooltip';
|
import Tooltip from '@mui/material/Tooltip';
|
||||||
import React, { useContext, useEffect, useState } from 'react';
|
import React, { useContext, useState } from 'react';
|
||||||
import { context as DeviceContext } from "./../../../context/devices";
|
import { context as DeviceContext } from "./../../../context/devices";
|
||||||
import { context as SnackbarContext } from "./../../../context/toast";
|
|
||||||
import * as deviceController from "./../../../controllers/devices";
|
import * as deviceController from "./../../../controllers/devices";
|
||||||
import * as helpers from "./../../../controllers/helpers"
|
|
||||||
import Typography from "@mui/material/Typography"
|
import Typography from "@mui/material/Typography"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export default function EnhancedTable(props) {
|
export default function EnhancedTable(props) {
|
||||||
const [deviceState, dispatch] = useContext(DeviceContext)
|
const [deviceState] = useContext(DeviceContext)
|
||||||
const [notifState, notifdispatch] = useContext(SnackbarContext)
|
|
||||||
|
|
||||||
const [state, setState] = useState({ loading: true, firstReqSent: false, segment: null, drive: null })
|
const [state, setState] = useState({ loading: true, firstReqSent: false, segment: null, drive: null })
|
||||||
|
|
||||||
|
@ -57,7 +51,7 @@ export default function EnhancedTable(props) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// test
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -75,7 +69,6 @@ export default function EnhancedTable(props) {
|
||||||
let gitCommit = "";
|
let gitCommit = "";
|
||||||
let metadata = {};
|
let metadata = {};
|
||||||
|
|
||||||
let response = ""
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
metadata = JSON.parse(drive.metadata);
|
metadata = JSON.parse(drive.metadata);
|
||||||
|
@ -103,7 +96,7 @@ export default function EnhancedTable(props) {
|
||||||
if (directoryTree) {
|
if (directoryTree) {
|
||||||
for (var i in directoryTree.children) {
|
for (var i in directoryTree.children) {
|
||||||
// skip any non-directory entries (for example m3u8 file in the drive directory)
|
// skip any non-directory entries (for example m3u8 file in the drive directory)
|
||||||
if (directoryTree.children[i].type != 'directory') continue;
|
if (directoryTree.children[i].type !== 'directory') continue;
|
||||||
|
|
||||||
var segment = directoryTree.children[i].name;
|
var segment = directoryTree.children[i].name;
|
||||||
|
|
||||||
|
@ -158,7 +151,7 @@ export default function EnhancedTable(props) {
|
||||||
{
|
{
|
||||||
directorySegments ? Object.keys(directorySegments).map((key, index) => {
|
directorySegments ? Object.keys(directorySegments).map((key, index) => {
|
||||||
|
|
||||||
{
|
|
||||||
return Object.keys(directorySegments[key]).map((key1, index1) => (
|
return Object.keys(directorySegments[key]).map((key1, index1) => (
|
||||||
<TableRow hover>
|
<TableRow hover>
|
||||||
<TableCell >{key}</TableCell>
|
<TableCell >{key}</TableCell>
|
||||||
|
@ -175,8 +168,8 @@ export default function EnhancedTable(props) {
|
||||||
|
|
||||||
|
|
||||||
</TableRow>
|
</TableRow>
|
||||||
))
|
))
|
||||||
}
|
|
||||||
|
|
||||||
}) : null
|
}) : null
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue