fixes and improvements
This commit is contained in:
@@ -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,
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user