feat(homelab)!: create interface for homelab management, use templating for route generation & support more options and route types
This commit is contained in:
14
nix/homelab/frontend/src/lib/minecraft/stats.ts
Normal file
14
nix/homelab/frontend/src/lib/minecraft/stats.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
type StatsResponse = {
|
||||
status: string;
|
||||
players_online: number;
|
||||
max_players: number;
|
||||
uptime: string;
|
||||
world_size: string;
|
||||
};
|
||||
|
||||
export const fetchStats = async () => {
|
||||
const response = await fetch(
|
||||
"http://localhost:5173/api/minecraft-server-stats",
|
||||
);
|
||||
return (await response.json()) as StatsResponse;
|
||||
};
|
||||
Reference in New Issue
Block a user