From da85dd972003daa56c9cc34be352b530a2d5fed7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20=C3=81ngel=20Gonz=C3=A1lez?= Date: Mon, 11 Dec 2017 13:47:31 +0100 Subject: [PATCH] Fix scan in progress "situation" on syscheck and rootcheck --- public/controllers/agents.js | 6 ++++++ public/templates/agents-general.html | 22 ++++++++++++---------- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/public/controllers/agents.js b/public/controllers/agents.js index dfaee2f6a..1839d36e3 100644 --- a/public/controllers/agents.js +++ b/public/controllers/agents.js @@ -90,6 +90,9 @@ function ($scope, $location, $rootScope, Notifier, appState, genericReq, apiReq, if ($scope.agent.rootcheck.end && $scope.agent.rootcheck.start) { let minutes = calculateMinutes($scope.agent.rootcheck.start, $scope.agent.rootcheck.end); $scope.agent.rootcheck.duration = window.Math.round(minutes); + if($scope.agent.rootcheck.duration <= 0){ + $scope.agent.rootcheck.inProgress = true; + } } else { if (!$scope.agent.rootcheck.end) { $scope.agent.rootcheck.end = 'Unknown'; @@ -105,6 +108,9 @@ function ($scope, $location, $rootScope, Notifier, appState, genericReq, apiReq, if ($scope.agent.syscheck.end && $scope.agent.syscheck.start) { let minutes = calculateMinutes($scope.agent.syscheck.start, $scope.agent.syscheck.end); $scope.agent.syscheck.duration = window.Math.round(minutes); + if($scope.agent.syscheck.duration <= 0){ + $scope.agent.syscheck.inProgress = true; + } } else { if (!$scope.agent.syscheck.end) { $scope.agent.syscheck.end = 'Unknown'; diff --git a/public/templates/agents-general.html b/public/templates/agents-general.html index 6cdeda50f..29e985137 100644 --- a/public/templates/agents-general.html +++ b/public/templates/agents-general.html @@ -58,22 +58,24 @@ -
{{agent.syscheck.end || 'Unknown'}}
- - Start time: {{ agent.syscheck.start }}
- End time: {{ agent.syscheck.end }}
- Duration time: {{ agent.syscheck.duration }} minutes +
Scan in progress
+
{{agent.syscheck.end || 'Unknown'}}
+ + Start time: {{ agent.syscheck.start || 'Unknown'}}
+ End time: {{ agent.syscheck.end || 'Unknown'}}
+ Duration time: {{ agent.syscheck.duration +' minutes' || 'Unknown'}}
Last syscheck scan
-
{{agent.rootcheck.end || 'Unknown'}}
- - Start time: {{ agent.rootcheck.start }}
- End time: {{ agent.rootcheck.end }}
- Duration time: {{ agent.rootcheck.duration }} minutes +
Scan in progress
+
{{agent.rootcheck.end || 'Unknown'}}
+ + Start time: {{ agent.rootcheck.start || 'Unknown'}}
+ End time: {{ agent.rootcheck.end || 'Unknown'}}
+ Duration time: {{ agent.rootcheck.duration + ' minutes' || 'Unknown' }}
Last rootcheck scan