Skip to content

Commit 01d200e

Browse files
committed
fix(node): replace disk usage retrieval function
1 parent 38ae1cc commit 01d200e

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

api/cluster/node.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,8 @@ import (
55

66
"github.com/0xJacky/Nginx-UI/internal/analytic"
77
"github.com/0xJacky/Nginx-UI/internal/version"
8-
"github.com/dustin/go-humanize"
98
"github.com/gin-gonic/gin"
109
"github.com/shirou/gopsutil/v4/cpu"
11-
"github.com/shirou/gopsutil/v4/disk"
1210
"github.com/uozi-tech/cosy"
1311
)
1412

@@ -28,13 +26,13 @@ func GetCurrentNode(c *gin.Context) {
2826
cpuInfo, _ := cpu.Info()
2927
memory, _ := analytic.GetMemoryStat()
3028
ver := version.GetVersionInfo()
31-
diskUsage, _ := disk.Usage(".")
29+
diskUsage, _ := analytic.GetDiskStat()
3230

3331
nodeInfo := analytic.NodeInfo{
3432
NodeRuntimeInfo: runtimeInfo,
3533
CPUNum: len(cpuInfo),
3634
MemoryTotal: memory.Total,
37-
DiskTotal: humanize.Bytes(diskUsage.Total),
35+
DiskTotal: diskUsage.Total,
3836
Version: ver.Version,
3937
}
4038

0 commit comments

Comments
 (0)