diff --git a/AppImage/components/notification-settings.tsx b/AppImage/components/notification-settings.tsx index 6e63905e..8fa1216f 100644 --- a/AppImage/components/notification-settings.tsx +++ b/AppImage/components/notification-settings.tsx @@ -244,16 +244,39 @@ export function NotificationSettings() { setTesting(channel) setTestResult(null) try { - const data = await fetchApi<{ success: boolean; message: string }>("/api/notifications/test", { + const data = await fetchApi<{ + success: boolean + message?: string + error?: string + results?: Record + }>("/api/notifications/test", { method: "POST", body: JSON.stringify({ channel }), }) - setTestResult({ channel, success: data.success, message: data.message }) + + // Extract message from the results object if present + let message = data.message || "" + if (!message && data.results) { + const channelResult = data.results[channel] + if (channelResult) { + message = channelResult.success + ? "Test notification sent successfully" + : channelResult.error || "Test failed" + } + } + if (!message && data.error) { + message = data.error + } + if (!message) { + message = data.success ? "Test notification sent successfully" : "Test failed" + } + + setTestResult({ channel, success: data.success, message }) } catch (err) { setTestResult({ channel, success: false, message: String(err) }) } finally { setTesting(null) - setTimeout(() => setTestResult(null), 5000) + setTimeout(() => setTestResult(null), 8000) } } @@ -577,6 +600,7 @@ matcher: proxmenux-pbs Channels +
@@ -935,7 +959,7 @@ matcher: proxmenux-pbs {/* Test Result */} {testResult && ( -
{testResult.message}
)} +
{/* close bordered channel container */} - {/* ── Severity Filter ── */} -
+ {/* ── Filters ── */} +
- Severity Filter + Filters & Events +
+
+ {/* Severity */} +
+ +
- -
- {/* ── Event Categories ── */} -
-
- - Event Categories -
+ {/* Event Categories */} +
+
{EVENT_CATEGORIES.map(cat => (
+
+
{/* close bordered filters container */}
{/* ── Proxmox Webhook ── */} -
+
+
+ + Proxmox Webhook +
+
- - Proxmox Webhook + PVE Webhook Configuration
{!editMode && (
+
{/* close bordered webhook container */} {/* PBS manual guide (collapsible) */}