diff --git a/messages/en-US.json b/messages/en-US.json
index c3a6a235c..950952e91 100644
--- a/messages/en-US.json
+++ b/messages/en-US.json
@@ -1977,6 +1977,8 @@
"aiUsageFilterAllResources": "All Resources",
"aiUsageFilterAllRoles": "All Roles",
"aiUsageFilterAllUsers": "All Users",
+ "aiUsageFilterSearch": "Search...",
+ "aiUsageFilterNotFound": "No options found",
"aiUsageResetFilters": "Reset Filters",
"aiUsageRefresh": "Refresh",
"aiUsageTokenTypePrompt": "Prompt",
@@ -2003,8 +2005,8 @@
"aiUsageTopResources": "Top Resources",
"aiUsageResourceCost": "Resource Cost",
"aiUsageResourceTokenUsage": "Resource Token Usage",
- "aiUsageResourceTypePublic": "Resource",
- "aiUsageResourceTypeSite": "Site resource",
+ "aiUsageResourceTypePublic": "Public Resource",
+ "aiUsageResourceTypeSite": "Private Resource",
"aiUsageNoResource": "No resource",
"aiUsageRolesTab": "Roles",
"aiUsageUsersTab": "Users",
@@ -3543,8 +3545,8 @@
"sourceAddress": "Source Address",
"destinationAddress": "Destination Address",
"duration": "Duration",
- "licenseRequiredToUse": "Enterprise Edition license is required. Book a demo or POC",
- "ossEnterpriseEditionRequired": "Enterprise Edition license is required. Book a demo or POC",
+ "licenseRequiredToUse": "Enterprise Edition license is required. Book a demo or trial",
+ "ossEnterpriseEditionRequired": "Enterprise Edition license is required. Book a demo or trial",
"certResolver": "Certificate Resolver",
"certResolverDescription": "Select the certificate resolver to use for this resource.",
"selectCertResolver": "Select Certificate Resolver",
diff --git a/src/components/AiUsageAnalyticsData.tsx b/src/components/AiUsageAnalyticsData.tsx
index 3cb35198e..3ce79cda5 100644
--- a/src/components/AiUsageAnalyticsData.tsx
+++ b/src/components/AiUsageAnalyticsData.tsx
@@ -7,20 +7,23 @@ import {
type AiUsageAnalyticsFilters
} from "@app/lib/queries";
import { useIsFetching, useQuery, useQueryClient } from "@tanstack/react-query";
-import { RefreshCw, XIcon } from "lucide-react";
+import { CheckIcon, ChevronsUpDown, RefreshCw, XIcon } from "lucide-react";
import { useTranslations } from "next-intl";
import { usePathname, useRouter, useSearchParams } from "next/navigation";
+import { useState } from "react";
import { DateRangePicker, type DateTimeValue } from "./DateTimePicker";
import { Button } from "./ui/button";
import { Card, CardHeader } from "./ui/card";
-import { Label } from "./ui/label";
import {
- Select,
- SelectContent,
- SelectItem,
- SelectTrigger,
- SelectValue
-} from "./ui/select";
+ Command,
+ CommandEmpty,
+ CommandGroup,
+ CommandInput,
+ CommandItem,
+ CommandList
+} from "./ui/command";
+import { Label } from "./ui/label";
+import { Popover, PopoverContent, PopoverTrigger } from "./ui/popover";
import { Separator } from "./ui/separator";
import { getSevenDaysAgo } from "@app/lib/getSevenDaysAgo";
import { HorizontalTabs, type TabItem } from "./HorizontalTabs";
@@ -161,7 +164,7 @@ export function AiUsageAnalyticsData(props: AiUsageAnalyticsDataProps) {
return (
-
+
setFilter("virtualApiKeyId", v)}
/>
- {!isEmptySearchParams && (
+
+ {!isEmptySearchParams && (
+
+ )}
+
- )}
-
-
+
@@ -287,29 +292,93 @@ type FilterSelectProps = {
};
function FilterSelect(props: FilterSelectProps) {
+ const t = useTranslations();
+ const [open, setOpen] = useState(false);
+ const selected = props.options.find(
+ (option) => option.value === props.value
+ );
+
return (
-
+
-
+
+
+
+
+
+
+
+
+
+ {t("aiUsageFilterNotFound")}
+
+
+ {
+ props.onValueChange(undefined);
+ setOpen(false);
+ }}
+ >
+
+ {props.placeholder}
+
+ {props.options.map((option) => (
+ {
+ props.onValueChange(
+ option.value === props.value
+ ? undefined
+ : option.value
+ );
+ setOpen(false);
+ }}
+ >
+
+
+ {option.label}
+
+
+ ))}
+
+
+
+
+
);
}