]>
git.proxmox.com Git - pve-manager.git/blob - www/manager6/form/TFASelector.js
1 Ext
.define('PVE.form.TFASelector', {
2 extend
: 'Ext.container.Container',
3 xtype
: 'pveTFASelector',
4 mixins
: ['Proxmox.Mixin.CBind'],
19 isOath
: (get) => get('type') === 'oath',
20 isYubico
: (get) => get('type') === 'yubico',
27 let step
= get('step');
28 let digits
= get('digits');
35 } else if (get('isYubico')) {
44 } else if (val
.type
=== '__default__') {
48 return PVE
.Parser
.printPropertyString(val
);
50 set: function(value
) {
51 let val
= PVE
.Parser
.parseTfaConfig(value
);
54 // we need to reset the original values, so that
55 // we can reliably track the state of the form
56 let form
= this.getView().up('form');
57 if (form
.trackResetOnLoad
) {
58 let fields
= this.getView().query('field[name!="tfa"]');
59 fields
.forEach((field
) => field
.resetOriginalValue());
68 xtype
: 'proxmoxtextfield',
73 deleteEmpty
: '{deleteEmpty}',
80 xtype
: 'proxmoxKVComboBox',
84 fieldLabel
: gettext('Require TFA'),
86 ['__default__', Proxmox
.Utils
.noneText
],
87 ['oath', 'OATH/TOTP'],
95 xtype
: 'proxmoxintegerfield',
99 emptyText
: Proxmox
.Utils
.defaultText
+ ' (30)',
100 fieldLabel
: gettext('Time Step'),
104 disabled
: "{!isOath}",
108 xtype
: 'proxmoxintegerfield',
111 fieldLabel
: gettext('Secret Length'),
114 emptyText
: Proxmox
.Utils
.defaultText
+ ' (6)',
118 disabled
: "{!isOath}",
126 fieldLabel
: 'Yubico API Id',
129 hidden
: "{!isYubico}",
130 disabled
: "{!isYubico}",
138 fieldLabel
: 'Yubico API Key',
141 hidden
: "{!isYubico}",
142 disabled
: "{!isYubico}",
149 fieldLabel
: 'Yubico URL',
152 hidden
: "{!isYubico}",
153 disabled
: "{!isYubico}",