Add Pi-hole blocked percentage and date widgets
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
||||
"context"
|
||||
|
||||
"github.com/mum4k/termdash"
|
||||
"github.com/mum4k/termdash/align"
|
||||
"github.com/mum4k/termdash/cell"
|
||||
"github.com/mum4k/termdash/container"
|
||||
"github.com/mum4k/termdash/container/grid"
|
||||
@@ -32,10 +33,12 @@ func initWidgets(ctx context.Context, term *tcell.Terminal) {
|
||||
|
||||
widgets.Create(ctx, term,
|
||||
widgets.New("Clock", widgets.Clock()),
|
||||
widgets.New("Date", widgets.Date()),
|
||||
widgets.New("ChangeTitle", widgets.TextInput(titleUpdate, textinput.Label("Update Title: "), textinput.PlaceHolder("New Title"))),
|
||||
widgets.New("Wifi", widgets.WifiQRCode()),
|
||||
widgets.New("Docker", widgets.DockerList()),
|
||||
widgets.New("PiHole", widgets.PiholeStats()),
|
||||
widgets.New("PiHoleBlocked", widgets.PiholeBlocked()),
|
||||
)
|
||||
}
|
||||
|
||||
@@ -56,11 +59,20 @@ func layout() []container.Option {
|
||||
grid.ColWidthPerc(20,
|
||||
grid.RowHeightFixed(8,
|
||||
grid.Widget(widgets.Get["Clock"],
|
||||
container.AlignHorizontal(align.HorizontalCenter),
|
||||
container.BorderTitle("Time"),
|
||||
container.Border(linestyle.Light),
|
||||
container.BorderColor(cell.ColorWhite),
|
||||
),
|
||||
),
|
||||
grid.RowHeightFixed(3,
|
||||
grid.Widget(widgets.Get["Date"],
|
||||
container.AlignHorizontal(align.HorizontalCenter),
|
||||
container.BorderTitle("Date"),
|
||||
container.Border(linestyle.Light),
|
||||
container.BorderColor(cell.ColorWhite),
|
||||
),
|
||||
),
|
||||
grid.RowHeightFixed(8,
|
||||
grid.Widget(widgets.Get["PiHole"],
|
||||
container.BorderTitle("pi-hole"),
|
||||
@@ -68,6 +80,13 @@ func layout() []container.Option {
|
||||
container.BorderColor(cell.ColorWhite),
|
||||
),
|
||||
),
|
||||
grid.RowHeightFixed(25,
|
||||
grid.Widget(widgets.Get["PiHoleBlocked"],
|
||||
container.BorderTitle("pi-hole (Blocked Percent)"),
|
||||
container.Border(linestyle.Light),
|
||||
container.BorderColor(cell.ColorWhite),
|
||||
),
|
||||
),
|
||||
grid.RowHeightPerc(85,
|
||||
grid.Widget(widgets.Get["empty"]),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user