集群界面数据改成异步加载

This commit is contained in:
刘祥超
2021-08-20 10:51:01 +08:00
parent 766c3666d8
commit fbcf439f89
11 changed files with 58 additions and 13 deletions

View File

@@ -1,15 +1,33 @@
Tea.context(function () {
this.isLoading = true
this.board = {}
this.metricCharts = []
/**
* 流量统计
*/
this.trafficTab = "hourly"
this.$delay(function () {
this.reloadHourlyTrafficChart()
this.reloadHourlyRequestsChart()
this.reloadTopNodesChart()
this.reloadTopDomainsChart()
this.reloadCPUChart()
this.$post("$")
.params({
clusterId: this.clusterId
})
.timeout(30)
.success(function (resp) {
for (let k in resp.data) {
this[k] = resp.data[k]
}
this.reloadHourlyTrafficChart()
this.reloadHourlyRequestsChart()
this.reloadTopNodesChart()
this.reloadTopDomainsChart()
this.reloadCPUChart()
this.isLoading = false
})
})
this.selectTrafficTab = function (tab) {