[pve-devel] [PATCH manager 2/7] ui: ha: use vmComboSelector when adding new resource

Thomas Lamprecht t.lamprecht at proxmox.com
Wed Oct 11 12:09:42 CEST 2017


Make adding resources more comfortable by showing the user also the
name, type, node, ... in a nice combo box grid when adding a
resource instead of just a integer spinner.

Fixes: #1517
Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---
 www/manager6/ha/ResourceEdit.js | 22 ++++++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)

diff --git a/www/manager6/ha/ResourceEdit.js b/www/manager6/ha/ResourceEdit.js
index 49dcfaa5..a70a1c75 100644
--- a/www/manager6/ha/ResourceEdit.js
+++ b/www/manager6/ha/ResourceEdit.js
@@ -65,15 +65,33 @@ Ext.define('PVE.ha.VMResourceInputPanel', {
 	    }
 	});
 
-	// value is a string above, but a number below
 	/*jslint confusion: true */
+	var vmidStore = (me.vmid) ? {} : {
+	    model: 'PVEResources',
+	    autoLoad: true,
+	    sorters: 'vmid',
+	    filters: [
+		{
+		    property: 'type',
+		    value: /lxc|qemu/
+		},
+		{
+		    property: 'hastate',
+		    value: /unmanaged/
+		}
+	    ]
+	};
+
+	// value is a string above, but a number below
 	me.column1 = [
 	    {
-		xtype: me.vmid ? 'displayfield' : 'pveGuestIDSelector',
+		xtype: me.vmid ? 'displayfield' : 'vmComboSelector',
+		submitValue: me.isCreate,
 		name: 'vmid',
 		fieldLabel: (me.vmid && me.guestType === 'ct') ? 'CT' : 'VM',
 		value: me.vmid,
 		loadNextGuestID: false,
+		store: vmidStore,
 		validateExists: true
 	    },
 	    {
-- 
2.11.0





More information about the pve-devel mailing list