优化界面

This commit is contained in:
GoEdgeLab
2021-07-21 08:07:46 +08:00
parent a00bdb1563
commit 88271f0166
25 changed files with 187 additions and 178 deletions

View File

@@ -28,10 +28,6 @@ Tea.context(function () {
}
return ""
})
window.addEventListener("resize", function () {
that.resizeChart("hourly-requests-chart")
that.resizeChart("hourly-traffic-chart")
})
})
this.reloadRequestsChart = function (chartId, name, stats, tooltipFunc) {
@@ -44,7 +40,7 @@ Tea.context(function () {
return Math.max(v.countRequests, v.countCachedRequests)
})
let chart = echarts.init(chartBox)
let chart = teaweb.initChart(chartBox)
let option = {
xAxis: {
data: stats.map(function (v) {
@@ -116,7 +112,7 @@ Tea.context(function () {
return Math.max(v.bytes, v.cachedBytes)
})
let chart = echarts.init(chartBox)
let chart = teaweb.initChart(chartBox)
let option = {
xAxis: {
data: stats.map(function (v) {
@@ -177,13 +173,4 @@ Tea.context(function () {
chart.setOption(option)
chart.resize()
}
this.resizeChart = function (chartId) {
let chartBox = document.getElementById(chartId)
if (chartBox == null) {
return
}
let chart = echarts.init(chartBox)
chart.resize()
}
})