From 88be410b0edb5f7714a00473dc8cb7f0d1a3ad8e Mon Sep 17 00:00:00 2001 From: Manuel Albarral Date: Mon, 3 Jul 2017 08:43:59 +0200 Subject: [PATCH] Preventing blinking when loading --- public/controllers/agents.js | 10 +++++----- public/controllers/overview.js | 11 +++++------ public/templates/agents-audit.html | 2 +- public/templates/agents-fim.html | 2 +- public/templates/agents-oscap.html | 2 +- public/templates/agents-overview.html | 4 ++-- public/templates/agents-pci.html | 2 +- public/templates/agents-pm.html | 2 +- public/templates/overview-audit.html | 2 +- public/templates/overview-fim.html | 2 +- public/templates/overview-general.html | 2 +- public/templates/overview-oscap.html | 2 +- public/templates/overview-pci.html | 2 +- public/templates/overview-pm.html | 2 +- server/api/wazuh-api.js | 2 +- 15 files changed, 24 insertions(+), 25 deletions(-) diff --git a/public/controllers/agents.js b/public/controllers/agents.js index 84d12287f..4ec394e0d 100644 --- a/public/controllers/agents.js +++ b/public/controllers/agents.js @@ -14,7 +14,7 @@ app.controller('agentsController', function ($scope, $q, DataFactory, Notifier, $scope._os = 'all'; $scope.defaultManager = $scope.state.getDefaultManager().name; $scope.extensions = $scope.state.getExtensions().extensions; - $scope.results = false; + $scope.results = true; $scope.hideRing = function(items){ if($(".vis-editor-content" ).length >= items) return true; @@ -51,11 +51,11 @@ app.controller('agentsController', function ($scope, $q, DataFactory, Notifier, $scope.submenuNavItem = tab; $location.search('tab', $scope.submenuNavItem); if($scope.submenuNavItem != "preview"){ - $scope.presentData($scope._agent.name).then(function (data) {$scope.results = data;}); + $scope.presentData($scope._agent.name).then(function (data) {$scope.results = data;}, function() { $scope.results = false; }); } }else{ $rootScope.$broadcast('fetchVisualization'); - $scope.presentData($scope._agent.name).then(function (data) {$scope.results = data;}); + $scope.presentData($scope._agent.name).then(function (data) {$scope.results = data;}, function() { $scope.results = false; }); } }; @@ -164,7 +164,7 @@ app.controller('agentsController', function ($scope, $q, DataFactory, Notifier, $scope.search = data.data.name; $location.search('id', $scope._agent.id); $scope.presentData($scope._agent.name).then(function (data) { - $scope.results = data; + $scope.results = data; $scope.load = false; }); @@ -238,7 +238,7 @@ app.controller('agentsController', function ($scope, $q, DataFactory, Notifier, //Check for present data for the selected tab if($scope.submenuNavItem != "preview"){ - $scope.presentData($scope._agent.name).then(function (data) {$scope.results = data;}); + $scope.presentData($scope._agent.name).then(function (data) {$scope.results = data;}, function() { $scope.results = false; }); } } } diff --git a/public/controllers/overview.js b/public/controllers/overview.js index b8f44a8f8..62577ade3 100644 --- a/public/controllers/overview.js +++ b/public/controllers/overview.js @@ -7,8 +7,7 @@ app.controller('overviewController', function ($scope, appState, $window, generi $scope.extensions = $scope.state.getExtensions().extensions; $scope.submenuNavItem = "general"; $scope.tabView = "panels"; - $scope.results = false; - $scope.loadedBoxes = false; + $scope.results = true; $scope.hideRing = function(items){ if($(".vis-editor-content" ).length >= items) return true; @@ -56,9 +55,9 @@ app.controller('overviewController', function ($scope, appState, $window, generi $scope.submenuNavItem = tab; $location.search('tab', $scope.submenuNavItem); - $scope.presentData().then(function (data) {$scope.results = data;}); + $scope.presentData().then(function (data) {$scope.results = data;}, function(){ $scope.results = false;}); }else{ - $scope.presentData().then(function (data) {$scope.results = data;}); + $scope.presentData().then(function (data) {$scope.results = data;}, function(){ $scope.results = false;}); $rootScope.$broadcast('fetchVisualization'); } }; @@ -116,13 +115,13 @@ app.controller('overviewController', function ($scope, appState, $window, generi $scope.timeLT = currentTimeFilter.time.to; //Check for present data for the selected tab - $scope.presentData().then(function (data) {$scope.results = data;}); + $scope.presentData().then(function (data) {$scope.results = data;}, function(){ $scope.results = false;}); } } }); // Load - $scope.presentData().then(function (data) {$scope.results = data;}); + $scope.presentData().then(function (data) {$scope.results = data;}, function(){ $scope.results = false;}); }); diff --git a/public/templates/agents-audit.html b/public/templates/agents-audit.html index 01c197136..9b79a8725 100644 --- a/public/templates/agents-audit.html +++ b/public/templates/agents-audit.html @@ -4,7 +4,7 @@
- + No results for selected time interval diff --git a/public/templates/agents-fim.html b/public/templates/agents-fim.html index c5f13ccd5..560fe7750 100644 --- a/public/templates/agents-fim.html +++ b/public/templates/agents-fim.html @@ -4,7 +4,7 @@
- + No results for selected time interval diff --git a/public/templates/agents-oscap.html b/public/templates/agents-oscap.html index 3a3c29646..03537c95b 100644 --- a/public/templates/agents-oscap.html +++ b/public/templates/agents-oscap.html @@ -4,7 +4,7 @@
- + No results for selected time interval diff --git a/public/templates/agents-overview.html b/public/templates/agents-overview.html index 21b5aba2a..db9f03f54 100644 --- a/public/templates/agents-overview.html +++ b/public/templates/agents-overview.html @@ -3,7 +3,7 @@
-
+
@@ -70,7 +70,7 @@
- + No results for selected time interval diff --git a/public/templates/agents-pci.html b/public/templates/agents-pci.html index bf37ee2cf..3c20e87f7 100644 --- a/public/templates/agents-pci.html +++ b/public/templates/agents-pci.html @@ -4,7 +4,7 @@
- + No results for selected time interval diff --git a/public/templates/agents-pm.html b/public/templates/agents-pm.html index 1dd4e9db5..7c7b38f19 100644 --- a/public/templates/agents-pm.html +++ b/public/templates/agents-pm.html @@ -4,7 +4,7 @@
- + No results for selected time interval diff --git a/public/templates/overview-audit.html b/public/templates/overview-audit.html index 468bdf9b3..cc3d0e67e 100644 --- a/public/templates/overview-audit.html +++ b/public/templates/overview-audit.html @@ -4,7 +4,7 @@
- + No results for selected time interval diff --git a/public/templates/overview-fim.html b/public/templates/overview-fim.html index 77446a375..4385c78c0 100644 --- a/public/templates/overview-fim.html +++ b/public/templates/overview-fim.html @@ -4,7 +4,7 @@
- + No results for selected time interval diff --git a/public/templates/overview-general.html b/public/templates/overview-general.html index 9135c8f8a..d0624f170 100644 --- a/public/templates/overview-general.html +++ b/public/templates/overview-general.html @@ -4,7 +4,7 @@
- + No results for selected time interval diff --git a/public/templates/overview-oscap.html b/public/templates/overview-oscap.html index 92cce7411..5831d94dd 100644 --- a/public/templates/overview-oscap.html +++ b/public/templates/overview-oscap.html @@ -4,7 +4,7 @@
- + No results for selected time interval diff --git a/public/templates/overview-pci.html b/public/templates/overview-pci.html index 8764941de..5f097456a 100644 --- a/public/templates/overview-pci.html +++ b/public/templates/overview-pci.html @@ -4,7 +4,7 @@
- + No results for selected time interval diff --git a/public/templates/overview-pm.html b/public/templates/overview-pm.html index 08a80b445..46d1caeaa 100644 --- a/public/templates/overview-pm.html +++ b/public/templates/overview-pm.html @@ -4,7 +4,7 @@
- + No results for selected time interval diff --git a/server/api/wazuh-api.js b/server/api/wazuh-api.js index 6b1e5f595..0317a6426 100644 --- a/server/api/wazuh-api.js +++ b/server/api/wazuh-api.js @@ -576,5 +576,5 @@ module.exports = function (server, options) { path: '/api/wazuh-api/updateApiHostname/{id}', handler: updateApiHostname }); - + };