diff --git a/interface/src/CustomMuiTheme.tsx b/interface/src/CustomMuiTheme.tsx index 971511ffd..98caf1315 100644 --- a/interface/src/CustomMuiTheme.tsx +++ b/interface/src/CustomMuiTheme.tsx @@ -25,7 +25,7 @@ const theme = createMuiTheme({ success: { main: green[500] } - }, + } }); export default class CustomMuiTheme extends Component { diff --git a/interface/src/project/EMSESPDevicesForm.tsx b/interface/src/project/EMSESPDevicesForm.tsx index 071e6682c..136f14955 100644 --- a/interface/src/project/EMSESPDevicesForm.tsx +++ b/interface/src/project/EMSESPDevicesForm.tsx @@ -2,20 +2,14 @@ import React, { Component, Fragment } from "react"; import { withStyles, Theme, createStyles } from '@material-ui/core/styles'; import { - Table, - TableBody, - TableCell, - TableHead, - TableRow, - TableContainer, - withWidth, - WithWidthProps, - isWidthDown, - Button, + Table, TableBody, TableCell, TableHead, TableRow, TableContainer, + withWidth, WithWidthProps, isWidthDown, + Button, Tooltip, DialogTitle, DialogContent, DialogActions, Box, Dialog, Typography } from "@material-ui/core"; import RefreshIcon from "@material-ui/icons/Refresh"; +import ListIcon from '@material-ui/icons/List'; import { redirectingAuthorizedFetch, withAuthenticatedContext, AuthenticatedContextProps } from '../authentication'; @@ -58,6 +52,17 @@ interface EMSESPDevicesFormState { deviceData?: EMSESPDeviceData; } +const LightTooltip = withStyles((theme: Theme) => ({ + tooltip: { + // backgroundColor: theme.palette.common.black, + backgroundColor: theme.palette.primary.dark, + color: theme.palette.common.white, + boxShadow: theme.shadows[1], + borderRadius: "18px", + fontSize: 11 + }, +}))(Tooltip); + type EMSESPDevicesFormProps = RestFormProps & AuthenticatedContextProps & WithWidthProps; class EMSESPDevicesForm extends Component { @@ -76,9 +81,10 @@ class EMSESPDevicesForm extends Component { - return (this.state.deviceData?.deviceData.length === 0); + return ((this.state.deviceData?.deviceData || []).length === 0); }; + createDeviceItems() { const { width, data } = this.props; return ( @@ -86,9 +92,7 @@ class EMSESPDevicesForm extends Component Devices - - (click to show details) - +

{!this.noDevices() && ( @@ -99,15 +103,18 @@ class EMSESPDevicesForm extends ComponentDevice ID Product ID Version + {data.devices.sort(compareDevices).map(device => ( - this.handleRowClick(device.id)} - > + this.handleRowClick(device.id)}> - {device.type} + + + {device.brand} @@ -124,6 +131,9 @@ class EMSESPDevicesForm extends Component {device.version} + + + ))} @@ -176,7 +186,7 @@ class EMSESPDevicesForm extends Component - No connected Dallas temperature sensors detected + There are no external temperature sensors connected ) @@ -265,10 +275,6 @@ class EMSESPDevicesForm extends Component

@@ -277,25 +283,35 @@ class EMSESPDevicesForm extends Component - - -
- - - - {deviceData.deviceData.map(deviceData => ( - - - {deviceData.n} - - - {deviceData.v} - - - ))} - -
- + {!this.noDeviceData() && ( + + + + + + {deviceData.deviceData.map(deviceData => ( + + + {deviceData.n} + + + {deviceData.v} + + + ))} + +
+
+ )} + {this.noDeviceData() && + ( + + + No data available for this device + + + ) + } ); diff --git a/interface/src/project/EMSESPStatus.ts b/interface/src/project/EMSESPStatus.ts index c3378a7eb..b60d9887f 100644 --- a/interface/src/project/EMSESPStatus.ts +++ b/interface/src/project/EMSESPStatus.ts @@ -29,3 +29,12 @@ export const busStatus = ({ status }: EMSESPStatus) => { return "Unknown"; } } + +export const qualityHighlight = ( value: number, theme: Theme) => { + if (value >= 95) { + return theme.palette.success.main; + } + + return theme.palette.error.main; +} + diff --git a/interface/src/project/EMSESPStatusForm.tsx b/interface/src/project/EMSESPStatusForm.tsx index 0f32be4b5..3dcfc828f 100644 --- a/interface/src/project/EMSESPStatusForm.tsx +++ b/interface/src/project/EMSESPStatusForm.tsx @@ -1,12 +1,11 @@ import React, { Component, Fragment } from "react"; -import { WithTheme, withTheme, withStyles, Theme, createStyles } from "@material-ui/core/styles"; +import { WithTheme, withTheme } from "@material-ui/core/styles"; import { TableContainer, Table, TableBody, TableCell, - TableHead, TableRow, List, ListItem, @@ -14,7 +13,7 @@ import { ListItemText, withWidth, WithWidthProps, - isWidthDown + isWidthDown, } from "@material-ui/core"; import RefreshIcon from "@material-ui/icons/Refresh"; @@ -30,7 +29,7 @@ import { import { busStatus, busStatusHighlight, - isConnected + isConnected, } from "./EMSESPStatus"; import { EMSESPStatus } from "./EMSESPtypes"; @@ -41,18 +40,6 @@ function formatNumber(num: number) { type EMSESPStatusFormProps = RestFormProps & WithTheme & WithWidthProps; -const StyledTableCell = withStyles((theme: Theme) => - createStyles({ - head: { - backgroundColor: theme.palette.common.black, - color: theme.palette.common.white, - }, - body: { - fontSize: 14, - }, - }), -)(TableCell); - class EMSESPStatusForm extends Component { createListItems() { @@ -65,41 +52,39 @@ class EMSESPStatusForm extends Component { - + {isConnected(data) && ( - - - Statistic - # Telegrams - - - (Rx) Received telegrams + Received Telegrams + + {formatNumber(data.rx_received)} - {formatNumber(data.rx_received)} - (Rx) Quality + Rx Quality + + {data.rx_quality} % - {formatNumber(data.rx_quality)}% - (Tx) Sent telegrams + Sent Telegrams + + {formatNumber(data.tx_sent)} - {formatNumber(data.tx_sent)} - (Tx) Quality + Tx Quality + + {data.tx_quality} % - {formatNumber(data.tx_quality)}%
diff --git a/interface/src/security/SecuritySettingsForm.tsx b/interface/src/security/SecuritySettingsForm.tsx index 6407f5f72..41d5bbaa8 100644 --- a/interface/src/security/SecuritySettingsForm.tsx +++ b/interface/src/security/SecuritySettingsForm.tsx @@ -24,9 +24,9 @@ class SecuritySettingsForm extends React.Component { { /> - The JWT secret is used to sign authentication tokens. If you modify the JWT Secret, all users will be signed out. + The Super User password is used to sign authentication tokens and also the Console's `su` password. If you modify this all users will be signed out.