1
0
mirror of https://github.com/tw93/Mole.git synced 2026-02-04 11:31:46 +00:00

refactor: remove trimName and renderGPUCard functions

This commit is contained in:
Tw93
2026-01-06 21:07:51 +08:00
parent c2c589ac81
commit 0d15177735
2 changed files with 0 additions and 26 deletions

View File

@@ -179,10 +179,6 @@ func calculateNameWidth(termWidth int) int {
return available
}
func trimName(name string) string {
return trimNameWithWidth(name, 45) // Default width for backward compatibility
}
func trimNameWithWidth(name string, maxWidth int) string {
const (
ellipsis = "..."

View File

@@ -213,28 +213,6 @@ func renderCPUCard(cpu CPUStatus) cardData {
return cardData{icon: iconCPU, title: "CPU", lines: lines}
}
func renderGPUCard(gpus []GPUStatus) cardData {
var lines []string
if len(gpus) == 0 {
lines = append(lines, subtleStyle.Render("No GPU detected"))
} else {
for _, g := range gpus {
if g.Usage >= 0 {
lines = append(lines, fmt.Sprintf("Total %s %5.1f%%", progressBar(g.Usage), g.Usage))
}
coreInfo := ""
if g.CoreCount > 0 {
coreInfo = fmt.Sprintf(" (%d cores)", g.CoreCount)
}
lines = append(lines, g.Name+coreInfo)
if g.Usage < 0 {
lines = append(lines, subtleStyle.Render("Run with sudo for usage metrics"))
}
}
}
return cardData{icon: iconGPU, title: "GPU", lines: lines}
}
func renderMemoryCard(mem MemoryStatus) cardData {
// Check if swap is being used (or at least allocated).
hasSwap := mem.SwapTotal > 0 || mem.SwapUsed > 0