- Add SystemOverview component and related hooks;

- update Dashboard layout and introduce new UI components
This commit is contained in:
2026-01-07 16:18:14 +00:00
parent a33fd976eb
commit 97818ca8d9
12 changed files with 279 additions and 5 deletions

View File

@@ -0,0 +1,21 @@
import { useQuery } from "@tanstack/react-query";
import { cambase } from "../../../app/config";
const fetchSystemHealth = async () => {
const response = await fetch(`${cambase}/api/system-health`);
if (!response.ok) throw new Error("Network response was not ok");
return response.json();
};
export const useGetSystemHealth = () => {
const systemHealthQuery = useQuery({
queryKey: ["systemHealth"],
queryFn: fetchSystemHealth,
refetchInterval: 60000,
refetchOnWindowFocus: false,
retry: false,
staleTime: 30000,
});
return { systemHealthQuery };
};