UI updates #71

This commit is contained in:
proddy
2021-06-18 17:08:57 +02:00
parent 270298eb8a
commit 2056d3ff19
4 changed files with 43 additions and 41 deletions

View File

@@ -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
}; };

View File

@@ -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'
}, },

View File

@@ -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,

View File

@@ -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,6 +65,14 @@ class LogEventForm extends Component<LogEventFormProps> {
const { data, saveData } = this.props; const { data, saveData } = this.props;
return ( return (
<ValidatorForm onSubmit={saveData}> <ValidatorForm onSubmit={saveData}>
<Grid
container
spacing={0}
direction="row"
justify="flex-start"
alignItems="center"
>
<Grid item xs={2}>
<SelectValidator <SelectValidator
name="level" name="level"
label="Log Level" label="Log Level"
@@ -81,12 +89,16 @@ class LogEventForm extends Component<LogEventFormProps> {
<MenuItem value={7}>DEBUG</MenuItem> <MenuItem value={7}>DEBUG</MenuItem>
<MenuItem value={8}>TRACE</MenuItem> <MenuItem value={8}>TRACE</MenuItem>
</SelectValidator> </SelectValidator>
</Grid>
<Grid item md>
<Typography color="primary" variant="body2"> <Typography color="primary" variant="body2">
<i> <i>
(the last {data.max_messages} messages are buffered. New log events (the last {data.max_messages} messages are buffered and new log
are shown in real-time.) events are shown in real time)
</i> </i>
</Typography> </Typography>
</Grid>
</Grid>
</ValidatorForm> </ValidatorForm>
); );
} }