final mcord + UI merge
diff --git a/views/ngXosViews/mcordTopology/src/js/main.js b/views/ngXosViews/mcordTopology/src/js/main.js
index f926df9..6a38c3e 100644
--- a/views/ngXosViews/mcordTopology/src/js/main.js
+++ b/views/ngXosViews/mcordTopology/src/js/main.js
@@ -49,7 +49,7 @@
let trafficCorrection = 5;
const filterBBU = (instances) => {
- return _.filter(instances, i => i.name.indexOf('BBU') >= 0);
+ return _.filter(instances, i => i.name.indexOf("bbu") >= 0);
};
const filterOthers = (instances) => {
@@ -351,4 +351,4 @@
}
};
-});
\ No newline at end of file
+});
diff --git a/xos/configurations/mcord/mcord.yaml b/xos/configurations/mcord/mcord.yaml
index 971e7a9..a55b58f 100644
--- a/xos/configurations/mcord/mcord.yaml
+++ b/xos/configurations/mcord/mcord.yaml
@@ -32,7 +32,7 @@
description: Do not allow Tosca to update this object
kind:
type: string
- default: generic
+ default: RAN
description: Type of service.
view_url:
type: string
@@ -69,7 +69,7 @@
properties:
kind:
type: string
- default: generic
+ default: RAN
description: Kind of component
s1u_tag:
type: string
@@ -89,17 +89,19 @@
display_message:
type: string
required: false
+ default: New vBBU Component
description: Just a message
-
+
topology_template:
node_templates:
- service_mcord:
+ vBBU:
type: tosca.nodes.MCORDService
requirements:
properties:
- kind: Mobile Services
- view_url: /mcord/mcordservice
+ kind: RAN
+ icon_url: /static/mCordServices/service_server.png
+ view_url: /admin/mcord/vbbucomponent
public_key: { get_artifact: [ SELF, pubkey, LOCAL_FILE] }
private_key_fn: /opt/xos/configurations/mcord/mcord_private_key
artifacts:
@@ -212,11 +214,11 @@
relationship: tosca.relationships.MemberOfSite
mysite_vbbu_slice1:
- description: MCORD Service Slice 1
+ description: vBBU Service Slice 1
type: tosca.nodes.Slice
requirements:
- - mcord_service:
- node: service_mcord
+ - vBBU:
+ node: vBBU
relationship: tosca.relationships.MemberOfService
- site:
node: mysite
@@ -232,18 +234,3 @@
default_flavor: m1.xlarge
default_node: computeBBU2
- mysite_VBBU_Component:
- description: MCORD Service default Component
- type: tosca.nodes.VBBUComponent
- requirements:
- - provider_service:
- node: service_mcord
- relationship: tosca.relationships.MemberOfService
- - vbbu_slice:
- node: mysite_vbbu_slice1
- relationship: tosca.relationships.MemberOfSlice
- properties:
- display_message: vBBU looks good!
- s1u_tag: 201
- s1mme_tag: 200
- rru_tag: 199
diff --git a/xos/configurations/mcord/setup.yaml b/xos/configurations/mcord/setup.yaml
index 8af297a..e37c4e5 100644
--- a/xos/configurations/mcord/setup.yaml
+++ b/xos/configurations/mcord/setup.yaml
@@ -78,12 +78,6 @@
view_url: /mcord/?service=vBBU
icon_url: /static/mCordServices/service_rru.png
kind: RAN
- vBBU:
- type: tosca.nodes.Service
- properties:
- view_url: /mcord/?service=vBBU
- icon_url: /static/mCordServices/service_server.png
- kind: RAN
eSON:
type: tosca.nodes.Service
properties:
diff --git a/xos/configurations/mcord/tosca_tmp/mcord.yaml b/xos/configurations/mcord/tosca_tmp/mcord.yaml
new file mode 100644
index 0000000..971e7a9
--- /dev/null
+++ b/xos/configurations/mcord/tosca_tmp/mcord.yaml
@@ -0,0 +1,249 @@
+tosca_definitions_version: tosca_simple_yaml_1_0
+
+description: Setup MCORD-related services.
+
+imports:
+ - custom_types/xos.yaml
+
+node_types:
+
+ tosca.nodes.MCORDService:
+ derived_from: tosca.nodes.Root
+ description: >
+ An XOS Service object. Services may be listed in the Service
+ directory and may be linked together via Tenancy Relationships.
+ capabilities:
+ scalable:
+ type: tosca.capabilities.Scalable
+ service:
+ type: tosca.capabilities.xos.Service
+ properties:
+ no-delete:
+ type: boolean
+ default: false
+ description: Do not allow Tosca to delete this object
+ no-create:
+ type: boolean
+ default: false
+ description: Do not allow Tosca to create this object
+ no-update:
+ type: boolean
+ default: false
+ description: Do not allow Tosca to update this object
+ kind:
+ type: string
+ default: generic
+ description: Type of service.
+ view_url:
+ type: string
+ required: false
+ description: URL to follow when icon is clicked in the Service Directory.
+ icon_url:
+ type: string
+ required: false
+ description: ICON to display in the Service Directory.
+ enabled:
+ type: boolean
+ default: true
+ published:
+ type: boolean
+ default: true
+ description: If True then display this Service in the Service Directory.
+ public_key:
+ type: string
+ required: false
+ description: Public key to install into Instances to allows Services to SSH into them.
+ private_key_fn:
+ type: string
+ required: false
+ description: Location of private key file
+ versionNumber:
+ type: string
+ required: false
+ description: Version number of Service.
+
+ tosca.nodes.VBBUComponent:
+ derived_from: tosca.nodes.Root
+ description: >
+ CORD: vBBU Component of MCORD Service.
+ properties:
+ kind:
+ type: string
+ default: generic
+ description: Kind of component
+ s1u_tag:
+ type: string
+ required: false
+ default: 201
+ description: VTN stag port-name
+ s1mme_tag:
+ type: string
+ required: false
+ default: 200
+ description: VTN stag port-name
+ rru_tag:
+ type: string
+ required: false
+ default: 199
+ description: VTN stag port-name
+ display_message:
+ type: string
+ required: false
+ description: Just a message
+
+
+topology_template:
+ node_templates:
+ service_mcord:
+ type: tosca.nodes.MCORDService
+ requirements:
+ properties:
+ kind: Mobile Services
+ view_url: /mcord/mcordservice
+ public_key: { get_artifact: [ SELF, pubkey, LOCAL_FILE] }
+ private_key_fn: /opt/xos/configurations/mcord/mcord_private_key
+ artifacts:
+ pubkey: /opt/xos/configurations/mcord/mcord_public_key
+
+
+ Private:
+ type: tosca.nodes.NetworkTemplate
+
+ External:
+ type: tosca.nodes.NetworkTemplate
+
+ management_template:
+ type: tosca.nodes.NetworkTemplate
+ properties:
+ visibility: private
+ translation: none
+
+ management:
+ type: tosca.nodes.network.Network.XOS
+# properties:
+# no-create: true
+# no-delete: true
+# no-update: true
+
+ lan_3gpp_s1mme_network:
+ type: tosca.nodes.network.Network.XOS
+ properties:
+ ip_version: 4
+ labels: lan_3gpp_s1uc_net
+ cidr: 172.16.1.0/24
+ start_ip: 172.16.1.3
+ end_ip: 172.16.1.12
+ gateway_ip: 172.16.1.1
+ requirements:
+ - network_template:
+ node: External
+ relationship: tosca.relationships.UsesNetworkTemplate
+ - owner:
+ node: mysite_mobile_net
+ relationship: tosca.relationships.MemberOfSlice
+ - connection:
+ node: mysite_vbbu_slice1
+ relationship: tosca.relationships.ConnectsToSlice
+
+ lan_3gpp_s1u_network:
+ type: tosca.nodes.network.Network.XOS
+ properties:
+ ip_version: 4
+ labels: lan_3gpp_s1u_net
+ cidr: 172.16.2.0/24
+ start_ip: 172.16.2.3
+ end_ip: 172.16.2.12
+ gateway_ip: 172.16.16.1
+ requirements:
+ - network_template:
+ node: External
+ relationship: tosca.relationships.UsesNetworkTemplate
+ - owner:
+ node: mysite_mobile_net
+ relationship: tosca.relationships.MemberOfSlice
+ - connection:
+ node: mysite_vbbu_slice1
+ relationship: tosca.relationships.ConnectsToSlice
+
+ lan_rru_network:
+ type: tosca.nodes.network.Network.XOS
+ properties:
+ ip_version: 4
+ labels: lan_rru_net
+ cidr: 172.16.0.0/24
+ start_ip: 172.16.0.3
+ end_ip: 172.16.0.12
+ gateway_ip: 172.16.0.1
+ requirements:
+ - network_template:
+ node: External
+ relationship: tosca.relationships.UsesNetworkTemplate
+ - owner:
+ node: mysite_mobile_net
+ relationship: tosca.relationships.MemberOfSlice
+ - connection:
+ node: mysite_vbbu_slice1
+ relationship: tosca.relationships.ConnectsToSlice
+
+ mysite:
+ type: tosca.nodes.Site
+
+ mcord-bbu-multi-nic:
+ type: tosca.nodes.Image
+
+ mysite_management:
+ description: This slice exists solely to own the management network
+ type: tosca.nodes.Slice
+ properties:
+ network: noauto
+ requirements:
+ - site:
+ node: mysite
+ relationship: tosca.relationships.MemberOfSite
+
+ mysite_mobile_net:
+ description: This slice exists solely to own the mobile network
+ type: tosca.nodes.Slice
+ properties:
+ network: noauto
+ requirements:
+ - site:
+ node: mysite
+ relationship: tosca.relationships.MemberOfSite
+
+ mysite_vbbu_slice1:
+ description: MCORD Service Slice 1
+ type: tosca.nodes.Slice
+ requirements:
+ - mcord_service:
+ node: service_mcord
+ relationship: tosca.relationships.MemberOfService
+ - site:
+ node: mysite
+ relationship: tosca.relationships.MemberOfSite
+ - default_image:
+ node: mcord-bbu-multi-nic
+ relationship: tosca.relationships.DefaultImage
+ - management:
+ node: management
+ relationship: tosca.relationships.ConnectsToNetwork
+ properties:
+ network: noauto
+ default_flavor: m1.xlarge
+ default_node: computeBBU2
+
+ mysite_VBBU_Component:
+ description: MCORD Service default Component
+ type: tosca.nodes.VBBUComponent
+ requirements:
+ - provider_service:
+ node: service_mcord
+ relationship: tosca.relationships.MemberOfService
+ - vbbu_slice:
+ node: mysite_vbbu_slice1
+ relationship: tosca.relationships.MemberOfSlice
+ properties:
+ display_message: vBBU looks good!
+ s1u_tag: 201
+ s1mme_tag: 200
+ rru_tag: 199
diff --git a/xos/configurations/mcord/vbbu.yaml b/xos/configurations/mcord/vbbu.yaml
new file mode 100644
index 0000000..ee535e3
--- /dev/null
+++ b/xos/configurations/mcord/vbbu.yaml
@@ -0,0 +1,251 @@
+tosca_definitions_version: tosca_simple_yaml_1_0
+
+description: Setup MCORD-related services.
+
+imports:
+ - custom_types/xos.yaml
+
+node_types:
+
+ tosca.nodes.MCORDService:
+ derived_from: tosca.nodes.Root
+ description: >
+ An XOS Service object. Services may be listed in the Service
+ directory and may be linked together via Tenancy Relationships.
+ capabilities:
+ scalable:
+ type: tosca.capabilities.Scalable
+ service:
+ type: tosca.capabilities.xos.Service
+ properties:
+ no-delete:
+ type: boolean
+ default: false
+ description: Do not allow Tosca to delete this object
+ no-create:
+ type: boolean
+ default: false
+ description: Do not allow Tosca to create this object
+ no-update:
+ type: boolean
+ default: false
+ description: Do not allow Tosca to update this object
+ kind:
+ type: string
+ default: RAN
+ description: Type of service.
+ view_url:
+ type: string
+ required: false
+ description: URL to follow when icon is clicked in the Service Directory.
+ icon_url:
+ type: string
+ required: false
+ description: ICON to display in the Service Directory.
+ enabled:
+ type: boolean
+ default: true
+ published:
+ type: boolean
+ default: true
+ description: If True then display this Service in the Service Directory.
+ public_key:
+ type: string
+ required: false
+ description: Public key to install into Instances to allows Services to SSH into them.
+ private_key_fn:
+ type: string
+ required: false
+ description: Location of private key file
+ versionNumber:
+ type: string
+ required: false
+ description: Version number of Service.
+
+ tosca.nodes.VBBUComponent:
+ derived_from: tosca.nodes.Root
+ description: >
+ CORD: vBBU Component of MCORD Service.
+ properties:
+ kind:
+ type: string
+ default: RAN
+ description: Kind of component
+ s1u_tag:
+ type: string
+ required: false
+ default: 201
+ description: VTN stag port-name
+ s1mme_tag:
+ type: string
+ required: false
+ default: 200
+ description: VTN stag port-name
+ rru_tag:
+ type: string
+ required: false
+ default: 199
+ description: VTN stag port-name
+ display_message:
+ type: string
+ required: false
+ default: New vBBU Component
+ description: Just a message
+
+
+topology_template:
+ node_templates:
+ vBBU:
+ type: tosca.nodes.MCORDService
+ requirements:
+ properties:
+ kind: RAN
+ icon_url: /static/mCordServices/service_server.png
+ view_url: /admin/mcord/vbbucomponent
+ public_key: { get_artifact: [ SELF, pubkey, LOCAL_FILE] }
+ private_key_fn: /opt/xos/configurations/mcord/mcord_private_key
+ artifacts:
+ pubkey: /opt/xos/configurations/mcord/mcord_public_key
+
+
+ Private:
+ type: tosca.nodes.NetworkTemplate
+
+ External:
+ type: tosca.nodes.NetworkTemplate
+
+ management_template:
+ type: tosca.nodes.NetworkTemplate
+ properties:
+ visibility: private
+ translation: none
+
+ management:
+ type: tosca.nodes.network.Network.XOS
+# properties:
+# no-create: true
+# no-delete: true
+# no-update: true
+
+ lan_3gpp_s1mme_network:
+ type: tosca.nodes.network.Network.XOS
+ properties:
+ ip_version: 4
+ labels: lan_3gpp_s1uc_net
+ cidr: 172.16.1.0/24
+ start_ip: 172.16.1.3
+ end_ip: 172.16.1.12
+ gateway_ip: 172.16.1.1
+ requirements:
+ - network_template:
+ node: External
+ relationship: tosca.relationships.UsesNetworkTemplate
+ - owner:
+ node: mysite_mobile_net
+ relationship: tosca.relationships.MemberOfSlice
+ - connection:
+ node: mysite_vbbu_slice1
+ relationship: tosca.relationships.ConnectsToSlice
+
+ lan_3gpp_s1u_network:
+ type: tosca.nodes.network.Network.XOS
+ properties:
+ ip_version: 4
+ labels: lan_3gpp_s1u_net
+ cidr: 172.16.2.0/24
+ start_ip: 172.16.2.3
+ end_ip: 172.16.2.12
+ gateway_ip: 172.16.16.1
+ requirements:
+ - network_template:
+ node: External
+ relationship: tosca.relationships.UsesNetworkTemplate
+ - owner:
+ node: mysite_mobile_net
+ relationship: tosca.relationships.MemberOfSlice
+ - connection:
+ node: mysite_vbbu_slice1
+ relationship: tosca.relationships.ConnectsToSlice
+
+ lan_rru_network:
+ type: tosca.nodes.network.Network.XOS
+ properties:
+ ip_version: 4
+ labels: lan_rru_net
+ cidr: 172.16.0.0/24
+ start_ip: 172.16.0.3
+ end_ip: 172.16.0.12
+ gateway_ip: 172.16.0.1
+ requirements:
+ - network_template:
+ node: External
+ relationship: tosca.relationships.UsesNetworkTemplate
+ - owner:
+ node: mysite_mobile_net
+ relationship: tosca.relationships.MemberOfSlice
+ - connection:
+ node: mysite_vbbu_slice1
+ relationship: tosca.relationships.ConnectsToSlice
+
+ mysite:
+ type: tosca.nodes.Site
+
+ mcord-bbu-multi-nic:
+ type: tosca.nodes.Image
+
+ mysite_management:
+ description: This slice exists solely to own the management network
+ type: tosca.nodes.Slice
+ properties:
+ network: noauto
+ requirements:
+ - site:
+ node: mysite
+ relationship: tosca.relationships.MemberOfSite
+
+ mysite_mobile_net:
+ description: This slice exists solely to own the mobile network
+ type: tosca.nodes.Slice
+ properties:
+ network: noauto
+ requirements:
+ - site:
+ node: mysite
+ relationship: tosca.relationships.MemberOfSite
+
+ mysite_vbbu_slice1:
+ description: vBBU Service Slice 1
+ type: tosca.nodes.Slice
+ requirements:
+ - vBBU:
+ node: vBBU
+ relationship: tosca.relationships.MemberOfService
+ - site:
+ node: mysite
+ relationship: tosca.relationships.MemberOfSite
+ - default_image:
+ node: mcord-bbu-multi-nic
+ relationship: tosca.relationships.DefaultImage
+ - management:
+ node: management
+ relationship: tosca.relationships.ConnectsToNetwork
+ properties:
+ network: noauto
+ default_flavor: m1.xlarge
+ default_node: computeBBU2
+
+ mysite_VBBU_Component:
+ description: MCORD Service default Component
+ type: tosca.nodes.VBBUComponent
+ requirements:
+ - provider_service:
+ node: vBBU
+ relationship: tosca.relationships.MemberOfService
+ - vbbu_slice:
+ node: mysite_vbbu_slice1
+ relationship: tosca.relationships.MemberOfSlice
+ properties:
+ display_message: vBBU looks good!
+ s1u_tag: 201
+ s1mme_tag: 200
+ rru_tag: 199
diff --git a/xos/core/xoslib/static/js/xosMcordTopology.js b/xos/core/xoslib/static/js/xosMcordTopology.js
index 21b5a56..c1decb6 100644
--- a/xos/core/xoslib/static/js/xosMcordTopology.js
+++ b/xos/core/xoslib/static/js/xosMcordTopology.js
@@ -1 +1 @@
-"use strict";angular.module("xos.mcordTopology",["ngResource","ngCookies","ui.router","xos.helpers"]).config(["$stateProvider",function(t){t.state("topology",{url:"/",template:"<m-cord-topology></m-cord-topology>"})}]).config(["$httpProvider",function(t){t.interceptors.push("NoHyperlinks")}]).factory("_",["$window",function(t){return t._}]).service("Traffic",["$http","$q",function(t,n){this.get=function(){var e=n.defer();return t.get("videoLocal.txt").then(function(t){e.resolve(t.data)})["catch"](function(t){console.log(t),e.resolve(10*Math.random())}),e.promise}}]).directive("mCordTopology",function(){return{restrict:"E",scope:{},bindToController:!0,controllerAs:"vm",template:"",controller:["$element","$interval","$rootScope","_","$http","TopologyElements","NodeDrawer","Traffic",function(t,n,e,r,a,i,o,c){var s=t[0],u=[],l=[],d=0,p=1,f=5,h=function(t){return r.filter(t,function(t){return t.name.indexOf("BBU")>=0})},m=function(t){return i.fakedInstance},y=function(){d3.select("svg").style("width",s.clientWidth+"px").style("height",s.clientHeight+"px"),u=i.nodes,l=i.links,c.get().then(function(t){if(d)if(t===d)p=p;else{var n=t-d;n>0?p+=n/f:p-=-1*n/f}else p=2;return.2>p&&(p=.2),d=t,a.get("/api/core/xos/instances")}).then(function(t){b(h(t.data)),w(m(t.data)),V(g,u,l)})["catch"](function(t){throw new Error(t)})},v=d3.layout.force(),g=d3.select(s).append("svg").style("width",s.clientWidth+"px").style("height",s.clientHeight+"px"),x=(g.append("g").attr({"class":"link-container"}),g.append("g").attr({"class":"node-container"}),function(t,n){return t.map(function(t){console.log(r.find);var e=r.findIndex(n,{id:t.source}),a=r.findIndex(n,{id:t.target});return{source:e,target:a,value:1,id:"link-"+e+"-"+a,type:t.source.indexOf("fabric")>=0?"big":"small"}})}),H=function(t){return r.map(t,function(t){return"fabric"!==t.type?t:(t.x=t.x*Z,t.y=t.y*M,t)})},b=function(t){var n=s.clientWidth/2/(t.length+1),e=t.map(function(t,e){return{type:"bbu",name:t.name,id:"bbu-"+t.id,fixed:!0,y:3*M,x:n*(e+1)}}),r=e.map(function(t){return{source:t.id,target:"fabric4"}});t.forEach(function(t,a){e.push({type:"rru",name:"rru",id:"rru-"+t.id,fixed:!0,y:4*M,x:n*(a+1)}),r.push({source:"rru-"+t.id,target:"bbu-"+t.id})}),u=u.concat(e),l=l.concat(r)},w=function(t){var n=s.clientWidth/2/(t.length+1),e=t.map(function(t,e){return{type:t.name.substring(0,3),name:t.name,id:t.name.substring(0,3)+"-"+t.id,fixed:!0,y:3*M,x:s.clientWidth/2+n*(e+1)}}),r=e.map(function(t){return{source:t.id,target:"fabric4"}});u=u.concat(e),l=l.concat(r)},Z=void 0,M=void 0;Z=s.clientWidth/3,M=s.clientHeight/5;var V=function(t,n,e){Z=s.clientWidth/3,M=s.clientHeight/5,e=x(e,n),n=H(n),console.log(n),v.nodes(n).links(e).size([s.clientWidth,s.clientHeight]).charge(-20).chargeDistance(200).linkDistance(80).linkStrength(.1).start();var r=d3.select(".link-container"),a=d3.select(".node-container");o.drawFabricBox(a,Z,M);var i=r.selectAll(".link").data(e,function(t){return t.id});i.enter().append("line").attr({"class":function(t){return"link "+t.type},"stroke-width":p,id:function(t){return t.id},opacity:0}).transition().duration(1e3).attr({opacity:1}),i.transition().duration(1e3).attr({"stroke-width":p,opacity:1}),i.exit().remove();var c=a.selectAll(".node").data(n,function(t){return t.id}),u=c.enter().append("g",function(t){return t.interfaceCfgIdentifier}).attr({"class":function(t){return t.type+" node"},transform:function(t){return"translate("+t.x+", "+t.y+")"}});o.drawBbus(u.filter(".bbu")),o.drawRrus(u.filter(".rru")),o.drawFabric(u.filter(".fabric")),o.drawOthers(u.filter(function(t){return console.log(t.type),"MME"===t.type||"SGW"===t.type||"PGW"===t.type||"Vid"===t.type}));var l=c.exit();o.removeElements(l),v.on("tick",function(){i.attr("x1",function(t){return t.source.x}).attr("y1",function(t){return t.source.y}).attr("x2",function(t){return t.target.x}).attr("y2",function(t){return t.target.y}),c.attr("transform",function(t){return"translate("+t.x+","+t.y+")"})})};y()}]}}),angular.module("xos.mcordTopology").run(["$templateCache",function(t){t.put("templates/users-list.tpl.html",'<div class="row">\n <div class="col-xs-12">\n <h1>Users List</h1>\n <p>This is only an example view.</p>\n </div>\n</div>\n<div class="row">\n <div class="col-xs-4">Email</div>\n <div class="col-xs-4">First Name</div>\n <div class="col-xs-4">Last Name</div>\n</div> \n<div class="row" ng-repeat="user in vm.users">\n <div class="col-xs-4">{{user.email}}</div>\n <div class="col-xs-4">{{user.firstname}}</div>\n <div class="col-xs-4">{{user.lastname}}</div>\n</div> ')}]),angular.module("xos.mcordTopology").constant("TopologyElements",{nodes:[{id:"fabric4",type:"fabric",name:"fabric4",fixed:!0,x:1.5,y:1.5}],links:[],fakedInstance:[{humanReadableName:"MME",name:"MME"},{humanReadableName:"PGW",name:"PGW"},{humanReadableName:"SGW",name:"SGW"},{humanReadableName:"Video Server",name:"Video Server"}],icons:{bbu:"M11.08,4.66H24.76l6.81,6.82H4.23Z M4.24,18.34V13.21H31.6v5.13H4.24Zm25.64-1.72V14.94H28.19v1.69h1.68Zm-13.65-1.7v1.69h1.69V14.93H16.22Zm-3.42,0v1.69h1.68V14.93H12.8Zm-3.42,0v1.69h1.68V14.93H9.38ZM6,14.93v1.69H7.64V14.93H6Z M32.8,33.23H3V11.42l0,0c1.17-1.16,2.54-2.5,3.87-3.8S9.59,5,10.72,3.87l0,0H25.08l0,0C26.25,5,27.6,6.32,28.9,7.61s2.68,2.63,3.83,3.78l0,0v0.06ZM3.3,33H32.53l0-21.43C31.36,10.39,30,9.07,28.71,7.8S26.09,5.22,25,4.1H10.86C9.75,5.21,8.41,6.52,7.12,7.77s-2.67,2.61-3.83,3.76V33Z M4.24,25.18V20.05H31.6v5.13H4.24Zm24-1.73h1.68V21.78H28.19v1.67Zm-12,0H17.9V21.78H16.21v1.68Zm-1.73-1.68H12.81v1.67h1.68V21.78Zm-3.43,1.68V21.78H9.38v1.69h1.68ZM6,23.46H7.64V21.78H6v1.68Z M31.6,26.89V32H4.24V26.89H31.6Zm-3.4,1.72V30.3h1.68V28.61H28.19Zm-10.28,0H16.22V30.3h1.68V28.62Zm-3.43,1.69V28.62H12.8v1.69h1.68Zm-3.42,0V28.62H9.38v1.69h1.68ZM7.65,28.62H6v1.67H7.65V28.62Z","switch":"M10,20a10,10,0,0,1,10-10h70a10,10,0,0,1,10,10v70a10,10,\n 0,0,1-10,10h-70a10,10,0,0,1-10-10zM60,26l12,0,0-8,18,13-18,13,0\n -8-12,0zM60,60l12,0,0-8,18,13-18,13,0-8-12,0zM50,40l-12,0,0-8\n -18,13,18,13,0-8,12,0zM50,74l-12,0,0-8-18,13,18,13,0-8,12,0z",rru:"M18.11,11a2.25,2.25,0,0,1,2.13,1.53A2.2,2.2,0,0,1,19.52,15a0.74,0.74,0,0,0-.3.61A7.49,7.49,0,0,0,20,19.35c2,4.55,3.94,9.13,5.89,13.7a1.14,1.14,0,0,1-.59,1.64A1.11,1.11,0,0,1,23.86,34q-0.53-1.2-1-2.41a0.38,0.38,0,0,0-.41-0.28H13.78a0.36,0.36,0,0,0-.39.26q-0.51,1.24-1.06,2.47a1.11,1.11,0,0,1-1.14.67,1.07,1.07,0,0,1-1-.89,1.47,1.47,0,0,1,.1-0.75q2.84-6.66,5.7-13.32a4.06,4.06,0,0,1,.18-0.42A6.39,6.39,0,0,0,17,15.53,0.58,0.58,0,0,0,16.74,15,2.21,2.21,0,0,1,16,12.5,2.26,2.26,0,0,1,18.11,11ZM21.74,29.1c-0.32-.74-0.61-1.43-0.92-2.12a0.35,0.35,0,0,0-.27-0.14H15.66a0.33,0.33,0,0,0-.26.11c-0.32.7-.62,1.41-0.93,2.15h7.26Zm-5.31-4.55h3.37L18.1,20.63Z M2.23,13.56A16,16,0,0,1,6.76,2.16a1.68,1.68,0,0,1,.8-0.46,1.06,1.06,0,0,1,1.18.59,1.16,1.16,0,0,1-.23,1.37A14.48,14.48,0,0,0,6.19,6.77a13.57,13.57,0,0,0,1.9,15.59l0.46,0.49a1.16,1.16,0,1,1-1.68,1.59,15.6,15.6,0,0,1-4.41-8.64C2.32,14.95,2.28,14.07,2.23,13.56Z M34,13.84a15.51,15.51,0,0,1-4.54,10.52,1.19,1.19,0,0,1-1.65.18,1.17,1.17,0,0,1,0-1.77,13.81,13.81,0,0,0,2.79-4.1,13.6,13.6,0,0,0-2.7-14.91A1.8,1.8,0,0,1,27.41,3,1.08,1.08,0,0,1,28,1.8,1.15,1.15,0,0,1,29.38,2a15.59,15.59,0,0,1,2.51,3.28A16.47,16.47,0,0,1,34,13.84Z M10.93,21.6A1.33,1.33,0,0,1,9.87,21a11.06,11.06,0,0,1-2.8-5.27A11.22,11.22,0,0,1,9.8,5.51l0.27-.28a1.16,1.16,0,1,1,1.64,1.63,8.62,8.62,0,0,0-2.06,3.22A8.87,8.87,0,0,0,11.18,19c0.18,0.23.4,0.44,0.59,0.66A1.13,1.13,0,0,1,11.95,21,1.08,1.08,0,0,1,10.93,21.6Z M29.47,13.57a11.11,11.11,0,0,1-3.27,7.64,1.18,1.18,0,0,1-1.51.21,1.13,1.13,0,0,1-.43-1.4,2.06,2.06,0,0,1,.39-0.54,8.85,8.85,0,0,0,2.49-5.89A9,9,0,0,0,24.64,7a1.85,1.85,0,0,1-.44-0.85A1,1,0,0,1,24.82,5a1.07,1.07,0,0,1,1.3.21,20.11,20.11,0,0,1,1.79,2.31A11.09,11.09,0,0,1,29.47,13.57Z M11.3,13.18a6.73,6.73,0,0,1,2-4.73,1.15,1.15,0,0,1,1.45-.2,1.12,1.12,0,0,1,.49,1.32,1.58,1.58,0,0,1-.33.53,4.49,4.49,0,0,0,0,6.26,1.16,1.16,0,1,1-1.7,1.57A6.81,6.81,0,0,1,11.3,13.18Z M24.94,13.14A6.9,6.9,0,0,1,23,18a1.16,1.16,0,1,1-1.7-1.58,4.5,4.5,0,0,0,0-6.29A1.16,1.16,0,1,1,23,8.5,6.75,6.75,0,0,1,24.94,13.14Z"}}),angular.module("xos.mcordTopology").service("NodeDrawer",["TopologyElements",function(t){var n=500,e=!1;this.drawFabricBox=function(t,n,r){if(!e){var a=t.append("g").attr({transform:"translate("+(n-25)+", "+(r-25)+")"});a.append("rect").attr({width:n+50,height:r+50,"class":"fabric-container"}),e=!0}},this.drawBbus=function(e){e.append("rect").attr({"class":function(t){return t.type},width:30,height:30,x:-15,y:-15,opacity:0}).transition().duration(n).attr({r:15,opacity:1}),e.append("path").attr({"class":function(t){return t.type+" antenna"},opacity:0,d:function(){return t.icons.bbu},transform:"translate(-18, -18)"}).transition().duration(n).attr({opacity:1}),e.append("text").attr({"text-anchor":"start",y:25,x:5,opacity:0}).text(function(t){return"BBU "+t.name.substr(t.name.length-1,1)}).transition().duration(2*n).attr({opacity:1})},this.drawRrus=function(e){e.append("circle").attr({"class":function(t){return t.type+"-shadow"},r:0,opacity:0}).transition().duration(2*n).attr({r:40,opacity:1}),e.append("path").attr({"class":function(t){return t.type+" antenna"},opacity:0,d:function(){return t.icons.rru},transform:"translate(-18, -18)"}).transition().duration(n).attr({opacity:1})},this.drawFabric=function(e){e.append("rect").attr({width:30,height:30,x:-15,y:-15}),e.append("path").attr({"class":function(t){return t.type},opacity:0,d:function(){return t.icons["switch"]},transform:"translate(-22, -22), scale(0.4)"}).transition().duration(n).attr({opacity:1})},this.drawOthers=function(e){e.append("rect").attr({"class":function(t){return t.type},width:30,height:30,x:-15,y:-15,opacity:0}).transition().duration(n).attr({r:15,opacity:1}),e.append("path").attr({"class":function(t){return t.type+" antenna"},opacity:0,d:function(){return t.icons.bbu},transform:"translate(-18, -18)"}).transition().duration(n).attr({opacity:1}),e.append("text").attr({"text-anchor":"start",y:25,x:-12,opacity:0}).text(function(t){return t.name.toUpperCase()}).transition().duration(2*n).attr({opacity:1})},this.removeElements=function(t){t.transition().duration(n).attr({opacity:0}).remove()}}]),angular.module("xos.mcordTopology").run(["$location",function(t){t.path("/")}]);
\ No newline at end of file
+"use strict";angular.module("xos.mcordTopology",["ngResource","ngCookies","ui.router","xos.helpers"]).config(["$stateProvider",function(t){t.state("topology",{url:"/",template:"<m-cord-topology></m-cord-topology>"})}]).config(["$httpProvider",function(t){t.interceptors.push("NoHyperlinks")}]).factory("_",["$window",function(t){return t._}]).service("Traffic",["$http","$q",function(t,n){this.get=function(){var e=n.defer();return t.get("videoLocal.txt").then(function(t){e.resolve(t.data)})["catch"](function(t){console.log(t),e.resolve(10*Math.random())}),e.promise}}]).directive("mCordTopology",function(){return{restrict:"E",scope:{},bindToController:!0,controllerAs:"vm",template:"",controller:["$element","$interval","$rootScope","_","$http","TopologyElements","NodeDrawer","Traffic",function(t,n,e,r,a,i,o,c){var s=t[0],u=[],l=[],d=0,p=1,f=5,h=function(t){return r.filter(t,function(t){return t.name.indexOf("bbu")>=0})},m=function(t){return i.fakedInstance},y=function(){d3.select("svg").style("width",s.clientWidth+"px").style("height",s.clientHeight+"px"),u=i.nodes,l=i.links,c.get().then(function(t){if(d)if(t===d)p=p;else{var n=t-d;n>0?p+=n/f:p-=-1*n/f}else p=2;return.2>p&&(p=.2),d=t,a.get("/api/core/xos/instances")}).then(function(t){b(h(t.data)),w(m(t.data)),V(g,u,l)})["catch"](function(t){throw new Error(t)})},v=d3.layout.force(),g=d3.select(s).append("svg").style("width",s.clientWidth+"px").style("height",s.clientHeight+"px"),x=(g.append("g").attr({"class":"link-container"}),g.append("g").attr({"class":"node-container"}),function(t,n){return t.map(function(t){console.log(r.find);var e=r.findIndex(n,{id:t.source}),a=r.findIndex(n,{id:t.target});return{source:e,target:a,value:1,id:"link-"+e+"-"+a,type:t.source.indexOf("fabric")>=0?"big":"small"}})}),H=function(t){return r.map(t,function(t){return"fabric"!==t.type?t:(t.x=t.x*Z,t.y=t.y*M,t)})},b=function(t){var n=s.clientWidth/2/(t.length+1),e=t.map(function(t,e){return{type:"bbu",name:t.name,id:"bbu-"+t.id,fixed:!0,y:3*M,x:n*(e+1)}}),r=e.map(function(t){return{source:t.id,target:"fabric4"}});t.forEach(function(t,a){e.push({type:"rru",name:"rru",id:"rru-"+t.id,fixed:!0,y:4*M,x:n*(a+1)}),r.push({source:"rru-"+t.id,target:"bbu-"+t.id})}),u=u.concat(e),l=l.concat(r)},w=function(t){var n=s.clientWidth/2/(t.length+1),e=t.map(function(t,e){return{type:t.name.substring(0,3),name:t.name,id:t.name.substring(0,3)+"-"+t.id,fixed:!0,y:3*M,x:s.clientWidth/2+n*(e+1)}}),r=e.map(function(t){return{source:t.id,target:"fabric4"}});u=u.concat(e),l=l.concat(r)},Z=void 0,M=void 0;Z=s.clientWidth/3,M=s.clientHeight/5;var V=function(t,n,e){Z=s.clientWidth/3,M=s.clientHeight/5,e=x(e,n),n=H(n),console.log(n),v.nodes(n).links(e).size([s.clientWidth,s.clientHeight]).charge(-20).chargeDistance(200).linkDistance(80).linkStrength(.1).start();var r=d3.select(".link-container"),a=d3.select(".node-container");o.drawFabricBox(a,Z,M);var i=r.selectAll(".link").data(e,function(t){return t.id});i.enter().append("line").attr({"class":function(t){return"link "+t.type},"stroke-width":p,id:function(t){return t.id},opacity:0}).transition().duration(1e3).attr({opacity:1}),i.transition().duration(1e3).attr({"stroke-width":p,opacity:1}),i.exit().remove();var c=a.selectAll(".node").data(n,function(t){return t.id}),u=c.enter().append("g",function(t){return t.interfaceCfgIdentifier}).attr({"class":function(t){return t.type+" node"},transform:function(t){return"translate("+t.x+", "+t.y+")"}});o.drawBbus(u.filter(".bbu")),o.drawRrus(u.filter(".rru")),o.drawFabric(u.filter(".fabric")),o.drawOthers(u.filter(function(t){return console.log(t.type),"MME"===t.type||"SGW"===t.type||"PGW"===t.type||"Vid"===t.type}));var l=c.exit();o.removeElements(l),v.on("tick",function(){i.attr("x1",function(t){return t.source.x}).attr("y1",function(t){return t.source.y}).attr("x2",function(t){return t.target.x}).attr("y2",function(t){return t.target.y}),c.attr("transform",function(t){return"translate("+t.x+","+t.y+")"})})};y()}]}}),angular.module("xos.mcordTopology").run(["$templateCache",function(t){t.put("templates/users-list.tpl.html",'<div class="row">\n <div class="col-xs-12">\n <h1>Users List</h1>\n <p>This is only an example view.</p>\n </div>\n</div>\n<div class="row">\n <div class="col-xs-4">Email</div>\n <div class="col-xs-4">First Name</div>\n <div class="col-xs-4">Last Name</div>\n</div> \n<div class="row" ng-repeat="user in vm.users">\n <div class="col-xs-4">{{user.email}}</div>\n <div class="col-xs-4">{{user.firstname}}</div>\n <div class="col-xs-4">{{user.lastname}}</div>\n</div> ')}]),angular.module("xos.mcordTopology").constant("TopologyElements",{nodes:[{id:"fabric4",type:"fabric",name:"fabric4",fixed:!0,x:1.5,y:1.5}],links:[],fakedInstance:[{humanReadableName:"MME",name:"MME"},{humanReadableName:"PGW",name:"PGW"},{humanReadableName:"SGW",name:"SGW"},{humanReadableName:"Video Server",name:"Video Server"}],icons:{bbu:"M11.08,4.66H24.76l6.81,6.82H4.23Z M4.24,18.34V13.21H31.6v5.13H4.24Zm25.64-1.72V14.94H28.19v1.69h1.68Zm-13.65-1.7v1.69h1.69V14.93H16.22Zm-3.42,0v1.69h1.68V14.93H12.8Zm-3.42,0v1.69h1.68V14.93H9.38ZM6,14.93v1.69H7.64V14.93H6Z M32.8,33.23H3V11.42l0,0c1.17-1.16,2.54-2.5,3.87-3.8S9.59,5,10.72,3.87l0,0H25.08l0,0C26.25,5,27.6,6.32,28.9,7.61s2.68,2.63,3.83,3.78l0,0v0.06ZM3.3,33H32.53l0-21.43C31.36,10.39,30,9.07,28.71,7.8S26.09,5.22,25,4.1H10.86C9.75,5.21,8.41,6.52,7.12,7.77s-2.67,2.61-3.83,3.76V33Z M4.24,25.18V20.05H31.6v5.13H4.24Zm24-1.73h1.68V21.78H28.19v1.67Zm-12,0H17.9V21.78H16.21v1.68Zm-1.73-1.68H12.81v1.67h1.68V21.78Zm-3.43,1.68V21.78H9.38v1.69h1.68ZM6,23.46H7.64V21.78H6v1.68Z M31.6,26.89V32H4.24V26.89H31.6Zm-3.4,1.72V30.3h1.68V28.61H28.19Zm-10.28,0H16.22V30.3h1.68V28.62Zm-3.43,1.69V28.62H12.8v1.69h1.68Zm-3.42,0V28.62H9.38v1.69h1.68ZM7.65,28.62H6v1.67H7.65V28.62Z","switch":"M10,20a10,10,0,0,1,10-10h70a10,10,0,0,1,10,10v70a10,10,\n 0,0,1-10,10h-70a10,10,0,0,1-10-10zM60,26l12,0,0-8,18,13-18,13,0\n -8-12,0zM60,60l12,0,0-8,18,13-18,13,0-8-12,0zM50,40l-12,0,0-8\n -18,13,18,13,0-8,12,0zM50,74l-12,0,0-8-18,13,18,13,0-8,12,0z",rru:"M18.11,11a2.25,2.25,0,0,1,2.13,1.53A2.2,2.2,0,0,1,19.52,15a0.74,0.74,0,0,0-.3.61A7.49,7.49,0,0,0,20,19.35c2,4.55,3.94,9.13,5.89,13.7a1.14,1.14,0,0,1-.59,1.64A1.11,1.11,0,0,1,23.86,34q-0.53-1.2-1-2.41a0.38,0.38,0,0,0-.41-0.28H13.78a0.36,0.36,0,0,0-.39.26q-0.51,1.24-1.06,2.47a1.11,1.11,0,0,1-1.14.67,1.07,1.07,0,0,1-1-.89,1.47,1.47,0,0,1,.1-0.75q2.84-6.66,5.7-13.32a4.06,4.06,0,0,1,.18-0.42A6.39,6.39,0,0,0,17,15.53,0.58,0.58,0,0,0,16.74,15,2.21,2.21,0,0,1,16,12.5,2.26,2.26,0,0,1,18.11,11ZM21.74,29.1c-0.32-.74-0.61-1.43-0.92-2.12a0.35,0.35,0,0,0-.27-0.14H15.66a0.33,0.33,0,0,0-.26.11c-0.32.7-.62,1.41-0.93,2.15h7.26Zm-5.31-4.55h3.37L18.1,20.63Z M2.23,13.56A16,16,0,0,1,6.76,2.16a1.68,1.68,0,0,1,.8-0.46,1.06,1.06,0,0,1,1.18.59,1.16,1.16,0,0,1-.23,1.37A14.48,14.48,0,0,0,6.19,6.77a13.57,13.57,0,0,0,1.9,15.59l0.46,0.49a1.16,1.16,0,1,1-1.68,1.59,15.6,15.6,0,0,1-4.41-8.64C2.32,14.95,2.28,14.07,2.23,13.56Z M34,13.84a15.51,15.51,0,0,1-4.54,10.52,1.19,1.19,0,0,1-1.65.18,1.17,1.17,0,0,1,0-1.77,13.81,13.81,0,0,0,2.79-4.1,13.6,13.6,0,0,0-2.7-14.91A1.8,1.8,0,0,1,27.41,3,1.08,1.08,0,0,1,28,1.8,1.15,1.15,0,0,1,29.38,2a15.59,15.59,0,0,1,2.51,3.28A16.47,16.47,0,0,1,34,13.84Z M10.93,21.6A1.33,1.33,0,0,1,9.87,21a11.06,11.06,0,0,1-2.8-5.27A11.22,11.22,0,0,1,9.8,5.51l0.27-.28a1.16,1.16,0,1,1,1.64,1.63,8.62,8.62,0,0,0-2.06,3.22A8.87,8.87,0,0,0,11.18,19c0.18,0.23.4,0.44,0.59,0.66A1.13,1.13,0,0,1,11.95,21,1.08,1.08,0,0,1,10.93,21.6Z M29.47,13.57a11.11,11.11,0,0,1-3.27,7.64,1.18,1.18,0,0,1-1.51.21,1.13,1.13,0,0,1-.43-1.4,2.06,2.06,0,0,1,.39-0.54,8.85,8.85,0,0,0,2.49-5.89A9,9,0,0,0,24.64,7a1.85,1.85,0,0,1-.44-0.85A1,1,0,0,1,24.82,5a1.07,1.07,0,0,1,1.3.21,20.11,20.11,0,0,1,1.79,2.31A11.09,11.09,0,0,1,29.47,13.57Z M11.3,13.18a6.73,6.73,0,0,1,2-4.73,1.15,1.15,0,0,1,1.45-.2,1.12,1.12,0,0,1,.49,1.32,1.58,1.58,0,0,1-.33.53,4.49,4.49,0,0,0,0,6.26,1.16,1.16,0,1,1-1.7,1.57A6.81,6.81,0,0,1,11.3,13.18Z M24.94,13.14A6.9,6.9,0,0,1,23,18a1.16,1.16,0,1,1-1.7-1.58,4.5,4.5,0,0,0,0-6.29A1.16,1.16,0,1,1,23,8.5,6.75,6.75,0,0,1,24.94,13.14Z"}}),angular.module("xos.mcordTopology").service("NodeDrawer",["TopologyElements",function(t){var n=500,e=!1;this.drawFabricBox=function(t,n,r){if(!e){var a=t.append("g").attr({transform:"translate("+(n-25)+", "+(r-25)+")"});a.append("rect").attr({width:n+50,height:r+50,"class":"fabric-container"}),e=!0}},this.drawBbus=function(e){e.append("rect").attr({"class":function(t){return t.type},width:30,height:30,x:-15,y:-15,opacity:0}).transition().duration(n).attr({r:15,opacity:1}),e.append("path").attr({"class":function(t){return t.type+" antenna"},opacity:0,d:function(){return t.icons.bbu},transform:"translate(-18, -18)"}).transition().duration(n).attr({opacity:1}),e.append("text").attr({"text-anchor":"start",y:25,x:5,opacity:0}).text(function(t){return"vBBU "+t.name.substr(t.name.length-1,1)}).transition().duration(2*n).attr({opacity:1})},this.drawRrus=function(e){e.append("circle").attr({"class":function(t){return t.type+"-shadow"},r:0,opacity:0}).transition().duration(2*n).attr({r:40,opacity:1}),e.append("path").attr({"class":function(t){return t.type+" antenna"},opacity:0,d:function(){return t.icons.rru},transform:"translate(-18, -18)"}).transition().duration(n).attr({opacity:1})},this.drawFabric=function(e){e.append("rect").attr({width:30,height:30,x:-15,y:-15}),e.append("path").attr({"class":function(t){return t.type},opacity:0,d:function(){return t.icons["switch"]},transform:"translate(-22, -22), scale(0.4)"}).transition().duration(n).attr({opacity:1})},this.drawOthers=function(e){e.append("rect").attr({"class":function(t){return t.type},width:30,height:30,x:-15,y:-15,opacity:0}).transition().duration(n).attr({r:15,opacity:1}),e.append("path").attr({"class":function(t){return t.type+" antenna"},opacity:0,d:function(){return t.icons.bbu},transform:"translate(-18, -18)"}).transition().duration(n).attr({opacity:1}),e.append("text").attr({"text-anchor":"start",y:25,x:-12,opacity:0}).text(function(t){return t.name.toUpperCase()}).transition().duration(2*n).attr({opacity:1})},this.removeElements=function(t){t.transition().duration(n).attr({opacity:0}).remove()}}]),angular.module("xos.mcordTopology").run(["$location",function(t){t.path("/")}]);
diff --git a/xos/services/mcord/models.py b/xos/services/mcord/models.py
index 6e9fac5..5b69d4f 100644
--- a/xos/services/mcord/models.py
+++ b/xos/services/mcord/models.py
@@ -14,9 +14,9 @@
from sets import Set
from xos.config import Config
-MCORD_KIND = "MCORD"
+MCORD_KIND = "RAN" # This should be changed later I did it fo demo
MCORD_USE_VTN = getattr(Config(), "networking_use_vtn", False)
-VBBU_KIND = "vBBU"
+VBBU_KIND = "RAN"
VSGW_KIND = "vSGW"
VPGW_KIND = "vPGW"
net_types = ("s1u", "s1mme", "rru")
@@ -59,7 +59,7 @@
"rru_ip", "rru_mac")
# default_attributes is used cleanly indicate what the default values for
# the fields are.
- default_attributes = {"display_message": "VBBU Component is ready!", "s1u_tag": "201", "s1mme_tag": "200", "rru_tag": "199"}
+ default_attributes = {"display_message": "New vBBU Component", "s1u_tag": "201", "s1mme_tag": "200", "rru_tag": "199"}
def __init__(self, *args, **kwargs):
mcord_services = MCORDService.get_service_objects().all()
# When the tenant is created the default service in the form is set
diff --git a/xos/services/mcord/templates/mcordadmin.html b/xos/services/mcord/templates/mcordadmin.html
index 78f99f6..4a69dcc 100644
--- a/xos/services/mcord/templates/mcordadmin.html
+++ b/xos/services/mcord/templates/mcordadmin.html
@@ -2,7 +2,7 @@
<div class = "left-nav">
<ul>
<li>
- <a href="/admin/mcordservice/mcordcomponent/">
+ <a href="/admin/mcordservice/vbbucomponent/">
MCORD Service Components
</a>
</li>