Pull pipeline/ from boilerplate a80ad8a: cadence picker, queue badge, label refresh
The schedule cadence is a picker, the add row is behind a button and off here, a running-jobs chip with Kill and Stop run sits in every header, and a declared schedule's label is refreshed at startup. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
cebe62ddc9
commit
3a240e51df
16 files changed
+828
-167
No files matched your search
+10
-10
@@ -4,11 +4,11 @@
|
||||
* own pages, and at the bottom the phone: a width query for the layout and a
|
||||
* pointer query for the sizes, after newsdesk and health. No build step.
|
||||
*
|
||||
* The `--desk-jobs-*` block is how `<desk-jobs>`, `<desk-schedules>` and
|
||||
* `<auth-account>` are themed. Each keeps to a shadow root and reads those
|
||||
* properties, so an app skins it without forking it -- which is the deal
|
||||
* that lets the queue ship its own UI and still look like it belongs here --
|
||||
* and the app cannot lay it out beyond that.
|
||||
* The `--desk-jobs-*` block is how `<desk-jobs>`, `<desk-schedules>`,
|
||||
* `<desk-queue>` and `<auth-account>` are themed. Each keeps to a shadow
|
||||
* root and reads those properties, so an app skins it without forking it --
|
||||
* which is the deal that lets the queue ship its own UI and still look like
|
||||
* it belongs here -- and the app cannot lay it out beyond that.
|
||||
*/
|
||||
|
||||
:root {
|
||||
@@ -351,12 +351,12 @@ details.stage[open] summary { margin-bottom: 0.75rem; }
|
||||
}
|
||||
|
||||
/* -- the modules' elements ------------------------------------------------ */
|
||||
/* `<desk-jobs>` and `<desk-schedules>` from the queue, `<auth-account>` from
|
||||
* auth: all three read these, so they look like one application and none of
|
||||
* them is forked to get it. An element the app has not got yet simply matches
|
||||
* nothing. */
|
||||
/* `<desk-jobs>`, `<desk-schedules>` and the top bar's `<desk-queue>` from the
|
||||
* queue, `<auth-account>` from auth: all four read these, so they look like
|
||||
* one application and none of them is forked to get it. An element the app
|
||||
* has not got yet simply matches nothing. */
|
||||
|
||||
desk-jobs, desk-schedules, auth-account {
|
||||
desk-jobs, desk-schedules, desk-queue, auth-account {
|
||||
display: block;
|
||||
--desk-jobs-bg: var(--panel);
|
||||
--desk-jobs-fg: var(--fg);
|
||||
|
||||
+1
-13
@@ -5,7 +5,7 @@
|
||||
* `@job` in `app/jobs.py` is a new button and this file is not edited --
|
||||
* except that `pull` itself is pulled out of the list and wired to the
|
||||
* dedicated button instead of appearing twice. What the queue is doing is
|
||||
* `<desk-jobs>`'s business, and it draws itself.
|
||||
* `<desk-jobs>`'s business, and it draws itself, idle line included.
|
||||
*
|
||||
* Failures are the server's sentence through `api()`, which toasts it -- so
|
||||
* there is no error handling here beyond keeping the button usable.
|
||||
@@ -60,17 +60,5 @@
|
||||
});
|
||||
}
|
||||
|
||||
/* `<desk-jobs>` takes up no space while the queue is idle, so the line that
|
||||
says so is the app's to show and hide. Off the same socket the element
|
||||
reads, through live.js, rather than by asking the element: it keeps to a
|
||||
shadow root and owes nobody an answer about its own height. */
|
||||
document.addEventListener("app:jobs", (e) => {
|
||||
const idle = document.getElementById("idle");
|
||||
if (!idle) return;
|
||||
const state = e.detail || {};
|
||||
const busy = (state.running || []).length + (state.queued || []).length;
|
||||
idle.hidden = busy > 0;
|
||||
});
|
||||
|
||||
document.addEventListener("DOMContentLoaded", draw);
|
||||
})();
|
||||
@@ -47,6 +47,11 @@
|
||||
<a href="{{ tab.path }}"
|
||||
{% if here == tab.path %}class="active" aria-current="page"{% endif %}>{{ tab.label }}</a>
|
||||
{% endfor %}
|
||||
{# The queue's chip, from the queue's own router like `<desk-jobs>`: grey
|
||||
while idle, what is running and a popover with Kill otherwise, and a
|
||||
link to the Runs section. Loaded here, once, for every page. #}
|
||||
<script type="module" src="/_jobs/jobs.js"></script>
|
||||
<desk-queue href="/settings/sources#runs"></desk-queue>
|
||||
{# health's cog: an icon because it is not a place you go to often, and a
|
||||
word would take a third of the bar on a phone. #}
|
||||
<a href="/settings" class="icon{% if request.url.path.startswith('/settings') %} active{% endif %}"
|
||||
|
||||
@@ -114,23 +114,20 @@
|
||||
<p class="lede">Every 6 hours the pull reads every board, embed and score rank every role, extract fills in what the best postings say, score runs again with what it filled, and summarise writes the summaries. Change the cadence below.</p>
|
||||
|
||||
<h3>What is running</h3>
|
||||
{# The heading and the idle line are the app's: the element takes up no
|
||||
space while the queue is idle — that is its `idle="hide"` default, and a
|
||||
strip that is always there is furniture — and a heading with nothing
|
||||
under it reads as something that failed to load. The element and its
|
||||
script are the queue's own, served by its own router — see
|
||||
pipeline/web/static/jobs.js. #}
|
||||
<p class="muted small" id="idle">Nothing at the moment.</p>
|
||||
<script type="module" src="/_jobs/jobs.js"></script>
|
||||
<desk-jobs></desk-jobs>
|
||||
{# The element is the queue's own, served by its own router — see
|
||||
pipeline/web/static/jobs.js; base.html loads its script. `idle="show"`
|
||||
keeps it under the heading and has it say "Nothing running." when the
|
||||
queue is idle, since a heading with nothing under it reads as something
|
||||
that failed to load. #}
|
||||
<desk-jobs idle="show"></desk-jobs>
|
||||
|
||||
{# The element and its script are the scheduler's own, served by its own
|
||||
router — see pipeline/web/static/schedules.js. A cadence is typed as
|
||||
`every 15m`, `every 6h`, `daily at 06:00` or `weekly mon 07:00`; its add
|
||||
row's placeholder shows two. #}
|
||||
router — see pipeline/web/static/schedules.js. The cadence is picked
|
||||
(every 6h, daily at 06:00, weekly mon 07:00). `add="off"`, because the
|
||||
pull is the only schedule and it is declared in app/jobs/cascade.py. #}
|
||||
<h3>Schedule</h3>
|
||||
<script type="module" src="/_jobs/schedules.js"></script>
|
||||
<desk-schedules></desk-schedules>
|
||||
<desk-schedules add="off"></desk-schedules>
|
||||
|
||||
<details class="stage">
|
||||
<summary>Run one stage</summary>
|
||||
|
||||
Reference in new issue
Block a user