GUI -- TopoView - don't add source port on host link.
Change-Id: Ia1a298eb6cab9da1c209c8365b244025468f1a20
Showing
1 changed file
with
14 additions
and
11 deletions
... | @@ -198,21 +198,24 @@ | ... | @@ -198,21 +198,24 @@ |
198 | d.el.classed('enhanced', true); | 198 | d.el.classed('enhanced', true); |
199 | $log.debug('[' + (d.srcPort || 'H') + '] ---> [' + d.tgtPort + ']', d.key); | 199 | $log.debug('[' + (d.srcPort || 'H') + '] ---> [' + d.tgtPort + ']', d.key); |
200 | 200 | ||
201 | - // define port label data objects | 201 | + // Define port label data objects. |
202 | - var data = [ | 202 | + // NOTE: src port is absent in the case of host-links. |
203 | - { | 203 | + |
204 | + var data = [{ | ||
205 | + id: 'topo-port-tgt', | ||
206 | + num: d.tgtPort, | ||
207 | + baseX: d.target.x, | ||
208 | + baseY: d.target.y | ||
209 | + }]; | ||
210 | + | ||
211 | + if (d.srcPort) { | ||
212 | + data.push({ | ||
204 | id: 'topo-port-src', | 213 | id: 'topo-port-src', |
205 | num: d.srcPort, | 214 | num: d.srcPort, |
206 | baseX: d.source.x, | 215 | baseX: d.source.x, |
207 | baseY: d.source.y | 216 | baseY: d.source.y |
208 | - }, | 217 | + }); |
209 | - { | 218 | + } |
210 | - id: 'topo-port-tgt', | ||
211 | - num: d.tgtPort, | ||
212 | - baseX: d.target.x, | ||
213 | - baseY: d.target.y | ||
214 | - } | ||
215 | - ]; | ||
216 | 219 | ||
217 | td3.applyPortLabels(data, api.portLabelG()); | 220 | td3.applyPortLabels(data, api.portLabelG()); |
218 | } | 221 | } | ... | ... |
-
Please register or login to post a comment