add datastar and render shim

This commit is contained in:
Abel Luck 2026-03-30 12:27:45 +02:00
parent 9ce576e7e8
commit 2accb26546
6 changed files with 173 additions and 42 deletions

View file

@ -4,7 +4,6 @@ import htpy as h
from htpy import Node, Renderable
from repub.components import (
base_layout,
input_field,
nav_link,
select_field,
@ -451,7 +450,7 @@ def settings_panel() -> Renderable:
]
def admin_page(*, stylesheet_href: str) -> Renderable:
def admin_component() -> Renderable:
running_rows = (
(
h.div(class_="font-semibold text-slate-950")["Pangea mobile articles"],
@ -559,40 +558,39 @@ def admin_page(*, stylesheet_href: str) -> Renderable:
),
)
return base_layout(
page_title="Republisher Admin UI",
stylesheet_href=stylesheet_href,
content=h.div(class_="min-h-screen lg:grid lg:grid-cols-[18rem_minmax(0,1fr)]")[
sidebar(),
h.main(class_="px-4 py-5 sm:px-6 lg:px-8 lg:py-8")[
h.div(class_="mx-auto max-w-7xl space-y-6")[
page_header(),
overview_section(),
h.div(
class_="grid gap-6 xl:grid-cols-[minmax(0,1.35fr)_minmax(22rem,0.95fr)]"
)[
h.div(class_="space-y-6")[
source_form_section(),
configured_sources_section(),
job_table_section(
title="Running executions",
subtitle="Operators can inspect active crawls and stop them if needed.",
rows=running_rows,
),
job_table_section(
title="Upcoming jobs",
subtitle="Schedule preview with enable, disable, run now, and delete affordances.",
rows=upcoming_rows,
),
job_table_section(
title="Completed executions",
subtitle="Recent history with direct access to text logs.",
rows=completed_rows,
),
],
h.div(class_="space-y-6")[log_panel(), settings_panel()],
return h.main(
id="morph",
class_="min-h-screen lg:grid lg:grid-cols-[18rem_minmax(0,1fr)]",
)[
sidebar(),
h.div(class_="px-4 py-5 sm:px-6 lg:px-8 lg:py-8")[
h.div(class_="mx-auto max-w-7xl space-y-6")[
page_header(),
overview_section(),
h.div(
class_="grid gap-6 xl:grid-cols-[minmax(0,1.35fr)_minmax(22rem,0.95fr)]"
)[
h.div(class_="space-y-6")[
source_form_section(),
configured_sources_section(),
job_table_section(
title="Running executions",
subtitle="Operators can inspect active crawls and stop them if needed.",
rows=running_rows,
),
job_table_section(
title="Upcoming jobs",
subtitle="Schedule preview with enable, disable, run now, and delete affordances.",
rows=upcoming_rows,
),
job_table_section(
title="Completed executions",
subtitle="Recent history with direct access to text logs.",
rows=completed_rows,
),
],
]
],
h.div(class_="space-y-6")[log_panel(), settings_panel()],
],
]
],
)
]