Add News widget and integrate NewsAPI for live updates
This commit is contained in:
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user