alshabib

Merge branch 'master' of ssh://gerrit.onlab.us:29418/onos-next

...@@ -209,9 +209,13 @@ public class TopologyResource extends BaseResource { ...@@ -209,9 +209,13 @@ public class TopologyResource extends BaseResource {
209 // Produces JSON for a link. 209 // Produces JSON for a link.
210 private ObjectNode json(ObjectMapper mapper, AggLink aggLink) { 210 private ObjectNode json(ObjectMapper mapper, AggLink aggLink) {
211 Link link = aggLink.link; 211 Link link = aggLink.link;
212 + ConnectPoint src = link.src();
213 + ConnectPoint dst = link.dst();
212 return mapper.createObjectNode() 214 return mapper.createObjectNode()
213 - .put("src", link.src().deviceId().toString()) 215 + .put("src", src.deviceId().toString())
214 - .put("dst", link.dst().deviceId().toString()) 216 + .put("srcPort", src.port().toString())
217 + .put("dst", dst.deviceId().toString())
218 + .put("dstPort", dst.port().toString())
215 .put("type", link.type().toString().toLowerCase()) 219 .put("type", link.type().toString().toLowerCase())
216 .put("linkWidth", aggLink.links.size()); 220 .put("linkWidth", aggLink.links.size());
217 } 221 }
......
...@@ -28,73 +28,73 @@ ...@@ -28,73 +28,73 @@
28 28
29 // configuration data 29 // configuration data
30 var config = { 30 var config = {
31 - debugOn: false, 31 + debugOn: false,
32 - debug: { 32 + debug: {
33 - showNodeXY: false, 33 + showNodeXY: false,
34 - showKeyHandler: true 34 + showKeyHandler: true
35 + },
36 + options: {
37 + layering: true,
38 + collisionPrevention: true
39 + },
40 + jsonUrl: 'rs/topology/graph',
41 + jsonPrefix: '',
42 + XjsonUrl: 'json/network.json',
43 + XjsonPrefix: 'json/',
44 + iconUrl: {
45 + device: 'img/device.png',
46 + host: 'img/host.png',
47 + pkt: 'img/pkt.png',
48 + opt: 'img/opt.png'
49 + },
50 + mastHeight: 36,
51 + force: {
52 + note: 'node.class or link.class is used to differentiate',
53 + linkDistance: {
54 + infra: 200,
55 + host: 40
35 }, 56 },
36 - options: { 57 + linkStrength: {
37 - layering: true, 58 + infra: 1.0,
38 - collisionPrevention: true 59 + host: 1.0
39 }, 60 },
40 - jsonUrl: 'rs/topology/graph', 61 + charge: {
41 - jsonPrefix: '', 62 + device: -800,
42 - XjsonUrl: 'json/network.json', 63 + host: -1000
43 - XjsonPrefix: 'json/',
44 - iconUrl: {
45 - device: 'img/device.png',
46 - host: 'img/host.png',
47 - pkt: 'img/pkt.png',
48 - opt: 'img/opt.png'
49 }, 64 },
50 - mastHeight: 36, 65 + ticksWithoutCollisions: 50,
51 - force: { 66 + marginLR: 20,
52 - note: 'node.class or link.class is used to differentiate', 67 + marginTB: 20,
53 - linkDistance: { 68 + translate: function() {
54 - infra: 200, 69 + return 'translate(' +
55 - host: 40 70 + config.force.marginLR + ',' +
56 - }, 71 + config.force.marginTB + ')';
57 - linkStrength: { 72 + }
58 - infra: 1.0, 73 + },
59 - host: 1.0 74 + labels: {
60 - }, 75 + imgPad: 16,
61 - charge: { 76 + padLR: 8,
62 - device: -800, 77 + padTB: 6,
63 - host: -1000 78 + marginLR: 3,
64 - }, 79 + marginTB: 2
65 - ticksWithoutCollisions: 50, 80 + },
66 - marginLR: 20, 81 + icons: {
67 - marginTB: 20, 82 + w: 32,
68 - translate: function() { 83 + h: 32,
69 - return 'translate(' + 84 + xoff: -12,
70 - config.force.marginLR + ',' + 85 + yoff: -8
71 - config.force.marginTB + ')'; 86 + },
72 - } 87 + constraints: {
73 - }, 88 + ypos: {
74 - labels: { 89 + host: 0.05,
75 - imgPad: 16, 90 + switch: 0.3,
76 - padLR: 8, 91 + roadm: 0.7
77 - padTB: 6, 92 + }
78 - marginLR: 3, 93 + },
79 - marginTB: 2 94 + hostLinkWidth: 1.0,
80 - }, 95 + hostRadius: 7,
81 - icons: { 96 + mouseOutTimerDelayMs: 120
82 - w: 32, 97 + };
83 - h: 32,
84 - xoff: -12,
85 - yoff: -8
86 - },
87 - constraints: {
88 - ypos: {
89 - host: 0.05,
90 - switch: 0.3,
91 - roadm: 0.7
92 - }
93 - },
94 - hostLinkWidth: 1.0,
95 - hostRadius: 7,
96 - mouseOutTimerDelayMs: 120
97 - };
98 98
99 // state variables 99 // state variables
100 var view = {}, 100 var view = {},
......