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
@@ -173,15 +173,15 @@ export default {
methods: {
lockIconTooltipMessage(row) {
if (row.isVMImageEncrypted && row.isVolumeEncrypted) {
return this.t('harvester.virtualMachine.lockIconTooltip.both');
} else if (row.isVMImageEncrypted) {
return this.t('harvester.virtualMachine.lockIconTooltip.image');
} else if (row.isVolumeEncrypted) {
return this.t('harvester.virtualMachine.lockIconTooltip.volume');
const message = '';
if (row.encryptedVolumeType === 'all') {
return this.t('harvester.virtualMachine.volume.lockTooltip.all');
} else if (row.encryptedVolumeType === 'partial') {
return this.t('harvester.virtualMachine.volume.lockTooltip.partial');
}
return '';
return message;
}
}
};
@@ -213,7 +213,12 @@ export default {
:to="scope.row.detailLocation"
>
{{ scope.row.metadata.name }}
<i v-if="lockIconTooltipMessage(scope.row)" v-tooltip="lockIconTooltipMessage(scope.row)" class="icon icon-lock" />
<i
v-if="lockIconTooltipMessage(scope.row)"
v-tooltip="lockIconTooltipMessage(scope.row)"
class="icon icon-lock"
:class="{'green-icon': scope.row.encryptedVolumeType === 'all', 'yellow-icon': scope.row.encryptedVolumeType === 'partial'}"
/>
</router-link>
<span v-else>
{{ scope.row.metadata.name }}
@@ -234,6 +239,14 @@ export default {
}
}
.green-icon {
color: var(--success);
}
.yellow-icon {
color: var(--warning);
}
.name-console {
display: flex;
align-items: center;