mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-10 09:20:25 +08:00
30 lines
677 B
JavaScript
30 lines
677 B
JavaScript
|
|
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
|
||
|
|
})
|
||
|
|
}
|
||
|
|
})
|