certs: ui-reload: code cleanup and better gettext

there's no "GUI Server" in Proxmox projects..

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2021-03-28 14:31:11 +02:00
parent 64d85d96b3
commit 08d092b679
2 changed files with 12 additions and 13 deletions

View File

@ -86,13 +86,12 @@ Ext.define('Proxmox.panel.Certificates', {
method: 'DELETE',
success: function(response, opt) {
if (cert.reloadUid) {
let txt =
gettext('GUI will be restarted with new certificates, please reload!');
Ext.getBody().mask(txt, ['x-mask-loading']);
// reload after 10 seconds automatically
Ext.defer(function() {
window.location.reload(true);
}, 10000);
Ext.getBody().mask(
gettext('API server will be restarted to use new certificates, please reload web-interface!'),
['pve-static-mask'],
);
// try to reload after 10 seconds automatically
Ext.defer(() => window.location.reload(true), 10000);
}
},
failure: function(response, opt) {

View File

@ -122,12 +122,12 @@ Ext.define('Proxmox.window.CertificateUpload', {
return;
}
var txt = gettext('GUI server will be restarted with new certificates, please reload!');
Ext.getBody().mask(txt, ['pve-static-mask']);
// reload after 10 seconds automatically
Ext.defer(function() {
window.location.reload(true);
}, 10000);
Ext.getBody().mask(
gettext('API server will be restarted to use new certificates, please reload web-interface!'),
['pve-static-mask'],
);
// try to reload after 10 seconds automatically
Ext.defer(() => window.location.reload(true), 10000);
},
items: [