]> git.proxmox.com Git - pve-manager.git/commitdiff
Add 'type' option to AgentFeatureSelector
authorMatt Dunwoodie <ncon@noconroy.net>
Tue, 19 Nov 2019 14:25:55 +0000 (01:25 +1100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 20 Nov 2019 19:45:30 +0000 (20:45 +0100)
This adds an extra field to the AgentFeatureSelector that reflects the
change in qemu-server.

Changes since previous version:

 * Use map rather than if/else if/else for type display string.
 * Use Proxmox.Utils.unknownText for unknown type (should not occur with
   regular use).
 * Keep existing fields as boxLabel rather than fieldLabel, as they
   look crammed with fieldLabel.
 * Use __default__ for default option, to save space and replicate
   behaviour in other places.
 * Store option in advancedItems as it is a special case.

Even though the map only contains one item, it will be easily added to
in the future. There is only one item as there is no need to have a
string for "virtio" as it is not displayed because of __default__.

Signed-off-by: Matt Dunwoodie <ncon@noconroy.net>
www/manager6/Utils.js
www/manager6/form/AgentFeatureSelector.js

index 55b06e50c1b6b59ff7e63960aa600a3d7fb733f5..15cd4f4cf88a3655aeca3be19d227f37303f5563 100644 (file)
@@ -276,10 +276,17 @@ Ext.define('PVE.Utils', { utilities: {
            var keystring = '' ;
            agentstring += ', ' + key + ': ';
 
-           if (PVE.Parser.parseBoolean(value)) {
-               agentstring += Proxmox.Utils.enabledText;
+           if (key === 'type') {
+               let map = {
+                   isa: "ISA",
+               };
+               agentstring += map[value] || Proxmox.Utils.unknownText;
            } else {
-               agentstring += Proxmox.Utils.disabledText;
+               if (PVE.Parser.parseBoolean(value)) {
+                   agentstring += Proxmox.Utils.enabledText;
+               } else {
+                   agentstring += Proxmox.Utils.disabledText;
+               }
            }
        });
 
index 44ef2e577306fb2de81d0cd49965fef82b509378..4a968fdb49b29f7a09b3fffd7b955ae34183b9f3 100644 (file)
@@ -31,6 +31,20 @@ Ext.define('PVE.form.AgentFeatureSelector', {
        },
     ],
 
+    advancedItems: [
+       {
+           xtype: 'proxmoxKVComboBox',
+           name: 'type',
+           value: '__default__',
+           deleteEmpty: false,
+           fieldLabel: 'Type',
+           comboItems: [
+               ['__default__', Proxmox.Utils.defaultText + " (VirtIO)"],
+               ['isa', 'ISA'],
+           ],
+       }
+    ],
+
     onGetValues: function(values) {
        var agentstr = PVE.Parser.printPropertyString(values, 'enabled');
        return { agent: agentstr };