mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-08-05 16:18:25 +00:00
ui: node certs: make delete button safer, add confirmation
IMO the behavior was really dangerous prev., possibly causing downtime of API accessing stuff with a single mistaken click. Follow our general pattern and ask for confirmation Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
b1b0fcbcd3
commit
028e4cd309
@ -252,26 +252,23 @@ Ext.define('PVE.node.Certificates', {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
xtype: 'button',
|
xtype: 'proxmoxStdRemoveButton',
|
||||||
itemId: 'deletebtn',
|
itemId: 'deletebtn',
|
||||||
text: gettext('Delete Custom Certificate'),
|
text: gettext('Delete Custom Certificate'),
|
||||||
handler: function() {
|
dangerous: true,
|
||||||
var me = this.up('grid');
|
selModel: false,
|
||||||
Proxmox.Utils.API2Request({
|
getUrl: function(rec) {
|
||||||
url: '/nodes/' + me.nodename + '/certificates/custom?restart=1',
|
let view = this.up('grid');
|
||||||
method: 'DELETE',
|
return `/nodes/${view.nodename}/certificates/custom?restart=1`;
|
||||||
success: function(response, opt) {
|
},
|
||||||
var txt = gettext('pveproxy will be restarted with new certificates, please reload the GUI!');
|
confirmMsg: gettext('Delete custom certificate and switch to generated one?'),
|
||||||
Ext.getBody().mask(txt, ['pve-static-mask']);
|
callback: function(options, success, response) {
|
||||||
// reload after 10 seconds automatically
|
if (success) {
|
||||||
Ext.defer(function() {
|
let txt = gettext('API server will be restarted to use new certificates, please reload web-interface!');
|
||||||
window.location.reload(true);
|
Ext.getBody().mask(txt, ['pve-static-mask']);
|
||||||
}, 10000);
|
// reload after 10 seconds automatically
|
||||||
},
|
Ext.defer(() => window.location.reload(true), 10000);
|
||||||
failure: function(response, opt) {
|
}
|
||||||
Ext.Msg.alert(gettext('Error'), response.htmlStatus);
|
|
||||||
},
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
'-',
|
'-',
|
||||||
|
Loading…
Reference in New Issue
Block a user