auto formatting

This commit is contained in:
proddy
2021-05-06 10:17:33 +02:00
parent 461aa1fd58
commit 54c2a73d68
22 changed files with 47 additions and 47 deletions

View File

@@ -1,12 +1,12 @@
{ {
"name":"EMS-ESP", "name": "EMS-ESP",
"icons":[ "icons": [
{ {
"src":"/app/icon.png", "src": "/app/icon.png",
"sizes":"48x48 72x72 96x96 128x128 256x256" "sizes": "48x48 72x72 96x96 128x128 256x256"
} }
], ],
"start_url":"/", "start_url": "/",
"display":"fullscreen", "display": "fullscreen",
"orientation":"any" "orientation": "any"
} }

View File

@@ -7,7 +7,7 @@ import { Paper, Typography, Fab } from '@material-ui/core';
import ForwardIcon from '@material-ui/icons/Forward'; import ForwardIcon from '@material-ui/icons/Forward';
import { withAuthenticationContext, AuthenticationContextProps } from './authentication/AuthenticationContext'; import { withAuthenticationContext, AuthenticationContextProps } from './authentication/AuthenticationContext';
import {PasswordValidator} from './components'; import { PasswordValidator } from './components';
import { PROJECT_NAME, SIGN_IN_ENDPOINT } from './api'; import { PROJECT_NAME, SIGN_IN_ENDPOINT } from './api';
const styles = (theme: Theme) => createStyles({ const styles = (theme: Theme) => createStyles({

View File

@@ -1,7 +1,7 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import { AP_SETTINGS_ENDPOINT } from '../api'; import { AP_SETTINGS_ENDPOINT } from '../api';
import {restController, RestControllerProps, RestFormLoader, SectionContent } from '../components'; import { restController, RestControllerProps, RestFormLoader, SectionContent } from '../components';
import APSettingsForm from './APSettingsForm'; import APSettingsForm from './APSettingsForm';
import { APSettings } from './types'; import { APSettings } from './types';

View File

@@ -1,6 +1,6 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import {restController, RestControllerProps, RestFormLoader, SectionContent } from '../components'; import { restController, RestControllerProps, RestFormLoader, SectionContent } from '../components';
import { AP_STATUS_ENDPOINT } from '../api'; import { AP_STATUS_ENDPOINT } from '../api';
import APStatusForm from './APStatusForm'; import APStatusForm from './APStatusForm';

View File

@@ -38,7 +38,7 @@ export function fetchLoginRedirect(features: Features): H.LocationDescriptorObje
} }
/** /**
* Wraps the normal fetch routene with one with provides the access token if present. * Wraps the normal fetch routine with one with provides the access token if present.
*/ */
export function authorizedFetch(url: RequestInfo, params?: RequestInit): Promise<Response> { export function authorizedFetch(url: RequestInfo, params?: RequestInit): Promise<Response> {
const accessToken = getStorage().getItem(ACCESS_TOKEN); const accessToken = getStorage().getItem(ACCESS_TOKEN);
@@ -55,8 +55,8 @@ export function authorizedFetch(url: RequestInfo, params?: RequestInit): Promise
/** /**
* fetch() does not yet support upload progress, this wrapper allows us to configure the xhr request * fetch() does not yet support upload progress, this wrapper allows us to configure the xhr request
* for a single file upload and takes care of adding the Authroization header and redirecting on * for a single file upload and takes care of adding the Authorization header and redirecting on
* authroization errors as we do for normal fetch operations. * authorization errors as we do for normal fetch operations.
*/ */
export function redirectingAuthorizedUpload(xhr: XMLHttpRequest, url: string, file: File, onProgress: (event: ProgressEvent<EventTarget>) => void): Promise<void> { export function redirectingAuthorizedUpload(xhr: XMLHttpRequest, url: string, file: File, onProgress: (event: ProgressEvent<EventTarget>) => void): Promise<void> {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {

View File

@@ -3,7 +3,7 @@ import { TextValidator, ValidatorComponentProps } from 'react-material-ui-form-v
import { withStyles, WithStyles, createStyles } from '@material-ui/core/styles'; import { withStyles, WithStyles, createStyles } from '@material-ui/core/styles';
import { InputAdornment, IconButton } from '@material-ui/core'; import { InputAdornment, IconButton } from '@material-ui/core';
import {Visibility,VisibilityOff } from '@material-ui/icons'; import { Visibility, VisibilityOff } from '@material-ui/icons';
const styles = createStyles({ const styles = createStyles({
input: { input: {

View File

@@ -8,6 +8,6 @@ import App from './App';
render(( render((
<Router history={history}> <Router history={history}>
<App/> <App />
</Router> </Router>
), document.getElementById("root")) ), document.getElementById("root"))

View File

@@ -1,6 +1,6 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import {restController, RestControllerProps, RestFormLoader, SectionContent } from '../components'; import { restController, RestControllerProps, RestFormLoader, SectionContent } from '../components';
import { MQTT_SETTINGS_ENDPOINT } from '../api'; import { MQTT_SETTINGS_ENDPOINT } from '../api';
import MqttSettingsForm from './MqttSettingsForm'; import MqttSettingsForm from './MqttSettingsForm';

View File

@@ -1,6 +1,6 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import {restController, RestControllerProps, RestFormLoader, SectionContent } from '../components'; import { restController, RestControllerProps, RestFormLoader, SectionContent } from '../components';
import { MQTT_STATUS_ENDPOINT } from '../api'; import { MQTT_STATUS_ENDPOINT } from '../api';
import MqttStatusForm from './MqttStatusForm'; import MqttStatusForm from './MqttStatusForm';

View File

@@ -29,16 +29,16 @@ class MqttStatusForm extends Component<MqttStatusFormProps> {
</ListItem> </ListItem>
<Divider variant="inset" component="li" /> <Divider variant="inset" component="li" />
<ListItem> <ListItem>
<ListItemAvatar> <ListItemAvatar>
<HighlightAvatar color={mqttPublishHighlight(data, theme)}> <HighlightAvatar color={mqttPublishHighlight(data, theme)}>
<SpeakerNotesOffIcon /> <SpeakerNotesOffIcon />
</HighlightAvatar> </HighlightAvatar>
</ListItemAvatar> </ListItemAvatar>
<ListItemText <ListItemText
primary="MQTT Publish Errors" primary="MQTT Publish Errors"
secondary={data.mqtt_fails} secondary={data.mqtt_fails}
/> />
</ListItem> </ListItem>
</Fragment> </Fragment>
); );
} }

View File

@@ -1,6 +1,6 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import {restController, RestControllerProps, RestFormLoader, SectionContent } from '../components'; import { restController, RestControllerProps, RestFormLoader, SectionContent } from '../components';
import NetworkStatusForm from './NetworkStatusForm'; import NetworkStatusForm from './NetworkStatusForm';
import { NETWORK_STATUS_ENDPOINT } from '../api'; import { NETWORK_STATUS_ENDPOINT } from '../api';
import { NetworkStatus } from './types'; import { NetworkStatus } from './types';

View File

@@ -1,6 +1,6 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import {restController, RestControllerProps, RestFormLoader, SectionContent } from '../components'; import { restController, RestControllerProps, RestFormLoader, SectionContent } from '../components';
import { NTP_SETTINGS_ENDPOINT } from '../api'; import { NTP_SETTINGS_ENDPOINT } from '../api';
import NTPSettingsForm from './NTPSettingsForm'; import NTPSettingsForm from './NTPSettingsForm';

View File

@@ -30,7 +30,7 @@ export const busStatus = ({ status }: EMSESPStatus) => {
} }
} }
export const qualityHighlight = ( value: number, theme: Theme) => { export const qualityHighlight = (value: number, theme: Theme) => {
if (value >= 95) { if (value >= 95) {
return theme.palette.success.main; return theme.palette.success.main;
} }

View File

@@ -30,7 +30,7 @@ class ValueForm extends React.Component<ValueFormProps> {
const { devicevalue, handleValueChange, onDoneEditing, onCancelEditing } = this.props; const { devicevalue, handleValueChange, onDoneEditing, onCancelEditing } = this.props;
return ( return (
<ValidatorForm onSubmit={onDoneEditing} ref={this.formRef}> <ValidatorForm onSubmit={onDoneEditing} ref={this.formRef}>
<Dialog maxWidth="xs" onClose={onCancelEditing} aria-labelledby="user-form-dialog-title" open> <Dialog maxWidth="xs" onClose={onCancelEditing} aria-labelledby="user-form-dialog-title" open>
<DialogTitle id="user-form-dialog-title">Change the {devicevalue.name}</DialogTitle> <DialogTitle id="user-form-dialog-title">Change the {devicevalue.name}</DialogTitle>
<DialogContent dividers> <DialogContent dividers>
<TextValidator <TextValidator

View File

@@ -1,6 +1,6 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import {restController, RestControllerProps, RestFormLoader, SectionContent } from '../components'; import { restController, RestControllerProps, RestFormLoader, SectionContent } from '../components';
import { SECURITY_SETTINGS_ENDPOINT } from '../api'; import { SECURITY_SETTINGS_ENDPOINT } from '../api';
import ManageUsersForm from './ManageUsersForm'; import ManageUsersForm from './ManageUsersForm';

View File

@@ -1,6 +1,6 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import {restController, RestControllerProps, RestFormLoader, SectionContent } from '../components'; import { restController, RestControllerProps, RestFormLoader, SectionContent } from '../components';
import { SECURITY_SETTINGS_ENDPOINT } from '../api'; import { SECURITY_SETTINGS_ENDPOINT } from '../api';
import SecuritySettingsForm from './SecuritySettingsForm'; import SecuritySettingsForm from './SecuritySettingsForm';

View File

@@ -12,12 +12,12 @@
const isLocalhost = Boolean( const isLocalhost = Boolean(
window.location.hostname === 'localhost' || window.location.hostname === 'localhost' ||
// [::1] is the IPv6 localhost address. // [::1] is the IPv6 localhost address.
window.location.hostname === '[::1]' || window.location.hostname === '[::1]' ||
// 127.0.0.0/8 are considered localhost for IPv4. // 127.0.0.0/8 are considered localhost for IPv4.
window.location.hostname.match( window.location.hostname.match(
/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/ /^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/
) )
); );
type Config = { type Config = {
@@ -51,7 +51,7 @@ export function register(config?: Config) {
navigator.serviceWorker.ready.then(() => { navigator.serviceWorker.ready.then(() => {
console.log( console.log(
'This web app is being served cache-first by a service ' + 'This web app is being served cache-first by a service ' +
'worker. To learn more, visit https://bit.ly/CRA-PWA' 'worker. To learn more, visit https://bit.ly/CRA-PWA'
); );
}); });
} else { } else {
@@ -79,7 +79,7 @@ function registerValidSW(swUrl: string, config?: Config) {
// content until all client tabs are closed. // content until all client tabs are closed.
console.log( console.log(
'New content is available and will be used when all ' + 'New content is available and will be used when all ' +
'tabs for this page are closed. See https://bit.ly/CRA-PWA.' 'tabs for this page are closed. See https://bit.ly/CRA-PWA.'
); );
// Execute callback // Execute callback

View File

@@ -1,6 +1,6 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import {restController, RestControllerProps, RestFormLoader, SectionContent } from '../components'; import { restController, RestControllerProps, RestFormLoader, SectionContent } from '../components';
import { OTA_SETTINGS_ENDPOINT } from '../api'; import { OTA_SETTINGS_ENDPOINT } from '../api';
import OTASettingsForm from './OTASettingsForm'; import OTASettingsForm from './OTASettingsForm';

View File

@@ -1,6 +1,6 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import {restController, RestControllerProps, RestFormLoader, SectionContent } from '../components'; import { restController, RestControllerProps, RestFormLoader, SectionContent } from '../components';
import { SYSTEM_STATUS_ENDPOINT } from '../api'; import { SYSTEM_STATUS_ENDPOINT } from '../api';
import SystemStatusForm from './SystemStatusForm'; import SystemStatusForm from './SystemStatusForm';