feat: Add channel_id field for Notifiarr
- Add channel_id field for Notifiarr to store record of the discord channel_id into the PB.
This commit is contained in:
+19
@@ -92,6 +92,7 @@ const pushoverSchema = baseSchema.extend({
|
|||||||
const notifiarrSchema = baseSchema.extend({
|
const notifiarrSchema = baseSchema.extend({
|
||||||
notification_type: z.literal("notifiarr"),
|
notification_type: z.literal("notifiarr"),
|
||||||
api_token: z.string().min(1, "API token is required"),
|
api_token: z.string().min(1, "API token is required"),
|
||||||
|
channel_id: z.string().min(1, "Channel ID is required"),
|
||||||
});
|
});
|
||||||
|
|
||||||
const webhookSchema = baseSchema.extend({
|
const webhookSchema = baseSchema.extend({
|
||||||
@@ -635,6 +636,7 @@ export const NotificationChannelDialog = ({
|
|||||||
)}
|
)}
|
||||||
|
|
||||||
{notificationType === "notifiarr" && (
|
{notificationType === "notifiarr" && (
|
||||||
|
<>
|
||||||
<FormField
|
<FormField
|
||||||
control={form.control}
|
control={form.control}
|
||||||
name="api_token"
|
name="api_token"
|
||||||
@@ -651,6 +653,23 @@ export const NotificationChannelDialog = ({
|
|||||||
</FormItem>
|
</FormItem>
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
|
<FormField
|
||||||
|
control={form.control}
|
||||||
|
name="channel_id"
|
||||||
|
render={({ field }) => (
|
||||||
|
<FormItem>
|
||||||
|
<FormLabel>Channel ID</FormLabel>
|
||||||
|
<FormControl>
|
||||||
|
<Input placeholder="Discord Channel ID" {...field} />
|
||||||
|
</FormControl>
|
||||||
|
<FormDescription>
|
||||||
|
The Discord channel ID where notifications will be sent
|
||||||
|
</FormDescription>
|
||||||
|
<FormMessage />
|
||||||
|
</FormItem>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
</>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{notificationType === "webhook" && (
|
{notificationType === "webhook" && (
|
||||||
|
|||||||
@@ -94,6 +94,7 @@ export const alertConfigService = {
|
|||||||
|
|
||||||
} else if (config.notification_type === "notifiarr") {
|
} else if (config.notification_type === "notifiarr") {
|
||||||
cleanConfig.api_token = config.api_token || "";
|
cleanConfig.api_token = config.api_token || "";
|
||||||
|
cleanConfig.channel_id = config.channel_id || "";
|
||||||
|
|
||||||
} else if (config.notification_type === "webhook") {
|
} else if (config.notification_type === "webhook") {
|
||||||
cleanConfig.webhook_url = config.webhook_url || "";
|
cleanConfig.webhook_url = config.webhook_url || "";
|
||||||
|
|||||||
Reference in New Issue
Block a user