Fixing frozen Overview tab

This commit is contained in:
Pedro Sanchez 2017-06-20 14:34:05 +02:00 committed by GitHub
commit 6036e48efe
4 changed files with 32 additions and 17 deletions

View File

@ -1,6 +1,6 @@
{
"name": "wazuh",
"version": "2.0.0",
"version": "2.0.1",
"revision": "0335",
"kibana": {
"version" : "5.4.1"

View File

@ -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;

View File

@ -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";

View File

@ -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";
}