Simon Hunt

GUI - Implemented updateInstance event handler.

- Cleaned up onos instance rendering.

Change-Id: Ib074fb061467a566bc75052b14ea38ecbbc055b6
1 +{
2 + "event": "updateInstance",
3 + "payload": {
4 + "id": "onos-3",
5 + "online": true,
6 + "labels": [
7 + "onos-3",
8 + "192.168.3.3"
9 + ]
10 + }
11 +}
1 +{
2 + "event": "updateInstance",
3 + "payload": {
4 + "id": "onos-3",
5 + "online": false,
6 + "labels": [
7 + "onos-3",
8 + "192.168.3.3"
9 + ]
10 + }
11 +}
...@@ -273,10 +273,12 @@ svg .node.host circle { ...@@ -273,10 +273,12 @@ svg .node.host circle {
273 273
274 #topo-oibox .onosInst img { 274 #topo-oibox .onosInst img {
275 opacity: 0.5; 275 opacity: 0.5;
276 + padding: 3px;
276 } 277 }
277 278
278 #topo-oibox .onosInst.online img { 279 #topo-oibox .onosInst.online img {
279 opacity: 1.0; 280 opacity: 1.0;
281 + padding: 3px;
280 } 282 }
281 283
282 #topo-oibox .onosInst img.ui { 284 #topo-oibox .onosInst img.ui {
......
...@@ -557,7 +557,7 @@ ...@@ -557,7 +557,7 @@
557 addLink: addLink, 557 addLink: addLink,
558 addHost: addHost, 558 addHost: addHost,
559 559
560 - updateInstance: stillToImplement, 560 + updateInstance: updateInstance,
561 updateDevice: updateDevice, 561 updateDevice: updateDevice,
562 updateLink: updateLink, 562 updateLink: updateLink,
563 updateHost: updateHost, 563 updateHost: updateHost,
...@@ -652,7 +652,6 @@ ...@@ -652,7 +652,6 @@
652 if (instData) { 652 if (instData) {
653 $.extend(instData, inst); 653 $.extend(instData, inst);
654 updateInstances(); 654 updateInstances();
655 - //updateInstanceState(instData);
656 } else { 655 } else {
657 logicError('updateInstance lookup fail. ID = "' + id + '"'); 656 logicError('updateInstance lookup fail. ID = "' + id + '"');
658 } 657 }
...@@ -843,6 +842,7 @@ ...@@ -843,6 +842,7 @@
843 .data(onosOrder, function (d) { return d.id; }); 842 .data(onosOrder, function (d) { return d.id; });
844 843
845 // operate on existing onoses if necessary 844 // operate on existing onoses if necessary
845 + onoses.classed('online', function (d) { return d.online; });
846 846
847 var entering = onoses.enter() 847 var entering = onoses.enter()
848 .append('div') 848 .append('div')
...@@ -857,11 +857,7 @@ ...@@ -857,11 +857,7 @@
857 $('<img src="img/host.png">').appendTo(el); 857 $('<img src="img/host.png">').appendTo(el);
858 img = el.select('img') 858 img = el.select('img')
859 .attr({ 859 .attr({
860 - width: 40, 860 + width: 30
861 - top: -10,
862 - left: -10
863 - })
864 - .style({
865 }); 861 });
866 862
867 $('<div>').attr('class', 'onosTitle').text(d.id).appendTo(el); 863 $('<div>').attr('class', 'onosTitle').text(d.id).appendTo(el);
......