diff options
Diffstat (limited to 'src/views/_sila/Operations/ServerPowerOperations/BootSettings.vue')
-rw-r--r-- | src/views/_sila/Operations/ServerPowerOperations/BootSettings.vue | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/src/views/_sila/Operations/ServerPowerOperations/BootSettings.vue b/src/views/_sila/Operations/ServerPowerOperations/BootSettings.vue index 826d8607..17b51212 100644 --- a/src/views/_sila/Operations/ServerPowerOperations/BootSettings.vue +++ b/src/views/_sila/Operations/ServerPowerOperations/BootSettings.vue @@ -11,10 +11,7 @@ <b-form-select id="boot-option" v-model="form.bootOption" - :disabled=" - bootSourceOptions.length === 0 || - $store.getters['authentication/role'] === 'ReadOnly' - " + :disabled="bootSourceOptions.length === 0 || isNotAdmin" :options="bootSourceOptionsReplaced" @change="onChangeSelect" > @@ -23,10 +20,7 @@ <b-form-checkbox v-model="form.oneTimeBoot" class="mb-4" - :disabled=" - form.bootOption === 'Отключено' || - $store.getters['authentication/role'] === 'ReadOnly' - " + :disabled="form.bootOption === 'Отключено' || isNotAdmin" @change="$v.form.oneTimeBoot.$touch()" > {{ $t('pageServerPowerOperations.bootSettings.enableOneTimeBoot') }} @@ -35,7 +29,7 @@ <b-form-radio-group id="boot-settings-mode" v-model="form.bootMode" - :disabled="$store.getters['authentication/role'] === 'ReadOnly'" + :disabled="isNotAdmin" stacked > <b-form-radio class="mb-1" :value="bootModeOptions[0]"> @@ -59,7 +53,7 @@ id="tpm-required-policy" v-model="form.tpmPolicyOn" aria-describedby="tpm-required-policy-help-block" - :disabled="$store.getters['authentication/role'] === 'ReadOnly'" + :disabled="isNotAdmin" @change="$v.form.tpmPolicyOn.$touch()" > {{ $t('global.status.enabled') }} @@ -69,7 +63,7 @@ variant="primary" type="submit" class="mb-3" - :disabled="$store.getters['authentication/role'] === 'ReadOnly'" + :disabled="isNotAdmin" > {{ $t('global.action.save') }} </b-button> @@ -111,6 +105,9 @@ export default { 'overrideEnabled', 'tpmEnabled', ]), + isNotAdmin() { + return this.$store.getters['authentication/role'] === 'ReadOnly'; + }, bootSourceOptionsReplaced() { return replaceNoneArr(this.bootSourceOptions); }, |