diff --git a/js/controllers.js b/js/controllers.js index 7c724f59aef33..f800b8b5742fb 100644 --- a/js/controllers.js +++ b/js/controllers.js @@ -3,7 +3,7 @@ 'use strict'; angular.module('kibana.controllers', []) -.controller('DashCtrl', function($scope, $rootScope, $http, $timeout, $route, ejsResource, +.controller('DashCtrl', function($scope, $location, $rootScope, $http, $timeout, $route, ejsResource, fields, dashboard) { $scope.editor = { diff --git a/js/services.js b/js/services.js index ec51c226ec8e8..57d37a26ee76b 100644 --- a/js/services.js +++ b/js/services.js @@ -124,9 +124,13 @@ angular.module('kibana.services', []) }; }) -.service('querySrv', function(dashboard, ejsResource) { +.service('querySrv', function($location, dashboard, ejsResource) { // Create an object to hold our service state on the dashboard dashboard.current.services.query = dashboard.current.services.query || {}; + if ('query' in $location.search()) { + var query_string = $location.search()['query']; + dashboard.current.services.query.list[0].query = query_string.replace(/^"|"$/g, ''); + } _.defaults(dashboard.current.services.query,{ idQueue : [], list : {}, @@ -740,4 +744,4 @@ angular.module('kibana.services', []) }); }; -}); \ No newline at end of file +});