]> git.proxmox.com Git - pmg-gui.git/blob - js/Utils.js
SMTPWhitelist.js: implement add menu
[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 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 width: 400,
27 items: [
28 {
29 xtype: 'textfield',
30 name: 'regex',
31 labelWidth: 150,
32 fieldLabel: gettext("Regular Expression")
33 }
34 ]
35 },
36 1009: {
37 subdir: 'receiver_regex',
38 subject: gettext("Regular Expression"),
39 receivertest: true,
40 width: 400,
41 items: [
42 {
43 xtype: 'textfield',
44 name: 'regex',
45 labelWidth: 150,
46 fieldLabel: gettext("Regular Expression")
47 }
48 ]
49 },
50 1001: {
51 subdir: 'email',
52 subject: gettext("Email"),
53 width: 400,
54 items: [
55 {
56 xtype: 'textfield',
57 name: 'email',
58 fieldLabel: gettext("Email")
59 }
60 ]
61 },
62 1007: {
63 subdir: 'receiver',
64 subject: gettext("Email"),
65 receivertest: true,
66 width: 400,
67 items: [
68 {
69 xtype: 'textfield',
70 name: 'email',
71 fieldLabel: gettext("Email")
72 }
73 ]
74 },
75 1002: {
76 subdir: 'domain',
77 subject: gettext("Domain"),
78 width: 400,
79 items: [
80 {
81 xtype: 'textfield',
82 name: 'domain',
83 fieldLabel: gettext("Domain")
84 }
85 ]
86 },
87 1008: {
88 subdir: 'receiver_domain',
89 subject: gettext("Domain"),
90 receivertest: true,
91 width: 400,
92 items: [
93 {
94 xtype: 'textfield',
95 name: 'domain',
96 fieldLabel: gettext("Domain")
97 }
98 ]
99 },
100 1003: {
101 subdir: 'ip',
102 subject: gettext("IP Address"),
103 width: 400,
104 items: [
105 {
106 xtype: 'textfield',
107 name: 'ip',
108 fieldLabel: gettext("IP Address")
109 }
110 ]
111 },
112 1004: {
113 subdir: 'network',
114 subject: gettext("IP Network"),
115 width: 400,
116 items: [
117 {
118 xtype: 'textfield',
119 name: 'cidr',
120 fieldLabel: gettext("IP Network")
121 }
122 ]
123 }
124 },
125
126 constructor: function() {
127 var me = this;
128
129 // do whatever you want here
130 }
131 });