diff --git a/AppImage/components/notification-settings.tsx b/AppImage/components/notification-settings.tsx index d8b1bc57..1bf241aa 100644 --- a/AppImage/components/notification-settings.tsx +++ b/AppImage/components/notification-settings.tsx @@ -224,17 +224,17 @@ export function NotificationSettings() { } /** Reusable 10+1 category block rendered inside each channel tab. */ - const renderChannelCategories = (chName: string, accentColor: string) => { + const renderChannelCategories = (chName: string) => { const overrides = config.channel_overrides?.[chName] || { categories: {}, events: {} } const evtByGroup = config.event_types_by_group || {} return (
- +
-
+
{EVENT_CATEGORIES.map(cat => { const isEnabled = overrides.categories[cat.key] ?? true const isExpanded = expandedCategories.has(`${chName}.${cat.key}`) @@ -244,58 +244,58 @@ export function NotificationSettings() { ).length return ( -
-
- +
+ {/* Category row -- entire block is clickable to expand/collapse */} +
{ + if (!isEnabled) return + setExpandedCategories(prev => { + const next = new Set(prev) + const key = `${chName}.${cat.key}` + if (next.has(key)) next.delete(key) + else next.add(key) + return next + }) + }} + > + {/* Expand arrow */} + + {/* Label */}
- {cat.label} - {cat.desc}
+ {/* Count badge */} {isEnabled && eventsForGroup.length > 0 && ( - + {enabledCount}/{eventsForGroup.length} )} + {/* Toggle -- same style as channel enable toggle */}
+ {/* Sub-event toggles */} {isEnabled && isExpanded && eventsForGroup.length > 0 && ( -
+
{eventsForGroup.map(evt => { const evtEnabled = overrides.events?.[evt.type] ?? evt.default_enabled return ( -
- +
+ {evt.title}
@@ -876,7 +877,7 @@ matcher: proxmenux-pbs onChange={e => updateChannel("telegram", "chat_id", e.target.value)} />
- {renderChannelCategories("telegram", "blue")} + {renderChannelCategories("telegram")} {/* Per-channel action bar */}
- {renderChannelCategories("gotify", "green")} + {renderChannelCategories("gotify")} {/* Per-channel action bar */}
- {renderChannelCategories("discord", "indigo")} + {renderChannelCategories("discord")} {/* Per-channel action bar */}
- {renderChannelCategories("email", "amber")} + {renderChannelCategories("email")} {/* Per-channel action bar */}
- {/* ── Proxmox Webhook ── */} -
-
- - Proxmox Webhook -
-
-
-
- PVE Webhook Configuration -
- {!editMode && ( - - )} -
- - {/* Setup status inline */} - {webhookSetup.status === "success" && ( -
- -

PVE webhook configured successfully.

-
- )} - {webhookSetup.status === "failed" && ( -
-
- -

PVE auto-config failed: {webhookSetup.error}

-
- {webhookSetup.fallback_commands.length > 0 && ( -
-{webhookSetup.fallback_commands.join('\n')}
-                    
- )} -
- )} - -
- -
- updateConfig(p => ({ ...p, webhook_secret: e.target.value }))} - disabled={!editMode} - /> - -
-

- {"Used for remote connections only (e.g. PBS on another host). Local PVE webhook runs on localhost and does not need this header."} -

-
-
- - updateConfig(p => ({ ...p, webhook_allowed_ips: e.target.value }))} - disabled={!editMode} - /> -

- {"Localhost (127.0.0.1) is always allowed. This restricts remote callers only."} -

-
-
{/* close bordered webhook container */} - - {/* PBS manual guide (collapsible) */} -
- - - Configure PBS notifications (manual) - -
-

- Backups launched from PVE are covered by the PVE webhook. PBS internal jobs - (Verify, Prune, GC, Sync) require separate configuration on the PBS server. -

-

- Append to /etc/proxmox-backup/notifications.cfg: -

-
-{`webhook: proxmenux-webhook
-\tmethod post
-\turl http://:8008/api/notifications/webhook
-
-matcher: proxmenux-pbs
-\ttarget proxmenux-webhook
-\tmatch-severity warning,error`}
-                  
-

- {"Replace with this node's IP. Append at the end -- do not delete existing content."} -

-
-
-
- {/* ── Advanced: AI Enhancement ── */}
- {showHistory && ( -
- {history.length === 0 ? ( -

No notifications sent yet

- ) : ( - <> -
- -
-
- {history.map(entry => ( -
- {entry.success ? ( - - ) : ( - - )} -
- {entry.title || entry.event_type} - - {entry.channel} - {new Date(entry.sent_at).toLocaleString()} - -
- - {entry.severity} - -
- ))} -
- - )} -
- )} -
)} @@ -1492,7 +1299,7 @@ matcher: proxmenux-pbs

{config.enabled - ? "Notifications are active. Events matching your severity filter and category selection will be sent to configured channels." + ? "Notifications are active. Each channel sends events based on its own category and event selection." : "Enable notifications to receive alerts about system events, health status changes, and security incidents via Telegram, Gotify, Discord, or Email."}