* client: allow ip address in filter

This commit is contained in:
Ildar Kamalov 2019-07-01 15:52:24 +03:00
parent b45e8e80fb
commit e616d843bf
3 changed files with 4 additions and 7 deletions

View File

@ -4,7 +4,7 @@ import ReactModal from 'react-modal';
import classnames from 'classnames'; import classnames from 'classnames';
import { Trans, withNamespaces } from 'react-i18next'; import { Trans, withNamespaces } from 'react-i18next';
import { R_URL_REQUIRES_PROTOCOL } from '../../helpers/constants'; import { R_URL_REQUIRES_PROTOCOL } from '../../helpers/constants';
import './Modal.css'; import '../ui/Modal.css';
ReactModal.setAppElement('#root'); ReactModal.setAppElement('#root');
@ -17,10 +17,7 @@ const initialState = {
class Modal extends Component { class Modal extends Component {
state = initialState; state = initialState;
// eslint-disable-next-line isUrlValid = url => R_URL_REQUIRES_PROTOCOL.test(url);
isUrlValid = url => {
return R_URL_REQUIRES_PROTOCOL.test(url);
};
handleUrlChange = async (e) => { handleUrlChange = async (e) => {
const { value: url } = e.currentTarget; const { value: url } = e.currentTarget;

View File

@ -2,7 +2,7 @@ import React, { Component } from 'react';
import ReactTable from 'react-table'; import ReactTable from 'react-table';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { Trans, withNamespaces } from 'react-i18next'; import { Trans, withNamespaces } from 'react-i18next';
import Modal from '../ui/Modal'; import Modal from './Modal';
import PageTitle from '../ui/PageTitle'; import PageTitle from '../ui/PageTitle';
import Card from '../ui/Card'; import Card from '../ui/Card';
import UserRules from './UserRules'; import UserRules from './UserRules';

View File

@ -1,4 +1,4 @@
export const R_URL_REQUIRES_PROTOCOL = /^https?:\/\/\w[\w_\-.]*\.[a-z]{2,8}[^\s]*$/; export const R_URL_REQUIRES_PROTOCOL = /^https?:\/\/[^/\s]+(\/.*)?$/;
export const R_IPV4 = /^(?:(?:^|\.)(?:2(?:5[0-5]|[0-4]\d)|1?\d?\d)){4}$/g; export const R_IPV4 = /^(?:(?:^|\.)(?:2(?:5[0-5]|[0-4]\d)|1?\d?\d)){4}$/g;
export const R_MAC = /^((([a-fA-F0-9][a-fA-F0-9]+[-]){5}|([a-fA-F0-9][a-fA-F0-9]+[:]){5})([a-fA-F0-9][a-fA-F0-9])$)|(^([a-fA-F0-9][a-fA-F0-9][a-fA-F0-9][a-fA-F0-9]+[.]){2}([a-fA-F0-9][a-fA-F0-9][a-fA-F0-9][a-fA-F0-9]))$/g; export const R_MAC = /^((([a-fA-F0-9][a-fA-F0-9]+[-]){5}|([a-fA-F0-9][a-fA-F0-9]+[:]){5})([a-fA-F0-9][a-fA-F0-9])$)|(^([a-fA-F0-9][a-fA-F0-9][a-fA-F0-9][a-fA-F0-9]+[.]){2}([a-fA-F0-9][a-fA-F0-9][a-fA-F0-9][a-fA-F0-9]))$/g;