[pve-devel] [PATCH v4 manager 3/3] ui: vm-options: add spice enhancements

Aaron Lauterer a.lauterer at proxmox.com
Mon Oct 7 15:23:52 CEST 2019


Signed-off-by: Aaron Lauterer <a.lauterer at proxmox.com>
---

As suggested by Thomas in [0] I removed the gettext around the feature
names to have the same feature names accross all translations. This
should help if people start searching for a problem with them.

Removed the check if values is falsy because parsePropertyString can now
handle it [1].

[0]: https://pve.proxmox.com/pipermail/pve-devel/2019-October/039387.html
[1]: https://git.proxmox.com/?p=pve-manager.git;a=commit;h=a017d8aaa1c7338745b0be55bc1d8d386cdc2b74

www/manager6/Utils.js        | 18 ++++++++++++++++++
 www/manager6/qemu/Options.js | 14 ++++++++++++++
 2 files changed, 32 insertions(+)

diff --git a/www/manager6/Utils.js b/www/manager6/Utils.js
index 5cc6b674..84e45b21 100644
--- a/www/manager6/Utils.js
+++ b/www/manager6/Utils.js
@@ -334,6 +334,24 @@ Ext.define('PVE.Utils', { utilities: {
 	}
     },
 
+    render_spice_enhancements: function(values) {
+	let disabled = Proxmox.Utils.disabledText;
+
+	let props = PVE.Parser.parsePropertyString(values);
+	if (Ext.Object.isEmpty(props)) {
+	    return disabled;
+	}
+
+	let output = [];
+	if (PVE.Parser.parseBoolean(props.foldersharing)) {
+	    output.push('Folder Sharing: ' + gettext('Enabled'));
+	}
+	if (props.videostreaming === 'all' || props.videostreaming === 'filter') {
+	    output.push('Video Streaming: ' + props.videostreaming);
+	}
+	return output.join(', ');
+    },
+
     // fixme: auto-generate this
     // for now, please keep in sync with PVE::Tools::kvmkeymaps
     kvm_keymaps: {
diff --git a/www/manager6/qemu/Options.js b/www/manager6/qemu/Options.js
index e1580060..4a8e06e9 100644
--- a/www/manager6/qemu/Options.js
+++ b/www/manager6/qemu/Options.js
@@ -281,6 +281,20 @@ Ext.define('PVE.qemu.Options', {
 		    }
 		} : undefined
 	    },
+	    spice_enhancements: {
+		header: gettext('Spice Enhancements'),
+		defaultValue: false,
+		renderer:  PVE.Utils.render_spice_enhancements,
+		editor: caps.vms['VM.Config.Options'] ? {
+		    xtype: 'proxmoxWindowEdit',
+		    subject: gettext('Spice Enhancements'),
+		    onlineHelp: 'qm_spice_enhancements',
+		    items: {
+			xtype: 'pveSpiceEnhancementSelector',
+			name: 'spice_enhancements',
+		    }
+		} : undefined
+	    },
 	    hookscript: {
 		header: gettext('Hookscript')
 	    }
-- 
2.20.1





More information about the pve-devel mailing list