diff --git a/package.json b/package.json index c6dc9da55..973691255 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "wazuh", - "version": "2.0.0", + "version": "2.0.1", "revision": "0335", "kibana": { "version" : "5.4.1" diff --git a/public/controllers/overview.js b/public/controllers/overview.js index 269c3c2f5..094ddf7fa 100644 --- a/public/controllers/overview.js +++ b/public/controllers/overview.js @@ -64,7 +64,7 @@ app.controller('overviewController', function ($scope, appState, $window, generi if($route.current.params._g.startsWith("h@")){ decodedTimeFilter = JSON.parse(sessionStorage.getItem($route.current.params._g)); }else{ - decodedTimeFilter = rison.decode($route.current.params._g); + decodedTimeFilter = rison.decode($route.current.params._g); } if(decodedTimeFilter.time){ @@ -112,11 +112,16 @@ app.controller('overviewController', function ($scope, appState, $window, generi var currentTimeFilter = rison.decode($location.search()._g); // Check if timefilter has changed and update values var gParameter; - if($route.current.params._g.startsWith("h@")){ - gParameter = sessionStorage.getItem($route.current.params._g); - }else{ - gParameter = $route.current.params._g; - } + if($route.current.params._g){ + if($route.current.params._g.startsWith("h@")){ + gParameter = sessionStorage.getItem($route.current.params._g); + }else{ + gParameter = $route.current.params._g; + } + } + else{ + gParameter="{}"; + } if(gParameter != "{}" && gParameter != "()" && currentTimeFilter.time && ($scope.timeGTE != currentTimeFilter.time.from || $scope.timeLT != currentTimeFilter.time.to)){ $scope.timeGTE = currentTimeFilter.time.from; $scope.timeLT = currentTimeFilter.time.to; diff --git a/public/directives/kibanaDiscoverDirective.js b/public/directives/kibanaDiscoverDirective.js index 4d54fcb74..8c40cf376 100644 --- a/public/directives/kibanaDiscoverDirective.js +++ b/public/directives/kibanaDiscoverDirective.js @@ -159,10 +159,15 @@ require('ui/modules').get('app/wazuh', []).controller('discoverW', function($sco // Set default time var gParameter; - if($route.current.params._g.startsWith("h@")){ - gParameter = sessionStorage.getItem($route.current.params._g); - }else{ - gParameter = $route.current.params._g; + if($route.current.params._g){ + if($route.current.params._g.startsWith("h@")){ + gParameter = sessionStorage.getItem($route.current.params._g); + }else{ + gParameter = $route.current.params._g; + } + } + else{ + gParameter="()"; } if (gParameter == "()") $scope.timefilter.time.from = "now-24h"; diff --git a/public/directives/kibanaSearchbarDirective.js b/public/directives/kibanaSearchbarDirective.js index e19a771fa..7db8ba714 100644 --- a/public/directives/kibanaSearchbarDirective.js +++ b/public/directives/kibanaSearchbarDirective.js @@ -32,12 +32,17 @@ require('ui/modules').get('app/wazuh', []).controller('kibanaSearchBar', functio // Set default time var gParameter; - if($route.current.params._g.startsWith("h@")){ - gParameter = sessionStorage.getItem($route.current.params._g); - }else{ - gParameter = $route.current.params._g; - } - if (gParameter == "()"){ + if($route.current.params._g){ + if($route.current.params._g.startsWith("h@")){ + gParameter = sessionStorage.getItem($route.current.params._g); + }else{ + gParameter = $route.current.params._g; + } + } + else{ + gParameter="()"; + } + if (gParameter == "()"){ timefilter.time.from = "now-24h"; timefilter.time.to = "now"; }