]>
git.proxmox.com Git - proxmox-widget-toolkit.git/blob - src/panel/AuthView.js
9bd9b3f4292f9fb613922096662919133b993933
1 Ext
.define('Proxmox.panel.AuthView', {
2 extend
: 'Ext.grid.GridPanel',
4 alias
: 'widget.pmxAuthView',
7 stateId
: 'grid-authrealms',
15 header
: gettext('Realm'),
21 header
: gettext('Type'),
27 header
: gettext('Comment'),
30 renderer
: Ext
.String
.htmlEncode
,
43 openEditWindow: function(authType
, realm
) {
45 Ext
.create('Proxmox.window.AuthEditBase', {
49 destroy
: () => me
.reload(),
59 run_editor: function() {
61 let rec
= me
.getSelection()[0];
66 if (!Proxmox
.Schema
.authDomains
[rec
.data
.type
].edit
) {
70 me
.openEditWindow(rec
.data
.type
, rec
.data
.realm
);
73 initComponent: function() {
77 for (const [authType
, config
] of Object
.entries(Proxmox
.Schema
.authDomains
).sort()) {
78 if (!config
.add
) { continue; }
81 iconCls
: 'fa fa-fw ' + (config
.iconCls
|| 'fa-address-book-o'),
82 handler
: () => me
.openEditWindow(authType
),
94 xtype
: 'proxmoxButton',
95 text
: gettext('Edit'),
97 enableFn
: (rec
) => Proxmox
.Schema
.authDomains
[rec
.data
.type
].edit
,
98 handler
: () => me
.run_editor(),
101 xtype
: 'proxmoxStdRemoveButton',
102 baseurl
: '/access/domains/',
103 enableFn
: (rec
) => Proxmox
.Schema
.authDomains
[rec
.data
.type
].add
,
104 callback
: () => me
.reload(),
108 if (me
.extraButtons
) {
110 for (const button
of me
.extraButtons
) {
118 activate
: () => me
.reload(),
119 itemdblclick
: () => me
.run_editor(),