root: gettext('Superuser'),
admin: gettext('Administrator'),
qmanager: gettext('Quarantine Manager'),
- audit: gettext('Auditor'),
+ audit: gettext('Auditor')
},
format_user_role: function(role) {
Q: 'quarantine'
},
- icon_status_map: {
- 2: {
- fa: 'check-circle',
- color: 'green'
- },
- 4: {
- fa: 'clock-o',
- },
- 5: {
- fa: 'mail-reply',
- color: 'gray'
- },
- N: {
- fa: 'times-circle'
- },
- G: {
- fa: 'list'
- },
- A: {
- fa: 'check',
- color: 'green'
- },
- B: {
- fa: 'ban',
- color: 'red'
- },
- Q: {
- fa: 'cube'
- }
+ icon_status_map_class: {
+ 2: 'check-circle',
+ 4: 'clock-o',
+ 5: 'mail-reply',
+ N: 'times-circle',
+ G: 'list',
+ A: 'check',
+ B: 'ban',
+ Q: 'cube'
+ },
+
+ icon_status_map_color: {
+ 2: 'green',
+ 5: 'gray',
+ A: 'green',
+ B: 'red'
},
format_status_icon: function(status) {
- var icon = PMG.Utils.icon_status_map[status] || {};
- return '<i class="fa fa-' + (icon.fa || 'question-circle') + ' ' +
- (icon.color || '') + '"></i> ';
+ var icon = PMG.Utils.icon_status_map_class[status] || 'question-circle';
+ var color = PMG.Utils.icon_status_map_color[status] || '';
+ return '<i class="fa fa-' + icon + ' ' + color + '"></i> ';
},
format_oclass: function(oclass) {
}
},
- openVNCViewer: function(consoletype, nodename) {
- var url = Ext.urlEncode({
- console: consoletype, // upgrade or shell
- novnc: 1,
- node: nodename
- });
- var nw = window.open("?" + url, '_blank',
- "innerWidth=745,innerheight=427");
- nw.focus();
- },
-
updateLoginData: function(data) {
Proxmox.CSRFPreventionToken = data.CSRFPreventionToken;
Proxmox.UserName = data.username;
var cselect = qs.cselect;
var action = qs.action;
var ticket = qs.ticket;
+ var dateString = qs.date;
+
+ if (dateString) {
+ var date = new Date(dateString).getTime()/1000;
+
+ // set from date for QuarantineList
+ /*jslint confusion: true*/
+ /*from is a string above and number here */
+ PMG.QuarantineList.from = date;
+ /*jslint confusion: false*/
+ }
delete qs.cselect;
delete qs.action;
delete qs.ticket;
+ delete qs.date;
var newsearch = Ext.Object.toQueryString(qs);
var from = Ext.htmlEncode(rec.data.from);
var sender = Ext.htmlEncode(rec.data.sender);
if (sender) {
+ /*jslint confusion: true*/
+ /*format is a string above*/
from = Ext.String.format(gettext("{0} on behalf of {1}"),
sender, from);
+ /*jslint confusion: false*/
}
return '<small>' + from + '</small><br>' + subject;
},