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; });
},
showError: function(error) {
- var ErrorNames = {
- '1': gettext('Other Error'),
- '2': gettext('Bad Request'),
- '3': gettext('Configuration Unsupported'),
- '4': gettext('Device Ineligible'),
- '5': gettext('Timeout')
- };
Ext.Msg.alert(
gettext('Error'),
- "U2F Error: " + (ErrorNames[error] || Proxmox.Utils.unknownText)
+ PVE.Utils.render_u2f_error(error)
);
},
msg.close();
if (res.errorCode) {
Proxmox.Utils.authClear();
- Ext.Msg.alert(gettext('Error'), "U2F Error: "+res.errorCode);
+ Ext.Msg.alert(gettext('Error'), PVE.Utils.render_u2f_error(res.errorCode));
return;
}
delete res.errorCode;