配置变更的时候自动同步,不再需要手工点击同步

This commit is contained in:
刘祥超
2020-11-18 10:07:29 +08:00
parent c637cb7bf6
commit 850d343809
10 changed files with 134 additions and 44 deletions

View File

@@ -1,6 +1,5 @@
Tea.context(function () {
this.moreOptionsVisible = false
this.globalChangedClusters = []
this.globalMessageBadge = 0
if (typeof this.leftMenuItemIsDisabled == "undefined") {
@@ -12,9 +11,6 @@ Tea.context(function () {
this.$refs.focus.focus()
}
// 检查变更
this.checkClusterChanges()
// 检查消息
this.checkMessages()
})
@@ -37,32 +33,6 @@ Tea.context(function () {
menu.isActive = !menu.isActive
};
/**
* 检查集群变更
*/
this.checkClusterChanges = function () {
this.$post("/clusters/checkChange")
.params({
isNotifying: (this.globalChangedClusters.length > 0) ? 1 : 0
})
.timeout(60)
.success(function (resp) {
this.globalChangedClusters = resp.data.clusters;
})
.fail(function () {
this.globalChangedClusters = [];
})
.done(function () {
let delay = 3000
if (this.globalChangedClusters.length > 0) {
delay = 30000
}
this.$delay(function () {
this.checkClusterChanges()
}, delay)
})
}
/**
* 检查消息
*/
@@ -83,18 +53,6 @@ Tea.context(function () {
})
}
/**
* 同步集群配置
*/
this.syncClustersConfigs = function () {
teaweb.confirm("html:有若干个集群配置已变更!<br/>确定要同步配置到边缘节点吗?", function () {
this.$post("/clusters/sync")
.success(function () {
this.globalChangedClusters = [];
})
})
};
/**
* 底部伸展框
*/