Closes #11
This commit is contained in:
parent
ca4febfc8b
commit
6b469e9f88
2
main.go
2
main.go
@ -169,7 +169,7 @@ func widgetColors() {
|
||||
LineColor := make(map[string]ui.Color)
|
||||
if cpu.Count <= 8 {
|
||||
for i := 0; i < len(cpu.Data); i++ {
|
||||
LineColor[fmt.Sprintf("CPU%d", i+1)] = ui.Color(colorscheme.CPULines[i])
|
||||
LineColor[fmt.Sprintf("CPU%d", i)] = ui.Color(colorscheme.CPULines[i])
|
||||
}
|
||||
} else {
|
||||
LineColor["Average"] = ui.Color(colorscheme.CPULines[0])
|
||||
|
@ -25,7 +25,7 @@ func NewCPU(interval time.Duration, zoom int) *CPU {
|
||||
self.Zoom = zoom
|
||||
if self.Count <= 8 {
|
||||
for i := 0; i < self.Count; i++ {
|
||||
key := "CPU" + strconv.Itoa(i+1)
|
||||
key := "CPU" + strconv.Itoa(i)
|
||||
self.Data[key] = []float64{0}
|
||||
}
|
||||
} else {
|
||||
@ -48,7 +48,7 @@ func (self *CPU) update() {
|
||||
if self.Count <= 8 {
|
||||
percent, _ := psCPU.Percent(self.interval, true)
|
||||
for i := 0; i < self.Count; i++ {
|
||||
key := "CPU" + strconv.Itoa(i+1)
|
||||
key := "CPU" + strconv.Itoa(i)
|
||||
self.Data[key] = append(self.Data[key], percent[i])
|
||||
}
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user