mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-14 04:10:26 +08:00
IPBox增加地域、ISP、添加到黑名单等功能
This commit is contained in:
30
web/views/@default/servers/ipbox/index.js
Normal file
30
web/views/@default/servers/ipbox/index.js
Normal file
@@ -0,0 +1,30 @@
|
||||
Tea.context(function () {
|
||||
this.blackListsVisible = false
|
||||
this.allPublicBlackIPLists = this.publicBlackIPLists.$copy()
|
||||
|
||||
this.showBlackLists = function () {
|
||||
let that = this
|
||||
this.publicBlackIPLists = this.allPublicBlackIPLists.filter(function (allList) {
|
||||
let found = true
|
||||
that.ipLists.forEach(function (list) {
|
||||
if (allList.id == list.id) {
|
||||
found = false
|
||||
}
|
||||
})
|
||||
return found
|
||||
})
|
||||
this.blackListsVisible = !this.blackListsVisible
|
||||
}
|
||||
|
||||
this.addBlackIP = function (list) {
|
||||
this.$post(".addIP")
|
||||
.params({
|
||||
listId: list.id,
|
||||
ip: this.ip
|
||||
})
|
||||
.success(function () {
|
||||
this.ipLists.push(list)
|
||||
this.blackListsVisible = false
|
||||
})
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user