diff options
author | Vitalii Lysak <v.lysak@dunice.net> | 2022-08-10 15:46:15 +0300 |
---|---|---|
committer | Vitalii Lysak <v.lysak@dunice.net> | 2022-08-10 15:46:15 +0300 |
commit | b4d1fb8b8e6e6cdb7be76a2d4fa0d2b9a84f3ba2 (patch) | |
tree | 8806fa43f2e0d1301a89ddd4c7667d10568e531f /src/views/_sila/Operations/ServerPowerOperations | |
parent | 5fff754d48ec658673c11f8e593d3af4f94d79df (diff) | |
download | webui-vue-b4d1fb8b8e6e6cdb7be76a2d4fa0d2b9a84f3ba2.tar.xz |
SILABMC-236: upd layput for ReadOnly role
Diffstat (limited to 'src/views/_sila/Operations/ServerPowerOperations')
-rw-r--r-- | src/views/_sila/Operations/ServerPowerOperations/BootSettings.vue | 18 | ||||
-rw-r--r-- | src/views/_sila/Operations/ServerPowerOperations/ServerPowerOperations.vue | 15 |
2 files changed, 30 insertions, 3 deletions
diff --git a/src/views/_sila/Operations/ServerPowerOperations/BootSettings.vue b/src/views/_sila/Operations/ServerPowerOperations/BootSettings.vue index 8d74e381..1288af0a 100644 --- a/src/views/_sila/Operations/ServerPowerOperations/BootSettings.vue +++ b/src/views/_sila/Operations/ServerPowerOperations/BootSettings.vue @@ -11,7 +11,10 @@ <b-form-select id="boot-option" v-model="form.bootOption" - :disabled="bootSourceOptions.length === 0" + :disabled=" + bootSourceOptions.length === 0 || + $store.getters['authentication/role'] === 'ReadOnly' + " :options="bootSourceOptions" @change="onChangeSelect" > @@ -20,7 +23,10 @@ <b-form-checkbox v-model="form.oneTimeBoot" class="mb-4" - :disabled="form.bootOption === 'None'" + :disabled=" + form.bootOption === 'None' || + $store.getters['authentication/role'] === 'ReadOnly' + " @change="$v.form.oneTimeBoot.$touch()" > {{ $t('pageServerPowerOperations.bootSettings.enableOneTimeBoot') }} @@ -37,12 +43,18 @@ id="tpm-required-policy" v-model="form.tpmPolicyOn" aria-describedby="tpm-required-policy-help-block" + :disabled="$store.getters['authentication/role'] === 'ReadOnly'" @change="$v.form.tpmPolicyOn.$touch()" > {{ $t('global.status.enabled') }} </b-form-checkbox> </b-form-group> - <b-button variant="primary" type="submit" class="mb-3"> + <b-button + variant="primary" + type="submit" + class="mb-3" + :disabled="$store.getters['authentication/role'] === 'ReadOnly'" + > {{ $t('global.action.save') }} </b-button> </b-form> diff --git a/src/views/_sila/Operations/ServerPowerOperations/ServerPowerOperations.vue b/src/views/_sila/Operations/ServerPowerOperations/ServerPowerOperations.vue index e848215f..f8a18a9e 100644 --- a/src/views/_sila/Operations/ServerPowerOperations/ServerPowerOperations.vue +++ b/src/views/_sila/Operations/ServerPowerOperations/ServerPowerOperations.vue @@ -72,6 +72,7 @@ <b-button variant="primary" data-test-id="serverPowerOperations-button-powerOn" + :disabled="$store.getters['authentication/role'] === 'ReadOnly'" @click="powerOn" > {{ $t('pageServerPowerOperations.powerOn') }} @@ -88,6 +89,9 @@ name="reboot-option" data-test-id="serverPowerOperations-radio-rebootOrderly" value="orderly" + :disabled=" + $store.getters['authentication/role'] === 'ReadOnly' + " > {{ $t('pageServerPowerOperations.orderlyReboot') }} </b-form-radio> @@ -96,6 +100,9 @@ name="reboot-option" data-test-id="serverPowerOperations-radio-rebootImmediate" value="immediate" + :disabled=" + $store.getters['authentication/role'] === 'ReadOnly' + " > {{ $t('pageServerPowerOperations.immediateReboot') }} </b-form-radio> @@ -104,6 +111,7 @@ variant="primary" type="submit" data-test-id="serverPowerOperations-button-reboot" + :disabled="$store.getters['authentication/role'] === 'ReadOnly'" > {{ $t('pageServerPowerOperations.reboot') }} </b-button> @@ -118,6 +126,9 @@ name="shutdown-option" data-test-id="serverPowerOperations-radio-shutdownOrderly" value="orderly" + :disabled=" + $store.getters['authentication/role'] === 'ReadOnly' + " > {{ $t('pageServerPowerOperations.orderlyShutdown') }} </b-form-radio> @@ -126,6 +137,9 @@ name="shutdown-option" data-test-id="serverPowerOperations-radio-shutdownImmediate" value="immediate" + :disabled=" + $store.getters['authentication/role'] === 'ReadOnly' + " > {{ $t('pageServerPowerOperations.immediateShutdown') }} </b-form-radio> @@ -134,6 +148,7 @@ variant="primary" type="submit" data-test-id="serverPowerOperations-button-shutDown" + :disabled="$store.getters['authentication/role'] === 'ReadOnly'" > {{ $t('pageServerPowerOperations.shutDown') }} </b-button> |