formatting

This commit is contained in:
proddy
2024-09-08 19:55:34 +02:00
parent 20a1a6f952
commit 859b218609

View File

@@ -6,8 +6,12 @@ import WarningIcon from '@mui/icons-material/Warning';
import { Box, Button, Checkbox, MenuItem, TextField, styled } from '@mui/material'; import { Box, Button, Checkbox, MenuItem, TextField, styled } from '@mui/material';
import Grid from '@mui/material/Grid2'; import Grid from '@mui/material/Grid2';
import * as SystemApi from 'api/system'; import {
import { fetchLogES } from 'api/system'; fetchLog,
fetchLogES,
readLogSettings,
updateLogSettings
} from 'api/system';
import { useRequest, useSSE } from 'alova/client'; import { useRequest, useSSE } from 'alova/client';
import { import {
@@ -77,8 +81,8 @@ const SystemLog = () => {
saveData, saveData,
errorMessage errorMessage
} = useRest<LogSettings>({ } = useRest<LogSettings>({
read: SystemApi.readLogSettings, read: readLogSettings,
update: SystemApi.updateLogSettings update: updateLogSettings
}); });
const [logEntries, setLogEntries] = useState<LogEntry[]>([]); const [logEntries, setLogEntries] = useState<LogEntry[]>([]);
@@ -112,7 +116,7 @@ const SystemLog = () => {
}); });
// called on page load to reset pointer and fetch all log entries // called on page load to reset pointer and fetch all log entries
useRequest(SystemApi.fetchLog()); useRequest(fetchLog());
const paddedLevelLabel = (level: LogLevel) => { const paddedLevelLabel = (level: LogLevel) => {
const label = levelLabel(level); const label = levelLabel(level);
@@ -188,6 +192,7 @@ const SystemLog = () => {
<MenuItem value={9}>ALL</MenuItem> <MenuItem value={9}>ALL</MenuItem>
</TextField> </TextField>
</Grid> </Grid>
{data.psram && (
<Grid size={2}> <Grid size={2}>
<TextField <TextField
name="max_messages" name="max_messages"
@@ -205,6 +210,7 @@ const SystemLog = () => {
<MenuItem value={100}>100</MenuItem> <MenuItem value={100}>100</MenuItem>
</TextField> </TextField>
</Grid> </Grid>
)}
<Grid> <Grid>
<BlockFormControlLabel <BlockFormControlLabel
control={ control={