Add News widget and integrate NewsAPI for live updates

This commit is contained in:
2025-12-29 21:19:05 +01:00
parent d638a8ae97
commit 9b5afc3d7c
9 changed files with 260 additions and 38 deletions
+9 -4
View File
@@ -44,6 +44,7 @@ func initWidgets(ctx context.Context, term *tcell.Terminal) {
widgets.New("PiHole", widgets.PiholeStats()),
widgets.New("PiHoleBlocked", widgets.PiholeBlocked()),
widgets.New("NinaWarnings", widgets.NinaWarnings()),
widgets.New("News", widgets.News()),
)
}
@@ -69,7 +70,7 @@ func layout() []container.Option {
),
),
grid.ColWidthPerc(58,
grid.ColWidthPerc(62,
grid.RowHeightFixed(44,
grid.ColWidthFixed(40,
grid.RowHeightFixed(8,
@@ -125,8 +126,12 @@ func layout() []container.Option {
),
),
grid.RowHeightFixed(20,
grid.RowHeightFixed(25,
grid.Widget(widgets.Get["empty"]),
grid.RowHeightFixed(20,
grid.Widget(widgets.Get["News"],
container.BorderTitle("News"),
container.Border(linestyle.Light),
container.BorderColor(cell.ColorWhite),
),
),
grid.RowHeightFixed(20,
grid.Widget(widgets.Get["NinaWarnings"],
@@ -139,7 +144,7 @@ func layout() []container.Option {
),
grid.ColWidthPerc(35,
grid.RowHeightPerc(20,
grid.RowHeightFixed(20,
grid.Widget(widgets.Get["HTTPProber"],
container.BorderTitle("Website Status"),
container.Border(linestyle.Light),