feat(dashboard): expand stats & remove admin token auth

This commit is contained in:
syntaxbullet
2026-01-08 22:14:13 +01:00
parent cf4c28e1df
commit d46434de18
10 changed files with 257 additions and 330 deletions

View File

@@ -25,12 +25,7 @@ export function useActivityStats(): UseActivityStatsResult {
const fetchActivity = async () => {
setLoading(true);
try {
const token = (window as any).AURORA_ENV?.ADMIN_TOKEN;
const response = await fetch("/api/stats/activity", {
headers: {
"Authorization": `Bearer ${token}`
}
});
const response = await fetch("/api/stats/activity");
if (!response.ok) throw new Error(`HTTP error! status: ${response.status}`);
const jsonData = await response.json();
setData(jsonData);

View File

@@ -22,6 +22,17 @@ interface DashboardStats {
totalWealth: string;
avgLevel: number;
topStreak: number;
totalItems: number;
};
activeLootdrops: Array<{
rewardAmount: number;
currency: string;
createdAt: string;
expiresAt: string | null;
}>;
leaderboards: {
topLevels: Array<{ username: string; level: number | null }>;
topWealth: Array<{ username: string; balance: string }>;
};
recentEvents: Array<{
type: 'success' | 'error' | 'info' | 'warn';