mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2026-10-07 14:46:15 +08:00
Latest changes from Harvester master - d7d9d4af8a88d677695d7aff47a81d52041dfcca
Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>
This commit is contained in:
@@ -2,6 +2,10 @@ import { clone } from '@shell/utils/object';
|
||||
import StorageClass from '@shell/models/storage.k8s.io.storageclass';
|
||||
import { HCI } from '../../types';
|
||||
import { PRODUCT_NAME as HARVESTER_PRODUCT } from '../../config/harvester';
|
||||
import { LONGHORN_DRIVER } from '@shell/config/types';
|
||||
import { DATA_ENGINE_V1, DATA_ENGINE_V2 } from '../../edit/harvesterhci.io.storage/index.vue';
|
||||
|
||||
export const LVM_DRIVER = 'lvm.driver.harvesterhci.io';
|
||||
|
||||
export default class HciStorageClass extends StorageClass {
|
||||
get detailLocation() {
|
||||
@@ -31,4 +35,30 @@ export default class HciStorageClass extends StorageClass {
|
||||
get parentNameOverride() {
|
||||
return this.$rootGetters['i18n/t'](`typeLabel."${ HCI.STORAGE }"`, { count: 1 })?.trim();
|
||||
}
|
||||
|
||||
get longhornVersion() {
|
||||
if (this.provisioner === LONGHORN_DRIVER) {
|
||||
return (this.parameters || {}).dataEngine || DATA_ENGINE_V1;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
get provisionerDisplay() {
|
||||
let key = '';
|
||||
|
||||
if (this.provisioner === LONGHORN_DRIVER) {
|
||||
key = `harvester.storage.storageClass.longhorn.${ this.longhornVersion }.label`;
|
||||
}
|
||||
|
||||
if (this.provisioner === LVM_DRIVER) {
|
||||
key = `harvester.storage.storageClass.lvm.label`;
|
||||
}
|
||||
|
||||
return this.$rootGetters['i18n/t'](key);
|
||||
}
|
||||
|
||||
get isLonghornV2() {
|
||||
return this.provisioner === LONGHORN_DRIVER && this.longhornVersion === DATA_ENGINE_V2;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user