feat: add sidebar

This commit is contained in:
Austin Pickett 2026-04-22 23:25:17 -04:00
parent 7db2703b33
commit e5d2815b41
41 changed files with 2469 additions and 1391 deletions

View file

@ -513,7 +513,12 @@ export interface PluginManifestResponse {
description: string;
icon: string;
version: string;
tab: { path: string; position: string };
tab: {
path: string;
position?: string;
override?: string;
hidden?: boolean;
};
entry: string;
css?: string | null;
has_api: boolean;

View file

@ -0,0 +1,31 @@
import type { Translations } from "@/i18n/types";
const BUILTIN: Record<string, keyof Translations["app"]["nav"]> = {
"/sessions": "sessions",
"/analytics": "analytics",
"/logs": "logs",
"/cron": "cron",
"/skills": "skills",
"/config": "config",
"/env": "keys",
};
export function resolvePageTitle(
pathname: string,
t: Translations,
pluginTabs: { path: string; label: string }[],
): string {
const normalized = pathname.replace(/\/$/, "") || "/";
if (normalized === "/") {
return t.app.nav.sessions;
}
const plugin = pluginTabs.find((p) => p.path === normalized);
if (plugin) {
return plugin.label;
}
const key = BUILTIN[normalized];
if (key) {
return t.app.nav[key];
}
return t.app.webUi;
}