mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-07-26 05:56:30 +00:00
cloudinit: implement missing remove logic
this was missing from my original series also enable deletion of the password field via remove button Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
parent
122c653aff
commit
2ed6dceb9e
@ -24,10 +24,39 @@ Ext.define('PVE.qemu.CloudInit', {
|
|||||||
!caps.vms['VM.Config.Network']) {
|
!caps.vms['VM.Config.Network']) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (record.data.key === 'cipassword' && !record.data.value) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
handler: function() {
|
handler: function() {
|
||||||
var me = this.up('grid');
|
var me = this.up('grid');
|
||||||
|
var records = me.getSelection();
|
||||||
|
if (!records || !records.length) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var id = records[0].data.key;
|
||||||
|
var match = id.match(/^net(\d+)$/);
|
||||||
|
if (match) {
|
||||||
|
id = 'ipconfig' + match[1];
|
||||||
|
}
|
||||||
|
|
||||||
|
var params = {};
|
||||||
|
params['delete'] = id;
|
||||||
|
Proxmox.Utils.API2Request({
|
||||||
|
url: me.baseurl + '/config',
|
||||||
|
waitMsgTarget: me,
|
||||||
|
method: 'PUT',
|
||||||
|
params: params,
|
||||||
|
failure: function(response, opts) {
|
||||||
|
Ext.Msg.alert('Error', response.htmlStatus);
|
||||||
|
},
|
||||||
|
callback: function() {
|
||||||
|
me.reload();
|
||||||
|
}
|
||||||
|
});
|
||||||
},
|
},
|
||||||
text: gettext('Remove')
|
text: gettext('Remove')
|
||||||
},
|
},
|
||||||
@ -185,7 +214,6 @@ Ext.define('PVE.qemu.CloudInit', {
|
|||||||
cipassword: {
|
cipassword: {
|
||||||
header: gettext('Password'),
|
header: gettext('Password'),
|
||||||
iconCls: 'fa fa-unlock',
|
iconCls: 'fa fa-unlock',
|
||||||
never_delete: true,
|
|
||||||
defaultValue: '',
|
defaultValue: '',
|
||||||
editor: caps.vms['VM.Config.Options'] ? {
|
editor: caps.vms['VM.Config.Options'] ? {
|
||||||
xtype: 'proxmoxWindowEdit',
|
xtype: 'proxmoxWindowEdit',
|
||||||
|
Loading…
Reference in New Issue
Block a user