mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-17 22:30:25 +08:00
修复点击修改WAF规则时未保存时也会生效的Bug
This commit is contained in:
@@ -21,7 +21,7 @@ Vue.component("http-firewall-rules-box", {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
updateRule: function (index, rule) {
|
updateRule: function (index, rule) {
|
||||||
window.UPDATING_RULE = rule
|
window.UPDATING_RULE = teaweb.clone(rule)
|
||||||
let that = this
|
let that = this
|
||||||
teaweb.popup("/servers/components/waf/createRulePopup?type=" + this.vType, {
|
teaweb.popup("/servers/components/waf/createRulePopup?type=" + this.vType, {
|
||||||
height: "30em",
|
height: "30em",
|
||||||
|
|||||||
@@ -49,6 +49,10 @@ window.teaweb = {
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
|
clone: function (source) {
|
||||||
|
let s = JSON.stringify(source)
|
||||||
|
return JSON.parse(s)
|
||||||
|
},
|
||||||
|
|
||||||
loadJS: function (file, callback) {
|
loadJS: function (file, callback) {
|
||||||
let element = document.createElement("script")
|
let element = document.createElement("script")
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ Tea.context(function () {
|
|||||||
this.rule.checkpointPrefix = param
|
this.rule.checkpointPrefix = param
|
||||||
}
|
}
|
||||||
this.$delay(function () {
|
this.$delay(function () {
|
||||||
this.changeCheckpoint()
|
this.loadCheckpoint()
|
||||||
if (this.rule.checkpointOptions != null && this.checkpoint != null && this.checkpoint.options != null) {
|
if (this.rule.checkpointOptions != null && this.checkpoint != null && this.checkpoint.options != null) {
|
||||||
let that = this
|
let that = this
|
||||||
this.checkpoint.options.forEach(function (option) {
|
this.checkpoint.options.forEach(function (option) {
|
||||||
@@ -43,6 +43,18 @@ Tea.context(function () {
|
|||||||
* checkpoint
|
* checkpoint
|
||||||
*/
|
*/
|
||||||
this.checkpoint = null
|
this.checkpoint = null
|
||||||
|
|
||||||
|
this.loadCheckpoint = function () {
|
||||||
|
if (this.rule.checkpointPrefix.length == 0) {
|
||||||
|
this.checkpoint = null
|
||||||
|
return
|
||||||
|
}
|
||||||
|
let that = this
|
||||||
|
this.checkpoint = this.checkpoints.$find(function (k, v) {
|
||||||
|
return v.prefix == that.rule.checkpointPrefix
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
this.changeCheckpoint = function () {
|
this.changeCheckpoint = function () {
|
||||||
if (this.rule.checkpointPrefix.length == 0) {
|
if (this.rule.checkpointPrefix.length == 0) {
|
||||||
this.checkpoint = null
|
this.checkpoint = null
|
||||||
|
|||||||
@@ -57,7 +57,6 @@ Tea.context(function () {
|
|||||||
// 添加分组
|
// 添加分组
|
||||||
this.createGroup = function (type) {
|
this.createGroup = function (type) {
|
||||||
teaweb.popup("/servers/components/waf/createGroupPopup?firewallPolicyId=" + this.firewallPolicyId + "&type=" + type, {
|
teaweb.popup("/servers/components/waf/createGroupPopup?firewallPolicyId=" + this.firewallPolicyId + "&type=" + type, {
|
||||||
height: "16em",
|
|
||||||
callback: function () {
|
callback: function () {
|
||||||
teaweb.success("保存成功", function () {
|
teaweb.success("保存成功", function () {
|
||||||
window.location.reload()
|
window.location.reload()
|
||||||
|
|||||||
@@ -57,7 +57,6 @@ Tea.context(function () {
|
|||||||
// 添加分组
|
// 添加分组
|
||||||
this.createGroup = function (type) {
|
this.createGroup = function (type) {
|
||||||
teaweb.popup("/servers/components/waf/createGroupPopup?firewallPolicyId=" + this.firewallPolicyId + "&type=" + type, {
|
teaweb.popup("/servers/components/waf/createGroupPopup?firewallPolicyId=" + this.firewallPolicyId + "&type=" + type, {
|
||||||
height: "16em",
|
|
||||||
callback: function () {
|
callback: function () {
|
||||||
teaweb.success("保存成功", function () {
|
teaweb.success("保存成功", function () {
|
||||||
window.location.reload()
|
window.location.reload()
|
||||||
|
|||||||
Reference in New Issue
Block a user