]>
git.proxmox.com Git - pmg-gui.git/blob - js/ObjectGroupConfiguration.js
1 Ext
.define('PMG.ObjectGroupConfiguration', {
2 extend
: 'Ext.panel.Panel',
4 ogclass
: undefined, // who, when, what
10 initComponent : function() {
13 if (me
.ogclass
=== undefined) {
14 throw "undefined object group class";
17 if (!(PMG
.Utils
.oclass_text
[me
.ogclass
])) {
18 throw "unknown object group class";
21 var left
= Ext
.create('PMG.ObjectGroupList', {
24 subject
: PMG
.Utils
.oclass_text
[me
.ogclass
],
25 title
: PMG
.Utils
.oclass_text
[me
.ogclass
],
31 var right
= Ext
.create('PMG.ObjectGroup', {
32 otype_list
: me
.otype_list
,
36 dblclickOGInfo: function(w
, e
, t
, ogdata
) {
37 // test if the correct groups is selected (just to be sure)
38 var rec
= left
.selModel
.getSelection()[0];
39 if (rec
&& rec
.data
&& rec
.data
.id
=== ogdata
.id
) {
47 me
.mon(left
.store
, "refresh", function() {
48 var rec
= left
.selModel
.getSelection()[0];
49 if (!(rec
&& rec
.data
&& rec
.data
.id
)) {
52 right
.setObjectInfo(rec
.data
);
55 me
.mon(left
.selModel
, "selectionchange", function() {
56 var rec
= left
.selModel
.getSelection()[0];
57 if (!(rec
&& rec
.data
&& rec
.data
.id
)) {
58 right
.setObjectInfo(undefined);
59 right
.setBaseUrl(undefined);
62 right
.setObjectInfo(rec
.data
);
63 var baseurl
= '/config/ruledb/' + me
.ogclass
+ '/' + rec
.data
.id
;
64 right
.setBaseUrl(baseurl
);
67 me
.items
= [ left
, right
];
73 Ext
.define('PMG.WhoConfiguration', {
74 extend
: 'PMG.ObjectGroupConfiguration',
75 xtype
: 'pmgWhoConfiguration',
78 otype_list
: [1000, 1001, 1002, 1003, 1004, 1005, 1006]
81 Ext
.define('PMG.WhenConfiguration', {
82 extend
: 'PMG.ObjectGroupConfiguration',
83 xtype
: 'pmgWhenConfiguration',
89 Ext
.define('PMG.WhatConfiguration', {
90 extend
: 'PMG.ObjectGroupConfiguration',
91 xtype
: 'pmgWhatConfiguration',
94 otype_list
: [3000, 3001, 3002, 3003, 3004, 3005]