updateLoginData: function(loginData) {
var me = this;
- console.dir(loginData);
-
me.loginData = loginData;
- PMG.CSRFPreventionToken = loginData.CSRFPreventionToken;
- PMG.UserName = loginData.username;
+ Proxmox.CSRFPreventionToken = loginData.CSRFPreventionToken;
+ Proxmox.UserName = loginData.username;
// creates a session cookie (expire = null)
// that way the cookie gets deleted after browser window close
showLogin: function() {
var me = this;
- PMG.Utils.authClear();
- PMG.UserName = null;
+ Proxmox.Utils.authClear();
+ Proxmox.UserName = null;
me.loginData = null;
if (!me.login) {
me.callParent();
- if (!PMG.Utils.authOK()) {
+ if (!Proxmox.Utils.authOK()) {
me.showLogin();
} else {
if (me.loginData) {
Ext.TaskManager.start({
run: function() {
- var ticket = PMG.Utils.authOK();
- if (!ticket || !PMG.UserName) {
+ var ticket = Proxmox.Utils.authOK();
+ if (!ticket || !Proxmox.UserName) {
return;
}
Ext.Ajax.request({
params: {
- username: PMG.UserName,
+ username: Proxmox.UserName,
password: ticket
},
url: '/api2/json/access/ticket',
method: 'POST',
+ failure: function() {
+ me.showLogin();
+ },
success: function(response, opts) {
var obj = Ext.decode(response.responseText);
me.updateLoginData(obj.data);
me.updateUserInfo();
if (loginData) {
- PMG.Utils.API2Request({
+ Proxmox.Utils.API2Request({
url: '/version',
method: 'GET',
success: function(response) {
var ui = me.query('#userinfo')[0];
- if (PMG.UserName) {
- var msg = Ext.String.format(gettext("You are logged in as {0}"), "'" + PMG.UserName + "'");
+ if (Proxmox.UserName) {
+ var msg = Ext.String.format(gettext("You are logged in as {0}"), "'" + Proxmox.UserName + "'");
ui.update('<div class="x-unselectable" style="white-space:nowrap;">' + msg + '</div>');
} else {
ui.update('');
minWidth: 100,
minHeight: 100,
id: 'content',
+ defaults: { layout: 'fit' },
xtype: 'pmgPanelConfig',
items: [
{
xtype: 'panel',
- title: 'Mail Filter',
+ title: gettext('Mail Filter'),
itemId: 'filter',
expandedOnInit: true,
items: [{ xtype: 'pmgRuleConfiguration' }]
{
xtype: 'panel',
groups: ['filter'],
- title: 'Actions',
+ title: PMG.Utils.oclass_text['action'],
itemId: 'filter-actions',
- html: "Actions"
+ items: [{ xtype: 'pmgActionList' }]
},
{
xtype: 'panel',
groups: ['filter'],
- title: 'Who',
+ title: PMG.Utils.oclass_text['who'],
itemId: 'filter-who',
- html: "Who"
+ items: [{ xtype: 'pmgWhoConfiguration' }]
},
{
xtype: 'panel',
groups: ['filter'],
- title: 'What',
+ title: PMG.Utils.oclass_text['what'],
itemId: 'filter-what',
- html: "What"
+ items: [{ xtype: 'pmgWhatConfiguration' }]
+
},
{
xtype: 'panel',
groups: ['filter'],
- title: 'When',
+ title: PMG.Utils.oclass_text['when'],
itemId: 'filter-when',
- html: "When"
+ items: [{ xtype: 'pmgWhenConfiguration' }]
},
-
{
xtype: 'panel',
title: 'Configuration',
itemId: 'configuration',
expandedOnInit: true,
- html: "System Configuration"
+ items: [{ xtype: 'pmgSystemConfiguration' }]
},
{
xtype: 'panel',
groups: ['configuration'],
- title: 'Mail Proxy',
+ title: gettext('Mail Proxy'),
itemId: 'config-mail-proxy',
- html: "Mail Proxy"
+ items: [{ xtype: 'pmgMailProxyConfiguration' }]
},
{
xtype: 'panel',
groups: ['configuration'],
- title: 'Spam Detector',
+ title: gettext('Spam Detector'),
itemId: 'config-spam',
- html: "Spam Detector"
+ items: [{ xtype: 'pmgSpamDetectorConfiguration' }]
},
{
xtype: 'panel',
groups: ['configuration'],
- title: 'Virus Detector',
+ title: gettext('Virus Detector'),
itemId: 'config-virus',
- html: "Virus Detector"
+ items: [{ xtype: 'pmgVirusDetectorConfiguration' }]
},
{
xtype: 'panel',
groups: ['configuration'],
- title: 'User Management',
+ title: gettext('User Management'),
itemId: 'config-users',
- html: "User Management"
+ items: [{ xtype: 'pmgUserManagement' }]
},
{
xtype: 'panel',
groups: ['configuration'],
- title: 'Cluster',
+ title: gettext('Cluster'),
itemId: 'config-cluster',
html: "Cluster"
},
{
xtype: 'panel',
- title: 'Administration',
+ title: gettext('Administration'),
itemId: 'admin',
expandedOnInit: true,
items: [{ xtype: 'pmgServerAdministration' }]
{
xtype: 'panel',
groups: ['admin'],
- title: 'Statistics',
+ title: gettext('Statistics'),
itemId: 'statistics',
html: "Statistics"
},
{
xtype: 'panel',
groups: ['admin'],
- title: 'Quarantine',
+ title: gettext('Quarantine'),
itemId: 'quarantine',
html: "Quarantine"
},
{
xtype: 'panel',
groups: ['admin'],
- title: 'Tracking Center',
+ title: gettext('Tracking Center'),
itemId: 'tracking',
html: "Tracking Center"
},
{
xtype: 'panel',
groups: ['admin'],
- title: 'Queues',
+ title: gettext('Queues'),
itemId: 'queues',
html: "Queues"
}