diff --git a/apps/dashboard/app/(app)/apis/[apiId]/_overview/components/table/components/log-details/components/log-section.tsx b/apps/dashboard/app/(app)/apis/[apiId]/_overview/components/table/components/log-details/components/log-section.tsx index 281aae4289..299a361fb0 100644 --- a/apps/dashboard/app/(app)/apis/[apiId]/_overview/components/table/components/log-details/components/log-section.tsx +++ b/apps/dashboard/app/(app)/apis/[apiId]/_overview/components/table/components/log-details/components/log-section.tsx @@ -6,6 +6,7 @@ import { Button } from "@unkey/ui"; import { TimestampInfo } from "@/components/timestamp-info"; import { Clone } from "@unkey/icons"; import { isValid, parse, parseISO } from "date-fns"; +import Link from "next/link"; const TIME_KEYWORDS = [ "created", @@ -28,9 +29,13 @@ const TIME_KEYWORDS = [ export const LogSection = ({ details, title, + keyAuthId, + apiId, }: { details: string | string[]; title: string; + apiId?: string; + keyAuthId?: string; }) => { const handleClick = () => { navigator.clipboard @@ -73,7 +78,19 @@ export const LogSection = ({ ) : ( - {value} + + {key === "ID" ? ( + + {value} + + ) : ( + value + )} + )} ); diff --git a/apps/dashboard/app/(app)/apis/[apiId]/_overview/components/table/components/log-details/index.tsx b/apps/dashboard/app/(app)/apis/[apiId]/_overview/components/table/components/log-details/index.tsx index 5856352a7d..be3082b641 100644 --- a/apps/dashboard/app/(app)/apis/[apiId]/_overview/components/table/components/log-details/index.tsx +++ b/apps/dashboard/app/(app)/apis/[apiId]/_overview/components/table/components/log-details/index.tsx @@ -25,6 +25,7 @@ const createPanelStyle = (distanceToTop: number): StyleObject => ({ type KeysOverviewLogDetailsProps = { distanceToTop: number; log: KeysOverviewLog | null; + apiId: string; setSelectedLog: (data: KeysOverviewLog | null) => void; }; @@ -96,7 +97,12 @@ export const KeysOverviewLogDetails = ({ {log.outcome_counts && } - + diff --git a/apps/dashboard/app/(app)/apis/[apiId]/_overview/components/table/components/override-indicator.tsx b/apps/dashboard/app/(app)/apis/[apiId]/_overview/components/table/components/override-indicator.tsx index 9a39d3b130..0efb1658ef 100644 --- a/apps/dashboard/app/(app)/apis/[apiId]/_overview/components/table/components/override-indicator.tsx +++ b/apps/dashboard/app/(app)/apis/[apiId]/_overview/components/table/components/override-indicator.tsx @@ -3,6 +3,7 @@ import { cn } from "@/lib/utils"; import type { KeysOverviewLog } from "@unkey/clickhouse/src/keys/keys"; import { TriangleWarning2 } from "@unkey/icons"; import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@unkey/ui"; +import Link from "next/link"; import { getErrorPercentage, getErrorSeverity } from "../utils/calculate-blocked-percentage"; export const KeyTooltip = ({ @@ -29,6 +30,7 @@ export const KeyTooltip = ({ type KeyIdentifierColumnProps = { log: KeysOverviewLog; + apiId: string; }; // Get warning icon based on error severity @@ -59,7 +61,7 @@ const getWarningMessage = (severity: string, errorRate: number) => { } }; -export const KeyIdentifierColumn = ({ log }: KeyIdentifierColumnProps) => { +export const KeyIdentifierColumn = ({ log, apiId }: KeyIdentifierColumnProps) => { const errorPercentage = getErrorPercentage(log); const severity = getErrorSeverity(log); const hasErrors = severity !== "none"; @@ -73,10 +75,16 @@ export const KeyIdentifierColumn = ({ log }: KeyIdentifierColumnProps) => { {getWarningIcon(severity)} -
- {log.key_id.substring(0, 8)}... - {log.key_id.substring(log.key_id.length - 4)} -
+ +
+ {log.key_id.substring(0, 8)}... + {log.key_id.substring(log.key_id.length - 4)} +
+ ); }; diff --git a/apps/dashboard/app/(app)/apis/[apiId]/_overview/components/table/logs-table.tsx b/apps/dashboard/app/(app)/apis/[apiId]/_overview/components/table/logs-table.tsx index 2ced272439..73a71515f4 100644 --- a/apps/dashboard/app/(app)/apis/[apiId]/_overview/components/table/logs-table.tsx +++ b/apps/dashboard/app/(app)/apis/[apiId]/_overview/components/table/logs-table.tsx @@ -36,7 +36,7 @@ export const KeysOverviewLogsTable = ({ apiId, setSelectedLog, log: selectedLog header: "ID", width: "15%", headerClassName: "pl-11", - render: (log) => , + render: (log) => , }, { key: "name", diff --git a/apps/dashboard/app/(app)/apis/[apiId]/_overview/logs-client.tsx b/apps/dashboard/app/(app)/apis/[apiId]/_overview/logs-client.tsx index ad75503e23..6d72e5fb62 100644 --- a/apps/dashboard/app/(app)/apis/[apiId]/_overview/logs-client.tsx +++ b/apps/dashboard/app/(app)/apis/[apiId]/_overview/logs-client.tsx @@ -27,6 +27,7 @@ export const LogsClient = ({ apiId }: { apiId: string }) => { ( } else if (timeRange >= MONTH_IN_MS) { granularity = "per3Days"; } else if (timeRange >= WEEK_IN_MS * 2) { - granularity = "perHour"; + granularity = "per6Hours"; } else if (timeRange >= WEEK_IN_MS) { granularity = "perHour"; } else {