Merge pull request #142 from aofei/master

Align CPU values in CPU widget
This commit is contained in:
xxxserxxx 2020-07-24 09:16:45 -05:00 committed by GitHub
commit f9f330a910
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -120,7 +120,7 @@ func (cpu *CPUWidget) update() {
defer cpu.updateLock.Unlock()
for key, percent := range cpus {
cpu.Data[key] = append(cpu.Data[key], float64(percent))
cpu.Labels[key] = fmt.Sprintf("%d%%", percent)
cpu.Labels[key] = fmt.Sprintf("%3d%%", percent)
cpu.cpuLoads[key] = float64(percent)
}
}()