import { BaseLayout } from "../views/layout"; import { AuroraClient } from "@/lib/BotClient"; export function dashboardRoute(): Response { // Gather real data where possible, mock where not const guildCount = AuroraClient.guilds.cache.size; const userCount = AuroraClient.guilds.cache.reduce((acc, guild) => acc + guild.memberCount, 0); // Approximation const commandCount = AuroraClient.commands.size; const ping = AuroraClient.ws.ping; // In a real app, these would be dynamic charts or lists const mockedActivity = [ { time: "10:42:01", type: "info", message: "User 'Syntax' ran /profile" }, { time: "10:41:55", type: "success", message: "Task 'HourlyCleanup' completed" }, { time: "10:40:12", type: "warning", message: "API Latency spike detected (150ms)" }, { time: "10:39:00", type: "info", message: "Bot connected to Gateway" }, ]; const content = `

Servers

${guildCount}

Users

${userCount}

Commands

${commandCount}

Ping

${ping < 0 ? "?" : ping}ms

Live Activity

LIVE
    ${mockedActivity.map(log => `
  • ${log.time} ${log.message}
  • `).join('')}
  • --:--:-- Waiting for events...

System Metrics

CPU Load (Mock)

Quick Actions

`; const html = BaseLayout({ title: "Dashboard", content }); return new Response(html, { headers: { "Content-Type": "text/html" }, }); }