Add app/space switcher dropdowns to landing and canvas pages
Replace legacy mountHeader() (identity only) with the full rstack shell header on both index.html and canvas.html. Both pages now show rstack-app-switcher (21 modules), rstack-space-switcher, and rstack-identity — matching the module pages rendered by renderShell(). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
fa740e09ca
commit
69d382cb70
|
|
@ -436,8 +436,18 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
<link rel="stylesheet" href="/shell.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body data-theme="light">
|
||||||
|
<header class="rstack-header" data-theme="light">
|
||||||
|
<div class="rstack-header__left">
|
||||||
|
<rstack-app-switcher current="canvas"></rstack-app-switcher>
|
||||||
|
<rstack-space-switcher current="" name=""></rstack-space-switcher>
|
||||||
|
</div>
|
||||||
|
<div class="rstack-header__right">
|
||||||
|
<rstack-identity></rstack-identity>
|
||||||
|
</div>
|
||||||
|
</header>
|
||||||
<div id="community-info">
|
<div id="community-info">
|
||||||
<h2 id="community-name">Loading...</h2>
|
<h2 id="community-name">Loading...</h2>
|
||||||
<p id="community-slug"></p>
|
<p id="community-slug"></p>
|
||||||
|
|
@ -535,10 +545,19 @@
|
||||||
generatePeerId,
|
generatePeerId,
|
||||||
OfflineStore
|
OfflineStore
|
||||||
} from "@lib";
|
} from "@lib";
|
||||||
import { mountHeader } from "@lib/rspace-header";
|
import { RStackIdentity } from "@shared/components/rstack-identity";
|
||||||
|
import { RStackAppSwitcher } from "@shared/components/rstack-app-switcher";
|
||||||
|
import { RStackSpaceSwitcher } from "@shared/components/rstack-space-switcher";
|
||||||
|
|
||||||
// Mount the header (light theme for canvas)
|
// Register shell header components
|
||||||
mountHeader({ theme: "light", showBrand: true });
|
RStackIdentity.define();
|
||||||
|
RStackAppSwitcher.define();
|
||||||
|
RStackSpaceSwitcher.define();
|
||||||
|
|
||||||
|
// Load module list for app switcher
|
||||||
|
fetch("/api/modules").then(r => r.json()).then(data => {
|
||||||
|
document.querySelector("rstack-app-switcher")?.setModules(data.modules || []);
|
||||||
|
}).catch(() => {});
|
||||||
|
|
||||||
// Register service worker for offline support
|
// Register service worker for offline support
|
||||||
if ("serviceWorker" in navigator && window.location.hostname !== "localhost") {
|
if ("serviceWorker" in navigator && window.location.hostname !== "localhost") {
|
||||||
|
|
@ -602,6 +621,13 @@
|
||||||
document.getElementById("community-name").textContent = communitySlug;
|
document.getElementById("community-name").textContent = communitySlug;
|
||||||
document.getElementById("community-slug").textContent = `${communitySlug}.rspace.online`;
|
document.getElementById("community-slug").textContent = `${communitySlug}.rspace.online`;
|
||||||
|
|
||||||
|
// Update shell header space-switcher with resolved slug
|
||||||
|
const spaceSwitcher = document.querySelector("rstack-space-switcher");
|
||||||
|
if (spaceSwitcher) {
|
||||||
|
spaceSwitcher.setAttribute("current", communitySlug);
|
||||||
|
spaceSwitcher.setAttribute("name", communitySlug);
|
||||||
|
}
|
||||||
|
|
||||||
const canvas = document.getElementById("canvas");
|
const canvas = document.getElementById("canvas");
|
||||||
const canvasContent = document.getElementById("canvas-content");
|
const canvasContent = document.getElementById("canvas-content");
|
||||||
const status = document.getElementById("status");
|
const status = document.getElementById("status");
|
||||||
|
|
|
||||||
|
|
@ -336,9 +336,19 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
<link rel="stylesheet" href="/shell.css">
|
||||||
<script defer src="https://rdata.online/collect.js" data-website-id="6ee7917b-0ed7-44cb-a4c8-91037638526b"></script>
|
<script defer src="https://rdata.online/collect.js" data-website-id="6ee7917b-0ed7-44cb-a4c8-91037638526b"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body data-theme="dark">
|
||||||
|
<header class="rstack-header" data-theme="dark">
|
||||||
|
<div class="rstack-header__left">
|
||||||
|
<rstack-app-switcher current=""></rstack-app-switcher>
|
||||||
|
<rstack-space-switcher current="" name="Spaces"></rstack-space-switcher>
|
||||||
|
</div>
|
||||||
|
<div class="rstack-header__right">
|
||||||
|
<rstack-identity></rstack-identity>
|
||||||
|
</div>
|
||||||
|
</header>
|
||||||
<div class="hero">
|
<div class="hero">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<h1>rSpace</h1>
|
<h1>rSpace</h1>
|
||||||
|
|
@ -567,10 +577,20 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script type="module">
|
<script type="module">
|
||||||
import { mountHeader, requireAuth, isAuthenticated, getAccessToken } from "@lib/rspace-header";
|
import { RStackIdentity } from "@shared/components/rstack-identity";
|
||||||
|
import { RStackAppSwitcher } from "@shared/components/rstack-app-switcher";
|
||||||
|
import { RStackSpaceSwitcher } from "@shared/components/rstack-space-switcher";
|
||||||
|
import { requireAuth, isAuthenticated, getAccessToken } from "@shared/components/rstack-identity";
|
||||||
|
|
||||||
// Mount the header
|
// Register shell header components
|
||||||
mountHeader({ theme: "dark", showBrand: true });
|
RStackIdentity.define();
|
||||||
|
RStackAppSwitcher.define();
|
||||||
|
RStackSpaceSwitcher.define();
|
||||||
|
|
||||||
|
// Load module list for app switcher
|
||||||
|
fetch("/api/modules").then(r => r.json()).then(data => {
|
||||||
|
document.querySelector("rstack-app-switcher")?.setModules(data.modules || []);
|
||||||
|
}).catch(() => {});
|
||||||
|
|
||||||
const nameInput = document.getElementById("community-name");
|
const nameInput = document.getElementById("community-name");
|
||||||
const slugInput = document.getElementById("community-slug");
|
const slugInput = document.getElementById("community-slug");
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue