diff --git a/src/ServicePulse.Host/app/js/services/factory.shareddata.js b/src/ServicePulse.Host/app/js/services/factory.shareddata.js index e45d08aa7e..c67ed240b6 100644 --- a/src/ServicePulse.Host/app/js/services/factory.shareddata.js +++ b/src/ServicePulse.Host/app/js/services/factory.shareddata.js @@ -34,7 +34,7 @@ var environment = { sc_version: undefined, - minimum_supported_sc_version: "1.23.0", + minimum_supported_sc_version: "1.27.0", is_compatible_with_sc: true, sp_version: spVersion }; diff --git a/src/ServicePulse.Host/app/js/services/services.service-control.js b/src/ServicePulse.Host/app/js/services/services.service-control.js index 994fa121ff..cd9beecbe8 100644 --- a/src/ServicePulse.Host/app/js/services/services.service-control.js +++ b/src/ServicePulse.Host/app/js/services/services.service-control.js @@ -38,8 +38,8 @@ }); } - function getExceptionGroups() { - var url = uri.join(scConfig.service_control_url, 'recoverability', 'groups'); + function getExceptionGroups(classifier) { + var url = uri.join(scConfig.service_control_url, 'recoverability', 'groups', classifier); return $http.get(url).then(function(response) { return { data: response.data @@ -96,6 +96,13 @@ }); } + function getExceptionGroupClassifiers() { + var url = uri.join(scConfig.service_control_url, 'recoverability', 'classifiers'); + return $http.get(url).then(function (response) { + return response.data; + }); + } + function getConfiguration() { var url = uri.join(scConfig.service_control_url, 'configuration'); return $http.get(url).then(function(response) { @@ -255,6 +262,7 @@ getEventLogItems: getEventLogItems, getFailedMessages: getFailedMessages, getExceptionGroups: getExceptionGroups, + getExceptionGroupClassifiers: getExceptionGroupClassifiers, getFailedMessagesForExceptionGroup: getFailedMessagesForExceptionGroup, getMessageBody: getMessageBody, getMessageHeaders: getMessageHeaders, diff --git a/src/ServicePulse.Host/app/js/views/failed_groups/controller.js b/src/ServicePulse.Host/app/js/views/failed_groups/controller.js index f499b2a134..b107450b9b 100644 --- a/src/ServicePulse.Host/app/js/views/failed_groups/controller.js +++ b/src/ServicePulse.Host/app/js/views/failed_groups/controller.js @@ -26,6 +26,7 @@ vm.loadingData = false; vm.exceptionGroups = []; + vm.availableClassifiers = []; vm.selectedExceptionGroup = {}; vm.allFailedMessagesGroup = { 'id': undefined, 'title': 'All Failed Messages', 'count': 0 } vm.stats = sharedDataService.getstats(); @@ -69,10 +70,36 @@ }); } - var autoGetExceptionGroups = function () { + vm.selectClassification = function (newClassification) { + vm.loadingData = true; + vm.selectedClassification = newClassification; + + return autoGetExceptionGroups().then(function (result) { + vm.loadingData = false; + + return true; + }); + }; + + var initialLoad = function () { vm.loadingData = true; + + serviceControlService.getExceptionGroupClassifiers().then(function (classifiers) { + vm.availableClassifiers = classifiers; + vm.selectedClassification = classifiers[0]; + + autoGetExceptionGroups().then(function (result) { + vm.loadingData = false; + vm.initialLoadComplete = true; + + return true; + }); + }); + }; + + var autoGetExceptionGroups = function () { vm.exceptionGroups = []; - serviceControlService.getExceptionGroups() + return serviceControlService.getExceptionGroups(vm.selectedClassification) .then(function (response) { if (response.data.length > 0) { @@ -89,7 +116,8 @@ vm.stats.number_of_exception_groups = vm.exceptionGroups.length; notifier.notify('ExceptionGroupCountUpdated', vm.stats.number_of_exception_groups); } - vm.loadingData = false; + + return true; }); }; @@ -97,7 +125,11 @@ var startTimer = function (time) { time = time || 5000; localtimeout = $timeout(function () { - autoGetExceptionGroups(); + vm.loadingData = true; + + autoGetExceptionGroups().then(function (result) { + vm.loadingData = false; + }); }, time); } @@ -116,7 +148,7 @@ }, 'FailedMessageGroupArchived'); // INIT - autoGetExceptionGroups(); + initialLoad(); } controller.$inject = [ diff --git a/src/ServicePulse.Host/app/js/views/failed_groups/view.html b/src/ServicePulse.Host/app/js/views/failed_groups/view.html index 663e0ee117..c576dedc7e 100644 --- a/src/ServicePulse.Host/app/js/views/failed_groups/view.html +++ b/src/ServicePulse.Host/app/js/views/failed_groups/view.html @@ -15,9 +15,24 @@