output to out/feeds/*
This commit is contained in:
parent
beac981047
commit
6fd3b598ab
11 changed files with 298 additions and 16 deletions
|
|
@ -13,6 +13,7 @@ from repub.components import (
|
|||
muted_action_link,
|
||||
stat_card,
|
||||
status_badge,
|
||||
table_section,
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -188,6 +189,56 @@ def running_executions_table(
|
|||
]
|
||||
|
||||
|
||||
def _source_feed_row(source_feed: Mapping[str, object]) -> tuple[Node, ...]:
|
||||
last_updated_iso = source_feed.get("last_updated_iso")
|
||||
last_updated = (
|
||||
h.time(
|
||||
datetime=str(last_updated_iso),
|
||||
title=str(last_updated_iso),
|
||||
class_="font-medium text-slate-900",
|
||||
)[str(source_feed["last_updated"])]
|
||||
if last_updated_iso is not None
|
||||
else h.p(class_="font-medium text-slate-900")[str(source_feed["last_updated"])]
|
||||
)
|
||||
return (
|
||||
h.div[
|
||||
h.div(class_="font-semibold text-slate-950")[str(source_feed["source"])],
|
||||
h.p(class_="mt-0.5 font-mono text-[11px] text-slate-500")[
|
||||
str(source_feed["slug"])
|
||||
],
|
||||
],
|
||||
h.div(class_="min-w-64")[
|
||||
inline_link(
|
||||
href=str(source_feed["feed_href"]),
|
||||
label=str(source_feed["feed_href"]),
|
||||
tone="amber",
|
||||
)
|
||||
],
|
||||
status_badge(
|
||||
label=str(source_feed["feed_status_label"]),
|
||||
tone=str(source_feed["feed_status_tone"]),
|
||||
),
|
||||
last_updated,
|
||||
h.p(class_="font-medium text-slate-900")[
|
||||
str(source_feed["artifact_footprint"])
|
||||
],
|
||||
)
|
||||
|
||||
|
||||
def published_feeds_table(
|
||||
*, source_feeds: tuple[Mapping[str, object], ...] | None = None
|
||||
) -> Renderable:
|
||||
rows = tuple(_source_feed_row(source_feed) for source_feed in (source_feeds or ()))
|
||||
return table_section(
|
||||
eyebrow="Published feeds",
|
||||
title="Published feeds",
|
||||
subtitle="Per-source public feed paths under /feeds, with current availability and disk usage.",
|
||||
headers=("Source", "Feed URL", "Status", "Last updated", "Disk usage"),
|
||||
rows=rows,
|
||||
actions=muted_action_link(href="/sources", label="Manage sources"),
|
||||
)
|
||||
|
||||
|
||||
def dashboard_page() -> Renderable:
|
||||
return dashboard_page_with_data()
|
||||
|
||||
|
|
@ -196,6 +247,7 @@ def dashboard_page_with_data(
|
|||
*,
|
||||
snapshot: Mapping[str, str] | None = None,
|
||||
running_executions: tuple[Mapping[str, object], ...] | None = None,
|
||||
source_feeds: tuple[Mapping[str, object], ...] | None = None,
|
||||
) -> Renderable:
|
||||
return h.main(
|
||||
id="morph",
|
||||
|
|
@ -207,6 +259,7 @@ def dashboard_page_with_data(
|
|||
dashboard_header(),
|
||||
operational_snapshot(snapshot=snapshot),
|
||||
running_executions_table(running_executions=running_executions),
|
||||
published_feeds_table(source_feeds=source_feeds),
|
||||
]
|
||||
],
|
||||
]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue