]> git.proxmox.com Git - pmg-gui.git/blobdiff - js/MainView.js
improve gettext usage
[pmg-gui.git] / js / MainView.js
index e537db20f9031f3cc3d0fc5d52502f982360de4c..1bcd83572a039a349da5d7a8d6eca64a5b842741 100644 (file)
@@ -12,8 +12,8 @@ Ext.define('PMG.MainView', {
                action: 'changePath',
                before: 'beforeChangePath',
                 conditions : {
-                   ':path'    : '(?:([%a-zA-Z0-9\-\_\s,]+))',
-                   ':subpath' : '(?:(?::)([%a-zA-Z0-9\-\_\s,]+))?'
+                   ':path'    : '(?:([%a-zA-Z0-9\\-\\_\\s,]+))',
+                   ':subpath' : '(?:(?::)([%a-zA-Z0-9\\-\\_\\s,]+))?'
                }
            }
        },
@@ -35,12 +35,11 @@ Ext.define('PMG.MainView', {
                subpath = subpath || 0;
                if (lastpanel.getActiveTab) {
                    // we assume lastpanel is a tabpanel
-                   if (lastpanel.getActiveTab().getItemId() === subpath) {
-                       // we are already there
-                   } else {
+                   if (lastpanel.getActiveTab().getItemId() !== subpath) {
                        // set the active tab
                        lastpanel.setActiveTab(subpath);
                    }
+                   // else we are already there
                }
                action.stop();
                return;
@@ -85,13 +84,7 @@ Ext.define('PMG.MainView', {
        },
 
        logout: function() {
-           var me = this;
-           Proxmox.Utils.authClear();
-           /*jslint confusion: true*/
-           /*destroy is a function below and boolean above */
-           me.getView().destroy();
-           /*jslint confusion: false*/
-           Ext.create({ xtype: 'loginview'});
+           PMG.app.logout();
        },
 
        navigate: function(treelist, item) {
@@ -145,10 +138,6 @@ Ext.define('PMG.MainView', {
                interval: 15*60*1000
            });
 
-           var provider = new Ext.state.LocalStorageProvider({
-               prefix: 'ext-pmg-' });
-           Ext.state.Manager.setProvider(provider);
-
            // select treeitem and load page from url fragment
            var token = Ext.util.History.getToken() || 'pmgDashboard';
            this.redirectTo(token, true);
@@ -168,7 +157,8 @@ Ext.define('PMG.MainView', {
                type: 'hbox',
                align: 'middle'
            },
-           margin: '4 5 4 5',
+           margin: '2 5 2 5',
+           height: 38,
            items: [
                {
                    xtype: 'proxmoxlogo'
@@ -183,13 +173,14 @@ Ext.define('PMG.MainView', {
                    baseCls: 'x-plain',
                    reference: 'usernameinfo',
                    padding: '0 5',
-                   tpl: Ext.String.format(gettext("You are logged in as '{0}'"), '{username}')
+                   tpl: Ext.String.format(gettext("You are logged in as {0}"), "'{username}'")
                },
                {
                    xtype: 'proxmoxHelpButton',
                    hidden: false,
                    baseCls: 'x-btn',
                    iconCls: 'fa fa-info-circle x-btn-icon-el-default-toolbar-small ',
+                   margin: '0 5 0 0',
                    listenToGlobalEvent: false,
                    onlineHelp: 'pmg_documentation_index'
                },