mirror of
https://github.com/oneclickvirt/basics.git
synced 2026-04-23 00:37:11 +08:00
fix: 回退无效的修改
This commit is contained in:
+3
-3
@@ -212,7 +212,7 @@ func getBSDDisks() ([]DiskSingelInfo, *DiskSingelInfo, string) {
|
||||
totalBytes := parseSize(fields[1])
|
||||
percentageStr := fields[4]
|
||||
if percentageStr != "" && strings.Contains(percentageStr, "%") {
|
||||
percentageStr = strings.ReplaceAll(percentageStr, "%", "")
|
||||
percentageStr = strings.ReplaceAll(percentageStr, "%", "%%")
|
||||
}
|
||||
diskInfo := DiskSingelInfo{
|
||||
TotalStr: fields[1],
|
||||
@@ -298,7 +298,7 @@ func getOverlayDisk() *DiskSingelInfo {
|
||||
usedBytes := uint64(tpDiskUsage) * 1024
|
||||
percentageStr := nonEmptyFields[4]
|
||||
if percentageStr != "" && strings.Contains(percentageStr, "%") {
|
||||
percentageStr = strings.ReplaceAll(percentageStr, "%", "")
|
||||
percentageStr = strings.ReplaceAll(percentageStr, "%", "%%")
|
||||
}
|
||||
diskInfo := createDiskInfo(totalBytes, usedBytes, nonEmptyFields[0], "/")
|
||||
diskInfo.PercentageStr = percentageStr
|
||||
@@ -356,7 +356,7 @@ func createDiskInfo(totalBytes, usedBytes uint64, bootPath, mountPath string) Di
|
||||
diskUsageStr = strconv.FormatFloat(diskUsageGB, 'f', 2, 64) + " GB"
|
||||
}
|
||||
percentage := float64(usedBytes) / float64(totalBytes) * 100
|
||||
percentageStr := strconv.FormatFloat(percentage, 'f', 1, 64) + "%"
|
||||
percentageStr := strconv.FormatFloat(percentage, 'f', 1, 64) + "%%"
|
||||
return DiskSingelInfo{
|
||||
TotalStr: diskTotalStr,
|
||||
UsageStr: diskUsageStr,
|
||||
|
||||
Reference in New Issue
Block a user