fix: emit relative container link URLs from harness, update dashboard join
Container link URLs (/screen.html, /stats.html) were root-relative, which works when the agent is accessed directly at :port/ but resolves to the gateway root when accessed via /agent/<name>/. Fix at the source: harness emits relative URLs (screen.html, stats.html) and the dashboard joins containerBase + '/' + url. The agent page uses the URL directly and relative resolution is now correct in both paths.
This commit is contained in:
parent
7a8b8fe266
commit
c353dc1893
2 changed files with 4 additions and 11 deletions
|
|
@ -585,10 +585,7 @@ window.marked = marked;
|
|||
// "https://forge.pr1ma.darkest.space"), fall back to
|
||||
// "<hostname>:3000" for gateway-off / local-dev deploys.
|
||||
const forgeBase = (s && s.forge_public_url) || `http://${hostname}:3000`;
|
||||
// Container nav-strip links resolve against the same base as the
|
||||
// primary `name` link — gateway-prefixed when the gateway is in
|
||||
// front, direct TCP otherwise. Strips the trailing slash so
|
||||
// `lnk.url` starting with `/` concatenates cleanly.
|
||||
// Container nav-strip base: gateway prefix or direct TCP.
|
||||
const containerBase = gatewayLinks
|
||||
? `/agent/${encodeURIComponent(c.name)}`
|
||||
: `http://${hostname}:${c.port}`;
|
||||
|
|
@ -600,7 +597,7 @@ window.marked = marked;
|
|||
for (const lnk of links) {
|
||||
const href = lnk.kind === 'forge' ? forgeBase + (lnk.url || '')
|
||||
: lnk.kind === 'external' ? (lnk.url || '')
|
||||
: /* container */ containerBase + (lnk.url || '');
|
||||
: /* container */ containerBase + '/' + (lnk.url || '');
|
||||
const a = el('a', {
|
||||
class: 'nav-link',
|
||||
href,
|
||||
|
|
|
|||
Loading…
Reference in a new issue