summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamian Celico <damianx.celico@intel.com>2022-03-01 14:47:52 +0300
committerDamian Celico <damianx.celico@intel.com>2022-10-24 17:47:13 +0300
commitef96c6d96950e40954c5eb8ed87fef5dcf630bf3 (patch)
treedbad4d227fbbcfb1d531797ce8e4a3bafcdf9eab
parentf7dd1bdffb3b14f8e819509fc7255b07bfaaedc8 (diff)
downloadwebui-vue-ef96c6d96950e40954c5eb8ed87fef5dcf630bf3.tar.xz
Add env variable toggle event logs delete button
Delete button in event logs page is shown or hidden based on the enviroment variable VUE_APP_EVENT_LOGS_DELETE_BUTTON_ENABLED Signed-off-by: Damian Celico <damianx.celico@intel.com> Change-Id: I10a46f5ef147865f954e6f94bcefec5c280ad3ea
-rw-r--r--.env.intel1
-rw-r--r--src/views/Logs/EventLogs/EventLogs.vue44
2 files changed, 29 insertions, 16 deletions
diff --git a/.env.intel b/.env.intel
index 45d46f6b..5b2383d0 100644
--- a/.env.intel
+++ b/.env.intel
@@ -6,6 +6,7 @@ VUE_APP_SUBSCRIBE_SOCKET_DISABLED="true"
VUE_APP_SWITCH_TO_BACKUP_IMAGE_DISABLED="true"
VUE_APP_MODIFY_SSH_POLICY_DISABLED="true"
VUE_APP_VIRTUAL_MEDIA_LIST_ENABLED="true"
+VUE_APP_EVENT_LOGS_DELETE_BUTTON_DISABLED="true"
CUSTOM_STYLES="true"
CUSTOM_APP_NAV="true"
CUSTOM_STORE="true"
diff --git a/src/views/Logs/EventLogs/EventLogs.vue b/src/views/Logs/EventLogs/EventLogs.vue
index 5b8ca110..a3a90fd8 100644
--- a/src/views/Logs/EventLogs/EventLogs.vue
+++ b/src/views/Logs/EventLogs/EventLogs.vue
@@ -373,12 +373,15 @@ export default {
],
expandRowLabel,
activeFilters: [],
- batchActions: [
- {
- value: 'delete',
- label: this.$t('global.action.delete'),
- },
- ],
+ batchActions:
+ process.env.VUE_APP_EVENT_LOGS_DELETE_BUTTON_DISABLED === 'true'
+ ? []
+ : [
+ {
+ value: 'delete',
+ label: this.$t('global.action.delete'),
+ },
+ ],
currentPage: currentPage,
filterStartDate: null,
filterEndDate: null,
@@ -389,6 +392,8 @@ export default {
selectedRows: selectedRows,
tableHeaderCheckboxModel: tableHeaderCheckboxModel,
tableHeaderCheckboxIndeterminate: tableHeaderCheckboxIndeterminate,
+ hideDelete:
+ process.env.VUE_APP_EVENT_LOGS_DELETE_BUTTON_DISABLED === 'true',
};
},
computed: {
@@ -404,16 +409,23 @@ export default {
return this.$store.getters['eventLog/allEvents'].map((event) => {
return {
...event,
- actions: [
- {
- value: 'export',
- title: this.$t('global.action.export'),
- },
- {
- value: 'delete',
- title: this.$t('global.action.delete'),
- },
- ],
+ actions: this.hideDelete
+ ? [
+ {
+ value: 'export',
+ title: this.$t('global.action.export'),
+ },
+ ]
+ : [
+ {
+ value: 'export',
+ title: this.$t('global.action.export'),
+ },
+ {
+ value: 'delete',
+ title: this.$t('global.action.delete'),
+ },
+ ],
};
});
},