From 580c165e28bf61283a30e2fbd3fb27fbb1aac45c Mon Sep 17 00:00:00 2001 From: Flo <53355483+Flo4604@users.noreply.github.com> Date: Fri, 13 Dec 2024 12:20:01 +0100 Subject: [PATCH] feat: metrics ui component (#2745) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: metrics ui component * fix: fmt * fix: permission metric component * fix: manual fmt * fix: manual fmt * fix: manual fmt * fix: border-border in some other places --------- Co-authored-by: Oğuzhan Olguncu <21091016+ogzhanolguncu@users.noreply.github.com> --- .../[apiId]/keys/[keyAuthId]/[keyId]/page.tsx | 17 +++-------------- apps/dashboard/app/(app)/apis/[apiId]/page.tsx | 10 +--------- .../[apiId]/settings/update-ip-whitelist.tsx | 2 +- .../app/(app)/apis/create-api-button.tsx | 2 +- .../permissions/[permissionId]/page.tsx | 2 +- .../permissions/create-new-permission.tsx | 2 +- .../authorization/roles/create-new-role.tsx | 2 +- .../app/(app)/ratelimits/[namespaceId]/page.tsx | 10 +--------- .../ratelimits/create-namespace-button.tsx | 2 +- .../(app)/settings/root-keys/[keyId]/layout.tsx | 13 +------------ .../app/(app)/settings/user/update-theme.tsx | 2 +- apps/dashboard/app/ratelimit/page.tsx | 13 +------------ apps/dashboard/components/ui/metric.tsx | 17 +++++++++++++++++ 13 files changed, 31 insertions(+), 63 deletions(-) create mode 100644 apps/dashboard/components/ui/metric.tsx diff --git a/apps/dashboard/app/(app)/apis/[apiId]/keys/[keyAuthId]/[keyId]/page.tsx b/apps/dashboard/app/(app)/apis/[apiId]/keys/[keyAuthId]/[keyId]/page.tsx index c6c016fe3e..12f8f1468d 100644 --- a/apps/dashboard/app/(app)/apis/[apiId]/keys/[keyAuthId]/[keyId]/page.tsx +++ b/apps/dashboard/app/(app)/apis/[apiId]/keys/[keyAuthId]/[keyId]/page.tsx @@ -9,6 +9,7 @@ import { StackedColumnChart } from "@/components/dashboard/charts"; import { EmptyPlaceholder } from "@/components/dashboard/empty-placeholder"; import { Badge } from "@/components/ui/badge"; import { Card, CardContent, CardHeader } from "@/components/ui/card"; +import { Metric } from "@/components/ui/metric"; import { Separator } from "@/components/ui/separator"; import { getTenantId } from "@/lib/auth"; import { clickhouse } from "@/lib/clickhouse"; @@ -143,10 +144,7 @@ export default async function APIKeyDetailPage(props: { ...ratelimitedOverTime.map((d) => ({ ...d, category: "Ratelimited" })), ...usageExceededOverTime.map((d) => ({ ...d, category: "Usage Exceeded" })), ...disabledOverTime.map((d) => ({ ...d, category: "Disabled" })), - ...insufficientPermissionsOverTime.map((d) => ({ - ...d, - category: "Insufficient Permissions", - })), + ...insufficientPermissionsOverTime.map((d) => ({ ...d, category: "Insufficient Permissions" })), ...expiredOverTime.map((d) => ({ ...d, category: "Expired" })), ...forbiddenOverTime.map((d) => ({ ...d, category: "Forbidden" })), ]; @@ -337,7 +335,7 @@ export default async function APIKeyDetailPage(props: { {Intl.NumberFormat().format(transientPermissionIds.size)} Permissions -
{label}
-{label}
-