mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
experimenting with url and dashboard state
This commit is contained in:
parent
d46e612cb1
commit
ec99096d52
@ -8,10 +8,7 @@ define([
|
|||||||
function (angular, $, config, _) {
|
function (angular, $, config, _) {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
var module = angular.module('grafana.controllers');
|
module.controller('DashCtrl', function($scope, $rootScope, dashboardKeybindings, filterSrv, dashboardSrv, panelMoveSrv, timer) {
|
||||||
|
|
||||||
module.controller('DashCtrl', function(
|
|
||||||
$scope, $rootScope, dashboardKeybindings, filterSrv, dashboardSrv, panelMoveSrv, timer) {
|
|
||||||
|
|
||||||
$scope.editor = { index: 0 };
|
$scope.editor = { index: 0 };
|
||||||
$scope.panelNames = config.panels;
|
$scope.panelNames = config.panels;
|
||||||
@ -49,10 +46,6 @@ function (angular, $, config, _) {
|
|||||||
|
|
||||||
dashboardKeybindings.shortcuts($scope);
|
dashboardKeybindings.shortcuts($scope);
|
||||||
|
|
||||||
if ($scope.dashboard.$state.panelId) {
|
|
||||||
$rootScope.fullscreen = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
$scope.emitAppEvent("dashboard-loaded", $scope.dashboard);
|
$scope.emitAppEvent("dashboard-loaded", $scope.dashboard);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -8,9 +8,10 @@ function (angular) {
|
|||||||
|
|
||||||
module.config(function($routeProvider) {
|
module.config(function($routeProvider) {
|
||||||
$routeProvider
|
$routeProvider
|
||||||
.when('/dashboard/db/:id/:panelId?', {
|
.when('/dashboard/db/:id', {
|
||||||
templateUrl: 'app/partials/dashboard.html',
|
templateUrl: 'app/partials/dashboard.html',
|
||||||
controller : 'DashFromDBProvider',
|
controller : 'DashFromDBProvider',
|
||||||
|
reloadOnSearch: false,
|
||||||
})
|
})
|
||||||
.when('/dashboard/elasticsearch/:id', {
|
.when('/dashboard/elasticsearch/:id', {
|
||||||
templateUrl: 'app/partials/dashboard.html',
|
templateUrl: 'app/partials/dashboard.html',
|
||||||
|
@ -7,7 +7,7 @@ function (angular, _, $) {
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var module = angular.module('grafana.services');
|
var module = angular.module('grafana.services');
|
||||||
module.service('panelSrv', function($rootScope, $timeout, datasourceSrv) {
|
module.service('panelSrv', function($rootScope, $timeout, datasourceSrv, $location) {
|
||||||
|
|
||||||
this.init = function($scope) {
|
this.init = function($scope) {
|
||||||
if (!$scope.panel.span) {
|
if (!$scope.panel.span) {
|
||||||
@ -106,6 +106,7 @@ function (angular, _, $) {
|
|||||||
$rootScope.$emit('panel-fullscreen-enter');
|
$rootScope.$emit('panel-fullscreen-enter');
|
||||||
|
|
||||||
$timeout(function() {
|
$timeout(function() {
|
||||||
|
$location.search({panelId: $scope.panel.id, mode: $scope.editMode ? 'edit' : 'full' });
|
||||||
$scope.$emit('render');
|
$scope.$emit('render');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user