实现基本的集群DNS列表、设置、简单数据同步

This commit is contained in:
刘祥超
2020-11-13 18:22:35 +08:00
parent a609a36795
commit 8b749fbc60
32 changed files with 743 additions and 26 deletions

View File

@@ -20,6 +20,16 @@ Tea.context(function () {
})
}
this.updateDomain = function (domainId) {
teaweb.popup("/dns/domains/updatePopup?domainId=" + domainId, {
callback: function () {
teaweb.success("保存成功", function () {
teaweb.reload()
})
}
})
}
this.deleteDomain = function (domain) {
let that = this
teaweb.confirm("确定要删除域名\"" + domain.name + "\"吗?", function () {
@@ -31,4 +41,34 @@ Tea.context(function () {
.refresh()
})
}
this.syncDomain = function (index, domain) {
domain.isSyncing = true
Vue.set(this.domains, index, domain)
this.$post("/dns/domains/sync")
.params({
domainId: domain.id
})
.success(function () {
teaweb.success("同步成功", function () {
teaweb.reload()
})
})
.fail(function (resp) {
teaweb.warn(resp.message, function () {
if (resp.data.shouldFix) {
window.location = "/dns/issues"
}
})
})
.done(function () {
domain.isSyncing = false
Vue.set(this.domains, index, domain)
})
}
this.showRoutes = function (domainId) {
teaweb.popup("/dns/domains/routesPopup?domainId=" + domainId)
}
})