From 918ff299ab52071ff474cdb84cd415f6a0f7233b Mon Sep 17 00:00:00 2001 From: sbgap Date: Tue, 14 May 2024 09:32:57 +0200 Subject: [PATCH 1/5] fix: remove duplicate date picker in NR reactivate menu --- src/components/NotificationRuleList.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/NotificationRuleList.vue b/src/components/NotificationRuleList.vue index c6039d45..c23ba033 100644 --- a/src/components/NotificationRuleList.vue +++ b/src/components/NotificationRuleList.vue @@ -139,8 +139,8 @@ xs8 > From 198fc01080f32cf57120a058e5c9ec043d15f044 Mon Sep 17 00:00:00 2001 From: sbgap Date: Wed, 15 May 2024 08:31:50 +0200 Subject: [PATCH 2/5] feat: add excluded tags to notification rules --- src/components/NotificationRuleList.vue | 45 +++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/src/components/NotificationRuleList.vue b/src/components/NotificationRuleList.vue index c23ba033..1e1ed105 100644 --- a/src/components/NotificationRuleList.vue +++ b/src/components/NotificationRuleList.vue @@ -434,6 +434,35 @@ + + + + + + {{ tag }} + + + + label + {{ tag }} + + {{ props.item.user }} @@ -727,6 +768,7 @@ export default { { text: i18n.t('Event'), value: 'event' }, { text: i18n.t('Group'), value: 'group' }, { text: i18n.t('Tags'), value: 'tags' }, + { text: i18n.t('Excluded Tags'), value: 'excludedTags' }, { text: i18n.t('User'), value: 'user' }, { text: 'Text', value: 'text' }, { text: i18n.t('Actions'), value: 'name', sortable: false } @@ -746,6 +788,7 @@ export default { event: null, group: null, tags: [], + excludedTags: [], period: { startTime: '', endTime: '' @@ -776,6 +819,7 @@ export default { event: null, group: null, tags: [], + excludedTags: [], period: { startTime: '', endTime: '' @@ -1092,6 +1136,7 @@ export default { event: this.editedItem.event, group: this.editedItem.group, tags: this.editedItem.tags, + excludedTags: this.editedItem.excludedTags, startTime: sTimeStr, endTime: eTimeStr, text: this.editedItem.text.replace(/\{([\w\[\]\. ]*)\}/g, '%($1)s'), From 1ccbf0f2dfc61e50c3db89b5f2bacaa35088aae9 Mon Sep 17 00:00:00 2001 From: sbgap Date: Wed, 15 May 2024 08:35:38 +0200 Subject: [PATCH 3/5] fix: add error in notification history list --- src/components/NotificationHistoryList.vue | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/components/NotificationHistoryList.vue b/src/components/NotificationHistoryList.vue index 9747fbcb..91ee56fe 100644 --- a/src/components/NotificationHistoryList.vue +++ b/src/components/NotificationHistoryList.vue @@ -40,6 +40,7 @@ {{ props.item.channel }} {{ props.item.rule }} {{ props.item.alert }} + {{ props.item.error}} {{ props.item.confirmed }} {{ props.item.confirmed_time }} @@ -83,6 +84,7 @@ export default { { text: i18n.t('Channel'), value: 'channel' }, { text: i18n.t('NotificationRule'), value: 'rule' }, { text: i18n.t('Alert'), value: 'alert' }, + { text: i18n.t('Error'), value: 'error' }, { text: i18n.t('Confirmed'), value: 'confirmed' }, { text: i18n.t('ConfirmedTime'), value: 'confirmed_time' }, ], From ecc6f1087a871077ac2046993c28de37656f73b3 Mon Sep 17 00:00:00 2001 From: sbgap Date: Wed, 15 May 2024 09:37:00 +0200 Subject: [PATCH 4/5] feat: add url search for notification rules --- src/components/NotificationRuleList.vue | 8 ++++++++ src/router.ts | 3 +++ src/views/NotificationRule.vue | 23 ++++++++++++++++++----- 3 files changed, 29 insertions(+), 5 deletions(-) diff --git a/src/components/NotificationRuleList.vue b/src/components/NotificationRuleList.vue index 1e1ed105..82aa03f6 100644 --- a/src/components/NotificationRuleList.vue +++ b/src/components/NotificationRuleList.vue @@ -535,6 +535,7 @@ hide-details :label="$t('Search')" @change="setSearch" + @click:clear="clearSearch" /> @@ -999,6 +1000,13 @@ export default { methods: { setSearch(query) { this.$store.dispatch('notificationRules/updateQuery', {q: query}) + this.$router.push({query: {...this.$router.query, q: query}}) + this.refresh_all() + }, + clearSearch() { + this.query = null + this.$store.dispatch('notificationRules/updateQuery', {}) + this.$router.push({query: {...this.$router.query, q: undefined}}) this.refresh_all() }, getNotificationRules() { diff --git a/src/router.ts b/src/router.ts index 525fb543..1d6e480c 100644 --- a/src/router.ts +++ b/src/router.ts @@ -82,6 +82,9 @@ export function createRouter(basePath): VueRouter { { path: '/notificationrules', name: 'notificationrules', + props: route => ({ + query: route.query + }), component: () => import(/* webpackChunkName: 'user' */ './views/NotificationRule.vue'), meta: {title: 'NotificationRules', requiresAuth: true} }, diff --git a/src/views/NotificationRule.vue b/src/views/NotificationRule.vue index f8fb4e26..9f1060ec 100644 --- a/src/views/NotificationRule.vue +++ b/src/views/NotificationRule.vue @@ -4,14 +4,27 @@ - From bcc0a729fb5d5bb19382b4b1486e79c62a6b50f2 Mon Sep 17 00:00:00 2001 From: sbgap Date: Wed, 15 May 2024 09:38:02 +0200 Subject: [PATCH 5/5] feat: make rule and alert clickable in notification history --- src/components/NotificationHistoryList.vue | 31 +++++++++++++++++++--- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/src/components/NotificationHistoryList.vue b/src/components/NotificationHistoryList.vue index 91ee56fe..d3e794a9 100644 --- a/src/components/NotificationHistoryList.vue +++ b/src/components/NotificationHistoryList.vue @@ -38,9 +38,19 @@ {{ props.item.receiver }} {{ props.item.sender }} {{ props.item.channel }} - {{ props.item.rule }} - {{ props.item.alert }} - {{ props.item.error}} + + {{ props.item.rule }} + + + {{ props.item.alert }} + + {{ props.item.error }} {{ props.item.confirmed }} {{ props.item.confirmed_time }} @@ -152,8 +162,21 @@ export default { const config = this.$store.getters.getConfig('colors') return config.severity[confirmed ? 'ok' : sent ? 'warning' : 'critical'] || 'white' }, + findAlert(id){ + this.$router.push({ path: `/alerts?q=id:"${id}"` }) + }, + findNotificationRule(id){ + this.$router.push({ path: `/notificationrules?q=id:"${id}"` }) + } } } - +