generated from john/python-template
@@ -12,6 +12,7 @@ from nicegui import ui
|
||||
|
||||
from transcription.config import Settings
|
||||
from transcription.db.models import MaintenanceJobType
|
||||
from transcription.db.models import MaintenanceRunStatus
|
||||
from transcription.runtime_helpers import run_blocking
|
||||
from transcription.services.documents import DocumentService
|
||||
from transcription.services.maintenance import MaintenanceService
|
||||
@@ -23,6 +24,7 @@ from transcription.ui.components.error_presenter import run_ui_action
|
||||
from transcription.ui.components.primitives import destructive_button
|
||||
from transcription.ui.components.primitives import render_empty_state
|
||||
from transcription.ui.components.primitives import section_header_row
|
||||
from transcription.ui.components.table.common import build_table
|
||||
from transcription.ui.components.table.registry import render_registry_table
|
||||
from transcription.ui.homepage_store import read_homepage_markdown
|
||||
from transcription.ui.homepage_store import save_homepage_markdown
|
||||
@@ -562,8 +564,7 @@ def register_page(*, settings: Settings) -> None: # noqa: PLR0915
|
||||
for run in runs
|
||||
]
|
||||
|
||||
table = (
|
||||
ui.table(
|
||||
table = build_table(
|
||||
rows=rows,
|
||||
columns=[
|
||||
{"name": "job_type", "label": "Job Type", "field": "job_type", "sortable": True},
|
||||
@@ -575,13 +576,7 @@ def register_page(*, settings: Settings) -> None: # noqa: PLR0915
|
||||
],
|
||||
row_key="id",
|
||||
selection="single",
|
||||
)
|
||||
.classes("w-full ui-table")
|
||||
.props(
|
||||
'flat square table-style="table-layout: fixed; width: 100%;" '
|
||||
'header-cell-class="ui-table-header text-xs uppercase tracking-wider" '
|
||||
'table-class="ui-table-body text-xs"'
|
||||
)
|
||||
show_search=False,
|
||||
)
|
||||
|
||||
table.add_slot(
|
||||
@@ -656,7 +651,13 @@ def register_page(*, settings: Settings) -> None: # noqa: PLR0915
|
||||
ui.button("View Log", icon="visibility", on_click=view_log).props("flat")
|
||||
ui.button("Download Log", icon="download", on_click=download_log).props("flat")
|
||||
|
||||
if any(run.status.value in {"queued", "processing"} for run in runs):
|
||||
active_statuses = frozenset(
|
||||
{
|
||||
MaintenanceRunStatus.QUEUED,
|
||||
MaintenanceRunStatus.PROCESSING,
|
||||
}
|
||||
)
|
||||
if any(run.status in active_statuses for run in runs):
|
||||
ui.timer(4.0, render_maintenance.refresh, once=True)
|
||||
|
||||
@ui.refreshable
|
||||
|
||||
@@ -191,6 +191,13 @@ RUNTIME_SETTINGS_CATALOG: tuple[RuntimeSettingDescriptor, ...] = (
|
||||
"Optional build or commit identifier for evidence provenance.",
|
||||
"text",
|
||||
),
|
||||
RuntimeSettingDescriptor(
|
||||
"run_embedded_worker",
|
||||
"RUN_EMBEDDED_WORKER",
|
||||
"Run embedded worker",
|
||||
"Run the in-process worker loop in the web app process.",
|
||||
"bool",
|
||||
),
|
||||
RuntimeSettingDescriptor(
|
||||
"bootstrap_schema_on_startup",
|
||||
"BOOTSTRAP_SCHEMA_ON_STARTUP",
|
||||
|
||||
Reference in New Issue
Block a user