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