2 'app/gbp/sfc/sfc.service'
6 angular.module('app.gbp').controller('SfcTopologyController', SfcTopologyController);
8 SfcTopologyController.$inject = ['$filter', '$mdDialog', '$scope', 'chainName', 'SfcService'];
10 function SfcTopologyController($filter, $mdDialog, $scope, chainName, SfcService) {
12 $scope.chain = SfcService.createObject({name: chainName});
15 $scope.closeDialog = closeDialog;
19 $scope.chain.get(function() {
20 $scope.chain.data && $scope.chain.data['sfc-service-function'] &&
21 $scope.chain.data['sfc-service-function'].length && $scope.viewTopology();
23 $scope.topologyLoaded = true;
26 function closeDialog(){
30 function nodeTooltip() {
31 nx.define('MyNodeTooltip', nx.ui.Component, {
41 content: '{#node.model.data.type}',
48 $scope.viewTopology = function() {
50 $scope.topologySfc = new nx.graphic.Topology({
55 enableGradualScaling: true,
58 //label: 'model.label',
59 label: function (vertex) {
60 return vertex.get().label + ' (' + vertex.get().type + ')';
63 iconType: function (vertex) {
64 var type = vertex.get().type;
84 enableSmartNode: false,
85 tooltipManagerConfig: {
86 showLinkTooltip: false,
87 showNodeTooltip: false,
88 //nodeTooltipContentClass: 'MyNodeTooltip',
91 $scope.app = new nx.ui.Application;
96 $scope.chain.data['sfc-service-function'].forEach(function(sf, index) {
100 type: SfcService.getSfTypeShort(sf.type),
101 x: 100 * (index + 1),
105 index>0 && links.push({
111 $scope.topologySfc.data({
116 $scope.app.container(document.getElementById('next-vpp-topo'));
117 $scope.topologySfc.attach($scope.app);