mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-08 16:59:50 +03:00
Syslog Server requires IP-address - host name not working fixes #734
This commit is contained in:
@@ -8,7 +8,7 @@ import MenuItem from '@material-ui/core/MenuItem';
|
|||||||
import { ENDPOINT_ROOT } from '../api';
|
import { ENDPOINT_ROOT } from '../api';
|
||||||
import { restController, RestControllerProps, RestFormLoader, RestFormProps, FormActions, FormButton, BlockFormControlLabel, SectionContent } from '../components';
|
import { restController, RestControllerProps, RestFormLoader, RestFormProps, FormActions, FormButton, BlockFormControlLabel, SectionContent } from '../components';
|
||||||
|
|
||||||
import { isIP, isHostname, or, optional } from '../validators';
|
import { isIP, optional } from '../validators';
|
||||||
|
|
||||||
import { EMSESPSettings } from './EMSESPtypes';
|
import { EMSESPSettings } from './EMSESPtypes';
|
||||||
|
|
||||||
@@ -19,7 +19,7 @@ type EMSESPSettingsControllerProps = RestControllerProps<EMSESPSettings>;
|
|||||||
class EMSESPSettingsController extends Component<EMSESPSettingsControllerProps> {
|
class EMSESPSettingsController extends Component<EMSESPSettingsControllerProps> {
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
ValidatorForm.addValidationRule('isIPOrHostname', optional(or(isIP, isHostname)));
|
ValidatorForm.addValidationRule('isOptionalIP', optional(isIP));
|
||||||
this.props.loadData();
|
this.props.loadData();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -238,10 +238,10 @@ function EMSESPSettingsControllerForm(props: EMSESPSettingsControllerFormProps)
|
|||||||
label="Enable Syslog"
|
label="Enable Syslog"
|
||||||
/>
|
/>
|
||||||
<TextValidator
|
<TextValidator
|
||||||
validators={['isIPOrHostname']}
|
validators={['isOptionalIP']}
|
||||||
errorMessages={["Not a valid IP address or hostname"]}
|
errorMessages={["Not a valid IP address"]}
|
||||||
name="syslog_host"
|
name="syslog_host"
|
||||||
label="Syslog IP/Host"
|
label="Syslog IP"
|
||||||
fullWidth
|
fullWidth
|
||||||
variant="outlined"
|
variant="outlined"
|
||||||
value={data.syslog_host}
|
value={data.syslog_host}
|
||||||
|
|||||||
Reference in New Issue
Block a user