Add environments (spaces) support
All checks were successful
Deploy to Server / deploy (push) Successful in 2m28s

- API client sends _environment param on all content/asset requests
- GET /api/environments endpoint to list configured environments
- EnvironmentSwitcher in Sidebar with i18n label "Space"
- clearSession() also clears environment from sessionStorage
- .env.example documents ADMIN_USERNAME/PASSWORD/SESSION_SECRET

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Peter Meier
2026-03-15 22:46:52 +01:00
parent 6f2c4d8576
commit 261c2fe338
7 changed files with 120 additions and 17 deletions

View File

@@ -8,6 +8,7 @@ import { useQueries, useQuery } from "@tanstack/react-query";
import { useTranslations } from "next-intl";
import { fetchCollections, fetchContentList, getApiKey, clearSession } from "@/lib/api";
import { LocaleSwitcher } from "./LocaleSwitcher";
import { EnvironmentSwitcher } from "./EnvironmentSwitcher";
const navLinkClass =
"inline-flex items-center gap-2 rounded-lg px-3 py-2.5 text-sm font-medium min-h-[44px] md:min-h-0 md:py-2";
@@ -101,6 +102,9 @@ export function Sidebar({ locale, mobileOpen = false, onClose }: SidebarProps) {
</button>
)}
</div>
<div className="flex shrink-0 flex-col gap-2 pb-1">
<EnvironmentSwitcher />
</div>
<div className="flex shrink-0 flex-col gap-1">
<Link
href="/"