diff --git a/frontend/app/scripts/controllers/admin/platform/PlatformStatusCtrl.js b/frontend/app/scripts/controllers/admin/platform/PlatformStatusCtrl.js index b2e799213e..3718916b33 100644 --- a/frontend/app/scripts/controllers/admin/platform/PlatformStatusCtrl.js +++ b/frontend/app/scripts/controllers/admin/platform/PlatformStatusCtrl.js @@ -1,7 +1,7 @@ (function() { 'use strict'; - angular.module('theHiveControllers').controller('PlatformStatusCtrl', function(PlatformSrv, NotificationSrv, appConfig) { + angular.module('theHiveControllers').controller('PlatformStatusCtrl', function(ModalSrv, PlatformSrv, NotificationSrv, appConfig) { var self = this; self.appConfig = appConfig; @@ -43,7 +43,6 @@ var date = new moment().format('YYYYMMDD-HH:mmZ'); var fileName = 'Platform-Status-Report-'+date+'.json'; - var content = { indexStatus: self.indexStatus, checkStatus: self.checkStats, @@ -61,16 +60,46 @@ } this.reindex = function(indexName) { - PlatformSrv.runReindex(indexName) - .then(function(response) { - NotificationSrv.log('Reindexing of ' + indexName + ' started sucessfully', 'success'); + var modalInstance = ModalSrv.confirm( + 'Reindex', + 'Are you sure you want to trigger ' + indexName + ' data reindex', { + okText: 'Yes, reindex it' + } + ); + + modalInstance.result + .then(function() { + PlatformSrv.runReindex(indexName); + }) + .then(function(/*response*/) { + NotificationSrv.success('Reindexing of ' + indexName + ' data started sucessfully'); + }) + .catch(function(err) { + if (!_.isString(err)) { + NotificationSrv.error('Platform status', err.data, err.status); + } }); }; this.checkControl = function(checkName) { - PlatformSrv.runCheck(checkName) - .then(function(response) { - NotificationSrv.log('Integrity check of ' + checkName + ' started sucessfully', 'success'); + var modalInstance = ModalSrv.confirm( + 'Data health check', + 'Are you sure you want to trigger ' + checkName + ' health check', { + okText: 'Yes, trigger it' + } + ); + + modalInstance.result + .then(function() { + PlatformSrv.runCheck(checkName); + }) + .then(function(/*response*/) { + NotificationSrv.success('Data health check of ' + checkName + ' started sucessfully'); + }) + .catch(function(err) { + if (!_.isString(err)) { + NotificationSrv.error('Platform status', err.data, err.status); + } }); } diff --git a/frontend/app/views/partials/admin/platform/status.html b/frontend/app/views/partials/admin/platform/status.html index f433fe64c1..fec4258275 100644 --- a/frontend/app/views/partials/admin/platform/status.html +++ b/frontend/app/views/partials/admin/platform/status.html @@ -12,21 +12,21 @@

Platform Status

-

Index status Reload

+

Data index status Reload

Loading index status...
Status
Index name
-
Mixed count
-
Composite
+
Database Objects
+
Index Objects
@@ -40,10 +40,18 @@

Index status {{indexName}}

+
+
{{(data.mixedCount / data.compositeCount) * 100}}%
+
+
+
+
- {{data.mixedCount}} + {{data.mixedCount}} objects in DB
{{data.compositeCount}} @@ -57,8 +65,8 @@

-

Integrity control status Reload

-
Loading integrity control stats...
+

Data health status Reload

+
Loading data health stats...
Status
@@ -84,11 +92,11 @@

- Iterations: - {{data.globalStats.global.iterations}} - Duplicate: + Iterations: + {{data.globalStats.global.iteration}} + Duplicate: {{data.globalStats.global.duplicate}} - Duration: + Duration: {{data.globalStats.global.duration}}
@@ -102,11 +110,11 @@

- Iterations: - {{data.duplicateStats.global.iterations}} - Duplicate: + Iterations: + {{data.duplicateStats.global.iteration}} + Duplicate: {{data.duplicateStats.global.duplicate}} - Duration: + Duration: {{data.duplicateStats.global.duration}}