From 7208d5b2bf8218d78f011b7724f6ab029c228cf8 Mon Sep 17 00:00:00 2001 From: MacRimi Date: Thu, 19 Feb 2026 19:56:20 +0100 Subject: [PATCH] Update notification service --- AppImage/components/notification-settings.tsx | 168 ++++++----- AppImage/scripts/flask_notification_routes.py | 266 +++++++++++------- 2 files changed, 262 insertions(+), 172 deletions(-) diff --git a/AppImage/components/notification-settings.tsx b/AppImage/components/notification-settings.tsx index 90f8d47d..6e63905e 100644 --- a/AppImage/components/notification-settings.tsx +++ b/AppImage/components/notification-settings.tsx @@ -12,7 +12,8 @@ import { fetchApi } from "../lib/api-config" import { Bell, BellOff, Send, CheckCircle2, XCircle, Loader2, AlertTriangle, Info, Settings2, Zap, Eye, EyeOff, - Trash2, ChevronDown, ChevronUp, TestTube2, Mail, Webhook + Trash2, ChevronDown, ChevronUp, TestTube2, Mail, Webhook, + Copy, Server, Shield } from "lucide-react" interface ChannelConfig { @@ -45,6 +46,9 @@ interface NotificationConfig { hostname: string webhook_secret: string webhook_allowed_ips: string + pbs_host: string + pve_host: string + pbs_trusted_sources: string } interface ServiceStatus { @@ -109,6 +113,9 @@ const DEFAULT_CONFIG: NotificationConfig = { hostname: "", webhook_secret: "", webhook_allowed_ips: "", + pbs_host: "", + pve_host: "", + pbs_trusted_sources: "", } export function NotificationSettings() { @@ -198,6 +205,18 @@ export function NotificationSettings() { const handleSave = async () => { setSaving(true) try { + // If notifications are being disabled, clean up PVE webhook first + const wasEnabled = originalConfig.enabled + const isNowDisabled = !config.enabled + + if (wasEnabled && isNowDisabled) { + try { + await fetchApi("/api/notifications/proxmox/cleanup-webhook", { method: "POST" }) + } catch { + // Non-fatal: webhook cleanup failed but we still save settings + } + } + await fetchApi("/api/notifications/settings", { method: "POST", body: JSON.stringify(config), @@ -581,9 +600,8 @@ matcher: proxmenux-pbs - )} + + )} @@ -648,9 +669,8 @@ matcher: proxmenux-pbs - )} + + )} @@ -715,9 +738,8 @@ matcher: proxmenux-pbs - )} + + )} @@ -772,9 +798,8 @@ matcher: proxmenux-pbs