[pve-devel] [PATCH manager 1/7] www: use render_u2f_error from wtk

Wolfgang Bumiller w.bumiller at proxmox.com
Tue Nov 9 12:27:08 CET 2021


Signed-off-by: Wolfgang Bumiller <w.bumiller at proxmox.com>
---
 www/manager6/Utils.js              | 11 -----------
 www/manager6/dc/TFAEdit.js         |  2 +-
 www/manager6/window/LoginWindow.js |  2 +-
 3 files changed, 2 insertions(+), 13 deletions(-)

diff --git a/www/manager6/Utils.js b/www/manager6/Utils.js
index 274d4db2..c907eecf 100644
--- a/www/manager6/Utils.js
+++ b/www/manager6/Utils.js
@@ -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; });
diff --git a/www/manager6/dc/TFAEdit.js b/www/manager6/dc/TFAEdit.js
index 54e8d87f..57a73b39 100644
--- a/www/manager6/dc/TFAEdit.js
+++ b/www/manager6/dc/TFAEdit.js
@@ -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),
 	);
     },
 
diff --git a/www/manager6/window/LoginWindow.js b/www/manager6/window/LoginWindow.js
index 2f23cbb5..ecd198a5 100644
--- a/www/manager6/window/LoginWindow.js
+++ b/www/manager6/window/LoginWindow.js
@@ -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;
-- 
2.30.2






More information about the pve-devel mailing list