Enhance bot and WebUI functionality with new features and environment updates

- Added support for new environment variables in `.env.example` for public site and legal operator information.
- Integrated core commands into the bot's command structure for improved functionality.
- Implemented a new `publishBotStatus` function to update bot status in Redis, enhancing monitoring capabilities.
- Updated the landing page to include features, invite links, and support server access, improving user experience.
- Enhanced localization with new keys for core commands and landing page elements in both English and German.
- Improved error handling and logging for bot presence updates and status publishing.
This commit is contained in:
smueller
2026-07-22 16:47:09 +02:00
parent 0b4ac0da29
commit 4852f16f79
32 changed files with 1579 additions and 83 deletions

View File

@@ -0,0 +1,39 @@
import Link from 'next/link';
import type { ReactNode } from 'react';
import { SiteShell } from '@/components/site/site-shell';
import { getLocale, t } from '@/lib/i18n';
export async function LegalShell({
title,
children
}: {
title: string;
children: ReactNode;
}) {
const locale = await getLocale();
return (
<SiteShell>
<div className="mx-auto grid w-full max-w-[1200px] gap-8 px-6 py-12 lg:grid-cols-[220px_1fr]">
<aside className="space-y-2 text-sm">
<p className="px-2 text-xs font-semibold uppercase tracking-wider text-muted-foreground">
{t(locale, 'legal.navTitle')}
</p>
<Link href="/impressum" className="block rounded-md px-2 py-1.5 hover:bg-accent">
{t(locale, 'legal.impressum.title')}
</Link>
<Link href="/privacy" className="block rounded-md px-2 py-1.5 hover:bg-accent">
{t(locale, 'legal.privacy.title')}
</Link>
<Link href="/terms" className="block rounded-md px-2 py-1.5 hover:bg-accent">
{t(locale, 'legal.terms.title')}
</Link>
</aside>
<article className="space-y-6">
<h1 className="text-3xl font-semibold">{title}</h1>
{children}
</article>
</div>
</SiteShell>
);
}

View File

@@ -0,0 +1,31 @@
import Link from 'next/link';
import { getLocale, t } from '@/lib/i18n';
export async function SiteFooter() {
const locale = await getLocale();
return (
<footer className="border-t border-border">
<div className="mx-auto flex w-full max-w-[1200px] flex-col gap-4 px-6 py-8 text-sm text-muted-foreground sm:flex-row sm:items-center sm:justify-between">
<p>© {new Date().getFullYear()} Nexumi</p>
<nav className="flex flex-wrap gap-4">
<Link href="/status" className="hover:text-foreground">
{t(locale, 'site.footer.status')}
</Link>
<Link href="/impressum" className="hover:text-foreground">
{t(locale, 'site.footer.impressum')}
</Link>
<Link href="/privacy" className="hover:text-foreground">
{t(locale, 'site.footer.privacy')}
</Link>
<Link href="/terms" className="hover:text-foreground">
{t(locale, 'site.footer.terms')}
</Link>
<Link href="/dashboard" className="hover:text-foreground">
{t(locale, 'site.footer.dashboard')}
</Link>
</nav>
</div>
</footer>
);
}

View File

@@ -0,0 +1,62 @@
'use client';
import { Moon, Sun } from 'lucide-react';
import Image from 'next/image';
import Link from 'next/link';
import { useTheme } from 'next-themes';
import { useTranslations } from '@/components/locale-provider';
import { Button } from '@/components/ui/button';
export function SiteHeader({
inviteUrl,
supportUrl,
isLoggedIn
}: {
inviteUrl: string;
supportUrl?: string;
isLoggedIn: boolean;
}) {
const t = useTranslations();
const { theme, setTheme } = useTheme();
return (
<header className="border-b border-border">
<div className="mx-auto flex h-14 w-full max-w-[1200px] items-center justify-between px-6">
<Link href="/" className="flex items-center gap-2 font-semibold">
<Image src="/nexumi-logo.svg" alt="Nexumi" width={28} height={28} priority />
Nexumi
</Link>
<nav className="flex items-center gap-2">
<Button asChild variant="ghost" size="sm">
<Link href="/status">{t('site.nav.status')}</Link>
</Button>
<Button asChild variant="ghost" size="sm">
<a href={inviteUrl} target="_blank" rel="noreferrer">
{t('site.nav.invite')}
</a>
</Button>
{supportUrl ? (
<Button asChild variant="ghost" size="sm">
<a href={supportUrl} target="_blank" rel="noreferrer">
{t('site.nav.support')}
</a>
</Button>
) : null}
<Button asChild size="sm">
<Link href={isLoggedIn ? '/dashboard' : '/login'}>
{isLoggedIn ? t('site.nav.dashboard') : t('site.nav.login')}
</Link>
</Button>
<Button
variant="ghost"
size="sm"
aria-label={t('userMenu.theme')}
onClick={() => setTheme(theme === 'dark' ? 'light' : 'dark')}
>
{theme === 'dark' ? <Sun className="size-4" /> : <Moon className="size-4" />}
</Button>
</nav>
</div>
</header>
);
}

View File

@@ -0,0 +1,21 @@
import type { ReactNode } from 'react';
import { SiteFooter } from '@/components/site/site-footer';
import { SiteHeader } from '@/components/site/site-header';
import { buildBotInviteUrl, env } from '@/lib/env';
import { getSession } from '@/lib/session';
export async function SiteShell({ children }: { children: ReactNode }) {
const session = await getSession();
return (
<div className="flex min-h-screen flex-col bg-background text-foreground">
<SiteHeader
inviteUrl={buildBotInviteUrl()}
supportUrl={env.SUPPORT_SERVER_URL}
isLoggedIn={Boolean(session)}
/>
<main className="flex-1">{children}</main>
<SiteFooter />
</div>
);
}