]> git.proxmox.com Git - pmg-gui.git/blame - js/WhoConfiguration.js
Who.js: display newlines in descriptions
[pmg-gui.git] / js / WhoConfiguration.js
CommitLineData
56b0691b
DM
1Ext.define('PMG.WhoConfiguration', {
2 extend: 'Ext.panel.Panel',
3 alias: 'widget.pmgWhoConfiguration',
4
5 ogclass: 'who',
6
7 title: gettext('Who Objects'),
8
9 layout: { type: 'hbox', align: 'stretch' },
10 border: false,
11
12 initComponent : function() {
13 var me = this;
14
a43acf2e 15 var left = Ext.create('PMG.ObjectGroupList', {
56b0691b
DM
16 width: 250,
17 ogclass: me.ogclass,
a43acf2e 18 subject: me.title,
56b0691b
DM
19 border: false
20 });
21
22 var right = Ext.create('PMG.Who', {
23 otype_list: [1000, 1001, 1002, 1003, 1004],
24 border: false,
25 flex: 1
26 });
27
28 me.mon(left.selModel, "selectionchange", function() {
29 var rec = left.selModel.getSelection()[0];
30 if (!(rec && rec.data && rec.data.id)) {
31 return;
32 }
33 right.setObjectInfo(rec.data.name, rec.data.info);
34 var baseurl = '/config/ruledb/who/' + rec.data.id;
35 right.setBaseUrl(baseurl);
36 });
37
38 me.items = [ left, { xtype: 'splitter' }, right ];
39
40 me.callParent();
41 }
42});