]>
git.proxmox.com Git - pve-manager.git/blob - www/manager6/dc/RoleView.js
1 Ext
.define('PVE.dc.RoleView', {
2 extend
: 'Ext.grid.GridPanel',
4 alias
: ['widget.pveRoleView'],
6 onlineHelp
: 'pveum_roles',
11 initComponent : function() {
14 var store
= new Ext
.data
.Store({
22 var render_privs = function(value
, metaData
) {
29 metaData
.style
= 'white-space:normal;';
31 return value
.replace(/\,/g, ' ');
34 Proxmox
.Utils
.monStoreErrors(me
, store
);
36 var sm
= Ext
.create('Ext.selection.RowModel', {});
38 var reload = function() {
42 var run_editor = function() {
43 var rec
= sm
.getSelection()[0];
48 if (!!rec
.data
.special
) {
52 var win
= Ext
.create('PVE.dc.RoleEdit', {
53 roleid
: rec
.data
.roleid
,
54 privs
: rec
.data
.privs
,
56 win
.on('destroy', reload
);
69 header
: gettext('Built-In'),
73 renderer
: Proxmox
.Utils
.format_boolean
,
76 header
: gettext('Name'),
83 header
: gettext('Privileges'),
85 renderer
: render_privs
,
91 activate: function() {
94 itemdblclick
: run_editor
,
98 text
: gettext('Create'),
100 var win
= Ext
.create('PVE.dc.RoleEdit', {});
101 win
.on('destroy', reload
);
106 xtype
: 'proxmoxButton',
107 text
: gettext('Edit'),
111 enableFn
: (rec
) => !rec
.data
.special
,
114 xtype
: 'proxmoxStdRemoveButton',
116 callback: function() {
119 baseurl
: '/access/roles/',
120 enableFn
: (rec
) => !rec
.data
.special
,