🐛 filter by resource UI

This commit is contained in:
Fred KISSIE
2025-11-21 03:05:40 +01:00
parent 87a0dd2d12
commit d41bd3023f

View File

@@ -170,13 +170,21 @@ export function LogAnalyticsData(props: AnalyticsContentProps) {
const newSearch = new URLSearchParams(
searchParams
);
newSearch.set("resourceId", newValue);
newSearch.delete("resourceId");
if (newValue !== "all") {
newSearch.set(
"resourceId",
newValue
);
}
router.replace(
`${path}?${newSearch.toString()}`
);
}}
value={filters.resourceId?.toString()}
value={
filters.resourceId?.toString() ?? "all"
}
>
<SelectTrigger
id="resourceId"
@@ -195,6 +203,9 @@ export function LogAnalyticsData(props: AnalyticsContentProps) {
{resource.name}
</SelectItem>
))}
<SelectItem value="all">
All resources
</SelectItem>
</SelectContent>
</Select>
</div>