]> git.proxmox.com Git - pmg-gui.git/blame - js/Utils.js
move object editor configuration to PMG.Utils.object_editors
[pmg-gui.git] / js / Utils.js
CommitLineData
fe81f069
DM
1Ext.ns('PMG');
2
fe81f069
DM
3console.log("Starting PMG Manager");
4
fe81f069 5
2c7b542d
DM
6Ext.define('PMG.Utils', {
7 singleton: true,
8
fe81f069
DM
9 // this singleton contains miscellaneous utilities
10
f9b851e8
DM
11 senderText: gettext('Sender'),
12 receiverText: gettext('Receiver'),
012f0f49
DM
13
14 format_otype: function(otype) {
15 var editor = PMG.Utils.object_editors[otype];
16 if (editor) {
17 return editor.subject;
18 }
19 return 'unknown';
20 },
21
22 object_editors: {
23 1000: {
24 subdir: 'regex',
25 subject: gettext("Regular Expression"),
26 items: [
27 {
28 xtype: 'textfield',
29 name: 'regex',
30 fieldLabel: gettext("Regular Expression")
31 }
32 ]
33 },
34 1009: {
35 subdir: 'receiver_regex',
36 subject: gettext("Regular Expression"),
37 items: [
38 {
39 xtype: 'textfield',
40 name: 'regex',
41 fieldLabel: gettext("Regular Expression")
42 }
43 ]
44 },
45 1001: {
46 subdir: 'email',
47 subject: gettext("Email"),
48 items: [
49 {
50 xtype: 'textfield',
51 name: 'email',
52 fieldLabel: gettext("Email")
53 }
54 ]
55 },
56 1007: {
57 subdir: 'receiver',
58 subject: gettext("Email"),
59 items: [
60 {
61 xtype: 'textfield',
62 name: 'email',
63 fieldLabel: gettext("Email")
64 }
65 ]
66 },
67 1002: {
68 subdir: 'domain',
69 subject: gettext("Domain"),
70 items: [
71 {
72 xtype: 'textfield',
73 name: 'domain',
74 fieldLabel: gettext("Domain")
75 }
76 ]
77 },
78 1008: {
79 subdir: 'receiver_domain',
80 subject: gettext("Domain"),
81 items: [
82 {
83 xtype: 'textfield',
84 name: 'domain',
85 fieldLabel: gettext("Domain")
86 }
87 ]
88 },
89 1003: {
90 subdir: 'ip',
91 subject: gettext("IP Address"),
92 items: [
93 {
94 xtype: 'textfield',
95 name: 'ip',
96 fieldLabel: gettext("IP Address")
97 }
98 ]
99 },
100 1004: {
101 subdir: 'network',
102 subject: gettext("IP Network"),
103 items: [
104 {
105 xtype: 'textfield',
106 name: 'cidr',
107 fieldLabel: gettext("IP Network")
108 }
109 ]
110 }
111 },
fe81f069 112
fe81f069
DM
113 constructor: function() {
114 var me = this;
fe81f069 115
2c7b542d 116 // do whatever you want here
fe81f069
DM
117 }
118});