From b5503cde2c5e30771535e08604cbcad5c4dde75c Mon Sep 17 00:00:00 2001 From: damocles Date: Thu, 4 Jun 2026 17:37:48 +0200 Subject: [PATCH] fix(logs): add ?id= deep-link to logs viewer, fix queue entry link target --- frontend/packages/dashboard/src/logs.js | 16 +++++++++++++++- frontend/packages/dashboard/src/tabs.js | 2 +- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/frontend/packages/dashboard/src/logs.js b/frontend/packages/dashboard/src/logs.js index ab27fec9..4e9b4b4a 100644 --- a/frontend/packages/dashboard/src/logs.js +++ b/frontend/packages/dashboard/src/logs.js @@ -73,7 +73,7 @@ import { } const ul = el('ul', { class: 'build-logs-list' }); for (const h of rows) { - const li = el('li', { class: 'build-logs-item' }); + const li = el('li', { class: 'build-logs-item', 'data-log-id': String(h.id) }); // status is null while running, 'ok'/'fail' when finished. const live = !h.status; const ok = h.status === 'ok'; @@ -175,6 +175,20 @@ import { ul.append(li); } buildList.append(ul); + // Deep-link: if the URL contains ?id=N, auto-expand that log entry + // so a `logs →` link from the rebuild-queue panel drops the operator + // straight into the live output without extra clicks. + const deepId = new URLSearchParams(location.search).get('id'); + if (deepId) { + const target = ul.querySelector('[data-log-id="' + deepId + '"]'); + if (target) { + const btn = target.querySelector('.build-logs-row-btn'); + if (btn) { + btn.click(); + target.scrollIntoView({ behavior: 'smooth', block: 'start' }); + } + } + } } catch (err) { buildList.replaceChildren(); buildList.append(el('p', { class: 'meta' }, 'fetch failed: ' + err)); diff --git a/frontend/packages/dashboard/src/tabs.js b/frontend/packages/dashboard/src/tabs.js index c17feb12..9895687a 100644 --- a/frontend/packages/dashboard/src/tabs.js +++ b/frontend/packages/dashboard/src/tabs.js @@ -2274,7 +2274,7 @@ window.marked = marked; ' ', el('a', { class: 'rqe-log-link', - href: '/api/build-logs/id/' + entry.build_log_id, + href: '/logs.html?id=' + entry.build_log_id + '#build', target: '_blank', title: 'view build log #' + entry.build_log_id, }, 'logs →'),