Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
gateway-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ui
gateway-ui
Commits
bc1f2636
Commit
bc1f2636
authored
Mar 02, 2020
by
derong.zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
对内容进行IP格式判断
parent
ec58374f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
21 deletions
+26
-21
mainconfiguration.vue
src/pages/mainconfiguration/mainconfiguration.vue
+26
-21
No files found.
src/pages/mainconfiguration/mainconfiguration.vue
View file @
bc1f2636
...
@@ -527,7 +527,7 @@ export default {
...
@@ -527,7 +527,7 @@ export default {
align
:
'
center
'
align
:
'
center
'
},
},
{
{
title
:
'
速
录
'
,
title
:
'
速
率
'
,
key
:
'
rate
'
,
key
:
'
rate
'
,
align
:
'
center
'
align
:
'
center
'
},
},
...
@@ -1079,6 +1079,7 @@ export default {
...
@@ -1079,6 +1079,7 @@ export default {
this
.
rollbackModal
=
false
this
.
rollbackModal
=
false
this
.
$Message
.
success
(
'
回滚成功
'
)
this
.
$Message
.
success
(
'
回滚成功
'
)
this
.
getconfigurlist
(
this
.
key
,
this
.
server
)
this
.
getconfigurlist
(
this
.
key
,
this
.
server
)
this
.
getList
(
this
.
key
,
this
.
server
)
this
.
getnodeList
()
this
.
getnodeList
()
}
}
})
})
...
@@ -1635,26 +1636,30 @@ export default {
...
@@ -1635,26 +1636,30 @@ export default {
});
});
return
return
}
}
// console.log(this.ipsetContent, typeof(this.ipsetContent))
let
re
=
/
[
"
\[\]]
/g
// eslint-disable-line no-useless-escape
// 判断是否有【】
if
(
!
re
.
test
(
this
.
ipsetContent
))
{
// let reg = /\[\]/g
this
.
$Notice
.
error
({
// // 判断是否是IP字段
title
:
'
提示
'
,
// // let re=/^(\d+)\.(\d+)\.(\d+)\.(\d+)$/
desc
:
'
输入格式不正确
'
,
// // if (!re.test(this.ipsetContent)) {
});
// // this.$Notice.error({
return
// // title: '提示',
}
// // desc: ' 输入格式不正确',
let
str
=
this
.
ipsetContent
.
replace
(
re
,
''
);
// // });
let
arr
=
str
.
split
(
'
,
'
)
// // return
console
.
log
(
arr
,
888
)
// // }
console
.
log
(
this
.
ipsetContent
,
typeof
(
this
.
ipsetContent
))
// console.log(!reg.test(this.ipsetContent), 999)
// 判断是否是IP字段
// if (!reg.test(this.ipsetContent)) {
let
test
=
arr
&&
arr
.
every
(
item
=>
{
// this.$Notice.error({
let
reg
=
/^
(\d
+
)\.(\d
+
)\.(\d
+
)\.(\d
+
)
$/
// title: '提示',
return
!
reg
.
test
(
item
)
// desc: ' 输入格式不正确',
})
// });
if
(
test
)
{
// return
this
.
$Notice
.
error
({
// }
title
:
'
提示
'
,
desc
:
'
输入格式不正确
'
,
});
return
}
let
keys
=
this
.
ipsetData
.
some
(
item
=>
{
let
keys
=
this
.
ipsetData
.
some
(
item
=>
{
return
item
.
name
===
this
.
ipsetName
return
item
.
name
===
this
.
ipsetName
})
})
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment