mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-10-23 00:45:25 +08:00
Cloud deployments need a way to tell readers what is happening to the instance they are using (maintenance windows, service notices) without shipping a release per notice. Add a cloud.banner config block (switch, tone, dismissal, link targets and per-language copy) and expose the resolved banner on the unauthenticated /api/v1/system/info payload so the WebUI can render it before login. The banner resolves to null on OSS deployments, so a self-hosted copy of config.yaml never shows managed-service copy. Copy is plain text; only absolute http(s) link targets are rendered. The WebUI renders it once from the root layout, offsets the fixed app shell and the wizard through --cloud-banner-height, and keeps a dismissal bound to the notice it dismissed so new copy reappears. Co-authored-by: multica-agent <[email protected]>
18 lines
605 B
TypeScript
18 lines
605 B
TypeScript
import { Outlet } from 'react-router-dom';
|
|
import { useDocumentTitle } from '@/hooks/useDocumentTitle';
|
|
import { CloudBanner } from '@/components/CloudBanner';
|
|
|
|
// Top-level route layout: drives the dynamic document title from the active
|
|
// route and renders the matched child route via <Outlet />. The Cloud-only
|
|
// instance notice lives here so it is present on every route (login included);
|
|
// it publishes `--cloud-banner-height` for the fixed shell to offset itself.
|
|
export default function RootLayout() {
|
|
useDocumentTitle();
|
|
return (
|
|
<>
|
|
<CloudBanner />
|
|
<Outlet />
|
|
</>
|
|
);
|
|
}
|