import React, { Component } from 'react'; import { ValidatorForm, TextValidator, SelectValidator } from 'react-material-ui-form-validator'; import { Checkbox, Typography, Box, Link } from '@material-ui/core'; import SaveIcon from '@material-ui/icons/Save'; import MenuItem from '@material-ui/core/MenuItem'; import { ENDPOINT_ROOT } from '../api'; import { restController, RestControllerProps, RestFormLoader, RestFormProps, FormActions, FormButton, BlockFormControlLabel, SectionContent } from '../components'; import { isIP, isHostname, or, optional } from '../validators'; import { EMSESPSettings } from './EMSESPtypes'; export const EMSESP_SETTINGS_ENDPOINT = ENDPOINT_ROOT + "emsespSettings"; type EMSESPSettingsControllerProps = RestControllerProps; class EMSESPSettingsController extends Component { componentDidMount() { ValidatorForm.addValidationRule('isIPOrHostname', optional(or(isIP, isHostname))); this.props.loadData(); } render() { return ( ( )} /> ) } } export default restController(EMSESP_SETTINGS_ENDPOINT, EMSESPSettingsController); type EMSESPSettingsControllerFormProps = RestFormProps; function EMSESPSettingsControllerForm(props: EMSESPSettingsControllerFormProps) { const { data, saveData, handleValueChange } = props; return ( Customize EMS-ESP by modifying the default settings here. Refer to the {'Wiki'} for descriptions of each setting.

EMS Bus Settings Service Key (0x0B) Modem (0x0D) Terminal (0x0A) Time Module (0x0F) Alarm Module (0x12)

Dallas Sensor Settings } label="Dallas Parasite Mode" />

LED Settings } label="Invert/Hide LED" />

Shower Settings } label="Shower Timer" /> } label="Shower Alert" />

Syslog Settings OFF ERR INFO DEBUG } variant="contained" color="primary" type="submit"> Save
); }