refactor(serverlist): refactored to also show uptime and other info about the server

This commit is contained in:
2025-10-31 07:14:11 -05:00
parent d60c08a281
commit e1e659f9b1
8 changed files with 205 additions and 23 deletions

View File

@@ -3,7 +3,7 @@ import axios from "axios";
export function getServers() {
return queryOptions({
queryKey: ["getModules"],
queryKey: ["getServers"],
queryFn: () => fetchSession(),
staleTime: 5000,
refetchOnWindowFocus: true,

View File

@@ -5,13 +5,13 @@ export function getServerStats() {
return queryOptions({
queryKey: ["getServerStats"],
queryFn: () => fetchSession(),
staleTime: 5000,
staleTime: 2 * 60 * 1000,
refetchOnWindowFocus: true,
});
}
const fetchSession = async () => {
const { data } = await axios.get(`/lst/api/system/stats`);
const { data } = await axios.get(`/lst/api/system/allservers/stats`);
return data;
};