www: use render_u2f_error from wtk

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Wolfgang Bumiller 2021-11-09 12:27:08 +01:00 committed by Thomas Lamprecht
parent 358d3efd1d
commit d35665de6c
3 changed files with 2 additions and 13 deletions

View File

@ -1302,17 +1302,6 @@ Ext.define('PVE.Utils', {
return Ext.htmlEncode(first + " " + last);
},
render_u2f_error: function(error) {
var ErrorNames = {
'1': gettext('Other Error'),
'2': gettext('Bad Request'),
'3': gettext('Configuration Unsupported'),
'4': gettext('Device Ineligible'),
'5': gettext('Timeout'),
};
return "U2F Error: " + ErrorNames[error] || Proxmox.Utils.unknownText;
},
windowHostname: function() {
return window.location.hostname.replace(Proxmox.Utils.IP6_bracket_match,
function(m, addr, offset, original) { return addr; });

View File

@ -44,7 +44,7 @@ Ext.define('PVE.window.TFAEdit', {
showError: function(error) {
Ext.Msg.alert(
gettext('Error'),
PVE.Utils.render_u2f_error(error),
Proxmox.Utils.render_u2f_error(error),
);
},

View File

@ -151,7 +151,7 @@ Ext.define('PVE.window.LoginWindow', {
msg.close();
if (res.errorCode) {
Proxmox.Utils.authClear();
Ext.Msg.alert(gettext('Error'), PVE.Utils.render_u2f_error(res.errorCode));
Ext.Msg.alert(gettext('Error'), Proxmox.Utils.render_u2f_error(res.errorCode));
return;
}
delete res.errorCode;