mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2026-10-04 05:06:05 +08:00
Add volume and image encryption feature
Signed-off-by: andy.lee <andy.lee@suse.com>
This commit is contained in:
@@ -7,8 +7,9 @@ import Tabbed from '@shell/components/Tabbed';
|
||||
import Tab from '@shell/components/Tabbed/Tab';
|
||||
import { findBy } from '@shell/utils/array';
|
||||
import { get } from '@shell/utils/object';
|
||||
|
||||
import { ucFirst } from '@shell/utils/string';
|
||||
import Storage from './Storage';
|
||||
import { SECRET } from '@shell/config/types';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@@ -26,8 +27,14 @@ export default {
|
||||
},
|
||||
},
|
||||
|
||||
async fetch() {
|
||||
const inStore = this.$store.getters['currentProduct'].inStore;
|
||||
|
||||
this.secrets = await this.$store.dispatch(`${ inStore }/findAll`, { type: SECRET });
|
||||
},
|
||||
|
||||
data() {
|
||||
return {};
|
||||
return { secrets: [] };
|
||||
},
|
||||
|
||||
computed: {
|
||||
@@ -57,6 +64,21 @@ export default {
|
||||
return this.value?.spec?.sourceType === 'upload';
|
||||
},
|
||||
|
||||
encryptionSecret() {
|
||||
if (!this.value.isEncrypted) {
|
||||
return '-';
|
||||
}
|
||||
|
||||
return this.value.encryptionSecret;
|
||||
},
|
||||
secretLink() {
|
||||
return this.secrets.find(sc => sc.id === this.value.encryptionSecret)?.detailLocation;
|
||||
},
|
||||
|
||||
isEncryptedString() {
|
||||
return ucFirst(String(this.value.isEncrypted));
|
||||
},
|
||||
|
||||
imageName() {
|
||||
return this.value?.metadata?.annotations?.[HCI.IMAGE_NAME] || '-';
|
||||
},
|
||||
@@ -116,6 +138,23 @@ export default {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col span-12">
|
||||
<LabelValue :name="t('harvester.image.isEncryption')" :value="isEncryptedString" class="mb-20" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="value.isEncrypted" class="row">
|
||||
<div class="col span-12">
|
||||
<div class="text-label">
|
||||
{{ t('harvester.image.encryptionSecret') }}
|
||||
</div>
|
||||
<n-link v-if="secretLink" :to="secretLink">
|
||||
{{ encryptionSecret }}
|
||||
</n-link>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="errorMessage !== '-'" class="row">
|
||||
<div class="col span-12">
|
||||
<div>
|
||||
|
||||
Reference in New Issue
Block a user