实现完整的集群、域名同步

This commit is contained in:
GoEdgeLab
2020-11-14 21:28:14 +08:00
parent 28325f45a9
commit c1ec6a0319
17 changed files with 279 additions and 61 deletions

View File

@@ -43,29 +43,33 @@ Tea.context(function () {
}
this.syncDomain = function (index, domain) {
domain.isSyncing = true
Vue.set(this.domains, index, domain)
let that = this
teaweb.confirm("确定要同步此域名下的所有解析记录吗?", function () {
domain.isSyncing = true
Vue.set(that.domains, index, domain)
this.$post("/dns/domains/sync")
.params({
domainId: domain.id
})
.success(function () {
teaweb.success("同步成功", function () {
teaweb.reload()
this.$post("/dns/domains/sync")
.params({
domainId: domain.id
})
})
.fail(function (resp) {
teaweb.warn(resp.message, function () {
if (resp.data.shouldFix) {
window.location = "/dns/issues"
}
.success(function () {
teaweb.success("同步成功", function () {
teaweb.reload()
})
})
})
.done(function () {
domain.isSyncing = false
Vue.set(this.domains, index, domain)
})
.fail(function (resp) {
teaweb.warn(resp.message, function () {
if (resp.data.shouldFix) {
window.location = "/dns/issues"
}
})
})
.done(function () {
domain.isSyncing = false
that.dnsHasChanges = false
Vue.set(that.domains, index, domain)
})
})
}
this.showRoutes = function (domainId) {