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