From 1a395783b03572f95cd3d492b75a0e4072d2d6f4 Mon Sep 17 00:00:00 2001 From: headlessdev Date: Tue, 29 Apr 2025 22:40:07 +0200 Subject: [PATCH] Add Echobell notification fields and i18n support in settings --- app/dashboard/settings/Settings.tsx | 32 ++++++++++++++++++++++++++++- i18n/languages/de.json | 5 +++++ i18n/languages/en.json | 5 +++++ 3 files changed, 41 insertions(+), 1 deletion(-) diff --git a/app/dashboard/settings/Settings.tsx b/app/dashboard/settings/Settings.tsx index b3a8e3c..6c8ca22 100644 --- a/app/dashboard/settings/Settings.tsx +++ b/app/dashboard/settings/Settings.tsx @@ -22,6 +22,7 @@ import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert" import { AlertCircle, Check, Palette, User, Bell, AtSign, Send, MessageSquare, Trash2, Play, Languages } from "lucide-react" import { Toaster } from "@/components/ui/sonner" import { toast } from "sonner" +import { Textarea } from "@/components/ui/textarea" import { AlertDialog, @@ -35,7 +36,6 @@ import { } from "@/components/ui/alert-dialog" import { Label } from "@/components/ui/label" import { Checkbox } from "@/components/ui/checkbox" -import { Textarea } from "@/components/ui/textarea" import { useTranslations } from "next-intl" interface NotificationsResponse { @@ -82,6 +82,8 @@ export default function Settings() { const [pushoverUrl, setPushoverUrl] = useState("") const [pushoverToken, setPushoverToken] = useState("") const [pushoverUser, setPushoverUser] = useState("") + const [echobellURL, setEchobellURL] = useState("") + const [echobellData, setEchobellData] = useState("") const [language, setLanguage] = useState("english") const [notifications, setNotifications] = useState([]) @@ -190,6 +192,8 @@ export default function Settings() { pushoverUrl: pushoverUrl, pushoverToken: pushoverToken, pushoverUser: pushoverUser, + echobellURL: echobellURL, + echobellData: echobellData, }) getNotifications() } catch (error: any) { @@ -514,6 +518,7 @@ export default function Settings() { {t('Settings.Notifications.AddNotification.Gotify.Title')} {t('Settings.Notifications.AddNotification.Ntfy.Title')} {t('Settings.Notifications.AddNotification.Pushover.Title')} + {t('Settings.Notifications.AddNotification.Echobell.Title')} {notificationType === "smtp" && ( @@ -685,6 +690,31 @@ export default function Settings() { )} + + {notificationType === "echobell" && ( +
+
+ + setEchobellURL(e.target.value)} + /> +
+
+ +