]>
git.proxmox.com Git - pve-manager.git/blob - www/manager6/form/TFASelector.js
d5334f8af3aef70184cbf9267673886492b47503
1 Ext
.define('PVE.form.TFASelector', {
2 extend
: 'Ext.container.Container',
3 xtype
: 'pveTFASelector',
16 isOath
: (get) => get('type') === 'oath',
17 isYubico
: (get) => get('type') === 'yubico',
24 let step
= get('step');
25 let digits
= get('digits');
32 } else if (get('isYubico')) {
41 } else if (val
.type
=== '__default__') {
45 return PVE
.Parser
.printPropertyString(val
);
47 set: function(value
) {
48 let val
= PVE
.Parser
.parseTfaConfig(value
);
51 // we need to reset the original values, so that
52 // we can reliably track the state of the form
53 let form
= this.getView().up('form');
54 if (form
.trackResetOnLoad
) {
55 let fields
= this.getView().query('field[name!="tfa"]');
56 fields
.forEach((field
) => field
.resetOriginalValue());
65 xtype
: 'proxmoxtextfield',
75 xtype
: 'proxmoxKVComboBox',
79 fieldLabel
: gettext('TFA'),
80 comboItems
: [['__default__', Proxmox
.Utils
.noneText
], ['oath', 'OATH'], ['yubico', 'Yubico']],
86 xtype
: 'proxmoxintegerfield',
90 emptyText
: Proxmox
.Utils
.defaultText
+ ' (30)',
91 fieldLabel
: 'OATH time step',
95 disabled
: "{!isOath}",
99 xtype
: 'proxmoxintegerfield',
102 fieldLabel
: 'OATH password length',
105 emptyText
: Proxmox
.Utils
.defaultText
+ ' (6)',
109 disabled
: "{!isOath}",
117 fieldLabel
: 'Yubico API Id',
120 hidden
: "{!isYubico}",
121 disabled
: "{!isYubico}",
129 fieldLabel
: 'Yubico API Key',
132 hidden
: "{!isYubico}",
133 disabled
: "{!isYubico}",
140 fieldLabel
: 'Yubico URL',
143 hidden
: "{!isYubico}",
144 disabled
: "{!isYubico}",