修复点击修改WAF规则时未保存时也会生效的Bug

This commit is contained in:
刘祥超
2022-12-06 10:46:46 +08:00
parent e9a47041fd
commit 892ee0013a
5 changed files with 19 additions and 5 deletions

View File

@@ -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