remove the forge links from the hive dashboard and the agent page
Each agent row on the hive dashboard, and the agent page's link menu, linked to the agent's forge profile and its config repo. Both are gone, with what only they used: - hive-agent no longer builds the two links, the `Forge` link kind, or the `forge_public_url` field of its state, and no longer reads `HIVE_FORGE_PUBLIC_URL`. The agent page's link menu and the dashboard row's icon strip (which skips a forge link an agent not yet rebuilt still sends) drop their forge handling. - hive-c0re's dashboard state no longer carries `forge_public_url`. - `HIVE_FORGE_PUBLIC_URL` is no longer forwarded to agents through the meta flake (the forwarded-variable list, its test fixture, the controller's settings and the VM test), so the next meta flake render differs by that one line. hive-c0re still reads it for the forge URL a hive publishes, so `swarm.forge.publicUrl` stays, with its description corrected. - The docs stop describing the links.
This commit is contained in:
parent
1b6d7f3c99
commit
d516bb890c
5 changed files with 49 additions and 148 deletions
|
|
@ -141,7 +141,7 @@ export function Root() {
|
|||
count={todos.length}
|
||||
onClick={() => setOpenPanel("todos")}
|
||||
/>
|
||||
{/* Needs a loaded snapshot for its data (links/forge_public_url,
|
||||
{/* Needs a loaded snapshot for its data (links,
|
||||
* dashboard_port) — omitted until the first /api/state resolves,
|
||||
* same as the old page's populateOverflowMenu (now deleted —
|
||||
* dashboard-link moved here, rebuild removed outright, see
|
||||
|
|
@ -149,7 +149,6 @@ export function Root() {
|
|||
{state ? (
|
||||
<MetaNav
|
||||
links={state.links}
|
||||
forgePublicUrl={state.forge_public_url}
|
||||
dashboardBase={resolveDashboardBase(state.dashboard_port)}
|
||||
/>
|
||||
) : null}
|
||||
|
|
|
|||
|
|
@ -196,7 +196,7 @@ h3 {
|
|||
object-fit: cover;
|
||||
}
|
||||
|
||||
/* Meta-nav links (stats / screen / forge / dashboard / extras) —
|
||||
/* Meta-nav links (stats / screen / dashboard / extras) —
|
||||
no underline; hover lights with cyan glow + subtle background
|
||||
tint. Reads as a row of soft tabs rather than default-styled
|
||||
inline anchors. */
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
// (`@hive/shared/icons.js`'s `LinkIcon` — an emoji glyph can't match a
|
||||
// neighbouring icon's size/weight on any platform, see that file's
|
||||
// comment) in the pills cluster that opens a popover listing
|
||||
// stats/screen/forge/config + any `services.hyperhive.agent.dashboardLinks` extras,
|
||||
// stats/screen + any `services.hyperhive.agent.dashboardLinks` extras,
|
||||
// sourced from the backend's `agent_links()` (the single source of
|
||||
// truth — same list also feeds the dashboard card's icon strip) — plus
|
||||
// a `🧭 dashboard` back-link.
|
||||
|
|
@ -28,17 +28,12 @@ import "./MetaNav.css";
|
|||
|
||||
export interface MetaNavProps {
|
||||
links: AgentLink[];
|
||||
forgePublicUrl: string | null;
|
||||
/** Absolute base URL of the host dashboard (`resolveDashboardBase`)
|
||||
* — the `🧭 dashboard` item links to `${dashboardBase}`. */
|
||||
dashboardBase: string;
|
||||
}
|
||||
|
||||
export function MetaNav({
|
||||
links,
|
||||
forgePublicUrl,
|
||||
dashboardBase,
|
||||
}: MetaNavProps) {
|
||||
export function MetaNav({ links, dashboardBase }: MetaNavProps) {
|
||||
const [open, setOpen] = useState(false);
|
||||
const rootRef = useRef<HTMLDivElement>(null);
|
||||
|
||||
|
|
@ -64,11 +59,7 @@ export function MetaNav({
|
|||
};
|
||||
}, [open]);
|
||||
|
||||
// Same kind -> URL resolution as app.js's old refreshState meta-links
|
||||
// loop: `forge` needs `forgePublicUrl` set or the link is dropped
|
||||
// entirely (never guessed from `<host>:3000`); `external` is already
|
||||
// absolute; `container` is a same-origin path.
|
||||
const visible = links.filter((lnk) => lnk.kind !== "forge" || forgePublicUrl);
|
||||
// `external` is already absolute; `container` is a same-origin path.
|
||||
// No early-return-on-empty: the dashboard link below is always
|
||||
// present, so the trigger always has at least one item.
|
||||
|
||||
|
|
@ -93,24 +84,20 @@ export function MetaNav({
|
|||
>
|
||||
🧭 dashboard
|
||||
</a>
|
||||
{visible.map((lnk) => {
|
||||
const href =
|
||||
lnk.kind === "forge" ? `${forgePublicUrl}${lnk.url}` : lnk.url;
|
||||
return (
|
||||
<a
|
||||
key={lnk.url}
|
||||
class="meta-nav-item"
|
||||
href={href}
|
||||
target="_blank"
|
||||
rel="noopener"
|
||||
role="menuitem"
|
||||
onClick={() => setOpen(false)}
|
||||
>
|
||||
{lnk.icon ? <span aria-hidden="true">{lnk.icon}</span> : null}
|
||||
{lnk.label}
|
||||
</a>
|
||||
);
|
||||
})}
|
||||
{links.map((lnk) => (
|
||||
<a
|
||||
key={lnk.url}
|
||||
class="meta-nav-item"
|
||||
href={lnk.url}
|
||||
target="_blank"
|
||||
rel="noopener"
|
||||
role="menuitem"
|
||||
onClick={() => setOpen(false)}
|
||||
>
|
||||
{lnk.icon ? <span aria-hidden="true">{lnk.icon}</span> : null}
|
||||
{lnk.label}
|
||||
</a>
|
||||
))}
|
||||
</div>
|
||||
) : null}
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -28,11 +28,10 @@ export interface AgentState {
|
|||
paused: boolean;
|
||||
inbox: InboxRow[];
|
||||
links: AgentLink[];
|
||||
forge_public_url: string | null;
|
||||
}
|
||||
|
||||
// Mirrors `hive_agent::web_ui::state::AgentLink` — one meta-nav entry
|
||||
// in the agent page header (stats/screen/forge/config + any
|
||||
// in the agent page header (stats/screen + any
|
||||
// `services.hyperhive.agent.dashboardLinks` extras). `agent_links()` on the backend
|
||||
// is the single source of truth for what links an agent exposes; see
|
||||
// docs/2-handbook/agents/web-page.md::Header for the kind → URL resolution table.
|
||||
|
|
@ -40,7 +39,7 @@ export interface AgentLink {
|
|||
url: string;
|
||||
icon: string;
|
||||
label: string;
|
||||
kind: "container" | "forge" | "external";
|
||||
kind: "container" | "external";
|
||||
}
|
||||
|
||||
export interface TokenUsage {
|
||||
|
|
|
|||
|
|
@ -270,8 +270,7 @@ function containerRowFingerprint(
|
|||
// changed (keyed cache), skipping the build + async dashboard-state
|
||||
// fetch for stable rows.
|
||||
function buildContainerLi(c, opts) {
|
||||
const { pending, opRunning, selected, url, containerBase, forgeBase, s } =
|
||||
opts;
|
||||
const { pending, opRunning, selected, url, containerBase, s } = opts;
|
||||
// A single `pending-running` class covers any active transient
|
||||
// badge state (see the pending-badge derivation comment in
|
||||
// renderContainers).
|
||||
|
|
@ -342,8 +341,7 @@ function buildContainerLi(c, opts) {
|
|||
// `GET /api/dashboard-state` (via gateway when enabled, direct
|
||||
// TCP otherwise). The agent is the single source of truth for its
|
||||
// link list: stats / screen (GUI agents only — c0re's disk-based
|
||||
// fallback cannot detect this) / forge profile / agent-configs /
|
||||
// extras. DOM-built — link strings come from the agent's process
|
||||
// fallback cannot detect this) / extras. DOM-built — link strings come from the agent's process
|
||||
// and must never reach the HTML parser.
|
||||
const navStrip = el("span", { class: "nav-strip" });
|
||||
head.append(navStrip);
|
||||
|
|
@ -363,15 +361,13 @@ function buildContainerLi(c, opts) {
|
|||
// -- nav strip -----------------------------------------------
|
||||
if (Array.isArray(ds.links)) {
|
||||
for (const lnk of ds.links) {
|
||||
// No public forge URL to link to — hide rather than build
|
||||
// a broken/guessed href (see forgeBase above).
|
||||
if (lnk.kind === "forge" && !forgeBase) continue;
|
||||
// An agent not yet rebuilt still sends forge links, which no
|
||||
// page links to any more.
|
||||
if (lnk.kind === "forge") continue;
|
||||
const href =
|
||||
lnk.kind === "forge"
|
||||
? forgeBase + (lnk.url || "")
|
||||
: lnk.kind === "external"
|
||||
? lnk.url || ""
|
||||
: /* container */ containerBase + "/" + (lnk.url || "");
|
||||
lnk.kind === "external"
|
||||
? lnk.url || ""
|
||||
: /* container */ containerBase + "/" + (lnk.url || "");
|
||||
const a = el("a", {
|
||||
class: "nav-link",
|
||||
href,
|
||||
|
|
@ -634,12 +630,6 @@ export function renderContainers(s) {
|
|||
// loopback port while the socket marker is absent). See
|
||||
// `docs/2-handbook/hives/dashboard.md::Container row` + `docs/4-implementation/networking/gateway.md::Vhost map`.
|
||||
const gatewayLinks = !!(s && s.gateway_enabled);
|
||||
// Forge public URL: state.forge_public_url (set by the NixOS module
|
||||
// from services.hyperhive.swarm.forge.publicUrl) or null — never guessed
|
||||
// from "<hostname>:3000". `null` propagates down to
|
||||
// buildContainerLi/buildAgentMenu, which already hide forge links
|
||||
// rather than emit a possibly-wrong one.
|
||||
const forgeBase = (s && s.forge_public_url) || null;
|
||||
const ul = existingUl ?? el("ul", { class: "containers" });
|
||||
const rows = sortedContainerRows(containers);
|
||||
|
||||
|
|
@ -691,7 +681,6 @@ export function renderContainers(s) {
|
|||
selected,
|
||||
url,
|
||||
containerBase,
|
||||
forgeBase,
|
||||
s,
|
||||
});
|
||||
containerRowCache.set(c.name, { el: li, fingerprint: fp });
|
||||
|
|
|
|||
Loading…
Reference in a new issue