diff options
Diffstat (limited to 'src/views/_sila/Overview')
12 files changed, 59 insertions, 41 deletions
diff --git a/src/views/_sila/Overview/DateTime/DateTime.vue b/src/views/_sila/Overview/DateTime/DateTime.vue index 4440cd4a..e4bc89b7 100644 --- a/src/views/_sila/Overview/DateTime/DateTime.vue +++ b/src/views/_sila/Overview/DateTime/DateTime.vue @@ -42,7 +42,7 @@ v-model="form.configurationSelected" value="manual" data-test-id="dateTime-radio-configureManual" - :disabled="$store.getters['authentication/role'] === 'ReadOnly'" + :disabled="isNotAdmin" > {{ $t('pageDateTime.form.manual') }} </b-form-radio> @@ -57,10 +57,7 @@ id="input-manual-date" v-model="form.manual.date" :state="getValidationState($v.form.manual.date)" - :disabled=" - ntpOptionSelected || - $store.getters['authentication/role'] === 'ReadOnly' - " + :disabled="ntpOptionSelected || isNotAdmin" placeholder="YYYY-MM-DD" data-test-id="dateTime-input-manualDate" class="form-control-with-button" @@ -85,10 +82,7 @@ $t('global.calendar.useCursorKeysToNavigateCalendarDates') " :title="$t('global.calendar.selectDate')" - :disabled=" - ntpOptionSelected || - $store.getters['authentication/role'] === 'ReadOnly' - " + :disabled="ntpOptionSelected || isNotAdmin" button-variant="link" aria-controls="input-manual-date" > @@ -112,10 +106,7 @@ id="input-manual-time" v-model="form.manual.time" :state="getValidationState($v.form.manual.time)" - :disabled=" - ntpOptionSelected || - $store.getters['authentication/role'] === 'ReadOnly' - " + :disabled="ntpOptionSelected || isNotAdmin" placeholder="HH:MM" data-test-id="dateTime-input-manualTime" @blur="$v.form.manual.time.$touch()" @@ -136,7 +127,7 @@ v-model="form.configurationSelected" value="ntp" data-test-id="dateTime-radio-configureNTP" - :disabled="$store.getters['authentication/role'] === 'ReadOnly'" + :disabled="isNotAdmin" > NTP </b-form-radio> @@ -151,10 +142,7 @@ id="input-ntp-1" v-model="form.ntp.firstAddress" :state="getValidationState($v.form.ntp.firstAddress)" - :disabled=" - manualOptionSelected || - $store.getters['authentication/role'] === 'ReadOnly' - " + :disabled="manualOptionSelected || isNotAdmin" data-test-id="dateTime-input-ntpServer1" @blur="$v.form.ntp.firstAddress.$touch()" /> @@ -179,10 +167,7 @@ id="input-ntp-2" v-model="form.ntp.secondAddress" :state="getValidationState($v.form.ntp.secondAddress)" - :disabled=" - manualOptionSelected || - $store.getters['authentication/role'] === 'ReadOnly' - " + :disabled="manualOptionSelected || isNotAdmin" data-test-id="dateTime-input-ntpServer2" @blur="$v.form.ntp.secondAddress.$touch()" /> @@ -204,10 +189,7 @@ id="input-ntp-3" v-model="form.ntp.thirdAddress" :state="getValidationState($v.form.ntp.thirdAddress)" - :disabled=" - manualOptionSelected || - $store.getters['authentication/role'] === 'ReadOnly' - " + :disabled="manualOptionSelected || isNotAdmin" data-test-id="dateTime-input-ntpServer3" @blur="$v.form.ntp.thirdAddress.$touch()" /> @@ -224,7 +206,7 @@ variant="primary" type="submit" data-test-id="dateTime-button-saveSettings" - :disabled="$store.getters['authentication/role'] === 'ReadOnly'" + :disabled="isNotAdmin" > {{ $t('global.action.saveSettings') }} </b-button> @@ -318,6 +300,9 @@ export default { }, computed: { ...mapState('dateTime', ['ntpServers', 'isNtpProtocolEnabled']), + isNotAdmin() { + return this.$store.getters['authentication/role'] === 'ReadOnly'; + }, bmcTime() { return this.$store.getters['global/bmcTime']; }, diff --git a/src/views/_sila/Overview/Inventory/InventoryServiceIndicator.vue b/src/views/_sila/Overview/Inventory/InventoryServiceIndicator.vue index 7f0c9030..d823f40a 100644 --- a/src/views/_sila/Overview/Inventory/InventoryServiceIndicator.vue +++ b/src/views/_sila/Overview/Inventory/InventoryServiceIndicator.vue @@ -23,7 +23,7 @@ v-model="systems.locationIndicatorActive" data-test-id="inventoryService-toggle-identifyLed" switch - :disabled="$store.getters['authentication/role'] === 'ReadOnly'" + :disabled="isNotAdmin" @change="toggleIdentifyLedSwitch" > <span v-if="systems.locationIndicatorActive"> @@ -46,6 +46,9 @@ export default { components: { PageSection }, mixins: [BVToastMixin], computed: { + isNotAdmin() { + return this.$store.getters['authentication/role'] === 'ReadOnly'; + }, systems() { let systemData = this.$store.getters['system/systems'][0]; return systemData ? systemData : {}; diff --git a/src/views/_sila/Overview/Inventory/InventoryTableAssembly.vue b/src/views/_sila/Overview/Inventory/InventoryTableAssembly.vue index 929c172b..93a5fe51 100644 --- a/src/views/_sila/Overview/Inventory/InventoryTableAssembly.vue +++ b/src/views/_sila/Overview/Inventory/InventoryTableAssembly.vue @@ -32,7 +32,7 @@ v-model="row.item.identifyLed" name="switch" switch - :disabled="$store.getters['authentication/role'] === 'ReadOnly'" + :disabled="isNotAdmin" @change="toggleIdentifyLedValue(row.item)" > <span v-if="row.item.identifyLed"> @@ -118,6 +118,9 @@ export default { }; }, computed: { + isNotAdmin() { + return this.$store.getters['authentication/role'] === 'ReadOnly'; + }, assemblies() { return this.$store.getters['assemblies/assemblies']; }, diff --git a/src/views/_sila/Overview/Inventory/InventoryTableBmcManager.vue b/src/views/_sila/Overview/Inventory/InventoryTableBmcManager.vue index 5fb23bfd..e73dab05 100644 --- a/src/views/_sila/Overview/Inventory/InventoryTableBmcManager.vue +++ b/src/views/_sila/Overview/Inventory/InventoryTableBmcManager.vue @@ -36,7 +36,7 @@ v-model="row.item.identifyLed" name="switch" switch - :disabled="$store.getters['authentication/role'] === 'ReadOnly'" + :disabled="isNotAdmin" @change="toggleIdentifyLedValue(row.item)" > <span v-if="row.item.identifyLed"> @@ -209,6 +209,9 @@ export default { }; }, computed: { + isNotAdmin() { + return this.$store.getters['authentication/role'] === 'ReadOnly'; + }, bmc() { return this.$store.getters['bmc/bmc']; }, diff --git a/src/views/_sila/Overview/Inventory/InventoryTableChassis.vue b/src/views/_sila/Overview/Inventory/InventoryTableChassis.vue index d141924f..8897d87a 100644 --- a/src/views/_sila/Overview/Inventory/InventoryTableChassis.vue +++ b/src/views/_sila/Overview/Inventory/InventoryTableChassis.vue @@ -35,7 +35,7 @@ v-model="row.item.identifyLed" name="switch" switch - :disabled="$store.getters['authentication/role'] === 'ReadOnly'" + :disabled="isNotAdmin" @change="toggleIdentifyLedValue(row.item)" > <span v-if="row.item.identifyLed"> @@ -163,6 +163,9 @@ export default { }; }, computed: { + isNotAdmin() { + return this.$store.getters['authentication/role'] === 'ReadOnly'; + }, chassis() { return this.$store.getters['chassis/chassis']; }, diff --git a/src/views/_sila/Overview/Inventory/InventoryTableProcessors.vue b/src/views/_sila/Overview/Inventory/InventoryTableProcessors.vue index 60121818..83968314 100644 --- a/src/views/_sila/Overview/Inventory/InventoryTableProcessors.vue +++ b/src/views/_sila/Overview/Inventory/InventoryTableProcessors.vue @@ -56,7 +56,7 @@ v-model="row.item.identifyLed" name="switch" switch - :disabled="$store.getters['authentication/role'] === 'ReadOnly'" + :disabled="isNotAdmin" @change="toggleIdentifyLedValue(row.item)" > <span v-if="row.item.identifyLed"> @@ -207,6 +207,9 @@ export default { }; }, computed: { + isNotAdmin() { + return this.$store.getters['authentication/role'] === 'ReadOnly'; + }, filteredRows() { return this.searchFilter ? this.searchTotalFilteredRows diff --git a/src/views/_sila/Overview/Inventory/InventoryTableSystem.vue b/src/views/_sila/Overview/Inventory/InventoryTableSystem.vue index 286df969..e6929987 100644 --- a/src/views/_sila/Overview/Inventory/InventoryTableSystem.vue +++ b/src/views/_sila/Overview/Inventory/InventoryTableSystem.vue @@ -35,7 +35,7 @@ v-model="item.locationIndicatorActive" data-test-id="inventorySystem-toggle-identifyLed" switch - :disabled="$store.getters['authentication/role'] === 'ReadOnly'" + :disabled="isNotAdmin" @change="toggleIdentifyLedSwitch" > <span v-if="item.locationIndicatorActive"> @@ -203,6 +203,9 @@ export default { }; }, computed: { + isNotAdmin() { + return this.$store.getters['authentication/role'] === 'ReadOnly'; + }, systems() { return this.$store.getters['system/systems']; }, diff --git a/src/views/_sila/Overview/Network/NetworkGlobalSettings.vue b/src/views/_sila/Overview/Network/NetworkGlobalSettings.vue index 6a08c2c2..2d3ae4d0 100644 --- a/src/views/_sila/Overview/Network/NetworkGlobalSettings.vue +++ b/src/views/_sila/Overview/Network/NetworkGlobalSettings.vue @@ -11,7 +11,7 @@ <b-button variant="link" class="p-1" - :disabled="$store.getters['authentication/role'] === 'ReadOnly'" + :disabled="isNotAdmin" @click="initSettingsModal()" > <icon-edit :title="$t('pageNetwork.modal.editHostnameTitle')" /> @@ -29,7 +29,7 @@ v-model="useDomainNameState" data-test-id="networkSettings-switch-useDomainName" switch - :disabled="$store.getters['authentication/role'] === 'ReadOnly'" + :disabled="isNotAdmin" @change="changeDomainNameState" > <span v-if="useDomainNameState"> @@ -49,7 +49,7 @@ v-model="useDnsState" data-test-id="networkSettings-switch-useDns" switch - :disabled="$store.getters['authentication/role'] === 'ReadOnly'" + :disabled="isNotAdmin" @change="changeDnsState" > <span v-if="useDnsState"> @@ -69,7 +69,7 @@ v-model="useNtpState" data-test-id="networkSettings-switch-useNtp" switch - :disabled="$store.getters['authentication/role'] === 'ReadOnly'" + :disabled="isNotAdmin" @change="changeNtpState" > <span v-if="useNtpState"> @@ -103,6 +103,9 @@ export default { }, computed: { ...mapState('network', ['ethernetData']), + isNotAdmin() { + return this.$store.getters['authentication/role'] === 'ReadOnly'; + }, firstInterface() { return this.$store.getters['network/globalNetworkSettings'][0]; }, diff --git a/src/views/_sila/Overview/Network/NetworkInterfaceSettings.vue b/src/views/_sila/Overview/Network/NetworkInterfaceSettings.vue index 6eccb455..918b0f2e 100644 --- a/src/views/_sila/Overview/Network/NetworkInterfaceSettings.vue +++ b/src/views/_sila/Overview/Network/NetworkInterfaceSettings.vue @@ -39,7 +39,7 @@ <b-button variant="link" class="p-1" - :disabled="$store.getters['authentication/role'] === 'ReadOnly'" + :disabled="isNotAdmin" @click="initMacAddressModal()" > <icon-edit @@ -88,6 +88,9 @@ export default { }, computed: { ...mapState('network', ['ethernetData']), + isNotAdmin() { + return this.$store.getters['authentication/role'] === 'ReadOnly'; + }, }, watch: { // Watch for change in tab index diff --git a/src/views/_sila/Overview/Network/TableDns.vue b/src/views/_sila/Overview/Network/TableDns.vue index e522d69b..d6e55f27 100644 --- a/src/views/_sila/Overview/Network/TableDns.vue +++ b/src/views/_sila/Overview/Network/TableDns.vue @@ -5,7 +5,7 @@ <div class="text-right"> <b-button variant="primary" - :disabled="$store.getters['authentication/role'] === 'ReadOnly'" + :disabled="isNotAdmin" @click="initDnsModal()" > <icon-add /> @@ -93,6 +93,9 @@ export default { }, computed: { ...mapState('network', ['ethernetData']), + isNotAdmin() { + return this.$store.getters['authentication/role'] === 'ReadOnly'; + }, }, watch: { // Watch for change in tab index diff --git a/src/views/_sila/Overview/Network/TableIpv4.vue b/src/views/_sila/Overview/Network/TableIpv4.vue index 4cdc6a92..0e3bf576 100644 --- a/src/views/_sila/Overview/Network/TableIpv4.vue +++ b/src/views/_sila/Overview/Network/TableIpv4.vue @@ -9,7 +9,7 @@ <b-col class="text-right"> <b-button variant="primary" - :disabled="$store.getters['authentication/role'] === 'ReadOnly'" + :disabled="isNotAdmin" @click="initAddIpv4Address()" > <icon-add /> @@ -109,6 +109,9 @@ export default { }, computed: { ...mapState('network', ['ethernetData']), + isNotAdmin() { + return this.$store.getters['authentication/role'] === 'ReadOnly'; + }, }, watch: { // Watch for change in tab index diff --git a/src/views/_sila/Overview/OverviewInventory.vue b/src/views/_sila/Overview/OverviewInventory.vue index bc0fd69e..10d198a8 100644 --- a/src/views/_sila/Overview/OverviewInventory.vue +++ b/src/views/_sila/Overview/OverviewInventory.vue @@ -13,7 +13,7 @@ v-model="systems.locationIndicatorActive" data-test-id="overviewInventory-checkbox-identifyLed" switch - :disabled="$store.getters['authentication/role'] === 'ReadOnly'" + :disabled="isNotAdmin" @change="toggleIdentifyLedSwitch" > <span v-if="systems.locationIndicatorActive"> @@ -37,6 +37,9 @@ export default { OverviewCard, }, computed: { + isNotAdmin() { + return this.$store.getters['authentication/role'] === 'ReadOnly'; + }, systems() { let systemData = this.$store.getters['system/systems'][0]; return systemData ? systemData : {}; |