Add HTML5 operations SSE updates
This commit is contained in:
@@ -112,12 +112,14 @@ def render_html5_operations(jobs: Iterable[object]) -> str:
|
||||
<span>jobs</span>
|
||||
</div>
|
||||
</section>
|
||||
<section class="band">
|
||||
<section class="band" hx-ext="sse" sse-connect="/html5/operations/events">
|
||||
<div class="section-title">
|
||||
<h2>Очередь</h2>
|
||||
<a class="button" href="/html5">Проекты</a>
|
||||
</div>
|
||||
{render_html5_operation_summary(job_list)}
|
||||
<div data-html5-operations-summary-stream sse-swap="operations-summary" hx-swap="innerHTML">
|
||||
{render_html5_operation_summary(job_list)}
|
||||
</div>
|
||||
<div class="table-wrap">
|
||||
<table data-html5-operations>
|
||||
<thead>
|
||||
@@ -125,8 +127,7 @@ def render_html5_operations(jobs: Iterable[object]) -> str:
|
||||
</thead>
|
||||
<tbody
|
||||
data-html5-operations-body
|
||||
hx-get="/html5/operations/jobs"
|
||||
hx-trigger="every 3s"
|
||||
sse-swap="operations-jobs"
|
||||
hx-swap="innerHTML"
|
||||
>{render_html5_operation_rows(job_list)}</tbody>
|
||||
</table>
|
||||
@@ -148,9 +149,6 @@ def render_html5_operation_summary(jobs: Iterable[object]) -> str:
|
||||
<div
|
||||
class="ops-summary"
|
||||
data-html5-operations-summary
|
||||
hx-get="/html5/operations/summary"
|
||||
hx-trigger="every 3s"
|
||||
hx-swap="outerHTML"
|
||||
>
|
||||
{_metric("Всего", len(job_list))}
|
||||
{_metric("В работе", running)}
|
||||
|
||||
Reference in New Issue
Block a user