fixes and improvements

This commit is contained in:
2026-05-06 16:33:02 +02:00
parent d8d80867ce
commit 5277f21577
20 changed files with 577 additions and 222 deletions
+9 -9
View File
@@ -6,26 +6,26 @@ import {
fetchMonitoringOverview,
} from "../api/client";
export function useCounts() {
export function useCounts(machineId?: string) {
return useQuery({
queryKey: ["dashboard", "counts"],
queryFn: fetchCounts,
queryKey: ["dashboard", "counts", machineId ?? "default"],
queryFn: () => fetchCounts(machineId),
staleTime: 5 * 60 * 1000,
});
}
export function useLibraries() {
export function useLibraries(machineId?: string) {
return useQuery({
queryKey: ["dashboard", "libraries"],
queryFn: fetchLibraries,
queryKey: ["dashboard", "libraries", machineId ?? "default"],
queryFn: () => fetchLibraries(machineId),
staleTime: 5 * 60 * 1000,
});
}
export function useActivity() {
export function useActivity(machineId?: string) {
return useQuery({
queryKey: ["dashboard", "activity"],
queryFn: fetchActivity,
queryKey: ["dashboard", "activity", machineId ?? "default"],
queryFn: () => fetchActivity(machineId),
refetchInterval: 15_000,
});
}