From 2b8f7a95d2b11d7683e8309f6738a8173cd31c18 Mon Sep 17 00:00:00 2001 From: headlessdev Date: Sat, 19 Apr 2025 13:20:04 +0200 Subject: [PATCH] Add Gotify and Ntfy configuration fields to Settings component for enhanced notification options --- app/dashboard/settings/Settings.tsx | 56 +++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/app/dashboard/settings/Settings.tsx b/app/dashboard/settings/Settings.tsx index efaaf2a..dca5d80 100644 --- a/app/dashboard/settings/Settings.tsx +++ b/app/dashboard/settings/Settings.tsx @@ -69,6 +69,10 @@ export default function Settings() { const [telegramToken, setTelegramToken] = useState("") const [telegramChatId, setTelegramChatId] = useState("") const [discordWebhook, setDiscordWebhook] = useState("") + const [gotifyUrl, setGotifyUrl] = useState("") + const [gotifyToken, setGotifyToken] = useState("") + const [ntfyUrl, setNtfyUrl] = useState("") + const [ntfyToken, setNtfyToken] = useState("") const [notifications, setNotifications] = useState([]) @@ -168,6 +172,10 @@ export default function Settings() { telegramToken: telegramToken, telegramChatId: telegramChatId, discordWebhook: discordWebhook, + gotifyUrl: gotifyUrl, + gotifyToken: gotifyToken, + ntfyUrl: ntfyUrl, + ntfyToken: ntfyToken, }) getNotifications() } catch (error: any) { @@ -424,6 +432,8 @@ export default function Settings() { SMTP Telegram Discord + Gotify + Ntfy {notificationType === "smtp" && ( @@ -538,6 +548,52 @@ export default function Settings() { )} + + {notificationType === "gotify" && ( +
+
+ + setGotifyUrl(e.target.value)} + /> +
+ + setGotifyToken(e.target.value)} + /> +
+
+
+ )} + + {notificationType === "ntfy" && ( +
+
+ + setNtfyUrl(e.target.value)} + /> +
+ + setNtfyToken(e.target.value)} + /> +
+
+
+ )}