feat(dashboard): add 'journal logs →' link to agent overflow menu
Adds a navigation entry in the per-agent ⋮ overflow menu that opens the AGENT log tab pre-filtered to that container. The link uses the ?agent= URL param introduced by the accompanying logs.js change — the operator lands directly in the journal viewer without having to pick an agent from the dropdown. Placed between the rebuild action and the destructive destroy/purge block so it's reachable but clearly separated from dangerous actions.
This commit is contained in:
parent
b6b93f9fff
commit
2d769dda57
1 changed files with 22 additions and 0 deletions
|
|
@ -426,6 +426,20 @@ window.marked = marked;
|
||||||
return el('li', { class: 'agent-menu-sep', role: 'separator' });
|
return el('li', { class: 'agent-menu-sep', role: 'separator' });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Navigation link item (opens in same tab by default).
|
||||||
|
function menuLink(label, href, title) {
|
||||||
|
const li = el('li', { role: 'presentation' });
|
||||||
|
const a = el('a', {
|
||||||
|
class: 'agent-menu-item',
|
||||||
|
href,
|
||||||
|
role: 'menuitem',
|
||||||
|
title: title || '',
|
||||||
|
}, label);
|
||||||
|
a.addEventListener('click', () => closeAllAgentMenus());
|
||||||
|
li.append(a);
|
||||||
|
return li;
|
||||||
|
}
|
||||||
|
|
||||||
// Show only actions that are applicable in the current state.
|
// Show only actions that are applicable in the current state.
|
||||||
if (c.running) {
|
if (c.running) {
|
||||||
dropdown.append(
|
dropdown.append(
|
||||||
|
|
@ -439,6 +453,14 @@ window.marked = marked;
|
||||||
}
|
}
|
||||||
dropdown.append(
|
dropdown.append(
|
||||||
menuItem('↻ R3BU1LD', { action: '/rebuild/', confirm: `rebuild ${c.name}? hot-reloads the container.` }),
|
menuItem('↻ R3BU1LD', { action: '/rebuild/', confirm: `rebuild ${c.name}? hot-reloads the container.` }),
|
||||||
|
menuSep(),
|
||||||
|
// Deep-link to the AGENT log tab pre-filtered to this container.
|
||||||
|
// The ?agent= param is read by logs.js on load; the stored localStorage
|
||||||
|
// selection is overridden so the operator lands directly in this
|
||||||
|
// agent's journal without extra clicks.
|
||||||
|
menuLink('journal logs →',
|
||||||
|
`/logs.html?agent=${encodeURIComponent(c.name)}#agent`,
|
||||||
|
`view ${c.name} journal logs`),
|
||||||
);
|
);
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue