Merge: * client: allow ip address in filter
Closes #832 * commit 'e616d843bfbef044372c4968559f02b71f5d8210': * client: allow ip address in filter
This commit is contained in:
commit
5cddde53c3
|
@ -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;
|
|
@ -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';
|
||||||
|
|
|
@ -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;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue