mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-12 11:20:27 +08:00
配置变更的时候自动同步,不再需要手工点击同步
This commit is contained in:
@@ -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 = [];
|
||||
})
|
||||
})
|
||||
};
|
||||
|
||||
/**
|
||||
* 底部伸展框
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user