refactor(serverlist): refactored to also show uptime and other info about the server
This commit is contained in:
@@ -3,7 +3,7 @@ import axios from "axios";
|
||||
|
||||
export function getServers() {
|
||||
return queryOptions({
|
||||
queryKey: ["getModules"],
|
||||
queryKey: ["getServers"],
|
||||
queryFn: () => fetchSession(),
|
||||
staleTime: 5000,
|
||||
refetchOnWindowFocus: true,
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user