优化界面

This commit is contained in:
刘祥超
2021-07-21 08:07:46 +08:00
parent d6efb2dd12
commit 8d203a1d7c
25 changed files with 187 additions and 178 deletions

View File

@@ -73,7 +73,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) {
@@ -209,7 +209,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) {

View File

@@ -10,9 +10,6 @@ Tea.context(function () {
}, function (args) {
return that.systemStats[args.dataIndex].system.name + ": " + teaweb.formatNumber(that.systemStats[args.dataIndex].count)
}, systemAxis)
window.addEventListener("resize", function () {
that.resizeChart("system-chart")
})
let browserAxis = teaweb.countAxis(this.browserStats, function (v) {
return v.count
@@ -22,11 +19,6 @@ Tea.context(function () {
}, function (args) {
return that.browserStats[args.dataIndex].browser.name + ": " + teaweb.formatNumber(that.browserStats[args.dataIndex].count)
}, browserAxis)
window.addEventListener("resize", function () {
that.resizeChart("system-chart")
that.resizeChart("browser-chart")
})
})
this.reloadChart = function (chartId, name, stats, xFunc, tooltipFunc, axis) {
@@ -34,7 +26,7 @@ Tea.context(function () {
if (chartBox == null) {
return
}
let chart = echarts.init(chartBox)
let chart = teaweb.initChart(chartBox)
let option = {
xAxis: {
data: stats.map(xFunc),
@@ -78,13 +70,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()
}
})

View File

@@ -28,10 +28,6 @@ Tea.context(function () {
}
return ""
})
window.addEventListener("resize", function () {
that.resizeChart("daily-requests-chart")
that.resizeChart("daily-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()
}
})

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()
}
})

View File

@@ -28,10 +28,6 @@ Tea.context(function () {
}
return ""
})
window.addEventListener("resize", function () {
that.resizeChart("minutely-requests-chart")
that.resizeChart("minutely-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()
}
})

View File

@@ -10,9 +10,6 @@ Tea.context(function () {
}, function (args) {
return that.providerStats[args.dataIndex].provider.name + ": " + teaweb.formatNumber(that.providerStats[args.dataIndex].count)
}, axis)
window.addEventListener("resize", function () {
that.resizeChart("provider-chart")
})
})
this.reloadChart = function (chartId, name, stats, xFunc, tooltipFunc, axis) {
@@ -20,7 +17,7 @@ Tea.context(function () {
if (chartBox == null) {
return
}
let chart = echarts.init(chartBox)
let chart = teaweb.initChart(chartBox)
let option = {
xAxis: {
data: stats.map(xFunc),
@@ -64,13 +61,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()
}
})

View File

@@ -31,12 +31,6 @@ Tea.context(function () {
}, function (args) {
return that.cityStats[args.dataIndex].country.name + ": " + that.cityStats[args.dataIndex].province.name + " " + that.cityStats[args.dataIndex].city.name + " " + teaweb.formatNumber(that.cityStats[args.dataIndex].count)
}, cityAxis)
window.addEventListener("resize", function () {
that.resizeChart("country-chart")
that.resizeChart("province-chart")
that.resizeChart("city-chart")
})
})
this.reloadChart = function (chartId, name, stats, xFunc, tooltipFunc, axis) {
@@ -44,7 +38,7 @@ Tea.context(function () {
if (chartBox == null) {
return
}
let chart = echarts.init(chartBox)
let chart = teaweb.initChart(chartBox)
let option = {
xAxis: {
data: stats.map(xFunc),
@@ -88,13 +82,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()
}
})

View File

@@ -39,11 +39,6 @@ Tea.context(function () {
}
return that.groupStats[args.dataIndex].group.name + ": " + teaweb.formatNumber(that.groupStats[args.dataIndex].count) + percent
}, groupAxis)
window.addEventListener("resize", function () {
that.resizeChart("daily-chart")
that.resizeChart("group-chart")
})
})
this.reloadLineChart = function (chartId, name, stats, xFunc, tooltipFunc, axis) {
@@ -52,7 +47,7 @@ Tea.context(function () {
return
}
let that = this
let chart = echarts.init(chartBox)
let chart = teaweb.initChart(chartBox)
let option = {
xAxis: {
data: stats.map(xFunc)
@@ -129,7 +124,7 @@ Tea.context(function () {
if (chartBox == null) {
return
}
let chart = echarts.init(chartBox)
let chart = teaweb.initChart(chartBox)
let option = {
xAxis: {
data: stats.map(xFunc)
@@ -170,13 +165,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()
}
})