feat(notifications): optional Telegram sender (#1726)

refactor(notifications): optional Telegram sender
This commit is contained in:
martylukyy 2024-09-17 17:07:58 +02:00 committed by GitHub
parent c8e2fba334
commit ec79eafe43
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 22 additions and 6 deletions

View file

@ -146,6 +146,12 @@ function FormFieldsTelegram() {
help="Reverse proxy domain for api.telegram.org, only needs to be specified if the network you are using has blocked the Telegram API."
placeholder="http(s)://ip:port"
/>
<TextFieldWide
name="username"
label="Sender"
help="Custom sender name to show at the top of a notification"
placeholder="autobrr"
/>
</div>
);
}
@ -373,7 +379,8 @@ export function NotificationAddForm({ isOpen, toggle }: AddProps) {
type: "",
name: "",
webhook: "",
events: []
events: [],
username: ""
}}
onSubmit={onSubmit}
validate={validate}
@ -577,6 +584,7 @@ interface InitialValues {
topic?: string;
host?: string;
events: NotificationEvent[];
username?: string
}
export function NotificationUpdateForm({ isOpen, toggle, notification }: UpdateProps) {
@ -626,7 +634,8 @@ export function NotificationUpdateForm({ isOpen, toggle, notification }: UpdateP
channel: notification.channel,
topic: notification.topic,
host: notification.host,
events: notification.events || []
events: notification.events || [],
username: notification.username
};
return (