diff options
author | Vitalii Lysak <v.lysak@dunice.net> | 2022-08-25 18:03:39 +0300 |
---|---|---|
committer | Vitalii Lysak <v.lysak@dunice.net> | 2022-08-25 18:03:39 +0300 |
commit | 81e43ed3e15e2857faafc56edaf15ea1e1f63ec0 (patch) | |
tree | 07ea0e41c4f134bcd79f0faedcbfd8c41161f34e | |
parent | e8bf69b3d967a50fe01dc2af67c24d9e4e39b575 (diff) | |
parent | 3aa7a8ba3c0752b779c1c4f4d5bf3fffeb6dec52 (diff) | |
download | webui-vue-81e43ed3e15e2857faafc56edaf15ea1e1f63ec0.tar.xz |
Merge branch 'sila' of git.sila.ru:pub/openbmc/webui-vue into sila
4 files changed, 46 insertions, 12 deletions
diff --git a/src/utilities/_sila/transformBootOption.js b/src/utilities/_sila/transformBootOption.js new file mode 100644 index 00000000..047d9e7f --- /dev/null +++ b/src/utilities/_sila/transformBootOption.js @@ -0,0 +1,24 @@ +export function replaceNone(value) { + if (value === 'None') { + return 'Отключено'; + } else { + return value; + } +} + +export function replaceRevert(value) { + if (value === 'Отключено') { + return 'None'; + } else { + return value; + } +} + +export function replaceNoneArr(arr) { + return arr.map((item) => { + if (item === 'None') { + return 'Отключено'; + } + return item; + }); +} diff --git a/src/views/_sila/Operations/ServerPowerOperations/BootSettings.vue b/src/views/_sila/Operations/ServerPowerOperations/BootSettings.vue index 7ef83b5d..826d8607 100644 --- a/src/views/_sila/Operations/ServerPowerOperations/BootSettings.vue +++ b/src/views/_sila/Operations/ServerPowerOperations/BootSettings.vue @@ -15,7 +15,7 @@ bootSourceOptions.length === 0 || $store.getters['authentication/role'] === 'ReadOnly' " - :options="bootSourceOptions" + :options="bootSourceOptionsReplaced" @change="onChangeSelect" > </b-form-select> @@ -24,7 +24,7 @@ v-model="form.oneTimeBoot" class="mb-4" :disabled=" - form.bootOption === 'None' || + form.bootOption === 'Отключено' || $store.getters['authentication/role'] === 'ReadOnly' " @change="$v.form.oneTimeBoot.$touch()" @@ -39,11 +39,11 @@ stacked > <b-form-radio class="mb-1" :value="bootModeOptions[0]"> - {{ $t(`${bootModeOptions[0]}`) }} + {{ `${bootModeOptions[0]}` }} </b-form-radio> <b-form-radio class="mb-1" :value="bootModeOptions[1]"> - {{ $t(`${bootModeOptions[1]}`) }} + {{ `${bootModeOptions[1]}` }} </b-form-radio> </b-form-radio-group> </b-form-group> @@ -81,6 +81,11 @@ import { mapState } from 'vuex'; import BVToastMixin from '@/components/_sila/Mixins/BVToastMixin'; import LoadingBarMixin from '@/components/_sila/Mixins/LoadingBarMixin'; +import { + replaceNone, + replaceRevert, + replaceNoneArr, +} from '@/utilities/_sila/transformBootOption.js'; export default { name: 'BootSettings', @@ -88,7 +93,9 @@ export default { data() { return { form: { - bootOption: this.$store.getters['serverBootSettings/bootSource'], + bootOption: replaceNone( + this.$store.getters['serverBootSettings/bootSource'] + ), bootMode: this.$store.getters['serverBootSettings/bootMode'], oneTimeBoot: this.$store.getters['serverBootSettings/overrideEnabled'], tpmPolicyOn: this.$store.getters['serverBootSettings/tpmEnabled'], @@ -104,10 +111,13 @@ export default { 'overrideEnabled', 'tpmEnabled', ]), + bootSourceOptionsReplaced() { + return replaceNoneArr(this.bootSourceOptions); + }, }, watch: { bootSource: function (value) { - this.form.bootOption = value; + this.form.bootOption = replaceNone(value); }, bootMode: function (value) { this.form.bootMode = value; @@ -141,7 +151,7 @@ export default { this.startLoader(); const tpmPolicyChanged = this.$v.form.tpmPolicyOn.$dirty; let settings; - let bootSource = this.form.bootOption; + let bootSource = replaceRevert(this.form.bootOption); let overrideEnabled = this.form.oneTimeBoot; let bootMode = this.form.bootMode; let tpmEnabled = null; diff --git a/src/views/_sila/Overview/Inventory/InventoryPciDevices.vue b/src/views/_sila/Overview/Inventory/InventoryPciDevices.vue index 81ff0000..74858649 100644 --- a/src/views/_sila/Overview/Inventory/InventoryPciDevices.vue +++ b/src/views/_sila/Overview/Inventory/InventoryPciDevices.vue @@ -54,7 +54,7 @@ </template> <template #row-details="data"> <b-container fluid> - <b-row v-for="item in data.item.Functions" :key="item.deviceId"> + <b-row v-for="item in data.item.Functions" :key="item.id"> <b-col xs="6"> <dl> <dt>{{ $t('pagePci.table.name') }}:</dt> diff --git a/src/views/_sila/SecurityAndAccess/Ldap/Ldap.vue b/src/views/_sila/SecurityAndAccess/Ldap/Ldap.vue index 12584fac..b33cdf92 100644 --- a/src/views/_sila/SecurityAndAccess/Ldap/Ldap.vue +++ b/src/views/_sila/SecurityAndAccess/Ldap/Ldap.vue @@ -194,9 +194,9 @@ <b-col sm="6" xl="4"> <b-form-group label-for="user-id-attribute"> <template #label> - {{ $t('pageLdap.form.userIdAttribute') }} - + {{ $t('pageLdap.form.userIdAttribute') }} <span class="form-text d-inline"> - {{ $t('global.form.optional') }} + {{ '*' }} </span> </template> <b-form-input @@ -213,9 +213,9 @@ <b-col sm="6" xl="4"> <b-form-group label-for="group-id-attribute"> <template #label> - {{ $t('pageLdap.form.groupIdAttribute') }} - + {{ $t('pageLdap.form.groupIdAttribute') }} <span class="form-text d-inline"> - {{ $t('global.form.optional') }} + {{ '*' }} </span> </template> <b-form-input |