feat(start of server): added the start of server data

This commit is contained in:
2025-10-30 14:21:00 -05:00
parent d3e8e94110
commit d60c08a281
6 changed files with 332 additions and 6 deletions

View File

@@ -0,0 +1,17 @@
import { queryOptions } from "@tanstack/react-query";
import axios from "axios";
export function getServers() {
return queryOptions({
queryKey: ["getModules"],
queryFn: () => fetchSession(),
staleTime: 5000,
refetchOnWindowFocus: true,
});
}
const fetchSession = async () => {
const { data } = await axios.get("/lst/api/admin/server");
return data.data;
};

View File

@@ -0,0 +1,17 @@
import { queryOptions } from "@tanstack/react-query";
import axios from "axios";
export function getServerStats() {
return queryOptions({
queryKey: ["getServerStats"],
queryFn: () => fetchSession(),
staleTime: 5000,
refetchOnWindowFocus: true,
});
}
const fetchSession = async () => {
const { data } = await axios.get(`/lst/api/system/stats`);
return data;
};