feat: scaffold PulseNode dashboard (M1)
Next.js 16 + TypeScript + Tailwind v4 app with a YAML-driven config system: schema validation (zod), .env interpolation, and a widget registry rendering bookmark/search/group widgets. CSS custom properties (--pn-*) drive theming and are overridable from config.yml's theme.variables. Config load errors surface as a readable error page instead of crashing the app. Hot reload, docker/system/http collectors, and the WebSocket push layer land in later milestones per the approved plan.
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
import type { Metadata } from "next";
|
||||
import "./globals.css";
|
||||
import { configStore } from "@/lib/config/loader";
|
||||
import { ThemeStyleInjector } from "@/components/layout/ThemeStyleInjector";
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "PulseNode",
|
||||
description: "Self-hosted infrastructure dashboard",
|
||||
};
|
||||
|
||||
export default function RootLayout({ children }: LayoutProps<"/">) {
|
||||
let mode: "dark" | "light" = "dark";
|
||||
let variables: Record<string, string> = {};
|
||||
|
||||
try {
|
||||
const config = configStore.get();
|
||||
mode = config.theme.mode === "light" ? "light" : "dark";
|
||||
variables = config.theme.variables;
|
||||
} catch {
|
||||
// page.tsx surfaces the actual config error; layout falls back to defaults
|
||||
}
|
||||
|
||||
return (
|
||||
<html lang="en" data-theme={mode} className="h-full">
|
||||
<head>
|
||||
<ThemeStyleInjector variables={variables} />
|
||||
</head>
|
||||
<body className="min-h-full antialiased">{children}</body>
|
||||
</html>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user