diff --git a/frontend/src/api/endpoints.ts b/frontend/src/api/endpoints.ts index 63e5b588..52488544 100644 --- a/frontend/src/api/endpoints.ts +++ b/frontend/src/api/endpoints.ts @@ -9,14 +9,13 @@ interface CombatStatsResponse { stats: CombatStatsMessage[]; } -interface CountResponse { - total_rares?: number; - total_kills?: number; - count?: number; -} +// v1 response shapes: /total-rares โ†’ { all_time, today }, /total-kills โ†’ { total } +interface RaresResponse { all_time: number; today: number; } +interface KillsResponse { total: number; } export const getLive = () => apiFetch('/live'); export const getCombatStats = () => apiFetch('/combat-stats'); export const getServerHealth = () => apiFetch('/server-health'); -export const getTotalRares = () => apiFetch('/total-rares'); -export const getTotalKills = () => apiFetch('/total-kills'); +export const getTotalRares = () => apiFetch('/total-rares'); +export const getTotalKills = () => apiFetch('/total-kills'); +export const getCharacterStats = (name: string) => apiFetch>(`/character-stats/${encodeURIComponent(name)}`); diff --git a/frontend/src/components/map/MapLayout.tsx b/frontend/src/components/map/MapLayout.tsx index a4be9fbd..b4f377d6 100644 --- a/frontend/src/components/map/MapLayout.tsx +++ b/frontend/src/components/map/MapLayout.tsx @@ -57,7 +57,7 @@ export const MapLayout: React.FC = ({ data, onViewToggle }) => { showHeatmap={showHeatmap} showPortals={showPortals} /> - + diff --git a/frontend/src/components/map/Sidebar.tsx b/frontend/src/components/map/Sidebar.tsx index 54598cb7..e43a6d10 100644 --- a/frontend/src/components/map/Sidebar.tsx +++ b/frontend/src/components/map/Sidebar.tsx @@ -58,8 +58,12 @@ export const Sidebar: React.FC = ({
- Coldeve - {serverHealth?.latency_ms != null && {serverHealth.latency_ms}ms} + Coldeve {isOnline ? 'Online' : 'Offline'} + {serverHealth?.player_count != null && ๐Ÿ‘ฅ {serverHealth.player_count}} + {serverHealth?.latency_ms != null && {Math.round(serverHealth.latency_ms)}ms} + {serverHealth?.uptime_seconds != null && ( + Up: {Math.floor(serverHealth.uptime_seconds / 3600)}h + )}
@@ -68,6 +72,13 @@ export const Sidebar: React.FC = ({
{totalKills.toLocaleString()}Kills
+ {/* Tool links */} + + {/* Map toggles */}