[pve-devel] [PATCH v10 manager 12/19] ui: multi disk edit: add removeAllDisks function

Fabian Ebner f.ebner at proxmox.com
Wed Apr 6 10:04:09 CEST 2022


to be used by the upcoming import functionality.

Signed-off-by: Fabian Ebner <f.ebner at proxmox.com>
---
 www/manager6/panel/MultiDiskEdit.js | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/www/manager6/panel/MultiDiskEdit.js b/www/manager6/panel/MultiDiskEdit.js
index 7ba8246a..ace10eea 100644
--- a/www/manager6/panel/MultiDiskEdit.js
+++ b/www/manager6/panel/MultiDiskEdit.js
@@ -5,6 +5,10 @@ Ext.define('PVE.panel.MultiDiskPanel', {
 	this.items.each((panel) => panel.setNodename(nodename));
     },
 
+    removeAllDisks: function() {
+	this.getController().removeAllDisks();
+    },
+
     border: false,
     bodyBorder: false,
 
@@ -82,6 +86,18 @@ Ext.define('PVE.panel.MultiDiskPanel', {
 	    }
 	},
 
+	removeAllDisks: function() {
+	    let me = this;
+	    let grid = me.lookup('grid');
+
+	    grid.getSelectionModel().select([], false);
+	    me.getView().removeAll();
+	    grid.getStore().setData([]);
+
+	    me.updateVMConfig();
+	    me.checkValidity();
+	},
+
 	getBaseVMConfig: function() {
 	    throw "implement in subclass";
 	},
-- 
2.30.2






More information about the pve-devel mailing list