diff --git a/application/public/upload/notification/notifiarr.png b/application/public/upload/notification/notifiarr.png new file mode 100644 index 0000000..ae4d12e Binary files /dev/null and b/application/public/upload/notification/notifiarr.png differ diff --git a/application/src/components/settings/notification-settings/NotificationChannelDialog.tsx b/application/src/components/settings/notification-settings/NotificationChannelDialog.tsx index 7b20f9f..d96622d 100644 --- a/application/src/components/settings/notification-settings/NotificationChannelDialog.tsx +++ b/application/src/components/settings/notification-settings/NotificationChannelDialog.tsx @@ -36,7 +36,7 @@ interface NotificationChannelDialogProps { const baseSchema = z.object({ notify_name: z.string().min(1, "Name is required"), - notification_type: z.enum(["telegram", "discord", "slack", "signal", "google_chat", "email", "ntfy", "pushover", "webhook"]), + notification_type: z.enum(["telegram", "discord", "slack", "signal", "google_chat", "email", "ntfy", "pushover", "notifiarr", "webhook"]), enabled: z.boolean().default(true), service_id: z.string().default("global"), template_id: z.string().optional(), @@ -83,18 +83,23 @@ const ntfySchema = baseSchema.extend({ ntfy_endpoint: z.string().url("Must be a valid NTFY endpoint URL"), }); -const webhookSchema = baseSchema.extend({ - notification_type: z.literal("webhook"), - webhook_url: z.string().url("Must be a valid URL"), - webhook_payload_template: z.string().optional(), -}); - const pushoverSchema = baseSchema.extend({ notification_type: z.literal("pushover"), api_token: z.string().min(1, "API token is required"), user_key: z.string().min(1, "User key is required"), }); +const notifiarrSchema = baseSchema.extend({ + notification_type: z.literal("notifiarr"), + api_token: z.string().min(1, "API token is required"), +}); + +const webhookSchema = baseSchema.extend({ + notification_type: z.literal("webhook"), + webhook_url: z.string().url("Must be a valid URL"), + webhook_payload_template: z.string().optional(), +}); + const formSchema = z.discriminatedUnion("notification_type", [ telegramSchema, discordSchema, @@ -104,6 +109,7 @@ const formSchema = z.discriminatedUnion("notification_type", [ emailSchema, ntfySchema, pushoverSchema, + notifiarrSchema, webhookSchema, ]); @@ -158,6 +164,13 @@ const notificationTypeOptions = [ description: "Send push notifications via Pushover", icon: "/upload/notification/pushover.png" }, + + { + value: "notifiarr", + label: "Notifiarr", + description: "Send notifications via Notifiarr", + icon: "/upload/notification/notifiarr.png" + }, { value: "webhook", label: "Webhook", @@ -620,6 +633,25 @@ export const NotificationChannelDialog = ({ /> )} + + {notificationType === "notifiarr" && ( + ( + + API Token + + + + + Your Notifiarr API token for sending notifications + + + + )} + /> + )} {notificationType === "webhook" && ( <> diff --git a/application/src/components/settings/notification-settings/NotificationChannelList.tsx b/application/src/components/settings/notification-settings/NotificationChannelList.tsx index 6256f3e..8f28596 100644 --- a/application/src/components/settings/notification-settings/NotificationChannelList.tsx +++ b/application/src/components/settings/notification-settings/NotificationChannelList.tsx @@ -67,6 +67,8 @@ export const NotificationChannelList = ({ case "signal": return "Signal"; case "google_chat": return "Google Chat"; case "email": return "Email"; + case "pushover": return "Pushover"; + case "notifiarr": return "Notifiarr"; case "webhook": return "Webhook"; default: return type || "Unknown"; } diff --git a/application/src/services/alertConfigService.ts b/application/src/services/alertConfigService.ts index 83a702c..1147614 100644 --- a/application/src/services/alertConfigService.ts +++ b/application/src/services/alertConfigService.ts @@ -7,7 +7,7 @@ export interface AlertConfiguration { collectionId?: string; collectionName?: string; service_id: string; - notification_type: "telegram" | "discord" | "slack" | "signal" | "google_chat" | "email" | "ntfy" | "pushover" | "webhook"; + notification_type: "telegram" | "discord" | "slack" | "signal" | "google_chat" | "email" | "ntfy" | "pushover" | "notifiarr" | "webhook"; telegram_chat_id?: string; discord_webhook_url?: string; signal_number?: string; @@ -91,6 +91,9 @@ export const alertConfigService = { } else if (config.notification_type === "pushover") { cleanConfig.api_token = config.api_token || ""; cleanConfig.user_key = config.user_key || ""; + + } else if (config.notification_type === "notifiarr") { + cleanConfig.api_token = config.api_token || ""; } else if (config.notification_type === "webhook") { cleanConfig.webhook_url = config.webhook_url || "";