Files
EdgeAdmin/web/views/@default/servers/ipbox/index.js
2021-08-15 15:44:24 +08:00

33 lines
788 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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) {
let that = this
teaweb.confirm("确定要将此IP添加到此黑名单吗", function () {
that.$post(".addIP")
.params({
listId: list.id,
ip: that.ip
})
.success(function () {
that.ipLists.push(list)
that.blackListsVisible = false
})
})
}
})