Simon Hunt

GUI -- TopoView - Labels on host links now hidden when hosts are hidden.

  - removed 'animated' class from links.
  - fixed link label colors (text and rect) for both themes.

Change-Id: Iee638839090b64685d40296985e980f4e6105d82
...@@ -457,13 +457,6 @@ ...@@ -457,13 +457,6 @@
457 stroke: #D58E0F; 457 stroke: #D58E0F;
458 } 458 }
459 459
460 -.light #ov-topo svg .link.animated {
461 - stroke: #ffA300;
462 -}
463 -.dark #ov-topo svg .link.animated {
464 - stroke: #D58E0F;
465 -}
466 -
467 #ov-topo svg .link.secondary.optical { 460 #ov-topo svg .link.secondary.optical {
468 stroke-width: 4px; 461 stroke-width: 4px;
469 } 462 }
...@@ -484,16 +477,6 @@ ...@@ -484,16 +477,6 @@
484 stroke: #7352CD; 477 stroke: #7352CD;
485 } 478 }
486 479
487 -#ov-topo svg .link.animated.optical {
488 - stroke-width: 10px;
489 -}
490 -.light #ov-topo svg .link.animated.optical {
491 - stroke: #74f;
492 -}
493 -.dark #ov-topo svg .link.animated.optical {
494 - stroke: #7352CD;
495 -}
496 -
497 #ov-topo svg .linkLabel rect { 480 #ov-topo svg .linkLabel rect {
498 stroke: none; 481 stroke: none;
499 } 482 }
...@@ -501,7 +484,7 @@ ...@@ -501,7 +484,7 @@
501 fill: #eee; 484 fill: #eee;
502 } 485 }
503 .dark #ov-topo svg .linkLabel rect { 486 .dark #ov-topo svg .linkLabel rect {
504 - fill: #eee; 487 + fill: #555;
505 } 488 }
506 489
507 #ov-topo svg .linkLabel text { 490 #ov-topo svg .linkLabel text {
...@@ -510,10 +493,10 @@ ...@@ -510,10 +493,10 @@
510 font-size: 9pt; 493 font-size: 9pt;
511 } 494 }
512 .light #ov-topo svg .linkLabel text { 495 .light #ov-topo svg .linkLabel text {
513 - stroke: #777; 496 + fill: #444;
514 } 497 }
515 .dark #ov-topo svg .linkLabel text { 498 .dark #ov-topo svg .linkLabel text {
516 - stroke: #777; 499 + fill: #eee;
517 } 500 }
518 501
519 502
......
...@@ -368,10 +368,12 @@ ...@@ -368,10 +368,12 @@
368 function updateHostVisibility() { 368 function updateHostVisibility() {
369 sus.visible(nodeG.selectAll('.host'), showHosts); 369 sus.visible(nodeG.selectAll('.host'), showHosts);
370 sus.visible(linkG.selectAll('.hostLink'), showHosts); 370 sus.visible(linkG.selectAll('.hostLink'), showHosts);
371 + sus.visible(linkLabelG.selectAll('.hostLinkLabel'), showHosts);
371 } 372 }
372 373
373 function updateOfflineVisibility(dev) { 374 function updateOfflineVisibility(dev) {
374 function updDev(d, show) { 375 function updDev(d, show) {
376 + var b;
375 sus.visible(d.el, show); 377 sus.visible(d.el, show);
376 378
377 tms.findAttachedLinks(d.id).forEach(function (link) { 379 tms.findAttachedLinks(d.id).forEach(function (link) {
...@@ -925,6 +927,11 @@ ...@@ -925,6 +927,11 @@
925 y2: d.ldata.y2 927 y2: d.ldata.y2
926 }; 928 };
927 929
930 + if (d.ldata.type() === 'hostLink') {
931 + el.classed('hostLinkLabel', true);
932 + sus.visible(el, showHosts);
933 + }
934 +
928 d.el = el; 935 d.el = el;
929 rect = el.append('rect'); 936 rect = el.append('rect');
930 text = el.append('text').text(d.label); 937 text = el.append('text').text(d.label);
......
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
5 "paths": [ 5 "paths": [
6 { 6 {
7 "class": "primary", 7 "class": "primary",
8 - "traffic": false,
9 "links": [ 8 "links": [
10 "of:0000ffffffff0008/2-of:0000ffffffff0003/1" 9 "of:0000ffffffff0008/2-of:0000ffffffff0003/1"
11 ], 10 ],
...@@ -13,39 +12,22 @@ ...@@ -13,39 +12,22 @@
13 }, 12 },
14 { 13 {
15 "class": "secondary", 14 "class": "secondary",
16 - "traffic": false,
17 - "links": [
18 - "of:0000ffffffff0003/9-of:0000ffffffff0007/2"
19 - ],
20 - "labels": ["secondary"]
21 - },
22 - {
23 - "class": "animated",
24 - "traffic": true,
25 "links": [ 15 "links": [
16 + "of:0000ffffffff0003/9-of:0000ffffffff0007/2",
26 "of:0000ffffffff0008/4-of:0000ffffffff0007/1" 17 "of:0000ffffffff0008/4-of:0000ffffffff0007/1"
27 ], 18 ],
28 - "labels": ["animated"] 19 + "labels": ["secondary", "secondo"]
29 - },
30 - {
31 - "class": "animated optical",
32 - "traffic": true,
33 - "links": [
34 - "of:0000ffffffff0008/4-of:0000ffffffffff08/1"
35 - ],
36 - "labels": ["animated optical"]
37 }, 20 },
38 { 21 {
39 "class": "secondary optical", 22 "class": "secondary optical",
40 - "traffic": false,
41 "links": [ 23 "links": [
42 - "of:0000ffffffff0003/4-of:0000ffffffffff03/1" 24 + "of:0000ffffffff0003/4-of:0000ffffffffff03/1",
25 + "of:0000ffffffff0008/4-of:0000ffffffffff08/1"
43 ], 26 ],
44 - "labels": ["secondary optical"] 27 + "labels": ["secondary optical", "secondo optical"]
45 }, 28 },
46 { 29 {
47 "class": "primary optical", 30 "class": "primary optical",
48 - "traffic": false,
49 "links": [ 31 "links": [
50 "of:0000ffffffffff08/4-of:0000ffffffffff03/1" 32 "of:0000ffffffffff08/4-of:0000ffffffffff03/1"
51 ], 33 ],
......
1 -{
2 - "event": "showTraffic",
3 - "sid": 1,
4 - "payload": {
5 - "paths": [
6 - {
7 - "class": "animated",
8 - "traffic": true,
9 - "links": [
10 - "0E:2A:69:30:13:86/-1/0-of:0000ffffffff0003/101",
11 - "0E:2A:69:30:13:aa/-1/0-of:0000ffffffff0008/101"
12 - ],
13 - "labels": [
14 - "47 bytes",
15 - "47 bytes"
16 - ]
17 - },
18 - {
19 - "class": "animated optical",
20 - "traffic": true,
21 - "links": [
22 - "of:0000ffffffff0003/4-of:0000ffffffffff03/1",
23 - "of:0000ffffffff0008/4-of:0000ffffffffff08/1",
24 - "of:0000ffffffffff08/4-of:0000ffffffffff03/1"
25 - ],
26 - "labels": [
27 - "24 bytes",
28 - "some bits",
29 - "foo bars"
30 - ]
31 - }
32 - ]
33 - }
34 -}