Surface the three media jobs that appeared in no tab at all

play_state_sync, media_shares_permissions and media_cleaner work on the same
files the arrs manage and were visible only by opening the Scheduler and reading
an orchestrator's log. Readable at all because run_orch_child() now writes a run
record and a per-script log for its children — this could not have been written
yesterday. Each card shows the sentence the script itself ended on rather than a
count re-derived here, since the three word their outcome differently and the
wording is the part worth reading.
This commit is contained in:
Gmer4Lfe
2026-08-14 18:51:54 -04:00
parent fa7af04418
commit 1381a526ab
3 changed files with 103 additions and 0 deletions
+35
View File
@@ -374,6 +374,40 @@ function _syncSection(sync, recovery, settings) {
</div>`;
}
// ── Media jobs ────────────────────────────────────────────────────────────────
// Play state sync, permissions and the cleaner. They work on the same files the arrs manage and
// appeared in no tab at all — the only way to know whether one had run was to open the Scheduler
// and read an orchestrator's log. Readable at all only because run_orch_child() now writes a run
// record and a per-script log for its children.
//
// Each shows the sentence the script itself ended on rather than a count re-derived here. The
// three word their outcome differently — "done — 21 shares updated", "clean — nothing to remove" —
// and the wording is the part worth reading.
function _mediaJobsSection(jobs) {
if (!jobs || !jobs.length) return '';
const cards = jobs.map(j => {
const st = j.status || null;
const col = !st ? '#444' : st === 'ok' ? '#4caf50' : st === 'running' ? '#4a9eff'
: st === 'warn' ? '#ffb74d' : '#ef5350';
const pill = !st ? 'never run' : st;
const dur = j.duration != null ? _dur(j.duration) : '';
return `<div class="vv-arr-card">
<div style="display:flex;justify-content:space-between;align-items:center;margin-bottom:6px;gap:8px;">
<span style="font-size:11px;font-weight:700;color:#555;text-transform:uppercase;letter-spacing:.07em;">${vvEscHtml(j.label)}</span>
<span class="vv-arr-pill" style="color:${col};border:1px solid ${col}33;background:${col}14;">${vvEscHtml(pill)}</span>
</div>
<div style="font-size:11px;color:#555;">
${j.last_run ? _relTime(j.last_run) : 'no run recorded'}${dur ? ' · ' + dur : ''}
</div>
${j.summary ? `<div style="font-size:10px;color:#3f3f3f;margin-top:5px;line-height:1.45;">${vvEscHtml(j.summary)}</div>` : ''}
</div>`;
}).join('');
return `<div style="grid-column:1/-1;">
<div style="font-size:11px;font-weight:700;color:#555;text-transform:uppercase;letter-spacing:.07em;margin-bottom:8px;">Media jobs</div>
<div class="vv-arr-cards">${cards}</div>
</div>`;
}
// ── Settings card ─────────────────────────────────────────────────────────────
function _settingsCard(s) {
if (!s) return '';
@@ -440,6 +474,7 @@ function _render(data) {
let html = '';
for (const node of nodes) html += _nodeSection(node);
html += _syncSection(data.sync || {}, data.recovery || {}, data.settings);
html += _mediaJobsSection(data.media_jobs);
html += _settingsCard(data.settings);
document.getElementById('vv-arrs-grid').innerHTML = html;