]>
git.proxmox.com Git - pmg-gui.git/blob - js/Utils.js
3 console
.log("Starting PMG Manager");
6 Ext
.define('PMG.Utils', {
9 // this singleton contains miscellaneous utilities
11 senderText
: gettext('Sender'),
12 receiverText
: gettext('Receiver'),
15 who
: gettext('Who Objects'),
16 what
: gettext('What Objects'),
17 when
: gettext('When Objects'),
18 action
: gettext('Action Objects'),
19 from: gettext('From'),
24 who
: '<span class="fa fa-fw fa-user-circle"></span> ',
25 what
: '<span class="fa fa-fw fa-cube"></span> ',
26 when
: '<span class="fa fa-fw fa-clock-o"></span> ',
27 action
: '<span class="fa fa-fw fa-flag"></span> ',
28 from: '<span class="fa fa-fw fa-user-circle"></span> ',
29 to
: '<span class="fa fa-fw fa-user-circle"></span> ',
32 format_oclass: function(oclass
) {
33 var icon
= PMG
.Utils
.oclass_icon
[oclass
] || '';
34 var text
= PMG
.Utils
.oclass_text
[oclass
] || oclass
;
38 rule_direction_text
: {
41 2: gettext('In & Out')
44 format_rule_direction: function(dir
) {
45 return PMG
.Utils
.rule_direction_text
[dir
] || dir
;
48 format_otype: function(otype
) {
49 var editor
= PMG
.Utils
.object_editors
[otype
];
51 return editor
.subject
;
56 format_ldap_protocol: function(p
) {
57 if (p
=== undefined) return 'LDAP';
58 if (p
=== 'ldap') return 'LDAP';
59 if (p
=== 'ldaps') return 'LDAPS';
65 xtype
: 'proxmoxWindowEdit',
67 subject
: gettext("Regular Expression"),
74 fieldLabel
: gettext("Regular Expression")
79 xtype
: 'pmgLDAPGroupEditor',
81 subject
: gettext("LDAP Group")
84 xtype
: 'pmgLDAPUserEditor',
86 subject
: gettext("LDAP User")
89 xtype
: 'proxmoxWindowEdit',
90 subdir
: 'receiver_regex',
91 subject
: gettext("Regular Expression"),
99 fieldLabel
: gettext("Regular Expression")
104 xtype
: 'proxmoxWindowEdit',
106 subject
: gettext("Email"),
112 fieldLabel
: gettext("Email")
117 xtype
: 'proxmoxWindowEdit',
119 subject
: gettext("Email"),
126 fieldLabel
: gettext("Email")
131 xtype
: 'proxmoxWindowEdit',
133 subject
: gettext("Domain"),
139 fieldLabel
: gettext("Domain")
144 xtype
: 'proxmoxWindowEdit',
145 subdir
: 'receiver_domain',
146 subject
: gettext("Domain"),
153 fieldLabel
: gettext("Domain")
158 xtype
: 'proxmoxWindowEdit',
160 subject
: gettext("IP Address"),
166 fieldLabel
: gettext("IP Address")
171 xtype
: 'proxmoxWindowEdit',
173 subject
: gettext("IP Network"),
179 fieldLabel
: gettext("IP Network")
184 xtype
: 'proxmoxWindowEdit',
186 subject
: gettext("TimeFrame"),
192 fieldLabel
: gettext("Start Time")
198 fieldLabel
: gettext("End Time")
203 xtype
: 'proxmoxWindowEdit',
205 subject
: gettext('BCC'),
212 fieldLabel
: gettext('Name')
215 xtype
: 'textareafield',
217 fieldLabel
: gettext("Description")
223 fieldLabel
: gettext("Target")
226 xtype
: 'proxmoxcheckbox',
229 fieldLabel
: gettext("send orig. Mail")
236 openVNCViewer: function(consoletype
, nodename
) {
237 var url
= Ext
.urlEncode({
238 console
: consoletype
, // upgrade or shell
242 var nw
= window
.open("?" + url
, '_blank',
243 "innerWidth=745,innerheight=427");
247 updateLoginData: function(data
) {
248 Proxmox
.CSRFPreventionToken
= data
.CSRFPreventionToken
;
249 Proxmox
.UserName
= data
.username
;
250 Ext
.util
.Cookies
.set('PMGAuthCookie', data
.ticket
, null, '/', null, true );
253 constructor: function() {
256 // do whatever you want here