(m *ctrl.Control[*nano.Ctx])
| 597 | } |
| 598 | |
| 599 | func moreinfo(m *ctrl.Control[*nano.Ctx]) (stateinfo []*status, err error) { |
| 600 | var mems runtime.MemStats |
| 601 | runtime.ReadMemStats(&mems) |
| 602 | fmtmem := storagefmt(float64(mems.Sys)) |
| 603 | |
| 604 | hostinfo, err := host.Info() |
| 605 | if err != nil { |
| 606 | return |
| 607 | } |
| 608 | cpuinfo, err := cpu.Info() |
| 609 | if err != nil { |
| 610 | return |
| 611 | } |
| 612 | |
| 613 | count := len(m.Manager.M) |
| 614 | stateinfo = []*status{ |
| 615 | {name: "OS", text: []string{hostinfo.Platform}}, |
| 616 | {name: "CPU", text: []string{strings.TrimSpace(cpuinfo[0].ModelName)}}, |
| 617 | {name: "Version", text: []string{hostinfo.PlatformVersion}}, |
| 618 | {name: "Plugin", text: []string{"共 " + strconv.Itoa(count) + " 个"}}, |
| 619 | {name: "Memory", text: []string{"已用 " + fmtmem}}, |
| 620 | } |
| 621 | return |
| 622 | } |
| 623 | |
| 624 | func colorswitch(a uint8) color.Color { |
| 625 | if isday { |
no test coverage detected