]> git.proxmox.com Git - pve-manager-legacy.git/commitdiff
ui: tfa: move qrcode creation to controller
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 4 Apr 2019 08:07:25 +0000 (10:07 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 4 Apr 2019 08:07:25 +0000 (10:07 +0200)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
www/manager6/dc/TFAEdit.js

index 18d202eff3aedc11c6e121cbcdd9d198ca7671be..cfd492e3f18077d252e00da1547a5b5c8c6b60f8 100644 (file)
@@ -153,6 +153,12 @@ Ext.define('PVE.window.TFAEdit', {
                    var me = this.getView();
                    var viewmodel = this.getViewModel();
 
+                   me.qrdiv = document.createElement('center');
+                   me.qrcode = new QRCode(me.qrdiv, {
+                       width: 256,
+                       height: 256,
+                       correctLevel: QRCode.CorrectLevel.M
+                   });
                    me.down('#qrbox').getEl().appendChild(me.qrdiv);
 
                    viewmodel.set('has_tfa', me.hasTFA);
@@ -390,7 +396,7 @@ Ext.define('PVE.window.TFAEdit', {
                            labelWidth: 120,
                            reference: 'challenge',
                            padding: '0 5',
-                           emptyText: gettext('verify TOTP authentication code')
+                           emptyText: gettext('Scan QR code and enter TOTP auth. code to verify')
                        }
                    ]
                },
@@ -459,13 +465,6 @@ Ext.define('PVE.window.TFAEdit', {
     initComponent: function() {
        var me = this;
 
-       me.qrdiv = document.createElement('center');
-       me.qrcode = new QRCode(me.qrdiv, {
-           width: 256,
-           height: 256,
-           correctLevel: QRCode.CorrectLevel.M
-       });
-
        var store = new Ext.data.Store({
            model: 'pve-domains',
            autoLoad: true