]> git.proxmox.com Git - proxmox-backup.git/commitdiff
ui: tfa: add auto-fill button for webAuthn setup
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 1 Feb 2021 13:53:45 +0000 (14:53 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 1 Feb 2021 14:37:47 +0000 (15:37 +0100)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
www/config/WebauthnView.js

index 8f68ac004bc988bc57bc760146f8dcd63163f850..b23e813a22d7df4f5eec7108900e7a72d8c5c1b3 100644 (file)
@@ -82,5 +82,26 @@ Ext.define('PBS.WebauthnConfigEdit', {
            name: 'id',
            allowBlank: false,
        },
+       {
+           xtype: 'container',
+           layout: 'hbox',
+           items: [
+               {
+                   xtype: 'box',
+                   flex: 1,
+               },
+               {
+                   xtype: 'button',
+                   text: gettext('Auto-fill'),
+                   iconCls: 'fa fa-fw fa-pencil-square-o',
+                   handler: function(button, ev) {
+                       let panel = this.up('panel');
+                       panel.down('field[name=rp]').setValue(document.location.hostname);
+                       panel.down('field[name=origin]').setValue(document.location.origin);
+                       panel.down('field[name=id]').setValue(document.location.hostname);
+                   },
+               },
+           ],
+       },
     ],
 });