2020-08-21 12:32:16 +08:00
|
|
|
Tea.context(function () {
|
2020-12-23 10:31:00 +08:00
|
|
|
this.servers.forEach(function (v) {
|
|
|
|
|
v["status"] = {
|
|
|
|
|
isOk: false,
|
|
|
|
|
message: "",
|
|
|
|
|
todo: ""
|
|
|
|
|
}
|
|
|
|
|
})
|
2020-08-21 12:32:16 +08:00
|
|
|
|
2020-12-23 10:31:00 +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
|
|
|
|
|
})
|
|
|
|
|
.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
|
|
|
|
|
}
|
2021-05-23 20:44:51 +08:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 错误日志相关
|
|
|
|
|
*/
|
|
|
|
|
this.fixLog = function (logId) {
|
|
|
|
|
let that = this
|
|
|
|
|
teaweb.confirm("确定要关闭此错误提示吗?", function () {
|
|
|
|
|
that.$post(".fixLog")
|
|
|
|
|
.params({
|
2021-11-30 16:43:44 +08:00
|
|
|
logIds: logId
|
|
|
|
|
})
|
|
|
|
|
.success(function () {
|
|
|
|
|
teaweb.reload()
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.fixPageLogs = function () {
|
|
|
|
|
let logIds = this.errorLogs.map(function (v) {
|
|
|
|
|
return v.id
|
|
|
|
|
})
|
|
|
|
|
if (logIds.length == 0) {
|
|
|
|
|
teaweb.reload()
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let that = this
|
|
|
|
|
teaweb.confirm("确定要关闭此页错误提示吗?", function () {
|
|
|
|
|
that.$post(".fixLog")
|
|
|
|
|
.params({
|
|
|
|
|
logIds: logIds
|
2021-05-23 20:44:51 +08:00
|
|
|
})
|
|
|
|
|
.success(function () {
|
|
|
|
|
teaweb.reload()
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
}
|
2021-05-03 15:15:31 +08:00
|
|
|
})
|