Files
EdgeAdmin/web/views/@default/servers/index.js

50 lines
866 B
JavaScript
Raw Normal View History

2020-08-21 12:32:16 +08:00
Tea.context(function () {
this.servers.forEach(function (v) {
v["status"] = {
isOk: false,
message: "",
todo: ""
}
})
2020-08-21 12:32:16 +08:00
this.$delay(function () {
if (this.checkDNS) {
this.loadStatus()
}
let that = this
this.$watch("checkDNS", function (v) {
if (v) {
that.loadStatus()
}
})
})
this.loadStatus = function () {
let serverIds = this.servers.map(function (v) {
return v.id
})
this.$post(".status")
.params({
serverIds: serverIds
})
2023-03-21 11:41:40 +08:00
.timeout(300)
.success(function (resp) {
let status = resp.data.status
this.servers.forEach(function (server) {
if (typeof status[server.id] === "object") {
server.status = status[server.id]
}
})
})
}
2021-05-03 15:15:31 +08:00
/**
* 最近使用
*/
this.latestVisible = false
this.showLatest = function () {
this.latestVisible = !this.latestVisible
}
})