mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-22 09:10:25 +08:00
实现基本的集群DNS列表、设置、简单数据同步
This commit is contained in:
@@ -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)
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user