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

chore: remove redundant sensors card and bump version to 1.22.1

- Disable sensors data collection (CPU temp already shown in CPU card)
- Remove unused sensor-related functions (collectSensors, prettifyLabel, hasSensorData, renderSensorsCard)
- Remove unused gopsutil/sensors import
- Fix inline spinner disown call with explicit PID
- Update version from 1.22.0 to 1.22.1
- Update SECURITY_AUDIT.md to match new version and date
This commit is contained in:
Tw93
2026-01-17 10:46:11 +08:00
parent d39d787c83
commit 72f42a363e
6 changed files with 11 additions and 60 deletions

View File

@@ -201,15 +201,6 @@ func getScoreStyle(score int) lipgloss.Style {
}
}
func hasSensorData(sensors []SensorReading) bool {
for _, s := range sensors {
if s.Note == "" && s.Value > 0 {
return true
}
}
return false
}
func renderCPUCard(cpu CPUStatus, thermal ThermalStatus) cardData {
var lines []string
@@ -411,9 +402,10 @@ func buildCards(m MetricsSnapshot, width int) []cardData {
renderProcessCard(m.TopProcesses),
renderNetworkCard(m.Network, m.NetworkHistory, m.Proxy, width),
}
if hasSensorData(m.Sensors) {
cards = append(cards, renderSensorsCard(m.Sensors))
}
// Sensors card disabled - redundant with CPU temp
// if hasSensorData(m.Sensors) {
// cards = append(cards, renderSensorsCard(m.Sensors))
// }
return cards
}
@@ -600,20 +592,6 @@ func renderBatteryCard(batts []BatteryStatus, thermal ThermalStatus) cardData {
return cardData{icon: iconBattery, title: "Power", lines: lines}
}
func renderSensorsCard(sensors []SensorReading) cardData {
var lines []string
for _, s := range sensors {
if s.Note != "" {
continue
}
lines = append(lines, fmt.Sprintf("%-12s %s", shorten(s.Label, 12), colorizeTemp(s.Value)+s.Unit))
}
if len(lines) == 0 {
lines = append(lines, subtleStyle.Render("No sensors"))
}
return cardData{icon: iconSensors, title: "Sensors", lines: lines}
}
func renderCard(data cardData, width int, height int) string {
titleText := data.icon + " " + data.title
lineLen := max(width-lipgloss.Width(titleText)-2, 4)