mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2026-10-01 03:36:04 +08:00
feat: add cdrom hotplug volume (#703)
Signed-off-by: Tim Liou <tim.liou@suse.com>
This commit is contained in:
@@ -183,7 +183,7 @@ export default class VirtVm extends HarvesterResource {
|
||||
},
|
||||
{
|
||||
action: 'ejectCDROM',
|
||||
enabled: !!this.actions?.ejectCdRom,
|
||||
enabled: !this.hotplugCdRomEnabled && !!this.actions?.ejectCdRom,
|
||||
icon: 'icon icon-delete',
|
||||
label: this.t('harvester.action.ejectCDROM')
|
||||
},
|
||||
@@ -401,6 +401,17 @@ export default class VirtVm extends HarvesterResource {
|
||||
});
|
||||
}
|
||||
|
||||
ejectCdRomVolume(diskName) {
|
||||
const resources = this;
|
||||
|
||||
this.$dispatch('promptModal', {
|
||||
resources,
|
||||
name: diskName,
|
||||
type: 'cdrom',
|
||||
component: 'HarvesterHotUnplug',
|
||||
});
|
||||
}
|
||||
|
||||
unplugNIC(networkName) {
|
||||
const resources = this;
|
||||
|
||||
@@ -523,6 +534,16 @@ export default class VirtVm extends HarvesterResource {
|
||||
});
|
||||
}
|
||||
|
||||
insertCdRomVolume(diskName) {
|
||||
const resources = this;
|
||||
|
||||
this.$dispatch('promptModal', {
|
||||
resources,
|
||||
name: diskName,
|
||||
component: 'HarvesterInsertCdRomVolume',
|
||||
});
|
||||
}
|
||||
|
||||
addHotplugNic(resources = this) {
|
||||
this.$dispatch('promptModal', {
|
||||
resources,
|
||||
@@ -1267,6 +1288,10 @@ export default class VirtVm extends HarvesterResource {
|
||||
return this.$rootGetters['harvester-common/getFeatureEnabled']('hotplugNic');
|
||||
}
|
||||
|
||||
get hotplugCdRomEnabled() {
|
||||
return this.$rootGetters['harvester-common/getFeatureEnabled']('hotplugCdRom');
|
||||
}
|
||||
|
||||
get isBackupTargetUnavailable() {
|
||||
const allSettings = this.$rootGetters['harvester/all'](HCI.SETTING) || [];
|
||||
const backupTargetSetting = allSettings.find( (O) => O.id === 'backup-target');
|
||||
|
||||
Reference in New Issue
Block a user