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.lampre...@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


_______________________________________________
pve-devel mailing list
pve-devel@pve.proxmox.com
https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to