Explorar el Código

Added route change when saving to elasticsearch or browser default

Rashid Khan hace 12 años
padre
commit
459e117d28
Se han modificado 1 ficheros con 5 adiciones y 1 borrados
  1. 5 1
      src/app/services/dashboard.js

+ 5 - 1
src/app/services/dashboard.js

@@ -13,7 +13,7 @@ function (angular, $, kbn, _, config, moment, Modernizr) {
 
 
   var module = angular.module('kibana.services');
   var module = angular.module('kibana.services');
 
 
-  module.service('dashboard', function($routeParams, $http, $rootScope, $injector,
+  module.service('dashboard', function($routeParams, $http, $rootScope, $injector, $location,
     ejsResource, timer, kbnIndex, alertSrv
     ejsResource, timer, kbnIndex, alertSrv
   ) {
   ) {
     // A hash of defaults to use when loading a dashboard
     // A hash of defaults to use when loading a dashboard
@@ -206,6 +206,7 @@ function (angular, $, kbn, _, config, moment, Modernizr) {
     this.set_default = function(dashboard) {
     this.set_default = function(dashboard) {
       if (Modernizr.localstorage) {
       if (Modernizr.localstorage) {
         window.localStorage['dashboard'] = angular.toJson(dashboard || self.current);
         window.localStorage['dashboard'] = angular.toJson(dashboard || self.current);
+        $location.path('/dashboard');
         return true;
         return true;
       } else {
       } else {
         return false;
         return false;
@@ -331,6 +332,9 @@ function (angular, $, kbn, _, config, moment, Modernizr) {
       return request.doIndex(
       return request.doIndex(
         // Success
         // Success
         function(result) {
         function(result) {
+          if(type === 'dashboard') {
+            $location.path('/dashboard/elasticsearch/'+title);
+          }
           return result;
           return result;
         },
         },
         // Failure
         // Failure