diff options
author | Sivaprabu Ganesan <sivaprabug@ami.com> | 2023-04-12 16:38:20 +0300 |
---|---|---|
committer | Sivaprabu Ganesan <sivaprabug@ami.com> | 2023-04-25 00:34:51 +0300 |
commit | 0f6147ca2518bd7401e94e5551322a7892e27d77 (patch) | |
tree | f27b3acd1269c25617d294c8649c4f67f0cad1c8 /src | |
parent | 6c5418f599c6cd87941331a970c03f68eec66c39 (diff) | |
download | webui-vue-0f6147ca2518bd7401e94e5551322a7892e27d77.tar.xz |
Display eventlog status button based on condition
Resolved and Unresolved status button in event log page is shown
or hidden based on the environment variable
VUE_APP_EVENT_LOGS_TOGGLE_BUTTON_DISABLED
Change-Id: If99a9705d4690995fb998daa979c21c61c3cc4a7
Signed-off-by: Sivaprabu Ganesan <sivaprabug@ami.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/views/Logs/EventLogs/EventLogs.vue | 53 |
1 files changed, 35 insertions, 18 deletions
diff --git a/src/views/Logs/EventLogs/EventLogs.vue b/src/views/Logs/EventLogs/EventLogs.vue index a3a90fd8..ff0473e8 100644 --- a/src/views/Logs/EventLogs/EventLogs.vue +++ b/src/views/Logs/EventLogs/EventLogs.vue @@ -50,10 +50,14 @@ @batch-action="onBatchAction" > <template #toolbar-buttons> - <b-button variant="primary" @click="resolveLogs"> + <b-button v-if="!hideToggle" variant="primary" @click="resolveLogs"> {{ $t('pageEventLogs.resolve') }} </b-button> - <b-button variant="primary" @click="unresolveLogs"> + <b-button + v-if="!hideToggle" + variant="primary" + @click="unresolveLogs" + > {{ $t('pageEventLogs.unresolve') }} </b-button> <table-toolbar-export @@ -348,10 +352,12 @@ export default { label: this.$t('pageEventLogs.table.description'), tdClass: 'text-break', }, - { - key: 'status', - label: this.$t('pageEventLogs.table.status'), - }, + process.env.VUE_APP_EVENT_LOGS_TOGGLE_BUTTON_DISABLED === 'true' + ? {} + : { + key: 'status', + label: this.$t('pageEventLogs.table.status'), + }, { key: 'actions', sortable: false, @@ -359,18 +365,27 @@ export default { tdClass: 'text-right text-nowrap', }, ], - tableFilters: [ - { - key: 'severity', - label: this.$t('pageEventLogs.table.severity'), - values: ['OK', 'Warning', 'Critical'], - }, - { - key: 'filterByStatus', - label: this.$t('pageEventLogs.table.status'), - values: ['Resolved', 'Unresolved'], - }, - ], + tableFilters: + process.env.VUE_APP_EVENT_LOGS_TOGGLE_BUTTON_DISABLED === 'true' + ? [ + { + key: 'severity', + label: this.$t('pageEventLogs.table.severity'), + values: ['OK', 'Warning', 'Critical'], + }, + ] + : [ + { + key: 'severity', + label: this.$t('pageEventLogs.table.severity'), + values: ['OK', 'Warning', 'Critical'], + }, + { + key: 'filterByStatus', + label: this.$t('pageEventLogs.table.status'), + values: ['Resolved', 'Unresolved'], + }, + ], expandRowLabel, activeFilters: [], batchActions: @@ -392,6 +407,8 @@ export default { selectedRows: selectedRows, tableHeaderCheckboxModel: tableHeaderCheckboxModel, tableHeaderCheckboxIndeterminate: tableHeaderCheckboxIndeterminate, + hideToggle: + process.env.VUE_APP_EVENT_LOGS_TOGGLE_BUTTON_DISABLED === 'true', hideDelete: process.env.VUE_APP_EVENT_LOGS_DELETE_BUTTON_DISABLED === 'true', }; |