]> git.proxmox.com Git - pve-manager.git/commitdiff
ui: ha: use vmComboSelector when adding new resource
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 11 Oct 2017 10:09:42 +0000 (12:09 +0200)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Mon, 16 Oct 2017 12:54:22 +0000 (14:54 +0200)
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@proxmox.com>
Acked-by: Dominik Csapak <d.csapak@proxmox.com>
www/manager6/ha/ResourceEdit.js

index 07a83062bc92e8956a606d3b04b85f5a51b6fa6f..afcbca0550b16acffab0f7ca057a77c6f17119da 100644 (file)
@@ -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
            },
            {