feat(ui,api,admin): sveltekit admin spa, usage by day/agent/conversation/model, rate limits, memory tree, turn snapshot

This commit is contained in:
hh
2026-08-28 22:14:15 +02:00
parent 61562e947d
commit 98796a82c6
158 changed files with 8459 additions and 2531 deletions
+38
View File
@@ -0,0 +1,38 @@
import ActivityIcon from "@lucide/svelte/icons/activity";
import BrainIcon from "@lucide/svelte/icons/brain";
import ClockIcon from "@lucide/svelte/icons/clock";
import GaugeIcon from "@lucide/svelte/icons/gauge";
import KeyRoundIcon from "@lucide/svelte/icons/key-round";
import MessagesSquareIcon from "@lucide/svelte/icons/messages-square";
import ScrollTextIcon from "@lucide/svelte/icons/scroll-text";
import type { Component } from "svelte";
export interface NavItem {
href: string;
icon: Component<{ class?: string }>;
label: string;
mobile: boolean;
}
export const NAV: NavItem[] = [
{ href: "/", icon: ActivityIcon, label: "Now", mobile: true },
{
href: "/conversations",
icon: MessagesSquareIcon,
label: "Conversations",
mobile: true,
},
{ href: "/usage", icon: GaugeIcon, label: "Usage", mobile: true },
{ href: "/memory", icon: BrainIcon, label: "Memory", mobile: true },
{ href: "/tokens", icon: KeyRoundIcon, label: "Tokens", mobile: false },
{ href: "/jobs", icon: ClockIcon, label: "Jobs", mobile: false },
{ href: "/audit", icon: ScrollTextIcon, label: "Audit", mobile: false },
];
export function isActive(pathname: string, base: string, href: string) {
const path = pathname.startsWith(base)
? pathname.slice(base.length)
: pathname;
const current = path || "/";
return href === "/" ? current === "/" : current.startsWith(href);
}