mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-05-15 17:45:08 +00:00

Using ExtJS6 a browser refresh (F5) do not send the 'show' event which we use to display the store as it did with ExtJS4. At the momment only for tabs inside the datacenter tabpanel, since node and lxc tabpanels are not yet in manager6/
63 lines
1.0 KiB
JavaScript
63 lines
1.0 KiB
JavaScript
Ext.define('PVE.dc.RoleView', {
|
|
extend: 'Ext.grid.GridPanel',
|
|
|
|
alias: ['widget.pveRoleView'],
|
|
|
|
initComponent : function() {
|
|
var me = this;
|
|
|
|
var store = new Ext.data.Store({
|
|
model: 'pve-roles',
|
|
sorters: {
|
|
property: 'roleid',
|
|
order: 'DESC'
|
|
}
|
|
});
|
|
|
|
var render_privs = function(value, metaData) {
|
|
|
|
if (!value) {
|
|
return '-';
|
|
}
|
|
|
|
// allow word wrap
|
|
metaData.style = 'white-space:normal;';
|
|
|
|
return value.replace(/\,/g, ' ');
|
|
};
|
|
|
|
PVE.Utils.monStoreErrors(me, store);
|
|
|
|
Ext.apply(me, {
|
|
store: store,
|
|
stateful: false,
|
|
|
|
viewConfig: {
|
|
trackOver: false
|
|
},
|
|
columns: [
|
|
{
|
|
header: gettext('Name'),
|
|
width: 150,
|
|
sortable: true,
|
|
dataIndex: 'roleid'
|
|
},
|
|
{
|
|
id: 'privs',
|
|
header: gettext('Privileges'),
|
|
sortable: false,
|
|
renderer: render_privs,
|
|
dataIndex: 'privs',
|
|
flex: 1
|
|
}
|
|
],
|
|
listeners: {
|
|
activate: function() {
|
|
store.load();
|
|
}
|
|
}
|
|
});
|
|
|
|
me.callParent();
|
|
}
|
|
}); |