Fix topology bug for multiple versions
@@ -77,16 +77,16 @@ angular.module('serviceCenter.topology', [])
if (service.providers) {
angular.forEach(service.providers, function(provider) {
var objPro = {};
- objPro.from = service.microService.serviceName + service.microService.appId;
- objPro.to = provider.serviceName + service.microService.appId;
+ objPro.from = service.microService.serviceName + service.microService.appId + "#" + service.microService.version;
+ objPro.to = provider.serviceName + provider.appId + "#" + provider.version;
$scope.prosAndCons.push(objPro);
- providers.push(provider.serviceName);
+ providers.push(provider.serviceName + "#" + provider.version);
})
}
if (service.consumers) {
angular.forEach(service.consumers, function(consumer) {
- consumers.push(consumer.serviceName)
+ consumers.push(consumer.serviceName + "#" + consumer.version)
})
}
@@ -98,8 +98,8 @@ angular.module('serviceCenter.topology', [])
})
}
- objMic.id = service.microService.serviceName + service.microService.appId;
- objMic.label = service.microService.serviceName;
+ objMic.id = service.microService.serviceName + service.microService.appId + "#" + service.microService.version;
+ objMic.label = service.microService.serviceName + "#" + service.microService.version;
providers = providers.length > 0 ? "<br> Providers : " + providers : "";
consumers = consumers.length > 0 ? "<br> Consumers : " + consumers : "";
@@ -117,7 +117,6 @@ angular.module('serviceCenter.topology', [])
var microServices = new vis.DataSet($scope.microServices);
var prosAndCons = new vis.DataSet($scope.prosAndCons);
var container = document.getElementById('topology');
-
var data = {
nodes: microServices,
edges: prosAndCons
@@ -132,7 +131,11 @@ angular.module('serviceCenter.topology', [])
},
edges: {
arrows: {
- to: {enabled: true, scaleFactor:1, type:'arrow'}
+ to: {
+ enabled: true,
+ scaleFactor: 1,
+ type: 'arrow'
+ }
},
arrowStrikethrough: false,
length: 170
@@ -166,5 +169,4 @@ angular.module('serviceCenter.topology', [])
var topology = new vis.Network(container, data, options);
}
- }
-]);
\ No newline at end of file
+ }]);
\ No newline at end of file
