mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-03 20:40:26 +08:00
服务列表页带宽使用比特代替字节
This commit is contained in:
@@ -3,7 +3,6 @@ package servers
|
||||
import (
|
||||
"encoding/json"
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/configloaders"
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/utils/numberutils"
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/configutils"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/nodeconfigs"
|
||||
@@ -225,9 +224,9 @@ func (this *IndexAction) RunGet(params struct {
|
||||
}
|
||||
|
||||
// 统计数据
|
||||
var bandwidth = ""
|
||||
var bandwidthBits int64 = 0
|
||||
if server.BandwidthBytes > 0 {
|
||||
bandwidth = numberutils.FormatBytes(server.BandwidthBytes)
|
||||
bandwidthBits = server.BandwidthBytes * 8
|
||||
}
|
||||
|
||||
serverMaps = append(serverMaps, maps.Map{
|
||||
@@ -247,7 +246,7 @@ func (this *IndexAction) RunGet(params struct {
|
||||
"auditingIsOk": auditingIsOk,
|
||||
"user": userMap,
|
||||
"auditingTime": auditingTime,
|
||||
"bandwidth": bandwidth,
|
||||
"bandwidthBits": bandwidthBits,
|
||||
})
|
||||
}
|
||||
this.Data["servers"] = serverMaps
|
||||
|
||||
Reference in New Issue
Block a user