mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 00:09:51 +03:00
UI updates #71
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
import React from 'react';
|
import { Component } from 'react';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
ValidatorForm,
|
ValidatorForm,
|
||||||
TextValidator,
|
TextValidator,
|
||||||
@@ -11,13 +12,13 @@ import {
|
|||||||
Box,
|
Box,
|
||||||
Link,
|
Link,
|
||||||
withWidth,
|
withWidth,
|
||||||
WithWidthProps
|
WithWidthProps,
|
||||||
|
Grid
|
||||||
} from '@material-ui/core';
|
} from '@material-ui/core';
|
||||||
|
|
||||||
import SaveIcon from '@material-ui/icons/Save';
|
import SaveIcon from '@material-ui/icons/Save';
|
||||||
import MenuItem from '@material-ui/core/MenuItem';
|
import MenuItem from '@material-ui/core/MenuItem';
|
||||||
|
|
||||||
import Grid from '@material-ui/core/Grid';
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
redirectingAuthorizedFetch,
|
redirectingAuthorizedFetch,
|
||||||
withAuthenticatedContext,
|
withAuthenticatedContext,
|
||||||
@@ -48,7 +49,7 @@ interface EMSESPSettingsFormState {
|
|||||||
processing: boolean;
|
processing: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
class EMSESPSettingsForm extends React.Component<EMSESPSettingsFormProps> {
|
class EMSESPSettingsForm extends Component<EMSESPSettingsFormProps> {
|
||||||
state: EMSESPSettingsFormState = {
|
state: EMSESPSettingsFormState = {
|
||||||
processing: false
|
processing: false
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ const leftOffset = () =>
|
|||||||
|
|
||||||
const useStyles = makeStyles((theme: Theme) => ({
|
const useStyles = makeStyles((theme: Theme) => ({
|
||||||
console: {
|
console: {
|
||||||
padding: theme.spacing(2),
|
padding: theme.spacing(1),
|
||||||
position: 'absolute',
|
position: 'absolute',
|
||||||
left: (offsets: Offsets) => offsets.leftOffset(),
|
left: (offsets: Offsets) => offsets.leftOffset(),
|
||||||
right: 24,
|
right: 24,
|
||||||
@@ -33,7 +33,7 @@ const useStyles = makeStyles((theme: Theme) => ({
|
|||||||
entry: {
|
entry: {
|
||||||
color: '#bbbbbb',
|
color: '#bbbbbb',
|
||||||
fontFamily: 'Courier New, monospace',
|
fontFamily: 'Courier New, monospace',
|
||||||
fontSize: '14px',
|
fontSize: '13px',
|
||||||
letterSpacing: 'normal',
|
letterSpacing: 'normal',
|
||||||
whiteSpace: 'nowrap'
|
whiteSpace: 'nowrap'
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
import { Component } from 'react';
|
import { Component } from 'react';
|
||||||
|
|
||||||
import { createStyles, WithStyles, Theme } from '@material-ui/core';
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
restController,
|
restController,
|
||||||
RestControllerProps,
|
RestControllerProps,
|
||||||
@@ -30,16 +28,7 @@ interface LogEventControllerState {
|
|||||||
events: LogEvent[];
|
events: LogEvent[];
|
||||||
}
|
}
|
||||||
|
|
||||||
const styles = (theme: Theme) =>
|
type LogEventControllerProps = RestControllerProps<LogSettings>;
|
||||||
createStyles({
|
|
||||||
content: {
|
|
||||||
padding: theme.spacing(2),
|
|
||||||
margin: theme.spacing(3)
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
type LogEventControllerProps = RestControllerProps<LogSettings> &
|
|
||||||
WithStyles<typeof styles>;
|
|
||||||
|
|
||||||
class LogEventController extends Component<
|
class LogEventController extends Component<
|
||||||
LogEventControllerProps,
|
LogEventControllerProps,
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import {
|
|||||||
SelectValidator
|
SelectValidator
|
||||||
} from 'react-material-ui-form-validator';
|
} from 'react-material-ui-form-validator';
|
||||||
|
|
||||||
import { Typography } from '@material-ui/core';
|
import { Typography, Grid } from '@material-ui/core';
|
||||||
|
|
||||||
import MenuItem from '@material-ui/core/MenuItem';
|
import MenuItem from '@material-ui/core/MenuItem';
|
||||||
|
|
||||||
@@ -65,28 +65,40 @@ class LogEventForm extends Component<LogEventFormProps> {
|
|||||||
const { data, saveData } = this.props;
|
const { data, saveData } = this.props;
|
||||||
return (
|
return (
|
||||||
<ValidatorForm onSubmit={saveData}>
|
<ValidatorForm onSubmit={saveData}>
|
||||||
<SelectValidator
|
<Grid
|
||||||
name="level"
|
container
|
||||||
label="Log Level"
|
spacing={0}
|
||||||
value={data.level}
|
direction="row"
|
||||||
variant="outlined"
|
justify="flex-start"
|
||||||
onChange={this.changeLevel}
|
alignItems="center"
|
||||||
margin="normal"
|
|
||||||
>
|
>
|
||||||
<MenuItem value={-1}>OFF</MenuItem>
|
<Grid item xs={2}>
|
||||||
<MenuItem value={3}>ERROR</MenuItem>
|
<SelectValidator
|
||||||
<MenuItem value={4}>WARNING</MenuItem>
|
name="level"
|
||||||
<MenuItem value={5}>NOTICE</MenuItem>
|
label="Log Level"
|
||||||
<MenuItem value={6}>INFO</MenuItem>
|
value={data.level}
|
||||||
<MenuItem value={7}>DEBUG</MenuItem>
|
variant="outlined"
|
||||||
<MenuItem value={8}>TRACE</MenuItem>
|
onChange={this.changeLevel}
|
||||||
</SelectValidator>
|
margin="normal"
|
||||||
<Typography color="primary" variant="body2">
|
>
|
||||||
<i>
|
<MenuItem value={-1}>OFF</MenuItem>
|
||||||
(the last {data.max_messages} messages are buffered. New log events
|
<MenuItem value={3}>ERROR</MenuItem>
|
||||||
are shown in real-time.)
|
<MenuItem value={4}>WARNING</MenuItem>
|
||||||
</i>
|
<MenuItem value={5}>NOTICE</MenuItem>
|
||||||
</Typography>
|
<MenuItem value={6}>INFO</MenuItem>
|
||||||
|
<MenuItem value={7}>DEBUG</MenuItem>
|
||||||
|
<MenuItem value={8}>TRACE</MenuItem>
|
||||||
|
</SelectValidator>
|
||||||
|
</Grid>
|
||||||
|
<Grid item md>
|
||||||
|
<Typography color="primary" variant="body2">
|
||||||
|
<i>
|
||||||
|
(the last {data.max_messages} messages are buffered and new log
|
||||||
|
events are shown in real time)
|
||||||
|
</i>
|
||||||
|
</Typography>
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
</ValidatorForm>
|
</ValidatorForm>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user