|
|
@@ -3,8 +3,9 @@ define([
|
|
|
'config',
|
|
|
'lodash',
|
|
|
'jquery',
|
|
|
+ 'store',
|
|
|
],
|
|
|
-function (angular, config, _, $) {
|
|
|
+function (angular, config, _, $, store) {
|
|
|
"use strict";
|
|
|
|
|
|
var module = angular.module('grafana.controllers');
|
|
|
@@ -12,26 +13,23 @@ function (angular, config, _, $) {
|
|
|
module.controller('GrafanaCtrl', function($scope, alertSrv, grafanaVersion, $rootScope) {
|
|
|
|
|
|
$scope.grafanaVersion = grafanaVersion[0] === '@' ? 'master' : grafanaVersion;
|
|
|
- $scope.consoleEnabled = (window.localStorage && window.localStorage.grafanaConsole === 'true');
|
|
|
+ $scope.consoleEnabled = store.getBool('grafanaConsole');
|
|
|
|
|
|
- $rootScope.profilingEnabled = (window.localStorage && window.localStorage.profilingEnabled === 'true');
|
|
|
+ $rootScope.profilingEnabled = store.getBool('profilingEnabled');
|
|
|
$rootScope.performance = { loadStart: new Date().getTime() };
|
|
|
|
|
|
$scope.init = function() {
|
|
|
$scope._ = _;
|
|
|
- if ($rootScope.profilingEnabled) {
|
|
|
- $scope.initProfiling();
|
|
|
- }
|
|
|
+
|
|
|
+ if ($rootScope.profilingEnabled) { $scope.initProfiling(); }
|
|
|
|
|
|
$scope.dashAlerts = alertSrv;
|
|
|
- $scope.grafana = {
|
|
|
- style: 'dark'
|
|
|
- };
|
|
|
+ $scope.grafana = { style: 'dark' };
|
|
|
};
|
|
|
|
|
|
$scope.toggleConsole = function() {
|
|
|
$scope.consoleEnabled = !$scope.consoleEnabled;
|
|
|
- window.localStorage.grafanaConsole = $scope.consoleEnabled ? 'true' : 'false';
|
|
|
+ store.set('grafanaConsole', $scope.consoleEnabled);
|
|
|
};
|
|
|
|
|
|
$rootScope.onAppEvent = function(name, callback) {
|