feat(ui,api): strip board redesign - island, rail by day, context view, server search, vault graph
This commit is contained in:
+27
-24
@@ -1,35 +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 }>;
|
||||
key: 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 const SECTIONS: NavItem[] = [
|
||||
{ href: "/", key: "1", label: "Now" },
|
||||
{ href: "/conversations", key: "2", label: "Conversations" },
|
||||
{ href: "/memory", key: "3", label: "Memory" },
|
||||
{ href: "/usage", key: "4", label: "Usage" },
|
||||
];
|
||||
|
||||
export const SYSTEM: NavItem = { href: "/system", key: "5", label: "System" };
|
||||
|
||||
export const SYSTEM_PAGES: NavItem[] = [
|
||||
{ href: "/system", key: "", label: "Sessions" },
|
||||
{ href: "/system/agents", key: "", label: "Agents & endpoints" },
|
||||
{ href: "/system/jobs", key: "", label: "Jobs" },
|
||||
{ href: "/system/tokens", key: "", label: "Tokens" },
|
||||
{ href: "/system/audit", key: "", label: "Audit" },
|
||||
];
|
||||
|
||||
export function isActive(pathname: string, base: string, href: string) {
|
||||
const path = pathname.startsWith(base)
|
||||
? pathname.slice(base.length)
|
||||
: pathname;
|
||||
const current = path || "/";
|
||||
if (href === "/") {
|
||||
return current === "/";
|
||||
}
|
||||
return current === href || current.startsWith(`${href}/`);
|
||||
}
|
||||
|
||||
export function isSectionActive(pathname: string, base: string, href: string) {
|
||||
const path = pathname.startsWith(base)
|
||||
? pathname.slice(base.length)
|
||||
: pathname;
|
||||
|
||||
Reference in New Issue
Block a user