Fixed diagnostic build
diff --git a/views/ngXosViews/diagnostic/src/js/diagnostic.js b/views/ngXosViews/diagnostic/src/js/diagnostic.js
index 356583d..6638a95 100644
--- a/views/ngXosViews/diagnostic/src/js/diagnostic.js
+++ b/views/ngXosViews/diagnostic/src/js/diagnostic.js
@@ -1,13 +1,13 @@
(function () {
'use strict';
-
angular.module('xos.diagnostic')
- .directive('diagnostic', function(){
+ .directive('diagnosticContainer', function(){
return {
restrict: 'E',
templateUrl: 'templates/diagnostic.tpl.html',
controllerAs: 'vm',
- controller: function(ChartData, Subscribers, ServiceRelation, $rootScope){
+ controller: function(ChartData, Subscribers, ServiceRelation, $rootScope, $log){
+
this.loader = true;
this.error = false;
Subscribers.query().$promise
@@ -41,4 +41,4 @@
}
}
});
-})();
\ No newline at end of file
+})();
\ No newline at end of file
diff --git a/views/ngXosViews/diagnostic/src/js/main.js b/views/ngXosViews/diagnostic/src/js/main.js
index c3ea927..73cd3d9 100644
--- a/views/ngXosViews/diagnostic/src/js/main.js
+++ b/views/ngXosViews/diagnostic/src/js/main.js
@@ -1,20 +1,26 @@
-'use strict';
+(function () {
+ 'use strict';
-angular.module('xos.diagnostic', [
- 'ngResource',
- 'ngCookies',
- 'ngLodash',
- 'ngAnimate',
- 'ui.router',
- 'xos.helpers'
-])
-.config(($stateProvider) => {
- $stateProvider
- .state('home', {
- url: '/',
- template: '<diagnostic></diagnostic>'
+ angular.module('xos.diagnostic', [
+ 'ngResource',
+ 'ngCookies',
+ 'ngLodash',
+ 'ngAnimate',
+ 'ui.router',
+ 'xos.helpers'
+ ])
+ .config(($stateProvider) => {
+ $stateProvider
+ .state('home', {
+ url: '/',
+ template: '<diagnostic-container></diagnostic-container>'
+ });
+ })
+ .config(function($httpProvider){
+ $httpProvider.interceptors.push('NoHyperlinks');
+ })
+ .run(($log) => {
+ $log.info('Diagnostic Started');
});
-})
-.config(function($httpProvider){
- $httpProvider.interceptors.push('NoHyperlinks');
-});
+
+})();
\ No newline at end of file
diff --git a/views/ngXosViews/diagnostic/src/js/rest_services.js b/views/ngXosViews/diagnostic/src/js/rest_services.js
index cb66c37..f49df1c 100644
--- a/views/ngXosViews/diagnostic/src/js/rest_services.js
+++ b/views/ngXosViews/diagnostic/src/js/rest_services.js
@@ -373,7 +373,13 @@
delete currentService.id; // conflict with d3
return response;
}
+
let baseService = lodash.find(services, {id: 3});
+
+ if(!angular.isDefined(baseService)){
+ console.error('Missing Base service!');
+ return;
+ }
const baseData = {
name: 'Subscriber',
diff --git a/views/ngXosViews/diagnostic/src/js/serviceTopology.js b/views/ngXosViews/diagnostic/src/js/serviceTopology.js
index f131dcf..49e5d71 100644
--- a/views/ngXosViews/diagnostic/src/js/serviceTopology.js
+++ b/views/ngXosViews/diagnostic/src/js/serviceTopology.js
@@ -24,6 +24,11 @@
const draw = (tree) => {
+ if(!tree){
+ console.error('Tree is missing');
+ return;
+ }
+
// TODO update instead clear and redraw
// clean
@@ -64,7 +69,8 @@
};
$scope.$watch(() => this.serviceChain, (chain) => {
- if(chain){
+ console.log(chain);
+ if(angular.isDefined(chain)){
draw(chain);
}
});