]>
git.proxmox.com Git - pve-manager.git/blob - www/manager6/dc/AuthView.js
1 Ext
.define('PVE.dc.AuthView', {
2 extend
: 'Ext.grid.GridPanel',
4 alias
: ['widget.pveAuthView'],
6 onlineHelp
: 'pveum_authentication_realms',
9 stateId
: 'grid-authrealms',
17 header
: gettext('Realm'),
23 header
: gettext('Type'),
29 header
: gettext('TFA'),
35 header
: gettext('Comment'),
38 renderer
: Ext
.String
.htmlEncode
,
51 openEditWindow: function(authType
, realm
) {
53 Ext
.create('PVE.dc.AuthEditBase', {
57 destroy
: () => me
.reload(),
67 run_editor: function() {
69 let rec
= me
.getSelection()[0];
73 me
.openEditWindow(rec
.data
.type
, rec
.data
.realm
);
76 open_sync_window: function() {
78 let rec
= me
.getSelection()[0];
82 Ext
.create('PVE.dc.SyncWindow', {
83 realm
: rec
.data
.realm
,
85 destroy
: () => me
.reload(),
90 initComponent: function() {
94 for (const [authType
, config
] of Object
.entries(PVE
.Utils
.authSchema
)) {
95 if (!config
.add
) { continue; }
98 iconCls
: 'fa fa-fw ' + (config
.iconCls
|| 'fa-address-book-o'),
99 handler
: () => me
.openEditWindow(authType
),
106 text
: gettext('Add'),
112 xtype
: 'proxmoxButton',
113 text
: gettext('Edit'),
115 handler
: () => me
.run_editor(),
118 xtype
: 'proxmoxStdRemoveButton',
119 baseurl
: '/access/domains/',
120 enableFn
: (rec
) => PVE
.Utils
.authSchema
[rec
.data
.type
].add
,
121 callback
: () => me
.reload(),
125 xtype
: 'proxmoxButton',
126 text
: gettext('Sync'),
128 enableFn
: (rec
) => Boolean(PVE
.Utils
.authSchema
[rec
.data
.type
].syncipanel
),
129 handler
: () => me
.open_sync_window(),
133 itemdblclick
: () => me
.run_editor(),