]> git.proxmox.com Git - pmg-gui.git/blob - js/Utils.js
add TimeFrame editor
[pmg-gui.git] / js / Utils.js
1 Ext.ns('PMG');
2
3 console.log("Starting PMG Manager");
4
5
6 Ext.define('PMG.Utils', {
7 singleton: true,
8
9 // this singleton contains miscellaneous utilities
10
11 senderText: gettext('Sender'),
12 receiverText: gettext('Receiver'),
13
14 oclass_text: {
15 who: gettext('Who Objects'),
16 what: gettext('What Objects'),
17 when: gettext('When Objects'),
18 action: gettext('Action Objects')
19 },
20
21 format_otype: function(otype) {
22 var editor = PMG.Utils.object_editors[otype];
23 if (editor) {
24 return editor.subject;
25 }
26 return 'unknown';
27 },
28
29 object_editors: {
30 1000: {
31 subdir: 'regex',
32 subject: gettext("Regular Expression"),
33 width: 400,
34 items: [
35 {
36 xtype: 'textfield',
37 name: 'regex',
38 labelWidth: 150,
39 fieldLabel: gettext("Regular Expression")
40 }
41 ]
42 },
43 1009: {
44 subdir: 'receiver_regex',
45 subject: gettext("Regular Expression"),
46 receivertest: true,
47 width: 400,
48 items: [
49 {
50 xtype: 'textfield',
51 name: 'regex',
52 labelWidth: 150,
53 fieldLabel: gettext("Regular Expression")
54 }
55 ]
56 },
57 1001: {
58 subdir: 'email',
59 subject: gettext("Email"),
60 width: 400,
61 items: [
62 {
63 xtype: 'textfield',
64 name: 'email',
65 fieldLabel: gettext("Email")
66 }
67 ]
68 },
69 1007: {
70 subdir: 'receiver',
71 subject: gettext("Email"),
72 receivertest: true,
73 width: 400,
74 items: [
75 {
76 xtype: 'textfield',
77 name: 'email',
78 fieldLabel: gettext("Email")
79 }
80 ]
81 },
82 1002: {
83 subdir: 'domain',
84 subject: gettext("Domain"),
85 width: 400,
86 items: [
87 {
88 xtype: 'textfield',
89 name: 'domain',
90 fieldLabel: gettext("Domain")
91 }
92 ]
93 },
94 1008: {
95 subdir: 'receiver_domain',
96 subject: gettext("Domain"),
97 receivertest: true,
98 width: 400,
99 items: [
100 {
101 xtype: 'textfield',
102 name: 'domain',
103 fieldLabel: gettext("Domain")
104 }
105 ]
106 },
107 1003: {
108 subdir: 'ip',
109 subject: gettext("IP Address"),
110 width: 400,
111 items: [
112 {
113 xtype: 'textfield',
114 name: 'ip',
115 fieldLabel: gettext("IP Address")
116 }
117 ]
118 },
119 1004: {
120 subdir: 'network',
121 subject: gettext("IP Network"),
122 width: 400,
123 items: [
124 {
125 xtype: 'textfield',
126 name: 'cidr',
127 fieldLabel: gettext("IP Network")
128 }
129 ]
130 },
131 2000: {
132 subdir: 'timeframe',
133 subject: gettext("TimeFrame"),
134 items: [
135 {
136 xtype: 'timefield',
137 name: 'start',
138 format: 'H:i',
139 fieldLabel: gettext("Start Time")
140 },
141 {
142 xtype: 'timefield',
143 name: 'end',
144 format: 'H:i',
145 fieldLabel: gettext("End Time")
146 }
147 ]
148 }
149 },
150
151 constructor: function() {
152 var me = this;
153
154 // do whatever you want here
155 }
156 });