mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-09 16:50:26 +08:00
修复在手机端无法正常浏览图表的Bug
This commit is contained in:
@@ -132,7 +132,27 @@ window.teaweb = {
|
|||||||
return (Math.round(bytes * 100 / 1024 / 1024 / 1024 / 1024 / 1024) / 100) + "P";
|
return (Math.round(bytes * 100 / 1024 / 1024 / 1024 / 1024 / 1024) / 100) + "P";
|
||||||
},
|
},
|
||||||
formatNumber: function (x) {
|
formatNumber: function (x) {
|
||||||
return x.toString().replace(/\B(?<!\.\d*)(?=(\d{3})+(?!\d))/g, ", ");
|
if (x == null) {
|
||||||
|
return "null"
|
||||||
|
}
|
||||||
|
let s = x.toString()
|
||||||
|
let dotIndex = s.indexOf(".")
|
||||||
|
if (dotIndex >= 0) {
|
||||||
|
return this.formatNumber(s.substring(0, dotIndex)) + "." + s.substring(dotIndex + 1)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (s.length <= 3) {
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
let result = []
|
||||||
|
for (let i = 0; i < Math.floor(s.length / 3); i++) {
|
||||||
|
let start = s.length - (i + 1) * 3
|
||||||
|
result.push(s.substring(start, start + 3))
|
||||||
|
}
|
||||||
|
if (s.length % 3 != 0) {
|
||||||
|
result.push(s.substring(0, s.length % 3))
|
||||||
|
}
|
||||||
|
return result.reverse().join(", ")
|
||||||
},
|
},
|
||||||
formatCount: function (x) {
|
formatCount: function (x) {
|
||||||
let unit = ""
|
let unit = ""
|
||||||
|
|||||||
@@ -58,7 +58,6 @@ Tea.context(function () {
|
|||||||
})
|
})
|
||||||
let chartBox = document.getElementById(chartId)
|
let chartBox = document.getElementById(chartId)
|
||||||
let chart = teaweb.initChart(chartBox)
|
let chart = teaweb.initChart(chartBox)
|
||||||
let that = this
|
|
||||||
let option = {
|
let option = {
|
||||||
xAxis: {
|
xAxis: {
|
||||||
data: stats.map(function (v) {
|
data: stats.map(function (v) {
|
||||||
|
|||||||
Reference in New Issue
Block a user