v0.15.3: Show all storage paths on dashboard/monitoring + fix hub report
This commit is contained in:
@@ -58,16 +58,21 @@ func BuildReport(
|
||||
LoadAvg15: sysInfo.LoadAvg15,
|
||||
}
|
||||
|
||||
// Storage
|
||||
// Storage — root filesystem + all registered storage paths
|
||||
r.Storage = []StorageReport{
|
||||
{Mount: "/", TotalGB: sysInfo.DiskTotalGB, UsedGB: sysInfo.DiskUsedGB, Percent: sysInfo.DiskPercent},
|
||||
{Mount: "/", Label: "SSD", TotalGB: sysInfo.DiskTotalGB, UsedGB: sysInfo.DiskUsedGB, Percent: sysInfo.DiskPercent},
|
||||
}
|
||||
if sysInfo.HDDConfigured {
|
||||
for _, sp := range storagePaths {
|
||||
di := system.GetDiskUsage(sp.Path)
|
||||
if di == nil {
|
||||
continue
|
||||
}
|
||||
r.Storage = append(r.Storage, StorageReport{
|
||||
Mount: cfg.Paths.HDDPath,
|
||||
TotalGB: sysInfo.HDDTotalGB,
|
||||
UsedGB: sysInfo.HDDUsedGB,
|
||||
Percent: sysInfo.HDDPercent,
|
||||
Mount: sp.Path,
|
||||
Label: sp.Label,
|
||||
TotalGB: di.TotalGB,
|
||||
UsedGB: di.UsedGB,
|
||||
Percent: di.UsedPercent,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -38,6 +38,7 @@ type SystemReport struct {
|
||||
// StorageReport holds disk usage for a mount point.
|
||||
type StorageReport struct {
|
||||
Mount string `json:"mount"`
|
||||
Label string `json:"label,omitempty"`
|
||||
TotalGB float64 `json:"total_gb"`
|
||||
UsedGB float64 `json:"used_gb"`
|
||||
Percent float64 `json:"percent"`
|
||||
|
||||
Reference in New Issue
Block a user