fix #2334: gui/cloudinit: enable edit button only when editor is set

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@proxmox.com>
This commit is contained in:
Dominik Csapak 2020-01-09 09:59:35 +01:00 committed by Thomas Lamprecht
parent e341425c73
commit d790a1b45e

View File

@ -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();