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 svgIcon = (paths: string, cls = 'icon', viewBox = '0 0 24 24') => ``; const sparkline = (cls: string, stroke: string, d: string) => ``; const icons = { overview: svgIcon(``), tickets: svgIcon(``), automod: svgIcon(``), welcome: svgIcon(``), dynamicvoice: svgIcon(``), birthday: svgIcon(``), reactionroles: svgIcon(``), statuspage: svgIcon(``), serverstats: svgIcon(``), settings: svgIcon(``), modules: svgIcon(``), events: svgIcon(``), admin: svgIcon(``), owner: svgIcon(``, 'metric-icon owner'), created: svgIcon(``, 'metric-icon created'), members: svgIcon(``, 'metric-icon members'), channels: svgIcon(``, 'metric-icon channels'), open: svgIcon(``, 'metric-icon open'), closed: svgIcon(``, 'metric-icon closed'), message: svgIcon(``, 'activity-icon-svg message'), command: svgIcon(``, 'activity-icon-svg command'), shield: svgIcon(``, 'activity-icon-svg shield'), arrow: svgIcon(``, 'button-icon'), list: svgIcon(``, 'button-icon'), bot: svgIcon(``, 'status-bot'), logout: svgIcon(``, 'button-icon') }; const sidebar = ` `; if (!guildId) { res.send(` Papo Dashboard - Auswahl
${sidebar}

Wähle einen Server aus

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

Guild Dashboard

Dashboard & Guild-Config

Guild

icon

Guild

ID: -

${icons.bot} Bot aktiv

Guild Infos

${icons.owner}
Owner
-
${icons.created}
Erstellt
-
${icons.members}
Member
-
${icons.channels}
Channels
-
${icons.open}
Tickets offen
-
${icons.closed}
Tickets IP / Closed
- / -

Activity

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

Guild Logs

    Schnellzugriff

    Wichtige Funktionen auf einen Blick

    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 fr Ticket-Aktionen.

    Regel bearbeiten

    Knowledge-Base

    Artikel fr Self-Service.

    Automod Einstellungen

    Automod pro Guild aktivieren und Regeln konfigurieren.

    Automod aktivieren

    Diese Wörter werden zusätzlich zum Standard-Filter geblockt.

    Nachrichten von diesen Rollen werden nicht gefiltert.

    Willkommensnachrichten

    Embed konfigurieren und Feature aktivieren.

    Aktivieren
    Willkommen!
    Schön, dass du da bist.

    Dynamic Voice

    Lobby wählen, Channel-Namen & Limits setzen.

    Aktivieren

    {user} wird durch den Mitgliedsnamen ersetzt.

    Module

    Birthday

    Automatische Glückwünsche je Server.

    Nutze {user} als Platzhalter.

    Gespeicherte Geburtstage

    Einträge werden per /birthday angelegt.

    Reaction Roles

    Reaktionen verteilen oder entfernen Rollen.

    Eine Zeile pro Zuordnung. Label/Beschreibung optional.

    Reaction Role Nachrichten

    Bestehende Setups bearbeiten oder syncen.

    Statuspage

    Services verwalten und Checks steuern.

    Services

    Status, Uptime, letzter Check

    Server Stats

    Kategorie und Counter verwalten.

    Statistiken

    Counter und Format anpassen.

    Events

    Termine planen und Erinnerungen senden.

    Guilds

    -

    aktiv (24h): -

    Uptime

    -

    Start: -

    Aktivität (letzte 24h)

    Events/Commands pro Stunde

    Logs

    Neueste Einträge

      Einstellungen speichern

      Logging

      Falls leer, wird der allgemeine Log Channel genutzt.

      👋 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;