数据看板和节点看板都改成异步加载

This commit is contained in:
刘祥超
2021-08-30 15:23:31 +08:00
parent 19178f963e
commit 1d9d44ecc3
14 changed files with 188 additions and 99 deletions

View File

@@ -30,12 +30,13 @@ Tea.context(function () {
for (let k in resp.data) {
this[k] = resp.data[k]
}
this.reloadHourlyTrafficChart()
this.reloadHourlyRequestsChart()
this.reloadTopDomainsChart()
this.isLoading = false
this.$delay(function () {
this.reloadHourlyTrafficChart()
this.reloadHourlyRequestsChart()
this.reloadTopDomainsChart()
})
})
}
@@ -63,7 +64,7 @@ Tea.context(function () {
attackRatio = Math.round(stats[index].attackBytes * 10000 / stats[index].bytes) / 100
}
return stats[index].day + " " + stats[index].hour + "时<br/>总流量:" + teaweb.formatBytes(stats[index].bytes) + "<br/>缓存流量:" + teaweb.formatBytes(stats[index].cachedBytes) + "<br/>缓存命中率:" + cachedRatio + "%<br/>拦截攻击流量:" + teaweb.formatBytes(stats[index].attackBytes) + "<br/>拦截比例:" + attackRatio + "%"
return stats[index].day + " " + stats[index].hour + "时<br/>总流量:" + teaweb.formatBytes(stats[index].bytes) + "<br/>缓存流量:" + teaweb.formatBytes(stats[index].cachedBytes) + "<br/>缓存命中率:" + cachedRatio + "%<br/>拦截攻击流量:" + teaweb.formatBytes(stats[index].attackBytes) + "<br/>拦截比例:" + attackRatio + "%"
})
}