]>
git.proxmox.com Git - pve-manager.git/blob - www/manager6/form/RealmComboBox.js
1 Ext
.define('PVE.form.RealmComboBox', {
2 extend
: 'Ext.form.field.ComboBox',
3 alias
: ['widget.pveRealmComboBox'],
5 needOTP: function(realm
) {
8 var rec
= me
.store
.findRecord('realm', realm
);
10 return rec
&& rec
.data
&& rec
.data
.tfa
? rec
.data
.tfa
: undefined;
13 initComponent: function() {
16 var stateid
= 'pveloginrealm';
18 var realmstore
= Ext
.create('Ext.data.Store', {
23 fieldLabel
: gettext('Realm'),
32 displayField
: 'descr',
33 getState: function() {
34 return { value
: this.getValue() };
36 applyState : function(state
) {
37 if (state
&& state
.value
) {
38 this.setValue(state
.value
);
41 stateEvents
: [ 'select' ],
43 id
: stateid
, // fixme: remove (Stateful does not work without)
50 callback: function(r
, o
, success
) {
52 var def
= me
.getValue();
53 if (!def
|| !realmstore
.findRecord('realm', def
)) {
55 Ext
.each(r
, function(record
) {
56 if (record
.data
&& record
.data
["default"]) {
57 def
= record
.data
.realm
;