Commit 8816e180 by Torkel Ödegaard

Merge pull request #63 from jippi/feature/unique-local-storage-name

Make sure kibana and grafana on same hostname do not interfere with each other
parents aea4b377 e8be9507
...@@ -102,8 +102,8 @@ function (angular, $, kbn, _, config, moment, Modernizr) { ...@@ -102,8 +102,8 @@ function (angular, $, kbn, _, config, moment, Modernizr) {
$location.path(config.default_route); $location.path(config.default_route);
alertSrv.set('Saving to browser storage has been replaced',' with saving to Elasticsearch.'+ alertSrv.set('Saving to browser storage has been replaced',' with saving to Elasticsearch.'+
' Click <a href="#/dashboard/local/deprecated">here</a> to load your old dashboard anyway.'); ' Click <a href="#/dashboard/local/deprecated">here</a> to load your old dashboard anyway.');
} else if(!(_.isUndefined(window.localStorage.kibanaDashboardDefault))) { } else if(!(_.isUndefined(window.localStorage.grafanaDashboardDefault))) {
$location.path(window.localStorage.kibanaDashboardDefault); $location.path(window.localStorage.grafanaDashboardDefault);
} else { } else {
$location.path(config.default_route); $location.path(config.default_route);
} }
...@@ -197,7 +197,7 @@ function (angular, $, kbn, _, config, moment, Modernizr) { ...@@ -197,7 +197,7 @@ function (angular, $, kbn, _, config, moment, Modernizr) {
if(!_.isUndefined(window.localStorage['dashboard'])) { if(!_.isUndefined(window.localStorage['dashboard'])) {
delete window.localStorage['dashboard']; delete window.localStorage['dashboard'];
} }
window.localStorage.kibanaDashboardDefault = route; window.localStorage.grafanaDashboardDefault = route;
return true; return true;
} else { } else {
return false; return false;
...@@ -211,7 +211,7 @@ function (angular, $, kbn, _, config, moment, Modernizr) { ...@@ -211,7 +211,7 @@ function (angular, $, kbn, _, config, moment, Modernizr) {
delete window.localStorage['dashboard']; delete window.localStorage['dashboard'];
} }
delete window.localStorage.kibanaDashboardDefault; delete window.localStorage.grafanaDashboardDefault;
return true; return true;
} else { } else {
return false; return false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment