mirror of
https://github.com/fosrl/pangolin.git
synced 2026-08-14 16:30:15 +02:00
move ai logs under gateway section
This commit is contained in:
+10
-10
@@ -207,6 +207,16 @@ export const orgNavSections = (
|
|||||||
title: "sidebarVirtualApiKeys",
|
title: "sidebarVirtualApiKeys",
|
||||||
href: "/{orgId}/settings/virtual-api-keys",
|
href: "/{orgId}/settings/virtual-api-keys",
|
||||||
icon: <KeyRound className="size-4 flex-none" />
|
icon: <KeyRound className="size-4 flex-none" />
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "sidebarLogsAi",
|
||||||
|
href: "/{orgId}/settings/logs/ai",
|
||||||
|
icon: <Bot className="size-4 flex-none" />
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "sidebarLogsAiUsage",
|
||||||
|
href: "/{orgId}/settings/logs/ai-usage",
|
||||||
|
icon: <Coins className="size-4 flex-none" />
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -229,16 +239,6 @@ export const orgNavSections = (
|
|||||||
<SquareMousePointer className="size-4 flex-none" />
|
<SquareMousePointer className="size-4 flex-none" />
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
{
|
|
||||||
title: "sidebarLogsAi",
|
|
||||||
href: "/{orgId}/settings/logs/ai",
|
|
||||||
icon: <Bot className="size-4 flex-none" />
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "sidebarLogsAiUsage",
|
|
||||||
href: "/{orgId}/settings/logs/ai-usage",
|
|
||||||
icon: <Coins className="size-4 flex-none" />
|
|
||||||
},
|
|
||||||
...(!env?.flags.disableEnterpriseFeatures
|
...(!env?.flags.disableEnterpriseFeatures
|
||||||
? [
|
? [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -49,6 +49,10 @@ export interface SidebarNavProps extends React.HTMLAttributes<HTMLElement> {
|
|||||||
notificationCounts?: Record<string, number | undefined>;
|
notificationCounts?: Record<string, number | undefined>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function isPathActive(pathname: string, href: string): boolean {
|
||||||
|
return pathname === href || pathname.startsWith(`${href}/`);
|
||||||
|
}
|
||||||
|
|
||||||
type CollapsibleNavItemProps = {
|
type CollapsibleNavItemProps = {
|
||||||
item: SidebarNavItem;
|
item: SidebarNavItem;
|
||||||
level: number;
|
level: number;
|
||||||
@@ -285,7 +289,7 @@ function CollapsedNavItemWithPopover({
|
|||||||
childItem.href
|
childItem.href
|
||||||
);
|
);
|
||||||
const childIsActive = childHydratedHref
|
const childIsActive = childHydratedHref
|
||||||
? pathname.startsWith(childHydratedHref)
|
? isPathActive(pathname, childHydratedHref)
|
||||||
: false;
|
: false;
|
||||||
const childIsEE =
|
const childIsEE =
|
||||||
build === "enterprise" &&
|
build === "enterprise" &&
|
||||||
@@ -392,7 +396,7 @@ export function SidebarNav({
|
|||||||
|
|
||||||
function isItemOrChildActive(item: SidebarNavItem): boolean {
|
function isItemOrChildActive(item: SidebarNavItem): boolean {
|
||||||
const hydratedHref = hydrateHref(item.href);
|
const hydratedHref = hydrateHref(item.href);
|
||||||
if (hydratedHref && pathname.startsWith(hydratedHref)) {
|
if (hydratedHref && isPathActive(pathname, hydratedHref)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (item.items) {
|
if (item.items) {
|
||||||
@@ -408,7 +412,7 @@ export function SidebarNav({
|
|||||||
const hydratedHref = hydrateHref(item.href);
|
const hydratedHref = hydrateHref(item.href);
|
||||||
const hasNestedItems = item.items && item.items.length > 0;
|
const hasNestedItems = item.items && item.items.length > 0;
|
||||||
const isActive = hydratedHref
|
const isActive = hydratedHref
|
||||||
? pathname.startsWith(hydratedHref)
|
? isPathActive(pathname, hydratedHref)
|
||||||
: false;
|
: false;
|
||||||
const isChildActive = hasNestedItems
|
const isChildActive = hasNestedItems
|
||||||
? isItemOrChildActive(item)
|
? isItemOrChildActive(item)
|
||||||
|
|||||||
Reference in New Issue
Block a user