mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2026-01-07 04:25:49 +08:00
配置变更的时候自动同步,不再需要手工点击同步
This commit is contained in:
@@ -27,7 +27,6 @@
|
||||
</a>
|
||||
|
||||
<div class="right menu">
|
||||
<a href="" class="item" v-if="globalChangedClusters.length > 0" @click.prevent="syncClustersConfigs()"><span class="blink"><i class="icon refresh"></i></span>{{globalChangedClusters.length}}个集群服务变更</a>
|
||||
<a href="/messages" class="item" :class="{active:teaMenu == 'message'}"><span :class="{'blink':globalMessageBadge > 0}"><i class="icon bell"></i>消息({{globalMessageBadge}}) </span></a>
|
||||
<a href="/settings/profile" class="item" :class="{active: teaMenu == 'settings'}">
|
||||
<i class="icon user" v-if="teaUserAvatar.length == 0"></i>
|
||||
|
||||
@@ -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