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>
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;
+ }
}
});
},
],
+ 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 };