]> git.proxmox.com Git - pmg-gui.git/blobdiff - js/Application.js
dashboard: reduce noise in current kernel version
[pmg-gui.git] / js / Application.js
index c6b38be3c2a502f36875b15e253874d25146f078..f5f673c5420050fcf1ce1df38210e81835b45b1a 100644 (file)
@@ -5,7 +5,7 @@ Ext.define('PMG.Application', {
     appProperty: 'app',
 
     stores: [
-       'NavigationStore'
+       'NavigationStore',
     ],
 
     layout: 'fit',
@@ -33,7 +33,7 @@ Ext.define('PMG.Application', {
            targetview: me.targetview,
        });
        if (skipCheck !== true) {
-           Proxmox.Utils.checked_command(function() {}); // display subscription status
+           Proxmox.Utils.checked_command(Ext.emptyFn); // display subscription status
        }
     },
 
@@ -43,15 +43,21 @@ Ext.define('PMG.Application', {
     launch: function() {
        var me = this;
        Ext.on('resize', me.realignWindows);
+
+       var provider = new Ext.state.LocalStorageProvider({ prefix: 'ext-pmg-' });
+       Ext.state.Manager.setProvider(provider);
+
        // show login window if not loggedin
        var loggedin = Proxmox.Utils.authOK();
        var cookie = Ext.util.Cookies.get(Proxmox.Setup.auth_cookie_name);
        var qs = Ext.Object.fromQueryString(location.search);
 
-       if (location.pathname === "/quarantine") {
+       var pathname = location.pathname.replace(/\/+$/, '');
+
+       if (pathname === "/quarantine") {
            me.targetview = 'quarantineview';
 
-           if (qs.ticket == undefined && loggedin) {
+           if (qs.ticket === undefined && loggedin) {
                me.view = 'quarantineview';
            }
        } else if (loggedin && cookie.substr(0, 7) !== 'PMGQUAR') {
@@ -61,9 +67,9 @@ Ext.define('PMG.Application', {
        PMG.view = me.view;
        me.currentView = Ext.create({
            xtype: me.view,
-           targetview: me.targetview
+           targetview: me.targetview,
        });
-    }
+    },
 });
 
 Ext.application('PMG.Application');