diff options
author | Vitalii Lysak <v.lysak@dunice.net> | 2022-09-05 15:56:39 +0300 |
---|---|---|
committer | Vitalii Lysak <v.lysak@dunice.net> | 2022-09-05 15:56:39 +0300 |
commit | 86de3af082ba6c541d9a6cb10c4db0d14f6267e8 (patch) | |
tree | d68f6f7560b98cbd9451e035198778f7fbf1b340 /src/views/_sila/Logs/EventLogs | |
parent | fec1602b12c66e7675f4020d544886871cf5f5c9 (diff) | |
download | webui-vue-86de3af082ba6c541d9a6cb10c4db0d14f6267e8.tar.xz |
add method for isNotAdmin
Diffstat (limited to 'src/views/_sila/Logs/EventLogs')
-rw-r--r-- | src/views/_sila/Logs/EventLogs/EventLogs.vue | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/views/_sila/Logs/EventLogs/EventLogs.vue b/src/views/_sila/Logs/EventLogs/EventLogs.vue index 4e72ac49..7e425472 100644 --- a/src/views/_sila/Logs/EventLogs/EventLogs.vue +++ b/src/views/_sila/Logs/EventLogs/EventLogs.vue @@ -32,10 +32,7 @@ <table-filter :filters="tableFilters" @filter-change="onFilterChange" /> <b-button variant="link" - :disabled=" - allLogs.length === 0 || - $store.getters['authentication/role'] === 'ReadOnly' - " + :disabled="allLogs.length === 0 || isNotAdmin" @click="deleteAllLogs" > <icon-delete /> {{ $t('global.action.deleteAll') }} @@ -62,14 +59,14 @@ <template #toolbar-buttons> <b-button variant="primary" - :disabled="$store.getters['authentication/role'] === 'ReadOnly'" + :disabled="isNotAdmin" @click="resolveLogs" > {{ $t('pageEventLogs.resolve') }} </b-button> <b-button variant="primary" - :disabled="$store.getters['authentication/role'] === 'ReadOnly'" + :disabled="isNotAdmin" @click="unresolveLogs" > {{ $t('pageEventLogs.unresolve') }} @@ -196,7 +193,7 @@ v-model="row.item.status" name="switch" switch - :disabled="$store.getters['authentication/role'] === 'ReadOnly'" + :disabled="isNotAdmin" @change="changelogStatus(row.item)" > <span v-if="row.item.status"> @@ -220,9 +217,7 @@ :export-name="exportFileNameByDate('export')" :data-test-id="`eventLogs-button-deleteRow-${row.index}`" :class="{ - disabledDiv: - $store.getters['authentication/role'] === 'ReadOnly' && - action.value === 'delete', + disabledDiv: isNotAdmin && action.value === 'delete', }" @click-table-action="onTableRowAction($event, row.item)" > @@ -433,6 +428,9 @@ export default { }; }, computed: { + isNotAdmin() { + return this.$store.getters['authentication/role'] === 'ReadOnly'; + }, href() { return `data:text/json;charset=utf-8,${this.exportAllLogs()}`; }, |