]>
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
7 layout
: { type
: 'hbox', align
: 'stretch' },
10 initComponent : function() {
13 if (me
.ogclass
=== undefined) {
14 throw "undefined object group class"
17 if (!(me
.title
= PMG
.Utils
.oclass_text
[me
.ogclass
])) {
18 throw "unknown object group class";
21 var left
= Ext
.create('PMG.ObjectGroupList', {
28 var right
= Ext
.create('PMG.ObjectGroup', {
29 otype_list
: me
.otype_list
,
33 dblclickOGInfo: function(w
, e
, t
, ogdata
) {
34 // test if the correct groups is selected (just to be sure)
35 var rec
= left
.selModel
.getSelection()[0];
36 if (rec
&& rec
.data
&& rec
.data
.id
=== ogdata
.id
) {
44 me
.mon(left
.store
, "refresh", function() {
45 var rec
= left
.selModel
.getSelection()[0];
46 if (!(rec
&& rec
.data
&& rec
.data
.id
)) {
49 right
.setObjectInfo(rec
.data
);
52 me
.mon(left
.selModel
, "selectionchange", function() {
53 var rec
= left
.selModel
.getSelection()[0];
54 if (!(rec
&& rec
.data
&& rec
.data
.id
)) {
55 right
.setObjectInfo(undefined);
56 right
.setBaseUrl(undefined);
59 right
.setObjectInfo(rec
.data
);
60 var baseurl
= '/config/ruledb/' + me
.ogclass
+ '/' + rec
.data
.id
;
61 right
.setBaseUrl(baseurl
);
64 me
.items
= [ left
, { xtype
: 'splitter' }, right
];
70 Ext
.define('PMG.WhoConfiguration', {
71 extend
: 'PMG.ObjectGroupConfiguration',
72 xtype
: 'pmgWhoConfiguration',
75 otype_list
: [1000, 1001, 1002, 1003, 1004, 1005, 1006]
78 Ext
.define('PMG.WhenConfiguration', {
79 extend
: 'PMG.ObjectGroupConfiguration',
80 xtype
: 'pmgWhenConfiguration',
86 Ext
.define('PMG.WhatConfiguration', {
87 extend
: 'PMG.ObjectGroupConfiguration',
88 xtype
: 'pmgWhatConfiguration',