]>
git.proxmox.com Git - proxmox-backup.git/blob - www/config/WebauthnView.js
1 Ext
.define('PBS.WebauthnConfigView', {
2 extend
: 'Proxmox.grid.ObjectGrid',
3 alias
: ['widget.pbsWebauthnConfigView'],
5 url
: "/api2/json/config/access/tfa/webauthn",
11 header
: gettext('Relying Party'),
13 defaultValue
: gettext('Not configured'),
16 header
: gettext('Origin'),
18 defaultValue
: gettext('Not configured'),
23 defaultValue
: gettext('Not configured'),
29 text
: gettext("Edit"),
34 xclass
: 'Ext.app.ViewController',
36 runEditor
: () => Ext
.create('PBS.WebauthnConfigEdit', { autoShow
: true }),
38 startStore: function() { this.getView().getStore().rstore
.startUpdate(); },
39 stopStore: function() { this.getView().getStore().rstore
.stopUpdate(); },
44 itemdblclick
: 'runEditor',
45 activate
: 'startStore',
46 deactivate
: 'stopStore',
50 Ext
.define('PBS.WebauthnConfigEdit', {
51 extend
: 'Proxmox.window.Edit',
52 alias
: ['widget.pbsWebauthnConfigEdit'],
54 subject
: gettext('Webauthn'),
55 url
: "/api2/extjs/config/access/tfa/webauthn",
64 setValues: function(values
) {
67 me
.relayingPartySet
= values
&& typeof values
.rp
=== 'string';
69 me
.callParent(arguments
);
75 fieldLabel
: gettext('Relying Party'),
79 dirtychange: function(field
, isDirty
) {
80 let win
= field
.up('window');
81 let warningBox
= win
.down('box[id=rpChangeWarning]');
82 warningBox
.setHidden(!win
.relayingPartySet
|| !isDirty
);
88 fieldLabel
: gettext('Origin'),
108 text
: gettext('Auto-fill'),
109 iconCls
: 'fa fa-fw fa-pencil-square-o',
110 handler: function(button
, ev
) {
111 let panel
= this.up('panel');
112 panel
.down('field[name=rp]').setValue(document
.location
.hostname
);
113 panel
.down('field[name=origin]').setValue(document
.location
.origin
);
114 panel
.down('field[name=id]').setValue(document
.location
.hostname
);
121 html
: `<span class='pmx-hint'>${gettext('Note:')}</span> `
122 + gettext('WebAuthn requires using a trusted certificate.'),
126 id
: 'rpChangeWarning',
129 html
: '<i class="fa fa-exclamation-triangle warning"></i> '
130 + gettext('Changing the Relying Party may break existing webAuthn TFA entries.'),