fix(#888): use gateway forge URL in dashboard links
Dashboard links to the forge were hardcoded as http://<hostname>:3000, which breaks when the operator accesses the dashboard through hive-gateway (forge is served at forge.<domain> with no port). - nix/modules/hive-c0re.nix: inject HIVE_FORGE_PUBLIC_URL when forge.behindGateway = true (e.g. http://forge.pr1ma.darkest.space) - hive-c0re/src/dashboard.rs: expose forge_url: Option<String> in StateSnapshot, reading from HIVE_FORGE_PUBLIC_URL - frontend/packages/dashboard/src/tabs.js: use state.forge_url when present; fall back to http://<hostname>:3000 for gateway-off / local-dev deploys
This commit is contained in:
parent
61b9c23613
commit
d3ca857659
5 changed files with 37 additions and 3 deletions
|
|
@ -580,7 +580,11 @@ window.marked = marked;
|
|||
// and must never reach the HTML parser.
|
||||
const navStrip = el('span', { class: 'nav-strip' });
|
||||
head.append(navStrip);
|
||||
const forgeBase = `http://${hostname}:3000`;
|
||||
// Forge public URL: prefer state.forge_public_url (set by the NixOS
|
||||
// module when forge.behindGateway=true, e.g.
|
||||
// "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
|
||||
|
|
@ -1786,7 +1790,11 @@ window.marked = marked;
|
|||
// forge link base — only when the hive-forge container is up.
|
||||
const fs = window.__hyperhive_state;
|
||||
const hostname = (fs && fs.hostname) || window.location.hostname;
|
||||
const forgeBase = (fs && fs.forge_present) ? `http://${hostname}:3000` : null;
|
||||
// Prefer state.forge_public_url (set when forge.behindGateway=true,
|
||||
// e.g. "https://forge.pr1ma.darkest.space") over the direct :3000 port.
|
||||
const forgeBase = (fs && fs.forge_present)
|
||||
? (fs.forge_public_url || `http://${hostname}:3000`)
|
||||
: null;
|
||||
|
||||
const ul = el('ul', { class: 'approvals' });
|
||||
for (const a of pending) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue