Uncommented hooks

This commit is contained in:
2023-03-21 20:09:03 +01:00
parent e54129908d
commit 5078bc759a
2 changed files with 57 additions and 113 deletions

View File

@@ -16,27 +16,27 @@ interface GetNodeResp {
}
export function useNodes() {
// const http = useAuthStore((state) => state.http);
const http = useAuthStore((state) => state.http);
return useQuery(
["nodes"],
async () => {
// return http.get<GetNodeResp>("/api2/json/nodes")
return {
data: {
data: [
{
cpu: 0.0166442953020134,
mem: 21713018880,
maxmem: 29306216448,
uptime: 4854322,
status: "online",
maxcpu: 12,
node: "pve",
},
] as ProxmoxNode[],
},
isSuccess: true,
};
return http.get<GetNodeResp>("/api2/json/nodes");
// return {
// data: {
// data: [
// {
// cpu: 0.0166442953020134,
// mem: 21713018880,
// maxmem: 29306216448,
// uptime: 4854322,
// status: "online",
// maxcpu: 12,
// node: "pve",
// },
// ] as ProxmoxNode[],
// },
// isSuccess: true,
// };
},
{ select: (data) => data.data.data, refetchInterval: 6000 }
);