import { Router } from 'express'; const router = Router(); router.get('/', (req, res) => { if (!req.session?.user) { const baseRoot = process.env.WEB_BASE_PATH || '/ucp'; return res.redirect(`${baseRoot}/auth/discord`); } const guildId = typeof req.query.guildId === 'string' ? req.query.guildId : ''; const baseRoot = process.env.WEB_BASE_PATH || '/ucp'; const baseDashboard = `${baseRoot}/dashboard`; const baseAuth = `${baseRoot}/auth`; const baseApi = `${baseRoot}/api`; const baseScript = ` const BASE_ROOT = '${baseRoot}'; const BASE_DASH = '${baseDashboard}'; const BASE_API = '${baseApi}'; const BASE_AUTH = '${baseAuth}'; const prependBase = (url) => { if (typeof url !== 'string') return url; if (BASE_ROOT && url.startsWith(BASE_ROOT + '/')) return url; if (url.startsWith('/')) return (BASE_ROOT || '') + url; return url; }; const _fetch = window.fetch.bind(window); window.fetch = (u, o) => _fetch(prependBase(u), o); const gotoDashboard = (guildId) => { const qs = guildId ? ('?guildId=' + encodeURIComponent(guildId)) : ''; window.location.href = (BASE_DASH || '/dashboard') + qs; }; `; // TODO: TICKETS: Dashboard-Layout neu aufsetzen. // - Filter/Status/Live-Ansicht statt statischem Inline-HTML. // - Ticketdaten per API/WebSocket laden und live aktualisieren. // TODO: MODULE: Musik-Modul als toggelbares Modul mit Status- und Queue-Ansicht einbinden. // - Play/Pause/Skip/Loop als UI-Controls anbieten und Bot-Status spiegeln. // TODO: AUTOMOD: Konfiguration (Schwellenwerte, Filter, Logging) im Dashboard editierbar machen. // - Grenzwerte, Whitelist/Badwords und Log-Ziel in ein Formular ueberfuehren. const sidebar = ` `; if (!guildId) { res.send(` Papo Dashboard - Auswahl
${sidebar}

Waehle eine Guild aus

Nur Guilds, auf denen der Bot ist.
`); return; } res.send(` Papo Dashboard
${sidebar}

Guild Dashboard

Dashboard & Guild-Config

Guild

icon

Guild

ID: -

Bot aktiv

Guild Infos

Owner
-
Erstellt
-
Member
-
Channels
-
Tickets offen
-
Tickets IP / Closed
- / -

Activity

Messages (24h)
-
Commands (24h)
-
Automod (24h)
-

Guild Logs

    Tickets

    Übersicht, Pipeline, SLA, Automationen, Knowledge-Base.

    Ticketliste

    Links auswählen, Details im Modal. Plus öffnet Panel-Erstellung.

    Support-Login Status

    Aktive Supporter und letzte Sessions.

    Aktiv

    Letzte Sessions

    Status-Pipeline

    Tickets nach Phase. Status per Dropdown ändern.

    Neu

    In Bearbeitung

    Warten auf User

    Erledigt

    SLA / Response-Zeiten

    Average Time to Claim / First Response.

    SLA pro Supporter

    SupporterTicketsTTCTTFR

    SLA pro Tag

    DatumTicketsTTCTTFR

    Automationen

    Regeln für Ticket-Aktionen.

    Regel bearbeiten

    Knowledge-Base

    Artikel für Self-Service.

    Automod Einstellungen

    Automod pro Guild aktivieren und Regeln konfigurieren.

    Automod aktivieren
    👋 User Join / Leave
    ✏️ Message Edit
    🗑️ Message Delete
    🛡️ Automod Actions
    🎫 Ticket Actions
    🎵 Musik-Events
    🛰️ System / Channels

    `); }); router.get('/settings', (_req, res) => { res.json({ settings: [] }); }); export default router;