({{country.letter}}){{country.name}}
diff --git a/web/views/@default/servers/components/waf/ipadmin/index.js b/web/views/@default/servers/components/waf/ipadmin/index.js
index 7de05ca7..450fcf99 100644
--- a/web/views/@default/servers/components/waf/ipadmin/index.js
+++ b/web/views/@default/servers/components/waf/ipadmin/index.js
@@ -5,6 +5,9 @@ Tea.context(function () {
this.selectedGroup = "ABC"
this.letterCountries = {}
let that = this
+ this.countSelectedCountries = this.countries.$count(function (k, country) {
+ return country.isChecked
+ })
this.countries.forEach(function (country) {
if (typeof (that.letterCountries[country.letter]) == "undefined") {
that.letterCountries[country.letter] = []
@@ -19,10 +22,12 @@ Tea.context(function () {
this.selectCountry = function (country) {
country.isChecked = !country.isChecked
+ this.change()
}
this.deselectCountry = function (country) {
country.isChecked = false
+ this.change()
}
this.checkAll = function () {
@@ -31,6 +36,8 @@ Tea.context(function () {
this.countries.forEach(function (country) {
country.isChecked = that.isCheckingAll
})
+
+ this.change()
}
this.success = function () {
@@ -39,6 +46,11 @@ Tea.context(function () {
})
}
+ this.change = function () {
+ this.countSelectedCountries = this.countries.$count(function (k, country) {
+ return country.isChecked
+ })
+ }
/**
* 添加IP名单菜单
diff --git a/web/views/@default/servers/components/waf/ipadmin/provinces.html b/web/views/@default/servers/components/waf/ipadmin/provinces.html
index 92cf6a9b..ca240b3f 100644
--- a/web/views/@default/servers/components/waf/ipadmin/provinces.html
+++ b/web/views/@default/servers/components/waf/ipadmin/provinces.html
@@ -9,6 +9,7 @@
| 已封禁 |
+ 暂时没有选择封禁省份。
{{province.name}}
@@ -18,7 +19,16 @@
| 选择封禁区域 |
- 选择省份/自治区
+
+
+ 选择省份/自治区
+
+
diff --git a/web/views/@default/servers/components/waf/ipadmin/provinces.js b/web/views/@default/servers/components/waf/ipadmin/provinces.js
index 9c36ef57..31eff506 100644
--- a/web/views/@default/servers/components/waf/ipadmin/provinces.js
+++ b/web/views/@default/servers/components/waf/ipadmin/provinces.js
@@ -1,20 +1,28 @@
Tea.context(function () {
this.isCheckingAll = false
+ this.countSelectedProvinces = this.provinces.$count(function (k, province) {
+ return province.isChecked
+ })
+
this.selectProvince = function (province) {
province.isChecked = !province.isChecked
+ this.change()
}
this.deselectProvince = function (province) {
province.isChecked = false
+ this.change()
}
this.checkAll = function () {
this.isCheckingAll = !this.isCheckingAll
-
+ let that = this
this.provinces.forEach(function (province) {
province.isChecked = that.isCheckingAll
})
+
+ this.change()
}
this.success = function () {
@@ -23,6 +31,13 @@ Tea.context(function () {
})
}
+
+ this.change = function () {
+ this.countSelectedProvinces = this.provinces.$count(function (k, province) {
+ return province.isChecked
+ })
+ }
+
/**
* 添加IP名单菜单
*/
| |