[pve-devel] [PATCH v10 manager 13/19] ui: multi disk edit: allow adding a disk with existing settings
Fabian Ebner
f.ebner at proxmox.com
Wed Apr 6 10:04:10 CEST 2022
Signed-off-by: Fabian Ebner <f.ebner at proxmox.com>
---
www/manager6/lxc/MultiMPEdit.js | 7 ++++++-
www/manager6/panel/MultiDiskEdit.js | 6 +++---
www/manager6/qemu/MultiHDEdit.js | 11 +++++++++--
3 files changed, 18 insertions(+), 6 deletions(-)
diff --git a/www/manager6/lxc/MultiMPEdit.js b/www/manager6/lxc/MultiMPEdit.js
index 7310ad05..15d33e15 100644
--- a/www/manager6/lxc/MultiMPEdit.js
+++ b/www/manager6/lxc/MultiMPEdit.js
@@ -30,8 +30,13 @@ Ext.define('PVE.lxc.MultiMPPanel', {
return nextFreeDisk;
},
- addPanel: function(itemId, vmconfig, confid) {
+ addPanel: function(itemId, vmconfig, confid, settings) {
let me = this;
+
+ if (settings) {
+ console.warn("MultiMPPanel - volume settings ignored");
+ }
+
return me.getView().add({
vmconfig,
border: false,
diff --git a/www/manager6/panel/MultiDiskEdit.js b/www/manager6/panel/MultiDiskEdit.js
index ace10eea..cdc1df42 100644
--- a/www/manager6/panel/MultiDiskEdit.js
+++ b/www/manager6/panel/MultiDiskEdit.js
@@ -31,14 +31,14 @@ Ext.define('PVE.panel.MultiDiskPanel', {
throw "implement in subclass";
},
- addPanel: function(itemId, vmconfig, confid) {
+ addPanel: function(itemId, vmconfig, confid, settings) {
throw "implement in subclass";
},
// define in subclass
diskSorter: undefined,
- addDisk: function(confid) {
+ addDisk: function(confid, settings) {
let me = this;
let grid = me.lookup('grid');
let store = grid.getStore();
@@ -66,7 +66,7 @@ Ext.define('PVE.panel.MultiDiskPanel', {
itemId,
})[0];
- let panel = me.addPanel(itemId, vmconfig, confid);
+ let panel = me.addPanel(itemId, vmconfig, confid, settings);
panel.updateVMConfig(vmconfig);
// we need to setup a validitychange handler, so that we can show
diff --git a/www/manager6/qemu/MultiHDEdit.js b/www/manager6/qemu/MultiHDEdit.js
index c981cd98..e6cc9676 100644
--- a/www/manager6/qemu/MultiHDEdit.js
+++ b/www/manager6/qemu/MultiHDEdit.js
@@ -16,9 +16,10 @@ Ext.define('PVE.qemu.MultiHDPanel', {
return PVE.Utils.nextFreeDisk(clist, vmconfig);
},
- addPanel: function(itemId, vmconfig, confid) {
+ addPanel: function(itemId, vmconfig, confid, settings) {
let me = this;
- return me.getView().add({
+
+ let newPanel = me.getView().add({
vmconfig,
border: false,
showAdvanced: Ext.state.Manager.getProvider().get('proxmox-advanced-cb'),
@@ -32,6 +33,12 @@ Ext.define('PVE.qemu.MultiHDPanel', {
insideWizard: true,
preSelectConfid: confid,
});
+
+ if (settings) {
+ newPanel.setDrive(settings);
+ }
+
+ return newPanel;
},
getBaseVMConfig: function() {
--
2.30.2
More information about the pve-devel
mailing list