Updated Branches:
  refs/heads/branch-1.2.5 530990266 -> 24b99ab6b

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/24b99ab6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ambari/tree/24b99ab6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ambari/diff/24b99ab6

Branch: refs/heads/branch-1.2.5
Commit: 24b99ab6bf0ce52e0f4e5b2ab973643c5403ee77
Parents: 5309902
Author: Yusaku Sako <[email protected]>
Authored: Mon Jul 15 16:30:44 2013 -0700
Committer: Yusaku Sako <[email protected]>
Committed: Mon Jul 15 16:30:44 2013 -0700

----------------------------------------------------------------------
 ambari-web/app/routes/main.js | 1 +
 ambari-web/app/utils/db.js    | 9 +++++++++
 2 files changed, 10 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/24b99ab6/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/24b99ab6/ambari-web/app/utils/db.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/db.js b/ambari-web/app/utils/db.js
index b68c8c1..2f0c8fc 100644
--- a/ambari-web/app/utils/db.js
+++ b/ambari-web/app/utils/db.js
@@ -70,6 +70,15 @@ App.db.cleanUp = function () {
   localStorage.setObject('ambari', App.db.data);
 };
 
+App.db.updateStorage = function() {
+  App.db.data = localStorage.getObject('ambari');
+  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');

Reply via email to