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,23 +192,25 @@ const SystemLog = () => {
<MenuItem value={9}>ALL</MenuItem> <MenuItem value={9}>ALL</MenuItem>
</TextField> </TextField>
</Grid> </Grid>
<Grid size={2}> {data.psram && (
<TextField <Grid size={2}>
name="max_messages" <TextField
label={LL.BUFFER_SIZE()} name="max_messages"
value={data.max_messages} label={LL.BUFFER_SIZE()}
fullWidth value={data.max_messages}
variant="outlined" fullWidth
onChange={updateFormValue} variant="outlined"
margin="normal" onChange={updateFormValue}
select margin="normal"
> select
<MenuItem value={25}>25</MenuItem> >
<MenuItem value={50}>50</MenuItem> <MenuItem value={25}>25</MenuItem>
<MenuItem value={75}>75</MenuItem> <MenuItem value={50}>50</MenuItem>
<MenuItem value={100}>100</MenuItem> <MenuItem value={75}>75</MenuItem>
</TextField> <MenuItem value={100}>100</MenuItem>
</Grid> </TextField>
</Grid>
)}
<Grid> <Grid>
<BlockFormControlLabel <BlockFormControlLabel
control={ control={