]>
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',
8 initComponent : function() {
11 var store
= new Ext
.data
.Store({
19 var reload = function() {
23 var sm
= Ext
.create('Ext.selection.RowModel', {});
25 var run_editor = function() {
26 var rec
= sm
.getSelection()[0];
31 var win
= Ext
.create('PVE.dc.AuthEdit',{
32 realm
: rec
.data
.realm
,
33 authType
: rec
.data
.type
35 win
.on('destroy', reload
);
39 var edit_btn
= new PVE
.button
.Button({
40 text
: gettext('Edit'),
46 var remove_btn
= new PVE
.button
.Button({
47 text
: gettext('Remove'),
50 confirmMsg: function (rec
) {
51 return Ext
.String
.format(gettext('Are you sure you want to remove entry {0}'),
52 "'" + rec
.data
.realm
+ "'");
54 enableFn: function(rec
) {
55 return !(rec
.data
.type
=== 'pve' || rec
.data
.type
=== 'pam');
57 handler: function(btn
, event
, rec
) {
58 var realm
= rec
.data
.realm
;
60 PVE
.Utils
.API2Request({
61 url
: '/access/domains/' + realm
,
64 callback: function() {
67 failure: function (response
, opts
) {
68 Ext
.Msg
.alert(gettext('Error'), response
.htmlStatus
);
77 menu
: new Ext
.menu
.Menu({
80 text
: gettext('Active Directory Server'),
82 var win
= Ext
.create('PVE.dc.AuthEdit', {
85 win
.on('destroy', reload
);
90 text
: gettext('LDAP Server'),
92 var win
= Ext
.create('PVE.dc.AuthEdit',{
95 win
.on('destroy', reload
);
115 header
: gettext('Realm'),
121 header
: gettext('Type'),
127 header
: gettext('TFA'),
133 header
: gettext('Comment'),
135 dataIndex
: 'comment',
136 renderer
: Ext
.String
.htmlEncode
,
142 itemdblclick
: run_editor