Страница отчётов reports и встраивание визуализатора под /viz/ за входом Keycloak
Новый package reports: статический список ссылок (khbuild_process - Гант и ARIS), порт 8087, добавлен в deploy.sh. Визуализатор открывается под префиксом /viz/ (относительные адреса, ?view=gantt|aris, возврат к списку). Для хоста reports.khbuild.freeddns.org: nginx, oauth2-proxy и клиент Keycloak reports-proxy настроены под root, справочные копии - deploy/infra/. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -18,6 +18,7 @@ export function renderPage(opts: { set: string; stages: string[]; warnings: Arra
|
||||
body{margin:0;background:var(--bg);color:var(--fg);font:14px/1.4 "Segoe UI",Arial,sans-serif;display:flex;flex-direction:column;height:100vh}
|
||||
header{padding:10px 16px;border-bottom:1px solid var(--line);display:flex;flex-wrap:wrap;gap:10px 18px;align-items:center;background:var(--panel)}
|
||||
h1{font-size:16px;margin:0 8px 0 0}
|
||||
a.back{color:var(--acc);text-decoration:none;margin-right:4px}
|
||||
.tabs button{border:1px solid var(--line);background:var(--bg);color:var(--fg);padding:6px 14px;cursor:pointer}
|
||||
.tabs button:first-child{border-radius:6px 0 0 6px}
|
||||
.tabs button:last-child{border-radius:0 6px 6px 0;border-left:0}
|
||||
@@ -36,7 +37,7 @@ a.btn{color:var(--acc);text-decoration:none;border:1px solid var(--line);border-
|
||||
.stagebox{position:absolute;z-index:5;background:var(--bg);border:1px solid var(--line);padding:8px;display:flex;flex-direction:column}
|
||||
</style></head><body>
|
||||
<header>
|
||||
<h1>Процесс khbuild</h1>
|
||||
<h1><a class="back" href="../" title="К списку отчётов">←</a> Процесс khbuild</h1>
|
||||
<div class="tabs"><button id="tG" class="on">Гант</button><button id="tA">ARIS</button></div>
|
||||
<div class="opts">
|
||||
<label>Данные <select id="set">${sets}</select></label>
|
||||
@@ -71,20 +72,22 @@ a.btn{color:var(--acc);text-decoration:none;border:1px solid var(--line);border-
|
||||
}
|
||||
function place() { stage.style.transform = 'translate(' + tx + 'px,' + ty + 'px) scale(' + k + ')'; }
|
||||
function load() {
|
||||
var u = '/' + tab + '.svg?' + qs();
|
||||
var u = tab + '.svg?' + qs(); // относительный адрес: страница работает и на корне, и под префиксом /viz/
|
||||
$('dl').href = u + '&download=1';
|
||||
$('msg').textContent = 'Загрузка…';
|
||||
$('msg').style.display = '';
|
||||
fetch(u, { credentials: 'same-origin' })
|
||||
.then(function (r) { if (!r.ok) throw new Error(r.status); return r.text(); })
|
||||
.then(function (t) { stage.innerHTML = t; $('msg').style.display = 'none'; place(); })
|
||||
.catch(function (e) { $('msg').textContent = 'Ошибка: ' + e.message; });
|
||||
.catch(function (e) { $('msg').textContent = 'Ошибка загрузки (' + e.message + '). Если истёк вход - обновите страницу.'; });
|
||||
}
|
||||
function setTab(t) {
|
||||
tab = t;
|
||||
$('tG').className = t === 'gantt' ? 'on' : '';
|
||||
$('tA').className = t === 'aris' ? 'on' : '';
|
||||
$('lEv').style.display = $('lData').style.display = t === 'aris' ? '' : 'none';
|
||||
document.title = 'khbuild_process — ' + (t === 'aris' ? 'ARIS' : 'Gantt');
|
||||
try { history.replaceState(null, '', '?view=' + t); } catch (e) {}
|
||||
k = 1; tx = 8; ty = 8;
|
||||
load();
|
||||
}
|
||||
@@ -102,7 +105,7 @@ a.btn{color:var(--acc);text-decoration:none;border:1px solid var(--line);border-
|
||||
view.addEventListener('pointerdown', function (e) { drag = { x: e.clientX - tx, y: e.clientY - ty }; view.classList.add('drag'); view.setPointerCapture(e.pointerId); });
|
||||
view.addEventListener('pointermove', function (e) { if (!drag) return; tx = e.clientX - drag.x; ty = e.clientY - drag.y; place(); });
|
||||
view.addEventListener('pointerup', function () { drag = null; view.classList.remove('drag'); });
|
||||
setTab('gantt');
|
||||
setTab(new URLSearchParams(location.search).get('view') === 'aris' ? 'aris' : 'gantt');
|
||||
})();
|
||||
</script></body></html>`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user