Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions app/(app)/dashboard/quotas/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { DashboardPage } from "@/components/dashboard/dashboard-page"

export default function DashboardQuotasPage() {
return <DashboardPage section="quotas" />
}
23 changes: 22 additions & 1 deletion components/app-shell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
CloudIcon,
FileTextIcon,
FlaskConicalIcon,
GaugeIcon,
LayoutDashboardIcon,
Loader2Icon,
LogOutIcon,
Expand Down Expand Up @@ -91,6 +92,13 @@ function getPageCopy(pathname: string) {
};
}

if (pathname.startsWith("/dashboard/quotas")) {
return {
description: "Monitore consumo, limites configurados e janelas de renovação por provedor.",
title: "Quota Tracker",
};
}

if (pathname.startsWith("/dashboard/logs")) {
return {
description: "Acompanhe requests recentes, status e detalhes de erro.",
Expand Down Expand Up @@ -198,7 +206,8 @@ export function AppShell({ children }: { children: React.ReactNode }) {
asChild
isActive={
pathname.startsWith("/dashboard") &&
!pathname.startsWith("/dashboard/credentials")
!pathname.startsWith("/dashboard/credentials") &&
!pathname.startsWith("/dashboard/quotas")
}
tooltip="Dashboard"
>
Expand All @@ -208,6 +217,18 @@ export function AppShell({ children }: { children: React.ReactNode }) {
</Link>
</SidebarMenuButton>
</SidebarMenuItem>
<SidebarMenuItem>
<SidebarMenuButton
asChild
isActive={pathname.startsWith("/dashboard/quotas")}
tooltip="Quota Tracker"
>
<Link href="/dashboard/quotas">
<GaugeIcon />
<span>Quotas</span>
</Link>
</SidebarMenuButton>
</SidebarMenuItem>
<SidebarMenuItem>
<SidebarMenuButton asChild isActive={pathname.startsWith("/chat")} tooltip="Chat">
<Link href="/chat">
Expand Down
6 changes: 5 additions & 1 deletion components/dashboard/dashboard-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import { AnalyticsSection } from "@/components/dashboard/analytics-section";
import { ApiQuickStartCard } from "@/components/dashboard/api-quick-start-card";
import { RoutingSection } from "@/components/dashboard/routing-section";
import { ProviderCatalog } from "@/components/dashboard/providers/provider-catalog";
import { QuotaTracker } from "@/components/dashboard/quota-tracker";
import { useAppState } from "@/components/app-state-provider";
import {
AlertDialog,
Expand Down Expand Up @@ -62,7 +63,7 @@ import {
import { apiJson, apiJsonRequest } from "@/lib/api";
import { providerHasRequiredCredentials } from "@/lib/provider-credentials";

export type DashboardSection = "overview" | "keys" | "credentials" | "logs" | "analytics" | "routing" | "budget";
export type DashboardSection = "overview" | "keys" | "credentials" | "quotas" | "logs" | "analytics" | "routing" | "budget";

function sectionNeedsDashboardData(section: DashboardSection) {
return section === "overview" || section === "keys" || section === "logs";
Expand Down Expand Up @@ -237,6 +238,7 @@ export function DashboardPage({ section = "overview" }: { section?: DashboardSec
{ href: "/dashboard", id: "overview", label: "Visão geral" },
{ count: shouldLoadDashboardData ? apiKeys.length : undefined, href: "/dashboard/api-keys", id: "keys", label: "API Keys" },
{ count: providers.length, href: "/dashboard/credentials", id: "credentials", label: "Provedores" },
{ href: "/dashboard/quotas", id: "quotas", label: "Quotas" },
{ count: shouldLoadDashboardData ? logs.length : undefined, href: "/dashboard/logs", id: "logs", label: "Logs de uso" },
{ href: "/dashboard/analytics", id: "analytics", label: "Analytics" },
{ href: "/dashboard/routing", id: "routing", label: "Roteamento" },
Expand Down Expand Up @@ -636,6 +638,8 @@ export function DashboardPage({ section = "overview" }: { section?: DashboardSec
<ProviderCatalog />
) : null}

{section === "quotas" ? <QuotaTracker /> : null}

{section === "logs" ? (
<Card className="border-border/60">
<CardHeader>
Expand Down
Loading
Loading