* client: rename constant

This commit is contained in:
Ildar Kamalov 2019-04-05 14:32:56 +03:00
parent fa5ff053b7
commit b6ae539c36
2 changed files with 8 additions and 8 deletions

View File

@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
import classnames from 'classnames'; import classnames from 'classnames';
import { Trans, withNamespaces } from 'react-i18next'; import { Trans, withNamespaces } from 'react-i18next';
import { RESPONSE_STATUS } from '../../../helpers/constants'; import { DHCP_STATUS_RESPONSE } from '../../../helpers/constants';
import Form from './Form'; import Form from './Form';
import Leases from './Leases'; import Leases from './Leases';
import Interface from './Interface'; import Interface from './Interface';
@ -24,7 +24,7 @@ class Dhcp extends Component {
config, check, processingDhcp, processingConfig, config, check, processingDhcp, processingConfig,
} = this.props.dhcp; } = this.props.dhcp;
const otherDhcpFound = const otherDhcpFound =
check && check.otherServer && check.otherServer.found === RESPONSE_STATUS.YES; check && check.otherServer && check.otherServer.found === DHCP_STATUS_RESPONSE.YES;
const filledConfig = Object.keys(config).every((key) => { const filledConfig = Object.keys(config).every((key) => {
if (key === 'enabled' || key === 'icmp_timeout_msec') { if (key === 'enabled' || key === 'icmp_timeout_msec') {
return true; return true;
@ -67,7 +67,7 @@ class Dhcp extends Component {
getActiveDhcpMessage = (t, check) => { getActiveDhcpMessage = (t, check) => {
const { found } = check.otherServer; const { found } = check.otherServer;
if (found === RESPONSE_STATUS.ERROR) { if (found === DHCP_STATUS_RESPONSE.ERROR) {
return ( return (
<div className="text-danger mb-2"> <div className="text-danger mb-2">
<Trans>dhcp_error</Trans> <Trans>dhcp_error</Trans>
@ -82,7 +82,7 @@ class Dhcp extends Component {
return ( return (
<div className="mb-2"> <div className="mb-2">
{found === RESPONSE_STATUS.YES ? ( {found === DHCP_STATUS_RESPONSE.YES ? (
<div className="text-danger"> <div className="text-danger">
<Trans>dhcp_found</Trans> <Trans>dhcp_found</Trans>
</div> </div>
@ -96,7 +96,7 @@ class Dhcp extends Component {
} }
getDhcpWarning = (check) => { getDhcpWarning = (check) => {
if (check.otherServer.found === RESPONSE_STATUS.NO) { if (check.otherServer.found === DHCP_STATUS_RESPONSE.NO) {
return ''; return '';
} }
@ -108,7 +108,7 @@ class Dhcp extends Component {
} }
getStaticIpWarning = (t, check, interfaceName) => { getStaticIpWarning = (t, check, interfaceName) => {
if (check.staticIP.static === RESPONSE_STATUS.ERROR) { if (check.staticIP.static === DHCP_STATUS_RESPONSE.ERROR) {
return ( return (
<Fragment> <Fragment>
<div className="text-danger mb-2"> <div className="text-danger mb-2">
@ -123,7 +123,7 @@ class Dhcp extends Component {
</Fragment> </Fragment>
); );
} else if ( } else if (
check.staticIP.static === RESPONSE_STATUS.YES check.staticIP.static === DHCP_STATUS_RESPONSE.YES
&& check.staticIP.ip && check.staticIP.ip
&& interfaceName && interfaceName
) { ) {

View File

@ -158,7 +158,7 @@ export const UNSAFE_PORTS = [
export const ALL_INTERFACES_IP = '0.0.0.0'; export const ALL_INTERFACES_IP = '0.0.0.0';
export const RESPONSE_STATUS = { export const DHCP_STATUS_RESPONSE = {
YES: 'yes', YES: 'yes',
NO: 'no', NO: 'no',
ERROR: 'error', ERROR: 'error',