mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2025-12-13 21:21:44 +00:00
Merge pull request #149 from a110605/issue_7572_2
More third party storage UI change
This commit is contained in:
commit
f4edfb8f43
@ -23,10 +23,9 @@ import Tags from '../../components/DiskTags';
|
|||||||
import { DATA_ENGINE_V1, DATA_ENGINE_V2 } from '../../models/harvester/persistentvolumeclaim';
|
import { DATA_ENGINE_V1, DATA_ENGINE_V2 } from '../../models/harvester/persistentvolumeclaim';
|
||||||
import { LVM_DRIVER } from '../../models/harvester/storage.k8s.io.storageclass';
|
import { LVM_DRIVER } from '../../models/harvester/storage.k8s.io.storageclass';
|
||||||
|
|
||||||
const LONGHORN_V2_DATA_ENGINE = 'longhorn-system/v2-data-engine';
|
|
||||||
|
|
||||||
export const LVM_TOPOLOGY_LABEL = 'topology.lvm.csi/node';
|
export const LVM_TOPOLOGY_LABEL = 'topology.lvm.csi/node';
|
||||||
|
|
||||||
|
const LONGHORN_V2_DATA_ENGINE = 'longhorn-system/v2-data-engine';
|
||||||
const VOLUME_BINDING_MODE_IMMEDIATE = 'Immediate';
|
const VOLUME_BINDING_MODE_IMMEDIATE = 'Immediate';
|
||||||
const VOLUME_BINDING_MODE_WAIT = 'WaitForFirstConsumer';
|
const VOLUME_BINDING_MODE_WAIT = 'WaitForFirstConsumer';
|
||||||
|
|
||||||
|
|||||||
@ -63,7 +63,7 @@ export default {
|
|||||||
diskSelector: null,
|
diskSelector: null,
|
||||||
nodeSelector: null,
|
nodeSelector: null,
|
||||||
encrypted: 'false',
|
encrypted: 'false',
|
||||||
migratable: 'false',
|
migratable: this.value.thirdPartyStorageFeatureEnabled ? 'true' : 'false',
|
||||||
dataEngine: DATA_ENGINE_V2
|
dataEngine: DATA_ENGINE_V2
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -318,7 +318,7 @@ export default {
|
|||||||
:label="t('harvester.storage.parameters.migratable.label')"
|
:label="t('harvester.storage.parameters.migratable.label')"
|
||||||
:mode="mode"
|
:mode="mode"
|
||||||
:options="migratableOptions"
|
:options="migratableOptions"
|
||||||
:disabled="true"
|
:disabled="!value.thirdPartyStorageFeatureEnabled"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="row mt-20">
|
<div class="row mt-20">
|
||||||
|
|||||||
@ -46,22 +46,37 @@ export default class HciPv extends HarvesterResource {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.isLonghorn || !this.isLonghornV2) {
|
const exportImageAction = {
|
||||||
out = [
|
|
||||||
{
|
|
||||||
action: 'exportImage',
|
action: 'exportImage',
|
||||||
enabled: this.hasAction('export') && !this.isEncrypted,
|
enabled: this.hasAction('export') && !this.isEncrypted,
|
||||||
icon: 'icon icon-copy',
|
icon: 'icon icon-copy',
|
||||||
label: this.t('harvester.action.exportImage')
|
label: this.t('harvester.action.exportImage')
|
||||||
},
|
};
|
||||||
{
|
const takeSnapshotAction = {
|
||||||
action: 'snapshot',
|
action: 'snapshot',
|
||||||
enabled: this.hasAction('snapshot'),
|
enabled: this.hasAction('snapshot'),
|
||||||
icon: 'icon icon-backup',
|
icon: 'icon icon-backup',
|
||||||
label: this.t('harvester.action.snapshot'),
|
label: this.t('harvester.action.snapshot'),
|
||||||
},
|
};
|
||||||
|
|
||||||
|
if (this.thirdPartyStorageFeatureEnabled) { // v1.5.0
|
||||||
|
out = [
|
||||||
|
exportImageAction,
|
||||||
|
takeSnapshotAction,
|
||||||
...out
|
...out
|
||||||
];
|
];
|
||||||
|
// TODO: remove this block if Longhorn V2 engine supports restore volume snapshot
|
||||||
|
if (this.isLonghornV2) {
|
||||||
|
out = out.filter((action) => action.action !== takeSnapshotAction.action);
|
||||||
|
}
|
||||||
|
} else { // v1.4 / v1.3
|
||||||
|
if (!this.isLonghorn || !this.isLonghornV2) {
|
||||||
|
out = [
|
||||||
|
exportImageAction,
|
||||||
|
takeSnapshotAction,
|
||||||
|
...out
|
||||||
|
];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return [
|
return [
|
||||||
@ -325,6 +340,10 @@ export default class HciPv extends HarvesterResource {
|
|||||||
return this.dataEngine === DATA_ENGINE_V2;
|
return this.dataEngine === DATA_ENGINE_V2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get thirdPartyStorageFeatureEnabled() {
|
||||||
|
return this.$rootGetters['harvester-common/getFeatureEnabled']('thirdPartyStorage');
|
||||||
|
}
|
||||||
|
|
||||||
get resourceExternalLink() {
|
get resourceExternalLink() {
|
||||||
const host = window.location.host;
|
const host = window.location.host;
|
||||||
const { params } = this.currentRoute();
|
const { params } = this.currentRoute();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user