mirror of
https://github.com/tw93/Mole.git
synced 2026-02-04 16:49:41 +00:00
refactor: move GPU core count to header
- Display GPU cores in header: 'Apple M2 Pro (19 GPU cores)' - Remove standalone GPU card to keep UI clean - GPU info is more contextual when shown with CPU model
This commit is contained in:
BIN
bin/status-go
BIN
bin/status-go
Binary file not shown.
@@ -109,7 +109,11 @@ func renderHeader(m MetricsSnapshot, errMsg string, animFrame int, termWidth int
|
|||||||
infoParts = append(infoParts, m.Hardware.Model)
|
infoParts = append(infoParts, m.Hardware.Model)
|
||||||
}
|
}
|
||||||
if m.Hardware.CPUModel != "" {
|
if m.Hardware.CPUModel != "" {
|
||||||
infoParts = append(infoParts, m.Hardware.CPUModel)
|
cpuInfo := m.Hardware.CPUModel
|
||||||
|
if len(m.GPU) > 0 && m.GPU[0].CoreCount > 0 {
|
||||||
|
cpuInfo += fmt.Sprintf(" (%d GPU cores)", m.GPU[0].CoreCount)
|
||||||
|
}
|
||||||
|
infoParts = append(infoParts, cpuInfo)
|
||||||
}
|
}
|
||||||
if m.Hardware.TotalRAM != "" {
|
if m.Hardware.TotalRAM != "" {
|
||||||
infoParts = append(infoParts, m.Hardware.TotalRAM)
|
infoParts = append(infoParts, m.Hardware.TotalRAM)
|
||||||
@@ -152,9 +156,6 @@ func getScoreStyle(score int) lipgloss.Style {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func buildCards(m MetricsSnapshot, _ int) []cardData {
|
func buildCards(m MetricsSnapshot, _ int) []cardData {
|
||||||
// Row 1: CPU + Memory
|
|
||||||
// Row 2: Disk + Power
|
|
||||||
// Row 3: Top Processes + Network
|
|
||||||
cards := []cardData{
|
cards := []cardData{
|
||||||
renderCPUCard(m.CPU),
|
renderCPUCard(m.CPU),
|
||||||
renderMemoryCard(m.Memory),
|
renderMemoryCard(m.Memory),
|
||||||
@@ -163,10 +164,6 @@ func buildCards(m MetricsSnapshot, _ int) []cardData {
|
|||||||
renderProcessCard(m.TopProcesses),
|
renderProcessCard(m.TopProcesses),
|
||||||
renderNetworkCard(m.Network, m.Proxy),
|
renderNetworkCard(m.Network, m.Proxy),
|
||||||
}
|
}
|
||||||
// Only show GPU card if there are GPUs with usage data or core count
|
|
||||||
if len(m.GPU) > 0 && (m.GPU[0].Usage >= 0 || m.GPU[0].CoreCount > 0) {
|
|
||||||
cards = append(cards, renderGPUCard(m.GPU))
|
|
||||||
}
|
|
||||||
// Only show sensors if we have valid temperature readings
|
// Only show sensors if we have valid temperature readings
|
||||||
if hasSensorData(m.Sensors) {
|
if hasSensorData(m.Sensors) {
|
||||||
cards = append(cards, renderSensorsCard(m.Sensors))
|
cards = append(cards, renderSensorsCard(m.Sensors))
|
||||||
|
|||||||
Reference in New Issue
Block a user