2024-01-15 19:24:48 -06:00
|
|
|
// This creates a simple hello world window
|
|
|
|
package linuxstatus
|
|
|
|
|
2024-01-21 02:23:47 -06:00
|
|
|
import (
|
|
|
|
"go.wit.com/lib/gadgets"
|
2024-01-15 19:24:48 -06:00
|
|
|
)
|
|
|
|
|
|
|
|
// creates the actual widgets.
|
|
|
|
// it's assumed you are always passing in a box
|
|
|
|
func draw(ls *LinuxStatus) {
|
2024-01-21 02:23:47 -06:00
|
|
|
if !ls.Ready() {
|
|
|
|
return
|
|
|
|
}
|
2024-01-15 19:24:48 -06:00
|
|
|
ls.group = ls.window.Box().NewGroup("What Linux Knows It Is")
|
|
|
|
|
|
|
|
ls.grid = ls.group.NewGrid("gridnuts", 2, 2)
|
|
|
|
|
2024-01-21 02:23:47 -06:00
|
|
|
ls.hostnameStatus = gadgets.NewOneLiner(ls.grid, "status")
|
|
|
|
ls.hostname = gadgets.NewOneLiner(ls.grid, "hostname -f")
|
|
|
|
ls.hostshort = gadgets.NewOneLiner(ls.grid, "hostname -s")
|
|
|
|
ls.domainname = gadgets.NewOneLiner(ls.grid, "domain name")
|
|
|
|
ls.resolver = gadgets.NewOneLiner(ls.grid, "nameservers =")
|
|
|
|
ls.resolver.SetValue("TODO")
|
|
|
|
ls.uid = gadgets.NewOneLiner(ls.grid, "UID =")
|
|
|
|
ls.IPv4 = gadgets.NewOneLiner(ls.grid, "Current IPv4 =")
|
|
|
|
ls.IPv6 = gadgets.NewOneLiner(ls.grid, "Current IPv6 =")
|
|
|
|
ls.workingIPv4 = gadgets.NewOneLiner(ls.grid, "Real IPv4 =")
|
|
|
|
ls.workingIPv6 = gadgets.NewOneLiner(ls.grid, "Real IPv6 =")
|
2024-01-15 19:24:48 -06:00
|
|
|
// ls.nics = gadgets.NewOneLiner(ls.grid, "network intefaces =")
|
|
|
|
|
|
|
|
ls.grid.NewLabel("interfaces =")
|
2024-01-21 02:23:47 -06:00
|
|
|
ls.Interfaces = ls.grid.NewCombobox()
|
2024-01-15 19:24:48 -06:00
|
|
|
|
2024-01-21 02:23:47 -06:00
|
|
|
ls.speed = gadgets.NewOneLiner(ls.grid, "refresh speed =")
|
|
|
|
ls.speedActual = gadgets.NewOneLiner(ls.grid, "refresh speed =")
|
2024-01-15 19:24:48 -06:00
|
|
|
|
|
|
|
ls.grid.Margin()
|
|
|
|
ls.grid.Pad()
|
|
|
|
}
|