Dashboard: Telegram-Verknüpfung Button + Modal
- Session-Card-Menü: 'Telegram verknüpfen' zwischen Chat öffnen und Bearbeiten - Button nur sichtbar wenn Telegram Bot konfiguriert (GET /api/telegram/status) - Klick generiert 6-stelligen Link-Code (POST /api/telegram/link) - Modal zeigt '/link CODE' mit Copy-Button, 5 Min gültig - Neuer Backend-Endpoint GET /api/telegram/status (IsConfigured) - API-Funktionen: apiTelegramStatus(), apiTelegramLink() - Modal-CSS nach bestehendem .fe-overlay Pattern
This commit is contained in:
1 parent
24d818f5d2
commit
7d237c866a
4 files changed
+161
No files matched your search
@@ -22,6 +22,9 @@ public static class TelegramEndpoint
|
||||
// Webhook registrieren (Admin)
|
||||
app.MapPost("/api/telegram/register-webhook", HandleRegisterWebhook);
|
||||
|
||||
// Telegram-Status (ob konfiguriert – für Frontend)
|
||||
app.MapGet("/api/telegram/status", HandleStatus);
|
||||
|
||||
// Webhook-Info (Admin)
|
||||
app.MapGet("/api/telegram/webhook-info", HandleWebhookInfo);
|
||||
}
|
||||
@@ -115,6 +118,11 @@ public static class TelegramEndpoint
|
||||
await res.WriteAsJsonAsync(new { result });
|
||||
}
|
||||
|
||||
private static async Task HandleStatus(HttpResponse res, TelegramService telegram)
|
||||
{
|
||||
await res.WriteAsJsonAsync(new { configured = telegram.IsConfigured });
|
||||
}
|
||||
|
||||
private static async Task HandleWebhookInfo(HttpRequest req, HttpResponse res, TelegramService telegram)
|
||||
{
|
||||
if (!req.HttpContext.IsAdmin())
|
||||
|
||||
Reference in new issue
Block a user