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
4f7a7c67
Commit
4f7a7c67
authored
Feb 26, 2020
by
derong.zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
阻止重复添加
parent
2693c4ee
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
75 additions
and
5 deletions
+75
-5
mainconfiguration.vue
src/pages/mainconfiguration/mainconfiguration.vue
+75
-5
No files found.
src/pages/mainconfiguration/mainconfiguration.vue
View file @
4f7a7c67
...
@@ -172,11 +172,11 @@
...
@@ -172,11 +172,11 @@
<Option
v-for=
"(item, index) in tageList"
:value=
"item"
:key=
"index"
>
{{
item
}}
</Option>
<Option
v-for=
"(item, index) in tageList"
:value=
"item"
:key=
"index"
>
{{
item
}}
</Option>
</Select>
</Select>
</FormItem>
</FormItem>
<FormItem
prop=
"alladdcontent"
label=
"
首部
:"
>
<FormItem
prop=
"alladdcontent"
label=
"
header
:"
>
<Input
v-model=
"header"
type=
"text"
placeholder=
"请输入
速率
"
style=
"width: 70%"
/>
<Input
v-model=
"header"
type=
"text"
placeholder=
"请输入
首部
"
style=
"width: 70%"
/>
</FormItem>
</FormItem>
<FormItem
prop=
"alladdcontent"
label=
"
主体
:"
>
<FormItem
prop=
"alladdcontent"
label=
"
body
:"
>
<Input
v-model=
"body"
type=
"text"
placeholder=
"请输入
速率
"
style=
"width: 70%"
/>
<Input
v-model=
"body"
type=
"text"
placeholder=
"请输入
主体
"
style=
"width: 70%"
/>
</FormItem>
</FormItem>
</Form>
</Form>
<div
class=
"alladdbtn"
>
<div
class=
"alladdbtn"
>
...
@@ -808,7 +808,8 @@ export default {
...
@@ -808,7 +808,8 @@ export default {
}
}
}
}
],
],
rollbacklist
:
[]
rollbacklist
:
[],
keyArr
:
[],
}
}
},
},
methods
:
{
methods
:
{
...
@@ -841,6 +842,7 @@ export default {
...
@@ -841,6 +842,7 @@ export default {
this
.
testdiv
=
false
this
.
testdiv
=
false
this
.
key
=
key
this
.
key
=
key
this
.
logData
=
[]
this
.
logData
=
[]
this
.
singlebaraddition
=
''
this
.
getkeytext
(
key
)
this
.
getkeytext
(
key
)
this
.
getconfigurlist
(
key
,
this
.
server
)
this
.
getconfigurlist
(
key
,
this
.
server
)
this
.
isShowList
=
true
this
.
isShowList
=
true
...
@@ -944,6 +946,16 @@ export default {
...
@@ -944,6 +946,16 @@ export default {
this
.
$Message
.
error
(
'
请先输入要添加的内容
'
)
this
.
$Message
.
error
(
'
请先输入要添加的内容
'
)
return
return
}
}
let
keys
=
this
.
logData
.
some
(
item
=>
{
return
item
.
sort
===
this
.
singlebaraddition
})
if
(
keys
)
{
this
.
$Notice
.
error
({
title
:
'
提示
'
,
desc
:
'
不能添加重复的内容
'
,
});
return
}
this
.
logData
.
push
({
sort
:
this
.
singlebaraddition
})
this
.
logData
.
push
({
sort
:
this
.
singlebaraddition
})
this
.
logparamsarr
.
push
(
this
.
singlebaraddition
)
this
.
logparamsarr
.
push
(
this
.
singlebaraddition
)
this
.
singlebaraddition
=
''
this
.
singlebaraddition
=
''
...
@@ -952,6 +964,7 @@ export default {
...
@@ -952,6 +964,7 @@ export default {
this
.
origenselectserver
=
this
.
server
this
.
origenselectserver
=
this
.
server
},
},
alladd
()
{
alladd
()
{
this
.
formInline
.
alladdcontent
=
''
this
.
alladdModal
=
true
this
.
alladdModal
=
true
},
},
alladdconfire
()
{
alladdconfire
()
{
...
@@ -964,6 +977,23 @@ export default {
...
@@ -964,6 +977,23 @@ export default {
str
=
str
.
replace
(
/
\"
/g
,
''
)
// eslint-disable-line no-useless-escape
str
=
str
.
replace
(
/
\"
/g
,
''
)
// eslint-disable-line no-useless-escape
str
=
str
.
replace
(
/
\'
/g
,
''
)
// eslint-disable-line no-useless-escape
str
=
str
.
replace
(
/
\'
/g
,
''
)
// eslint-disable-line no-useless-escape
let
arr
=
str
.
split
(
'
,
'
)
let
arr
=
str
.
split
(
'
,
'
)
arr
.
map
(
item
=>
{
let
keys
=
this
.
logData
.
some
(
data
=>
{
return
item
===
data
.
sort
})
this
.
keyArr
.
push
(
keys
)
})
let
keys
=
this
.
keyArr
.
some
(
item
=>
{
return
item
===
true
})
if
(
keys
)
{
this
.
$Notice
.
error
({
title
:
'
提示
'
,
desc
:
'
不能添加重复的内容
'
,
});
this
.
keyArr
=
[]
return
}
this
.
logparamsarr
=
arr
this
.
logparamsarr
=
arr
arr
.
map
(
item
=>
{
arr
.
map
(
item
=>
{
this
.
logData
.
push
({
sort
:
item
})
this
.
logData
.
push
({
sort
:
item
})
...
@@ -1597,6 +1627,16 @@ export default {
...
@@ -1597,6 +1627,16 @@ export default {
this
.
addSpecifiedModal
=
true
;
this
.
addSpecifiedModal
=
true
;
},
},
confireIpset
()
{
confireIpset
()
{
let
keys
=
this
.
ipsetData
.
some
(
item
=>
{
return
item
.
name
===
this
.
ipsetName
})
if
(
keys
)
{
this
.
$Notice
.
error
({
title
:
'
提示
'
,
desc
:
'
不能添加重复的内容
'
,
});
return
}
if
(
this
.
updataIpsetSta
)
{
if
(
this
.
updataIpsetSta
)
{
this
.
ipsetData
[
this
.
updateconfigindex
].
ip_list
=
this
.
ipsetContent
this
.
ipsetData
[
this
.
updateconfigindex
].
ip_list
=
this
.
ipsetContent
}
else
{
}
else
{
...
@@ -1616,6 +1656,16 @@ export default {
...
@@ -1616,6 +1656,16 @@ export default {
this
.
origenselectserver
=
this
.
server
this
.
origenselectserver
=
this
.
server
},
},
confireUrlSet
()
{
confireUrlSet
()
{
let
keys
=
this
.
urlIpSetData
.
some
(
item
=>
{
return
item
.
ip_set_name
===
this
.
urlIpsetName
})
if
(
keys
)
{
this
.
$Notice
.
error
({
title
:
'
提示
'
,
desc
:
'
不能添加重复的内容
'
,
});
return
}
if
(
this
.
updataUrlSta
)
{
if
(
this
.
updataUrlSta
)
{
this
.
urlIpSetData
[
this
.
updateconfigindex
].
path
=
this
.
urlIpsetPath
this
.
urlIpSetData
[
this
.
updateconfigindex
].
path
=
this
.
urlIpsetPath
this
.
urlIpSetData
[
this
.
updateconfigindex
].
ip_set_name
=
this
.
urlIpsetName
this
.
urlIpSetData
[
this
.
updateconfigindex
].
ip_set_name
=
this
.
urlIpsetName
...
@@ -1635,6 +1685,16 @@ export default {
...
@@ -1635,6 +1685,16 @@ export default {
this
.
origenselectserver
=
this
.
server
this
.
origenselectserver
=
this
.
server
},
},
confireLimit
()
{
confireLimit
()
{
let
keys
=
this
.
urlIpSetData
.
some
(
item
=>
{
return
item
.
path
===
this
.
limitPath
})
if
(
keys
)
{
this
.
$Notice
.
error
({
title
:
'
提示
'
,
desc
:
'
不能添加重复的内容
'
,
});
return
}
if
(
this
.
updataLimitSta
)
{
if
(
this
.
updataLimitSta
)
{
this
.
limitData
[
this
.
updateconfigindex
].
path
=
this
.
limitPath
this
.
limitData
[
this
.
updateconfigindex
].
path
=
this
.
limitPath
this
.
limitData
[
this
.
updateconfigindex
].
duration
=
this
.
limitTime
this
.
limitData
[
this
.
updateconfigindex
].
duration
=
this
.
limitTime
...
@@ -1656,6 +1716,16 @@ export default {
...
@@ -1656,6 +1716,16 @@ export default {
this
.
origenselectserver
=
this
.
server
this
.
origenselectserver
=
this
.
server
},
},
confireSpecified
()
{
confireSpecified
()
{
let
keys
=
this
.
specifiedData
.
some
(
item
=>
{
return
item
.
err_type
===
this
.
err_type
&&
item
.
err_tag
===
this
.
err_tag
})
if
(
keys
)
{
this
.
$Notice
.
error
({
title
:
'
提示
'
,
desc
:
'
不能添加重复的内容
'
,
});
return
}
if
(
this
.
updataSpecifiedSta
)
{
if
(
this
.
updataSpecifiedSta
)
{
this
.
specifiedData
[
this
.
updateconfigindex
].
body
=
this
.
body
this
.
specifiedData
[
this
.
updateconfigindex
].
body
=
this
.
body
this
.
specifiedData
[
this
.
updateconfigindex
].
header
=
this
.
header
this
.
specifiedData
[
this
.
updateconfigindex
].
header
=
this
.
header
...
...
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