From 349c3cae0ec81aeac4a8051530cbc6da36745a77 Mon Sep 17 00:00:00 2001 From: Viktor Fomin Date: Wed, 1 Jun 2022 13:29:23 +0300 Subject: [PATCH] Web: Client: Settings: add support ip range --- .../security/sub-components/user-fields.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/web/ASC.Web.Client/src/components/pages/Settings/categories/security/sub-components/user-fields.js b/web/ASC.Web.Client/src/components/pages/Settings/categories/security/sub-components/user-fields.js index 3a97f30047..1d59bf877c 100644 --- a/web/ASC.Web.Client/src/components/pages/Settings/categories/security/sub-components/user-fields.js +++ b/web/ASC.Web.Client/src/components/pages/Settings/categories/security/sub-components/user-fields.js @@ -92,7 +92,19 @@ const UserFields = (props) => {
{inputs ? ( inputs.map((input, index) => { - const error = !regexp.test(input); + let newInput1; + let newInput2; + + if (input.includes("-")) { + newInput1 = input.split("-")[0]; + newInput2 = input.split("-")[1]; + } + + const error = newInput2 + ? input.split("-").length - 1 > 1 || + !regexp.test(newInput1) || + !regexp.test(newInput2) + : !regexp.test(input); return (