Updated Branches: refs/heads/trunk 2b013ac35 -> 4d1dc1e85
AMBARI-2639. UI behaviour is strange after ambari upgrade. (Andrii Babiichuk via yusaku) Project: http://git-wip-us.apache.org/repos/asf/incubator-ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ambari/commit/4d1dc1e8 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ambari/tree/4d1dc1e8 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ambari/diff/4d1dc1e8 Branch: refs/heads/trunk Commit: 4d1dc1e85a476790ecfbe2044f5e5b87a0b0d1a9 Parents: 2b013ac Author: Yusaku Sako <[email protected]> Authored: Fri Jul 12 10:39:09 2013 -0700 Committer: Yusaku Sako <[email protected]> Committed: Fri Jul 12 10:39:09 2013 -0700 ---------------------------------------------------------------------- ambari-web/app/routes/main.js | 1 + ambari-web/app/utils/db.js | 8 ++++++++ 2 files changed, 9 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/4d1dc1e8/ambari-web/app/routes/main.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/routes/main.js b/ambari-web/app/routes/main.js index 32dea91..e1dd26f 100644 --- a/ambari-web/app/routes/main.js +++ b/ambari-web/app/routes/main.js @@ -22,6 +22,7 @@ var stringUtils = require('utils/string_utils'); module.exports = Em.Route.extend({ route: '/main', enter: function (router) { + App.db.updateStorage(); console.log('in /main:enter'); if (router.getAuthenticated()) { App.router.get('clusterController').loadClusterName(false); http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/4d1dc1e8/ambari-web/app/utils/db.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/utils/db.js b/ambari-web/app/utils/db.js index b68c8c1..e7e18dc 100644 --- a/ambari-web/app/utils/db.js +++ b/ambari-web/app/utils/db.js @@ -70,6 +70,14 @@ App.db.cleanUp = function () { localStorage.setObject('ambari', App.db.data); }; +App.db.updateStorage = function() { + if (App.db.data && App.db.data.app && App.db.data.app.tables) { + return true; + } + console.warn("local storage is deprecated!"); + App.db.cleanUp(); + return false; +}; // called whenever user logs in if (localStorage.getObject('ambari') == null) { console.log('doing a cleanup');
