diff --git a/STATUS.md b/STATUS.md index fadee80..5d79d9d 100644 --- a/STATUS.md +++ b/STATUS.md @@ -13,6 +13,27 @@ caches reported `unchanged`. This run froze its source before D-113, so its image commits have no size metadata. Publication is not yet confirmed; do not treat the version change as delivered until the HTTPS/ref check below passes. +## Build control portal shows real progress (2026-11-14) + +The private portal draws one progress bar for the selected run from the same +phase plan as the stage grid. `phasePlan()` keeps hiding stages that a completed +instrumented run never entered, and now also cuts an uninstrumented run's plan +at the stage named by `state`/`failed_phase` instead of claiming that every +stage ran. The bar counts a phase as completed only once a later phase starts; +when there is no trace at all it takes the position of the current or failed +stage. A running or failed run is capped at 99 %, only `complete` reports +100 %, and the track exposes `aria-valuenow` for assistive technology. + +The deployed portal at `/opt/archipelago/control-source/control/` was newer than +this repository, so the live `app.js`, `index.html`, `style.css`, `server.py` and +`README.md` were first copied back here and then extended. Verified with +`node --check` and a stubbed DOM against the real `/api/status` and `/api/run` +payloads of the in-flight `20261114T133314Z` run (9 of 17 stages, 53 %), a +synthetic failed-at-Core run (7 of 8, 88 %) and a completed uninstrumented run +(100 %, "no trace recorded"). `infrastructure/tests/control_portal.py` asserts +the progress markup and the attribute update; `archipelago-control.service` was +restarted and serves the new files. + ## Image size and MIT licence in the software centers (D-113, 2026-11-14) Every image path now records its size in the published commit. The builder @@ -42,7 +63,7 @@ licence (`PLUGIN_DBUS_DIFF_DOWNLOAD_STAGE_ERROR_STATES_PASS`); the Discover adapter compiles against the `2026-11-12` snapshot with no missing libraries. Measured on the real Core commit `30717394…`: transfer 1 414 614 430 bytes, installed 2 092 868 303 bytes. Sources are pushed and deployed to the worker -source tree: `builder 853a88d`, `system df3e312`, `rfc f678845`. +source tree: `builder 853a88d`, `system bcc32b8`, `rfc f678845`. The size shown in the running software centers and the D-Bus values on an installed system remain user-verified only until the next cycle publishes. diff --git a/control/app.js b/control/app.js index 85fadd2..ae54e16 100644 --- a/control/app.js +++ b/control/app.js @@ -1,13 +1,25 @@ 'use strict'; const $ = id => document.getElementById(id); +// Actual driver phases. The optional marker limits a phase to that build mode so +// removed acceptance stages and disabled steps never appear in the UI. const phases = [ - ['preflight','Подготовка'],['freezing-and-compiling-source','Исходники и тесты'], - ['updating-flatpak-cache','Flatpak / GNOME'],['updating-kde-flatpak-cache','Flatpak / KDE'], - ['building-software-adapter','GNOME Software'],['building-discover-adapter','Discover'], - ['building-core','Core / ISO'],['building-gnome-purpose-and-iso','GNOME / ISO'],['building-kde-purpose-and-iso','KDE / ISO'], - ['core-installed-acceptance','Приёмка Core'],['gnome-installed-acceptance','Приёмка GNOME'],['kde-installed-acceptance','Приёмка KDE'], - ['archiving-artifacts','Архив и целостность'],['preparing-publication','Подготовка публикации'], - ['signing-and-publishing','Подпись и публикация'],['verifying-public-endpoints','Проверка HTTPS'],['cleaning-worker','Очистка worker'] + ['preflight','Подготовка окружения'], + ['selecting-repository','Выбор репозитория'], + ['freezing-and-compiling-source','Исходники, тесты, CLI'], + ['updating-flatpak-cache','Кэш Flatpak · GNOME','iso'], + ['updating-kde-flatpak-cache','Кэш Flatpak · KDE','iso'], + ['building-software-adapter','Адаптер GNOME Software'], + ['building-discover-adapter','Адаптер Discover'], + ['building-core','Core'], + ['building-gnome-purpose','GNOME'], + ['building-kde-purpose','KDE'], + ['building-container-runner','Container Runner'], + ['archiving-artifacts','Архив артефактов'], + ['preparing-publication','Проверка доказательств'], + ['signing-and-publishing','Подпись и публикация'], + ['verifying-public-endpoints','Проверка HTTPS'], + ['publishing-container-runner','Публикация Container Runner'], + ['cleaning-worker','Очистка worker'] ]; let run = '', log = '', offset = 0, next = 0, size = 0, text = '', data = null, status = null, busy = false, logBusy = false; let logsKey = '', runsKey = ''; @@ -30,7 +42,7 @@ function drawStatus(s) { status=s;const active=['active','activating'].includes(s.service.ActiveState);const stopping=s.service.ActiveState==='deactivating'; $('service').textContent=stopping?'Останавливается':active?'Выполняется':'Ожидает запуска'; $('service-detail').textContent=`systemd: ${s.service.ActiveState} / ${s.service.SubState}`; - $('schedule').textContent=s.timer.ActiveState==='active'?'OSTree: 3 дня · ISO: 30-го':'Приостановлено'; + $('schedule').textContent=s.timer.ActiveState==='active'?'ISO+OSTree · 1-е число':'Приостановлено'; $('next').textContent='Следующий: '+(s.timer.ActiveState==='active' && s.next_release ? `${s.next_release.date} · ${s.next_release.mode} · ${s.next_release.time}` : '—'); $('start').disabled=active||stopping;$('stop').disabled=!active;$('toggle-schedule').disabled=false; $('toggle-schedule').textContent=s.timer.ActiveState==='active'?'Ⅱ Приостановить расписание':'↻ Включить расписание'; @@ -41,14 +53,52 @@ function drawStatus(s) { $('run-count').textContent=s.runs.length; $('sources').replaceChildren();for(const [name,sha] of Object.entries(s.sources)){const d=node('div','',name+' ');d.append(node('code','',sha.slice(0,12)));$('sources').append(d);} } +function phasePlan(s, d, terminal) { + const byMode = phases.filter(([id,, mode]) => !mode || s.output_mode === mode); + if (d.instrumented && terminal) { + // A finished instrumented run shows only the phases it actually executed. + return byMode.filter(([id]) => d.events.some(e => e.phase === id)); + } + if (d.instrumented) return byMode; + // Without a phase trace the plan may not claim stages that never ran: cut it + // after the stage the state names, or after the one that failed. + const reached = byMode.findIndex(([id]) => id === (s.failed_phase || s.state)); + return reached < 0 ? byMode : byMode.slice(0, reached + 1); +} +function progressOf(s, d, plan) { + const total = plan.length; + if (!total) return {done: 0, total: 0, percent: 0}; + if (s.state === 'complete') return {done: total, total, percent: 100}; + let done = 0; + if (d.instrumented) { + // A phase counts once a later phase started; the current one is still running. + done = plan.filter(([id]) => { + const event = d.events.find(e => e.phase === id); + return event && d.events.some(e => e.time > event.time); + }).length; + } else { + done = Math.max(0, plan.findIndex(([id]) => id === (s.failed_phase || s.state))); + } + return {done, total, percent: Math.min(99, Math.round(done / total * 100))}; +} function drawRun(d) { - data=d;const s=d.state;const terminal=['failed','complete'].includes(s.state); + data=d;const s=d.state;const terminal=['failed','complete'].includes(s.state);const plan=phasePlan(s,d,terminal); $('run-name').textContent=s.run;$('run-state').textContent=label(s.state); - $('run-meta').textContent=`${date(s.started)} · ${elapsed(s.started,terminal?(s.finished||s.updated):null)} · ${s.worker} · ${s.channel}`; + $('run-state').className='badge'+(s.state==='failed'?' error':''); + $('run-meta').textContent=`${date(s.started)} · ${elapsed(s.started,terminal?(s.finished||s.updated):null)} · ${s.worker} · ${s.channel} · ${s.output_mode||'—'}`; $('run-error').hidden=!s.error;$('run-error').textContent=s.error_details||s.error||''; + const p=progressOf(s,d,plan);const track=$('run-progress-track'); + track.setAttribute('aria-valuenow',String(p.percent)); + track.className='progress-track'+(s.state==='failed'?' failed':s.state==='complete'?' complete':''); + $('run-progress').style.width=p.percent+'%'; + $('run-progress-text').textContent=s.state==='complete' + ? (d.instrumented?`Готово · ${p.total} этапов · ${elapsed(s.started,s.finished||s.updated)}`:'Завершён · подробная трассировка не записывалась') + : s.state==='failed' + ? `Остановлено после ${p.done} из ${p.total} этапов · ${p.percent}%` + : `${p.done} из ${p.total} этапов · ${p.percent}% · идёт ${elapsed(s.started)}`; $('phase-summary').textContent=d.instrumented?'Фактические переходы и время':'Исторический прогон · подробная трассировка не записывалась'; $('phases').replaceChildren(); - for(const [id,title] of phases){const event=d.events.find(e=>e.phase===id);const end=event?d.events[d.events.indexOf(event)+1]:null;let state='waiting';if(event)state=end?'succeeded':'active';if(s.state===id)state='active';if(s.failed_phase===id)state='failed';if(!d.instrumented&&s.state==='complete')state='succeeded';const p=node('div','phase '+state);p.append(node('strong','',({waiting:'○ ',active:'◉ ',succeeded:'✓ ',failed:'× '})[state]+title),node('small','',event?elapsed(event.time,end?.time):state==='waiting'?'Не выполнялся / нет данных':id));$('phases').append(p);} + for(const [id,title] of plan){const event=d.events.find(e=>e.phase===id);const end=event?d.events[d.events.indexOf(event)+1]:null;let state='waiting';if(event)state=end?'succeeded':'active';if(s.state===id)state='active';if(s.failed_phase===id)state='failed';if(!d.instrumented&&s.state==='complete')state='succeeded';const p=node('div','phase '+state);p.append(node('strong','',({waiting:'○ ',active:'◉ ',succeeded:'✓ ',failed:'× '})[state]+title),node('small','',event?elapsed(event.time,end?.time):state==='waiting'?'Не выполнялся / нет данных':id));$('phases').append(p);} const opened = new Set([...$('actions').querySelectorAll('details[open]')].map(el=>el.dataset.id)); $('action-count').textContent=`(${d.actions.length})`;$('actions').replaceChildren(); for(const a of d.actions.filter(Boolean)){const el=node('details','action');el.append(node('summary','',`${a.id} · ${label(a.state)} · ${a.phase} · ${a.duration_seconds??'…'} с · exit ${a.returncode??'—'}`),node('pre','',a.command.join(' ')));if(a.error)el.append(node('p','',a.error));const link=node('a','', 'Открыть полный лог →');link.href='#log-content';link.onclick=()=>selectLog('monitor/'+a.log);el.append(link);$('actions').append(el);} diff --git a/control/index.html b/control/index.html index b5c7151..0e0cb23 100644 --- a/control/index.html +++ b/control/index.html @@ -2,35 +2,111 @@ - Archipelago // Build control - + + + Archipelago · Build control + + + -
archipelago_
● PRIVATE / TERRA LAN + TAILSCALE
+
+ archipelago_ +
● PRIVATE / TERRA LAN + TAILSCALE
+
+
-

/ BUILD CONTROL ROOM

Сборка под контролем.

От исходников до публикации. Каждый этап. Каждая строка.

Подключение…—
- -
-
01 / PIPELINE—Чтение systemd
-
02 / SCHEDULE—Каждые 3 дня; ISO 30-го · 00:00 UTC
-
03 / PUBLICATION—Только по результату конвейера
+
+
+

Build control room

+

Сборка под контролем

+

От исходников до публикации: этапы, действия и полные логи.

+
+
Подключение…—
-
Лимит каждого действия: 4 часа
+ + + +
+
Pipeline—Чтение systemd
+
Schedule——
+
Publication—Только по результату конвейера
+
+ +
+
+ + + +
+ Лимит каждого действия: 4 часа +
+
- -

/ SELECTED RUN

Выберите прогон

—
-

Этапы конвейера

—
-
Все действия, команды и коды завершения
+ + +
+
+

Selected run

Выберите прогон

+ — +
+
+ + +
+
+
+
+

—

+
+ +

Этапы конвейера

—
+
+ +
+ Все действия, команды и коды завершения +
+
-

/ COMPLETE LOG EXPLORER

Ничего за кадром.

—
-
-
Выберите лог
-
—
- + +
+
+

Log explorer

Ничего за кадром

+ — +
+
+
+ + +
+
+
+
Выберите лог
+
+ + + + + + — +
+
Логи доступны целиком: навигация от первого байта до последнего и скачивание без ограничения размера.
-
- + + + + + diff --git a/control/server.py b/control/server.py index bae5b36..d7ca6fd 100644 --- a/control/server.py +++ b/control/server.py @@ -56,7 +56,10 @@ class App: def runs(self): names = {p.name for root in (self.archive, self.history) if root.exists() for p in root.iterdir() if RUN.fullmatch(p.name)} - return [s for name in sorted(names, reverse=True) if (s := self.state(name))] + states = [s for name in names if (s := self.state(name))] + # Show the run that changed most recently first: a resumed run keeps an + # older identity but is the one actually progressing. + return sorted(states, key=lambda s: (s.get("updated") or s.get("started") or "", s.get("run") or ""), reverse=True) def logs(self, run): if not self.state(run): diff --git a/control/style.css b/control/style.css index ff46e92..68a4ad4 100644 --- a/control/style.css +++ b/control/style.css @@ -1 +1,306 @@ -:root{color-scheme:dark;--bg:#080e12;--panel:#0d161c;--ink:#dce8ed;--muted:#8dabb8;--accent:#35d2d0;--line:#243741;--red:#ff8c87;--yellow:#e7c277;font-family:"SFMono-Regular",Consolas,"Liberation Mono",monospace;font-synthesis:none}*{box-sizing:border-box}body{margin:0;background:radial-gradient(ellipse at 90% 0,#1793d115,transparent 40%),var(--bg);color:var(--ink);font-size:13px;line-height:1.6}header,main,footer{max-width:1512px;margin:auto;padding-inline:40px}header{height:90px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--line)}a{color:var(--accent);text-decoration:none}.brand{display:flex;align-items:center;gap:10px;color:var(--ink);font-size:23px;font-weight:700;letter-spacing:-1px}.brand span{color:var(--accent);margin-left:-8px}.private{font-size:10px;color:var(--accent);letter-spacing:1px}.private span{color:var(--muted);margin-left:20px}.heading{display:flex;justify-content:space-between;align-items:center;gap:24px;padding:42px 0 30px}.eyebrow{font-size:10px;color:var(--accent);letter-spacing:1.5px;margin:0 0 12px}h1{font-size:clamp(26px,3.4vw,48px);letter-spacing:-2px;line-height:1.2;margin:0 0 16px}h1 span{color:var(--accent)}h2{font-size:20px;letter-spacing:-.5px;margin:0}h3{font-size:13px;margin:0}.muted,small{color:var(--muted)}.connection{text-align:right;font-size:11px;white-space:nowrap}.connection small{display:block;margin-top:6px}.connection i{display:inline-block;width:7px;height:7px;background:var(--yellow);margin-right:8px}.connection i.online{background:var(--accent);box-shadow:0 0 12px #35d2d044}.overview{display:grid;grid-template-columns:repeat(3,1fr);border:1px solid var(--line);background:var(--panel)}.overview article{padding:23px 26px;min-width:0}.overview article+article{border-left:1px solid var(--line)}.overview strong{font-size:20px;font-weight:500;display:block;margin:10px 0 5px}.overview small{font-size:11px;display:block;overflow-wrap:anywhere}.toolbar{display:flex;justify-content:space-between;align-items:center;gap:18px;padding:22px 0 30px}.controls{display:flex;gap:10px;flex-wrap:wrap}button{font:inherit;font-size:11px;padding:10px 14px;color:var(--ink);background:var(--panel);border:1px solid var(--line);cursor:pointer}button:hover{border-color:var(--accent)}button:disabled{opacity:.4;cursor:default}.primary{color:var(--bg);background:var(--accent);border-color:var(--accent);font-weight:700}.danger{color:var(--red)}button:focus-visible,a:focus-visible,input:focus-visible,summary:focus-visible{outline:2px solid var(--accent);outline-offset:3px}#action-result{color:var(--muted);font-size:11px}.workspace{display:grid;grid-template-columns:275px minmax(0,1fr);gap:24px}.section-title{display:flex;justify-content:space-between;align-items:center;gap:15px;margin-bottom:16px}.section-title>span{font-size:11px;color:var(--muted)}aside{min-width:0}.runs{max-height:480px;overflow:auto}.run-button{display:block;width:100%;text-align:left;border-left:2px solid var(--line);margin-bottom:7px;padding:13px 12px}.run-button.selected{border-color:var(--accent);background:#35d2d00b}.run-button strong{display:block;font-size:12px;font-weight:400}.run-button small{display:block;font-size:10px;margin-top:4px}.run-button .run-status{float:right;font-size:9px}.run-panel{border:1px solid var(--line);padding:25px;background:var(--panel);min-width:0}.run-heading{display:flex;justify-content:space-between;gap:16px;align-items:center;margin-bottom:10px}.badge{padding:4px 9px;border:1px solid var(--line);font-size:10px;color:var(--accent)}#run-meta{font-size:11px;margin-bottom:25px}#run-error,#error{color:var(--red);border:1px solid #ff8c8755;background:#ff8c8709;padding:14px;white-space:pre-wrap;overflow-wrap:anywhere}#error{margin-bottom:20px}.phases{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px}.phase{padding:12px;border:1px solid var(--line);color:var(--muted);min-height:69px;font-size:10px}.phase strong{display:block;font-size:11px;font-weight:400;margin-bottom:5px}.phase.active{border-color:var(--accent);color:var(--accent);background:#35d2d00a}.phase.succeeded{color:var(--ink);border-left:2px solid var(--accent)}.phase.failed{color:var(--red);border-color:#ff8c8755}.phase small{font-size:9px}details{margin-top:20px;font-size:11px}summary{cursor:pointer;color:var(--muted)}.sources div{font-size:10px;overflow-wrap:anywhere;margin:6px 0}.sources code{color:var(--accent)}.action{padding:12px 0;border-bottom:1px solid var(--line)}.action pre{font:inherit;white-space:pre-wrap;overflow-wrap:anywhere;color:var(--muted)}.action a{cursor:pointer}.logs-panel{margin:35px 0 45px}.log-layout{display:grid;grid-template-columns:275px minmax(0,1fr);gap:24px}.log-sidebar label{display:block;color:var(--muted);font-size:10px;margin-bottom:7px}input[type=search]{width:100%;font:inherit;font-size:11px;background:var(--panel);border:1px solid var(--line);padding:10px;color:var(--ink)}#log-files{max-height:570px;overflow:auto;margin-top:12px}.log-file{width:100%;display:block;text-align:left;margin-bottom:5px;padding:10px;overflow-wrap:anywhere;font-size:10px}.log-file.selected{border-color:var(--accent);color:var(--accent)}.log-file small{display:block;font-size:9px;margin-top:4px}.terminal{border:1px solid #31505c;background:#070d10;min-width:0;box-shadow:5px 5px 0 #0d161c}.terminal-bar{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:13px 16px;border-bottom:1px solid var(--line);font-size:10px;overflow-wrap:anywhere}.terminal-bar a{white-space:nowrap}.log-controls{display:flex;align-items:center;gap:7px;flex-wrap:wrap;padding:10px 12px;border-bottom:1px solid var(--line)}.log-controls button{padding:5px 8px;font-size:10px}.log-controls label{font-size:10px;display:flex;align-items:center;gap:4px}input[type=checkbox]{accent-color:var(--accent)}#log-range{font-size:9px;color:var(--muted);margin-left:auto}.search-label{display:flex;align-items:center;gap:10px;padding:9px 13px;color:var(--muted);font-size:9px}.search-label input{max-width:280px;padding:5px}#log-content{font:11px/1.65 "SFMono-Regular",Consolas,monospace;margin:0;padding:18px;overflow:auto;height:510px;white-space:pre;tab-size:4;color:#c8dce4}mark{background:#e7c277;color:#080e12}footer{border-top:1px solid var(--line);padding-block:22px;display:flex;justify-content:space-between;font-size:9px;color:var(--muted);gap:20px}[hidden]{display:none!important}@media(max-width:1050px){header,main,footer{padding-inline:24px}.phases{grid-template-columns:repeat(2,minmax(0,1fr))}.workspace,.log-layout{grid-template-columns:220px minmax(0,1fr)}.toolbar{align-items:flex-start;flex-direction:column}}@media(max-width:700px){header,main,footer{padding-inline:16px}.private span{display:none}.brand{font-size:18px}.heading{display:block;padding:28px 0}.connection{text-align:left;margin-top:18px}.overview{grid-template-columns:1fr}.overview article+article{border-left:0;border-top:1px solid var(--line)}.overview article{padding:16px}.workspace,.log-layout{grid-template-columns:1fr}.runs{max-height:180px}.run-panel{padding:16px}#log-files{max-height:180px}.search-label{flex-wrap:wrap}.run-heading{align-items:flex-start;flex-direction:column}footer{flex-direction:column}#log-content{height:430px}} +/* Archipelago build control room — Material You (Material 3) */ +:root{ + color-scheme:light dark; + /* shape */ + --md-shape-xs:4px; --md-shape-sm:8px; --md-shape-md:12px; --md-shape-lg:16px; + --md-shape-xl:28px; --md-shape-full:999px; + /* motion */ + --md-motion:200ms cubic-bezier(.2,0,0,1); + /* light scheme (seed: archipelago teal) */ + --md-primary:#00696B; + --md-on-primary:#FFFFFF; + --md-primary-container:#9CF1F2; + --md-on-primary-container:#002020; + --md-secondary:#4A6364; + --md-on-secondary:#FFFFFF; + --md-secondary-container:#CCE8E8; + --md-on-secondary-container:#051F20; + --md-tertiary:#4B607C; + --md-surface:#F5FAFA; + --md-surface-dim:#D5DBDB; + --md-surface-bright:#F5FAFA; + --md-surface-container-lowest:#FFFFFF; + --md-surface-container-low:#EFF5F4; + --md-surface-container:#E9EFEE; + --md-surface-container-high:#E4E9E9; + --md-surface-container-highest:#DEE4E3; + --md-on-surface:#171D1D; + --md-on-surface-variant:#3F4949; + --md-outline:#6F7979; + --md-outline-variant:#BEC8C8; + --md-error:#BA1A1A; + --md-on-error:#FFFFFF; + --md-error-container:#FFDAD6; + --md-on-error-container:#410002; + --md-inverse-surface:#2B3131; + --md-inverse-on-surface:#ECF2F1; + --md-scrim:rgba(0,0,0,.32); + --md-shadow:0 1px 2px rgba(0,0,0,.10),0 1px 3px 1px rgba(0,0,0,.06); + --md-shadow-2:0 2px 6px rgba(0,0,0,.12),0 1px 2px rgba(0,0,0,.08); + /* type */ + --md-font:"Roboto",system-ui,-apple-system,"Segoe UI","Noto Sans",Arial,sans-serif; + --md-mono:ui-monospace,"SF Mono",Consolas,"Liberation Mono",monospace; +} +@media (prefers-color-scheme:dark){ + :root{ + --md-primary:#80D5D6; + --md-on-primary:#003738; + --md-primary-container:#004F51; + --md-on-primary-container:#9CF1F2; + --md-secondary:#B0CCCD; + --md-on-secondary:#1B3536; + --md-secondary-container:#324B4C; + --md-on-secondary-container:#CCE8E8; + --md-tertiary:#B3C8E8; + --md-surface:#0E1414; + --md-surface-dim:#0E1414; + --md-surface-bright:#343A3A; + --md-surface-container-lowest:#090F0F; + --md-surface-container-low:#171D1D; + --md-surface-container:#1B2121; + --md-surface-container-high:#252B2B; + --md-surface-container-highest:#303636; + --md-on-surface:#DDE4E3; + --md-on-surface-variant:#BEC8C8; + --md-outline:#889392; + --md-outline-variant:#3F4949; + --md-error:#FFB4AB; + --md-on-error:#690005; + --md-error-container:#93000A; + --md-on-error-container:#FFDAD6; + --md-inverse-surface:#DDE4E3; + --md-inverse-on-surface:#2B3131; + --md-scrim:rgba(0,0,0,.6); + --md-shadow:0 1px 2px rgba(0,0,0,.5),0 1px 3px 1px rgba(0,0,0,.35); + --md-shadow-2:0 2px 8px rgba(0,0,0,.55),0 1px 2px rgba(0,0,0,.4); + } +} +*{box-sizing:border-box} +html,body{margin:0;padding:0} +body{ + background:var(--md-surface); + color:var(--md-on-surface); + font-family:var(--md-font); + font-size:14px;line-height:1.5; + -webkit-font-smoothing:antialiased; +} +a{color:var(--md-primary);text-decoration:none} +a:hover{text-decoration:underline} +h1,h2,h3,p{margin:0} +h1{font-size:32px;line-height:40px;font-weight:400;letter-spacing:0} +h2{font-size:22px;line-height:28px;font-weight:400} +h3{font-size:16px;line-height:24px;font-weight:500} +small,.muted{color:var(--md-on-surface-variant)} +.eyebrow{font-size:11px;line-height:16px;letter-spacing:.5px;text-transform:uppercase;color:var(--md-primary);font-weight:500} + +/* top app bar */ +header{ + position:sticky;top:0;z-index:20; + display:flex;align-items:center;justify-content:space-between;gap:16px; + height:64px;padding-inline:24px; + background:var(--md-surface-container); + border-bottom:1px solid var(--md-outline-variant); +} +.brand{display:flex;align-items:center;gap:12px;color:var(--md-on-surface);font-size:20px;font-weight:500;letter-spacing:.15px} +.brand img{border-radius:var(--md-shape-sm)} +.brand span{color:var(--md-primary)} +.private{ + display:inline-flex;align-items:center;gap:8px; + padding:6px 12px;border-radius:var(--md-shape-full); + background:var(--md-secondary-container);color:var(--md-on-secondary-container); + font-size:11px;letter-spacing:.5px;text-transform:uppercase;font-weight:500; +} +.private span{color:var(--md-on-secondary-container);opacity:.7} + +main{max-width:1440px;margin:0 auto;padding:24px 24px 48px} + +/* hero */ +.heading{display:flex;justify-content:space-between;align-items:flex-end;gap:24px;padding:16px 0 24px} +.heading h1{margin:8px 0 8px} +.heading h1 span{color:var(--md-primary)} +.connection{display:flex;flex-direction:column;align-items:flex-end;gap:4px;font-size:12px;color:var(--md-on-surface-variant);white-space:nowrap} +.connection i{display:inline-block;width:8px;height:8px;border-radius:50%;background:var(--md-outline);margin-right:8px;vertical-align:middle} +.connection i.online{background:var(--md-primary);box-shadow:0 0 0 4px var(--md-primary-container)} + +/* cards */ +.overview{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px} +.overview article{ + background:var(--md-surface-container-low); + border-radius:var(--md-shape-lg); + padding:20px 20px 18px; + box-shadow:var(--md-shadow); +} +.overview strong{display:block;font-size:20px;line-height:28px;font-weight:500;margin:10px 0 4px} +.overview small{display:block;font-size:12px;overflow-wrap:anywhere} + +/* buttons */ +.toolbar{display:flex;justify-content:space-between;align-items:center;gap:16px;padding:20px 0} +.controls{display:flex;gap:8px;flex-wrap:wrap;align-items:center} +button{ + font:inherit;font-size:14px;font-weight:500;letter-spacing:.1px; + height:40px;padding:0 24px;border:0;border-radius:var(--md-shape-full); + background:var(--md-surface-container-high);color:var(--md-on-surface); + cursor:pointer;transition:background var(--md-motion),box-shadow var(--md-motion),opacity var(--md-motion); + display:inline-flex;align-items:center;justify-content:center;gap:8px; +} +button:hover{box-shadow:var(--md-shadow)} +button:active{transform:translateY(1px)} +button:disabled{opacity:.38;cursor:default;box-shadow:none} +button:focus-visible,a:focus-visible,input:focus-visible,summary:focus-visible,pre:focus-visible{outline:3px solid var(--md-primary);outline-offset:2px} +.primary{background:var(--md-primary);color:var(--md-on-primary)} +.primary:hover{box-shadow:var(--md-shadow-2)} +.danger{background:var(--md-error-container);color:var(--md-on-error-container)} +.tonal{background:var(--md-secondary-container);color:var(--md-on-secondary-container)} +#action-result{font-size:12px;color:var(--md-on-surface-variant)} + +/* workspace */ +.workspace{display:grid;grid-template-columns:300px minmax(0,1fr);gap:16px;align-items:start} +aside{min-width:0} +.section-title{display:flex;justify-content:space-between;align-items:center;gap:12px;margin:0 0 12px} +.section-title>span,.section-title>small{font-size:12px;color:var(--md-on-surface-variant)} +.runs{display:flex;flex-direction:column;gap:6px;max-height:520px;overflow:auto;padding-right:4px} +.run-button{ + width:100%;height:auto;padding:12px 14px;display:block;text-align:left; + background:transparent;border-radius:var(--md-shape-md);color:var(--md-on-surface); +} +.run-button:hover{background:var(--md-surface-container-high)} +.run-button.selected{background:var(--md-secondary-container);color:var(--md-on-secondary-container)} +.run-button strong{display:block;font-size:13px;font-weight:500} +.run-button small{display:block;font-size:11px;margin-top:2px;opacity:.75} + +/* run panel */ +.run-panel{ + background:var(--md-surface-container-low); + border-radius:var(--md-shape-xl); + padding:24px;min-width:0;box-shadow:var(--md-shadow); +} +.run-heading{display:flex;justify-content:space-between;align-items:center;gap:16px;margin-bottom:6px} +#run-meta{font-size:12px;margin:4px 0 20px;color:var(--md-on-surface-variant)} +.badge{ + display:inline-flex;align-items:center;height:26px;padding:0 12px; + border-radius:var(--md-shape-full);background:var(--md-secondary-container); + color:var(--md-on-secondary-container);font-size:12px;font-weight:500;white-space:nowrap; +} +#run-error,#error{ + color:var(--md-on-error-container);background:var(--md-error-container); + border-radius:var(--md-shape-md);padding:14px 16px;margin-bottom:16px; + white-space:pre-wrap;overflow-wrap:anywhere;font-size:13px; +} + +/* run progress */ +.progress{display:grid;gap:8px;margin:0 0 22px} +.progress-track{ + height:6px;border-radius:var(--md-shape-full);overflow:hidden; + background:var(--md-secondary-container); +} +.progress-track>div{ + height:100%;width:0;border-radius:inherit;background:var(--md-primary); + transition:width var(--md-motion); +} +.progress-track.failed{background:var(--md-error-container)} +.progress-track.failed>div{background:var(--md-error)} +#run-progress-text{font-size:12px;margin:0;color:var(--md-on-surface-variant)} + +/* phases */ +.phases{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:8px} +.phase{ + display:flex;flex-direction:column;gap:2px; + padding:12px 14px;border-radius:var(--md-shape-md); + background:var(--md-surface-container); + color:var(--md-on-surface-variant);font-size:12px;min-height:64px; + transition:background var(--md-motion),color var(--md-motion); +} +.phase strong{font-size:13px;font-weight:500;color:var(--md-on-surface-variant)} +.phase small{font-size:11px;opacity:.8} +.phase.active{background:var(--md-primary-container);color:var(--md-on-primary-container)} +.phase.active strong{color:var(--md-on-primary-container)} +.phase.succeeded{background:var(--md-surface-container-high)} +.phase.succeeded strong{color:var(--md-on-surface)} +.phase.failed{background:var(--md-error-container);color:var(--md-on-error-container)} +.phase.failed strong{color:var(--md-on-error-container)} + +/* details */ +details{margin-top:16px} +summary{ + cursor:pointer;list-style:none;font-size:13px;font-weight:500;color:var(--md-on-surface-variant); + padding:10px 14px;border-radius:var(--md-shape-md);background:var(--md-surface-container); +} +summary::-webkit-details-marker{display:none} +summary:hover{background:var(--md-surface-container-high)} +.action{padding:12px 0;border-bottom:1px solid var(--md-outline-variant)} +.action:last-child{border-bottom:0} +.action summary{background:transparent;padding:0;font-weight:400} +.action pre{font-family:var(--md-mono);font-size:12px;white-space:pre-wrap;overflow-wrap:anywhere;color:var(--md-on-surface-variant);margin:6px 0 0} +.sources div{font-size:11px;overflow-wrap:anywhere;margin:4px 0;color:var(--md-on-surface-variant)} +.sources code{font-family:var(--md-mono);color:var(--md-primary)} + +/* logs */ +.logs-panel{margin-top:24px} +.log-layout{display:grid;grid-template-columns:300px minmax(0,1fr);gap:16px;align-items:start} +.log-sidebar label{display:block;font-size:12px;color:var(--md-on-surface-variant);margin:0 0 8px} +.log-controls label{font-size:12px;color:var(--md-on-surface-variant);display:flex;align-items:center;gap:6px} +input[type=search]{ + width:100%;font:inherit;font-size:13px;height:44px;padding:0 14px; + background:var(--md-surface-container-lowest);color:var(--md-on-surface); + border:1px solid var(--md-outline);border-radius:var(--md-shape-md); +} +input[type=search]::placeholder{color:var(--md-on-surface-variant);opacity:.7} +#log-files{max-height:560px;overflow:auto;margin-top:10px;display:flex;flex-direction:column;gap:4px} +.log-file{ + width:100%;height:auto;display:block;text-align:left;padding:10px 12px; + border-radius:var(--md-shape-sm);background:transparent;font-size:12px; + overflow-wrap:anywhere;color:var(--md-on-surface); +} +.log-file:hover{background:var(--md-surface-container-high)} +.log-file.selected{background:var(--md-secondary-container);color:var(--md-on-secondary-container)} +.log-file small{display:block;font-size:11px;opacity:.75;margin-top:2px} +.terminal{ + background:var(--md-surface-container-lowest); + border-radius:var(--md-shape-lg);overflow:hidden;min-width:0; + box-shadow:var(--md-shadow); +} +.terminal-bar{ + display:flex;align-items:center;justify-content:space-between;gap:12px; + padding:12px 16px;background:var(--md-surface-container); + font-size:12px;font-weight:500;overflow-wrap:anywhere; +} +.log-controls{display:flex;align-items:center;gap:6px;flex-wrap:wrap;padding:10px 12px;border-bottom:1px solid var(--md-outline-variant)} +.log-controls button{height:32px;padding:0 14px;font-size:12px;background:var(--md-surface-container-high)} +#log-range{font-size:11px;color:var(--md-on-surface-variant);margin-left:auto} +.search-label{display:flex;align-items:center;gap:10px;padding:10px 14px;font-size:11px;color:var(--md-on-surface-variant)} +.search-label input{height:36px;max-width:320px} +#log-content{ + font-family:var(--md-mono);font-size:12px;line-height:1.6; + margin:0;padding:16px;height:480px;overflow:auto;white-space:pre; + tab-size:4;color:var(--md-on-surface); +} +mark{background:var(--md-primary-container);color:var(--md-on-primary-container);border-radius:3px} + +footer{ + max-width:1440px;margin:0 auto;padding:16px 24px 32px; + display:flex;justify-content:space-between;gap:16px; + font-size:11px;color:var(--md-on-surface-variant); + border-top:1px solid var(--md-outline-variant); +} +[hidden]{display:none!important} + +@media(max-width:1100px){ + .workspace,.log-layout{grid-template-columns:240px minmax(0,1fr)} + .overview{grid-template-columns:1fr 1fr} +} +@media(max-width:760px){ + header{padding-inline:16px} + main,footer{padding-inline:16px} + .private span{display:none} + .heading{flex-direction:column;align-items:flex-start} + .connection{align-items:flex-start} + .overview{grid-template-columns:1fr} + .workspace,.log-layout{grid-template-columns:1fr} + .runs{max-height:220px} + #log-files{max-height:200px} + .toolbar{flex-direction:column;align-items:flex-start} + footer{flex-direction:column} +} + +/* state badges */ +.badge.error{background:var(--md-error-container);color:var(--md-on-error-container)} diff --git a/tests/control_portal.py b/tests/control_portal.py index 8f0e0f2..ecef3c7 100644 --- a/tests/control_portal.py +++ b/tests/control_portal.py @@ -69,6 +69,16 @@ class Portal(unittest.TestCase): server.shutdown() server.server_close() + def test_progress_markup_and_percentage_rules(self): + root = Path(__file__).parents[1] / 'control' + html = (root / 'index.html').read_text() + script = (root / 'app.js').read_text() + self.assertIn('id="run-progress-track"', html) + self.assertIn('role="progressbar"', html) + self.assertIn('aria-valuenow', html) + self.assertIn('function progressOf(', script) + self.assertIn("track.setAttribute('aria-valuenow'", script) + def test_failed_action_is_durable(self): with tempfile.TemporaryDirectory() as directory: observer = control.monitor.Monitor(Path(directory), '20261109T000000Z')