From c247e435e70ead4b0e6f34c75c0297544bbbca37 Mon Sep 17 00:00:00 2001 From: sbgap Date: Tue, 24 Nov 2026 09:50:13 +0100 Subject: [PATCH 1/2] fix: handle verify and CA bundle path in notification channels The backend passes verify to requests: null uses the default CA bundle, 'false' disables certificate verification, and any other string is used as the path to a CA bundle. Show the verify checkbox as checked unless verify is 'false' (case-insensitive). When checked, show an optional CA Bundle Path field; leaving it empty saves null. Unchecking saves 'false'. The dialog no longer writes 'true', which requests would treat as a file path. --- .../dialogs/add/NotificationChannelAdd.vue | 15 ++++++++++++++- src/locales/en.ts | 4 +++- .../store/types/notificationChannel-types.ts | 2 +- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/src/components/dialogs/add/NotificationChannelAdd.vue b/src/components/dialogs/add/NotificationChannelAdd.vue index 2dbc527b..868c7456 100644 --- a/src/components/dialogs/add/NotificationChannelAdd.vue +++ b/src/components/dialogs/add/NotificationChannelAdd.vue @@ -89,7 +89,10 @@ /> - + + + + @@ -162,6 +165,16 @@ const labels = { my_link: {token: t('ClientSecret'), sid: t('ClientID')} } +const verify = computed<'false' | null>({ + get: () => (editedItem.value.verify?.toLowerCase() === 'false' ? 'false' : null), + set: val => (editedItem.value.verify = val) +}) + +const verifyText = computed({ + get: () => (editedItem.value.verify?.toLowerCase() === 'false' ? null : editedItem.value.verify), + set: (val: string) => (editedItem.value.verify = val === '' ? null : val) +}) + const edit = ref(false) const showPlatformId = ref(false) diff --git a/src/locales/en.ts b/src/locales/en.ts index a45ededf..177770e6 100644 --- a/src/locales/en.ts +++ b/src/locales/en.ts @@ -288,7 +288,9 @@ export const en = { NotificationKeyGenerate: 'Genereates New Encryption Key And Copies It To Clipboard', NotificationKey: 'Set NOTIFICATION_KEY="{New Key}" In Config To Use Generated Key', Verify: 'Verify', - VerifyInfo: 'Verify SSL certificates of host. True/False', + CAPath: 'CA Bundle Path', + CAPathInfo: 'Path to a CA bundle on the Alerta server. Leave empty to use the default.', + VerifyInfo: 'Verify SSL certificates of host', Host: 'Host', HostInfo: 'Url for sms/email provider', NotificationChannels: 'Notification Channels', diff --git a/src/plugins/store/types/notificationChannel-types.ts b/src/plugins/store/types/notificationChannel-types.ts index 932fb2cd..eac8f3f1 100644 --- a/src/plugins/store/types/notificationChannel-types.ts +++ b/src/plugins/store/types/notificationChannel-types.ts @@ -19,7 +19,7 @@ export type NotificationChannel = { platformId?: string sender: string type: NotificationChannelType - verify: boolean | null + verify: string | null } export type Filter = { From 8b877cc85c4920c4f46da88aac7afe9a56c92103 Mon Sep 17 00:00:00 2001 From: sbgap Date: Tue, 24 Nov 2026 10:20:04 +0100 Subject: [PATCH 2/2] fix: allow updating notification channels Leave id out of the PUT body when updating a notification channel; the id is already given in the URL. --- src/components/dialogs/add/NotificationChannelAdd.vue | 5 +++-- src/plugins/store/types/notificationChannel-types.ts | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/dialogs/add/NotificationChannelAdd.vue b/src/components/dialogs/add/NotificationChannelAdd.vue index 868c7456..7e7bde57 100644 --- a/src/components/dialogs/add/NotificationChannelAdd.vue +++ b/src/components/dialogs/add/NotificationChannelAdd.vue @@ -220,10 +220,11 @@ watch(dialog, val => { async function save() { if (edit.value) { + const {id, ...update} = editedItem.value await store.dispatch('notificationChannels/updateNotificationChannel', [ - editedItem.value.id, + id, { - ...editedItem.value + ...update } ]) } else { diff --git a/src/plugins/store/types/notificationChannel-types.ts b/src/plugins/store/types/notificationChannel-types.ts index eac8f3f1..6a244f8d 100644 --- a/src/plugins/store/types/notificationChannel-types.ts +++ b/src/plugins/store/types/notificationChannel-types.ts @@ -68,7 +68,7 @@ export type Actions = { createNotificationChannel({dispatch}: AugmentedActionContext, notificationChannel: NotificationChannel): void updateNotificationChannel( {dispatch}: AugmentedActionContext, - [notificationChannelId, update]: [string, NotificationChannel] + [notificationChannelId, update]: [string, Omit] ): void deleteNotificationChannel({dispatch}: AugmentedActionContext, notificationChannelId: NotificationChannel['id']): void setPagination({commit}: AugmentedActionContext, pagination: Pagination): void