Add Nina Warnings widget and integrate BBK warning API
This commit is contained in:
@@ -43,12 +43,14 @@ func initWidgets(ctx context.Context, term *tcell.Terminal) {
|
||||
widgets.New("HTTPProber", widgets.HTTPProber()),
|
||||
widgets.New("PiHole", widgets.PiholeStats()),
|
||||
widgets.New("PiHoleBlocked", widgets.PiholeBlocked()),
|
||||
widgets.New("NinaWarnings", widgets.NinaWarnings()),
|
||||
)
|
||||
}
|
||||
|
||||
func layout() []container.Option {
|
||||
builder := grid.New()
|
||||
builder.Add(
|
||||
|
||||
grid.ColWidthFixed(84,
|
||||
grid.RowHeightFixed(44,
|
||||
grid.Widget(widgets.Get["Wifi"],
|
||||
@@ -56,7 +58,7 @@ func layout() []container.Option {
|
||||
container.Border(linestyle.Light),
|
||||
container.BorderColor(cell.ColorWhite)),
|
||||
),
|
||||
grid.RowHeightFixed(44,
|
||||
grid.RowHeightFixed(46,
|
||||
grid.Widget(widgets.Get["NetworkDevices"],
|
||||
container.BorderTitle("Network Devices"),
|
||||
container.Border(linestyle.Light),
|
||||
@@ -66,56 +68,76 @@ func layout() []container.Option {
|
||||
grid.Widget(widgets.Get["empty"]),
|
||||
),
|
||||
),
|
||||
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.ColWidthPerc(58,
|
||||
grid.RowHeightFixed(44,
|
||||
grid.ColWidthFixed(40,
|
||||
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(12,
|
||||
grid.Widget(widgets.Get["PiHole"],
|
||||
container.BorderTitle("pi-hole"),
|
||||
container.Border(linestyle.Light),
|
||||
container.BorderColor(cell.ColorWhite),
|
||||
),
|
||||
),
|
||||
grid.RowHeightFixed(40,
|
||||
grid.Widget(widgets.Get["PiHoleBlocked"],
|
||||
container.BorderTitle("pi-hole (Blocked Percent)"),
|
||||
container.Border(linestyle.Light),
|
||||
container.BorderColor(cell.ColorWhite),
|
||||
),
|
||||
),
|
||||
grid.RowHeightFixed(85,
|
||||
grid.Widget(widgets.Get["empty"]),
|
||||
),
|
||||
),
|
||||
|
||||
grid.ColWidthFixed(26,
|
||||
grid.RowHeightFixed(20,
|
||||
grid.Widget(widgets.Get["Calendar"],
|
||||
container.BorderTitle("Calendar"),
|
||||
container.Border(linestyle.Light),
|
||||
container.BorderColor(cell.ColorWhite)),
|
||||
),
|
||||
grid.RowHeightFixed(25,
|
||||
grid.Widget(widgets.Get["empty"]),
|
||||
),
|
||||
),
|
||||
|
||||
grid.ColWidthFixed(25,
|
||||
grid.RowHeightFixed(20,
|
||||
grid.Widget(widgets.Get["Weather"],
|
||||
container.BorderTitle("Weather"),
|
||||
container.Border(linestyle.Light),
|
||||
container.BorderColor(cell.ColorWhite),
|
||||
),
|
||||
),
|
||||
grid.RowHeightFixed(85,
|
||||
grid.Widget(widgets.Get["empty"]),
|
||||
),
|
||||
),
|
||||
),
|
||||
grid.RowHeightFixed(12,
|
||||
grid.Widget(widgets.Get["PiHole"],
|
||||
container.BorderTitle("pi-hole"),
|
||||
container.Border(linestyle.Light),
|
||||
container.BorderColor(cell.ColorWhite),
|
||||
),
|
||||
),
|
||||
grid.RowHeightFixed(24,
|
||||
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"]),
|
||||
),
|
||||
),
|
||||
grid.ColWidthPerc(13,
|
||||
grid.RowHeightFixed(20,
|
||||
grid.Widget(widgets.Get["Calendar"],
|
||||
container.BorderTitle("Calendar"),
|
||||
container.Border(linestyle.Light),
|
||||
container.BorderColor(cell.ColorWhite)),
|
||||
),
|
||||
grid.RowHeightPerc(25,
|
||||
grid.Widget(widgets.Get["empty"]),
|
||||
),
|
||||
),
|
||||
grid.ColWidthPerc(25,
|
||||
grid.RowHeightFixed(20,
|
||||
grid.Widget(widgets.Get["Weather"],
|
||||
container.BorderTitle("Weather"),
|
||||
container.Border(linestyle.Light),
|
||||
container.BorderColor(cell.ColorWhite),
|
||||
grid.RowHeightFixed(25,
|
||||
grid.Widget(widgets.Get["empty"]),
|
||||
),
|
||||
grid.RowHeightFixed(20,
|
||||
grid.Widget(widgets.Get["NinaWarnings"],
|
||||
container.BorderTitle("BBK Warnings"),
|
||||
container.Border(linestyle.Light),
|
||||
container.BorderColor(cell.ColorWhite),
|
||||
),
|
||||
),
|
||||
),
|
||||
grid.RowHeightPerc(25,
|
||||
grid.Widget(widgets.Get["empty"]),
|
||||
),
|
||||
),
|
||||
|
||||
grid.ColWidthPerc(35,
|
||||
grid.RowHeightPerc(20,
|
||||
grid.Widget(widgets.Get["HTTPProber"],
|
||||
|
||||
Reference in New Issue
Block a user