mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2026-10-01 03:36:04 +08:00
More third party storage UI change
Signed-off-by: andy.lee <andy.lee@suse.com>
This commit is contained in:
@@ -46,22 +46,37 @@ export default class HciPv extends HarvesterResource {
|
||||
}
|
||||
}
|
||||
|
||||
if (!this.isLonghorn || !this.isLonghornV2) {
|
||||
const exportImageAction = {
|
||||
action: 'exportImage',
|
||||
enabled: this.hasAction('export') && !this.isEncrypted,
|
||||
icon: 'icon icon-copy',
|
||||
label: this.t('harvester.action.exportImage')
|
||||
};
|
||||
const takeSnapshotAction = {
|
||||
action: 'snapshot',
|
||||
enabled: this.hasAction('snapshot'),
|
||||
icon: 'icon icon-backup',
|
||||
label: this.t('harvester.action.snapshot'),
|
||||
};
|
||||
|
||||
if (this.thirdPartyStorageFeatureEnabled) { // v1.5.0
|
||||
out = [
|
||||
{
|
||||
action: 'exportImage',
|
||||
enabled: this.hasAction('export') && !this.isEncrypted,
|
||||
icon: 'icon icon-copy',
|
||||
label: this.t('harvester.action.exportImage')
|
||||
},
|
||||
{
|
||||
action: 'snapshot',
|
||||
enabled: this.hasAction('snapshot'),
|
||||
icon: 'icon icon-backup',
|
||||
label: this.t('harvester.action.snapshot'),
|
||||
},
|
||||
exportImageAction,
|
||||
takeSnapshotAction,
|
||||
...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 [
|
||||
@@ -325,6 +340,10 @@ export default class HciPv extends HarvesterResource {
|
||||
return this.dataEngine === DATA_ENGINE_V2;
|
||||
}
|
||||
|
||||
get thirdPartyStorageFeatureEnabled() {
|
||||
return this.$rootGetters['harvester-common/getFeatureEnabled']('thirdPartyStorage');
|
||||
}
|
||||
|
||||
get resourceExternalLink() {
|
||||
const host = window.location.host;
|
||||
const { params } = this.currentRoute();
|
||||
|
||||
Reference in New Issue
Block a user