]>
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
,
33 objectClass
: me
.ogclass
,
37 dblclickOGInfo: function(w
, e
, t
, ogdata
) {
38 // test if the correct groups is selected (just to be sure)
39 var rec
= left
.selModel
.getSelection()[0];
40 if (rec
&& rec
.data
&& rec
.data
.id
=== ogdata
.id
) {
44 modeUpdate
: () => left
.reload(),
48 me
.mon(left
.store
, "refresh", function() {
49 var rec
= left
.selModel
.getSelection()[0];
50 if (!(rec
&& rec
.data
&& rec
.data
.id
)) {
53 right
.setObjectInfo(rec
.data
);
56 me
.mon(left
.selModel
, "selectionchange", function() {
57 var rec
= left
.selModel
.getSelection()[0];
58 if (!(rec
&& rec
.data
&& rec
.data
.id
)) {
59 right
.setObjectInfo(undefined);
60 right
.setBaseUrl(undefined);
63 right
.setObjectInfo(rec
.data
);
64 var baseurl
= '/config/ruledb/' + me
.ogclass
+ '/' + rec
.data
.id
;
65 right
.setBaseUrl(baseurl
);
68 me
.items
= [left
, right
];
74 Ext
.define('PMG.WhoConfiguration', {
75 extend
: 'PMG.ObjectGroupConfiguration',
76 xtype
: 'pmgWhoConfiguration',
79 otype_list
: [1000, 1001, 1002, 1003, 1004, 1005, 1006],
82 Ext
.define('PMG.WhenConfiguration', {
83 extend
: 'PMG.ObjectGroupConfiguration',
84 xtype
: 'pmgWhenConfiguration',
90 Ext
.define('PMG.WhatConfiguration', {
91 extend
: 'PMG.ObjectGroupConfiguration',
92 xtype
: 'pmgWhatConfiguration',
95 otype_list
: [3000, 3001, 3002, 3003, 3004, 3005, 3006],