phase2c: Oberflaeche heisst Homelab Orchestrator, Bereich Homelab, Anfragen gehen an die richtige Instanz

- /api/instanz: Rolle der ausliefernden Instanz, ohne Netzabfragen
- lib/instanz.ts: /api/homelab/... an die Homelab-Instanz, alles andere an die Box,
  ueber /api/partner/..., wenn die andere Instanz die Seite ausliefert
- neue Seite Homelab: Stand der zweiten Instanz (noch nicht eingerichtet / verbunden /
  antwortet nicht) und was dazukommt
- Kopfzeile, Titel und Web-Manifest mit neuem Namen; fuenfter Menuepunkt, 320 px geprueft

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Hitonabi
2026-09-24 17:59:23 +02:00
co-authored by Claude Opus 5.5
parent ee2bb9d03c
commit 22bb8c672b
41 changed files with 336 additions and 99 deletions
+6 -2
View File
@@ -1,5 +1,8 @@
// Dünner Zugriff auf das MC2-Backend. Bewusst ohne Anmelde- oder Geheimnis-Felder:
// Dünner Zugriff auf das Backend. Bewusst ohne Anmelde- oder Geheimnis-Felder:
// Nichts, was der Browser speichert, reist hier mit (Lehre aus v3-Umbau P1).
// Seit Phase 2 gibt es zwei Instanzen; welche eine Anfrage beantwortet, entscheidet lib/instanz.ts.
import { eigeneRolle, zielPfad } from "./instanz"
export class ApiFehler extends Error {
constructor(
@@ -22,9 +25,10 @@ function detailAus(body: unknown, status: number): string {
}
export async function api<T>(pfad: string, init: RequestInit = {}): Promise<T> {
const ziel = zielPfad(pfad, await eigeneRolle())
let antwort: Response
try {
antwort = await fetch(pfad, {
antwort = await fetch(ziel, {
...init,
headers: { "Content-Type": "application/json", Accept: "application/json", ...init.headers },
})