feat(ui): interactive graph, strip context menus, days by activity, message times, limit status words
This commit is contained in:
+11
-4
@@ -1,4 +1,6 @@
|
||||
export interface NavItem {
|
||||
// Lit only on its own path, not on its children (an index page).
|
||||
exact?: boolean;
|
||||
href: string;
|
||||
key: string;
|
||||
label: string;
|
||||
@@ -14,20 +16,25 @@ export const SECTIONS: NavItem[] = [
|
||||
export const SYSTEM: NavItem = { href: "/system", key: "5", label: "System" };
|
||||
|
||||
export const SYSTEM_PAGES: NavItem[] = [
|
||||
{ href: "/system", key: "", label: "Sessions" },
|
||||
{ exact: true, 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) {
|
||||
export function isActive(
|
||||
pathname: string,
|
||||
base: string,
|
||||
href: string,
|
||||
exact = false
|
||||
) {
|
||||
const path = pathname.startsWith(base)
|
||||
? pathname.slice(base.length)
|
||||
: pathname;
|
||||
const current = path || "/";
|
||||
if (href === "/") {
|
||||
return current === "/";
|
||||
if (href === "/" || exact) {
|
||||
return current === href;
|
||||
}
|
||||
return current === href || current.startsWith(`${href}/`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user