show volume encryption in vm detail volume tab

Signed-off-by: andy.lee <andy.lee@suse.com>
This commit is contained in:
andy.lee
2024-10-23 17:01:31 +02:00
committed by Francesco Torchia
parent 958e97f769
commit db21093670
8 changed files with 90 additions and 37 deletions
@@ -114,7 +114,7 @@ export default {
<div
data-testid="input-hec-bus"
class="col span-3"
class="col span-6"
>
<InputOrDisplay
:name="t('harvester.virtualMachine.volume.bus')"
@@ -8,6 +8,9 @@ import { PVC } from '@shell/config/types';
import { formatSi, parseSi } from '@shell/utils/units';
import { HCI } from '../../../../types';
import { VOLUME_TYPE, InterfaceOption } from '../../../../config/harvester-map';
import { _VIEW } from '@shell/config/query-params';
import LabelValue from '@shell/components/LabelValue';
import { ucFirst } from '@shell/utils/string';
export default {
name: 'HarvesterEditVMImage',
@@ -15,7 +18,7 @@ export default {
emits: ['update'],
components: {
UnitInput, LabeledInput, LabeledSelect, InputOrDisplay
UnitInput, LabeledInput, LabeledSelect, InputOrDisplay, LabelValue
},
props: {
@@ -75,6 +78,14 @@ export default {
},
computed: {
encryptionValue() {
return ucFirst(String(this.value.isEncrypted));
},
isView() {
return this.mode === _VIEW;
},
imagesOption() {
return this.images.filter(c => c.isReady).sort((a, b) => a.creationTimestamp > b.creationTimestamp ? -1 : 1).map( (I) => {
return {
@@ -272,7 +283,7 @@ export default {
<div class="row mb-20">
<div
data-testid="input-hevi-bus"
class="col span-3"
class="col span-6"
>
<InputOrDisplay
:name="t('harvester.virtualMachine.volume.bus')"
@@ -288,6 +299,15 @@ export default {
/>
</InputOrDisplay>
</div>
<div
v-if="isView"
class="col span-6"
>
<LabelValue
:name="t('harvester.virtualMachine.volume.encryption')"
:value="encryptionValue"
/>
</div>
</div>
</div>
</template>
@@ -8,6 +8,9 @@ import LabeledSelect from '@shell/components/form/LabeledSelect';
import { PVC, STORAGE_CLASS } from '@shell/config/types';
import { formatSi, parseSi } from '@shell/utils/units';
import { VOLUME_TYPE, InterfaceOption } from '../../../../config/harvester-map';
import { _VIEW } from '@shell/config/query-params';
import LabelValue from '@shell/components/LabelValue';
import { ucFirst } from '@shell/utils/string';
export default {
name: 'HarvesterEditVolume',
@@ -15,7 +18,7 @@ export default {
emits: ['update'],
components: {
InputOrDisplay, Loading, LabeledInput, LabeledSelect, UnitInput,
InputOrDisplay, Loading, LabeledInput, LabeledSelect, UnitInput, LabelValue
},
props: {
@@ -61,6 +64,13 @@ export default {
},
computed: {
encryptionValue() {
return ucFirst(String(this.value.isEncrypted));
},
isView() {
return this.mode === _VIEW;
},
pvcsResource() {
const allPVCs = this.$store.getters['harvester/all'](PVC) || [];
@@ -215,7 +225,7 @@ export default {
<div class="row mb-20">
<div
data-testid="input-hev-bus"
class="col span-3"
class="col span-6"
>
<InputOrDisplay :name="t('harvester.virtualMachine.volume.bus')" :value="value.bus" :mode="mode">
<LabeledSelect
@@ -228,6 +238,15 @@ export default {
/>
</InputOrDisplay>
</div>
<div
v-if="isView"
class="col span-6"
>
<LabelValue
:name="t('harvester.virtualMachine.volume.encryption')"
:value="encryptionValue"
/>
</div>
</div>
</div>
</template>