[pve-devel] [PATCH manager] fix #2334: gui/cloudinit: enable edit button only when editor is set

Dominik Csapak d.csapak at proxmox.com
Thu Jan 9 09:59:35 CET 2020


when a user does not have the right privileges for cloudinit (e.g.
VM.Config.Network), we do not set an editor, which results in a button
that does nothing when pressed

fix this by enabling the button only when there is an editor set

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 www/manager6/qemu/CloudInit.js | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/www/manager6/qemu/CloudInit.js b/www/manager6/qemu/CloudInit.js
index cb4742e5..cbb4af9d 100644
--- a/www/manager6/qemu/CloudInit.js
+++ b/www/manager6/qemu/CloudInit.js
@@ -65,6 +65,10 @@ Ext.define('PVE.qemu.CloudInit', {
 	{
 	    xtype: 'proxmoxButton',
 	    disabled: true,
+	    enableFn: function(rec) {
+		let me = this.up('pveCiPanel');
+		return !!me.rows[rec.data.key].editor;
+	    },
 	    handler: function() {
 		var me = this.up('grid');
 		me.run_editor();
-- 
2.20.1





More information about the pve-devel mailing list