mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-18 06:40:25 +08:00
[域名解析]优化解析状态显示
This commit is contained in:
45
web/views/@default/dns/domains/nodesPopup.js
Normal file
45
web/views/@default/dns/domains/nodesPopup.js
Normal file
@@ -0,0 +1,45 @@
|
||||
Tea.context(function () {
|
||||
this.keyword = ""
|
||||
this.status = ""
|
||||
|
||||
let allNodes = []
|
||||
this.clusters.forEach(function (cluster) {
|
||||
let nodes = cluster.nodes
|
||||
nodes.forEach(function (node) {
|
||||
node.cluster = cluster
|
||||
allNodes.push(node)
|
||||
})
|
||||
})
|
||||
|
||||
this.nodes = allNodes
|
||||
|
||||
this.$delay(function () {
|
||||
this.$watch("keyword", function () {
|
||||
this.reloadNodes()
|
||||
})
|
||||
this.$watch("status", function () {
|
||||
this.reloadNodes()
|
||||
})
|
||||
})
|
||||
|
||||
this.reloadNodes = function () {
|
||||
let that = this
|
||||
this.nodes = allNodes.$copy().$findAll(function (k, v) {
|
||||
if (that.keyword.length > 0
|
||||
&& !teaweb.match(v.cluster.name, that.keyword)
|
||||
&& !teaweb.match(v.cluster.dnsName, that.keyword)
|
||||
&& !teaweb.match(v.name, that.keyword)
|
||||
&& !teaweb.match(v.ipAddr, that.keyword)
|
||||
&& !teaweb.match(v.route.name, that.keyword)) {
|
||||
return false
|
||||
}
|
||||
if (that.status == "ok" && !v.isOk) {
|
||||
return false
|
||||
}
|
||||
if (that.status == "notOk" && v.isOk) {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
})
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user