feat(notifications): Add Gotify (#1180)

feat(notifications): Add Gotify (resolves #513)
This commit is contained in:
MouldWarpMole 2023-10-14 12:08:12 +02:00 committed by GitHub
parent 525861074b
commit 77948d7654
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 233 additions and 6 deletions

View file

@ -182,11 +182,36 @@ function FormFieldsPushover() {
);
}
function FormFieldsGotify() {
return (
<div className="border-t border-gray-200 dark:border-gray-700 py-4">
<div className="px-4 space-y-1">
<Dialog.Title className="text-lg font-medium text-gray-900 dark:text-white">Settings</Dialog.Title>
</div>
<TextFieldWide
name="host"
label="Gotify URL"
help="Gotify URL"
placeholder="https://some.gotify.server.com"
required={true}
/>
<PasswordFieldWide
name="token"
label="Application Token"
help="Application Token"
required={true}
/>
</div>
);
}
const componentMap: componentMapType = {
DISCORD: <FormFieldsDiscord />,
NOTIFIARR: <FormFieldsNotifiarr />,
TELEGRAM: <FormFieldsTelegram />,
PUSHOVER: <FormFieldsPushover />
PUSHOVER: <FormFieldsPushover />,
GOTIFY: <FormFieldsGotify />
};
interface NotificationAddFormValues {
@ -464,6 +489,7 @@ interface InitialValues {
priority?: number;
channel?: string;
topic?: string;
host?: string;
events: NotificationEvent[];
}
@ -513,6 +539,7 @@ export function NotificationUpdateForm({ isOpen, toggle, notification }: UpdateP
priority: notification.priority,
channel: notification.channel,
topic: notification.topic,
host: notification.host,
events: notification.events || []
};