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 ( Change the default settings on this page. For help click {'here'}.

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

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

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

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

API } label="Enable WEB API (for write commands)" /> on/off true/false 1/0

Syslog } label="Enable Syslog" /> OFF ERR NOTICE INFO DEBUG

Analog Input } label="Enable ADC" />

} variant="contained" color="primary" type="submit"> Save
); }