Topo2 - Key Command 'H' to toggel hosts visibility
JIRA Tasks; ONOS-6283

Change-Id: Id1b8c00342af799e1d92c84346bb3fe6f6023af6
diff --git a/web/gui/src/main/webapp/app/view/topo2/topo2Host.js b/web/gui/src/main/webapp/app/view/topo2/topo2Host.js
index e54f5a0..ed3a981 100644
--- a/web/gui/src/main/webapp/app/view/topo2/topo2Host.js
+++ b/web/gui/src/main/webapp/app/view/topo2/topo2Host.js
@@ -48,8 +48,8 @@
     angular.module('ovTopo2')
     .factory('Topo2HostService', [
         'Topo2Collection', 'Topo2NodeModel', 'Topo2ViewService',
-        'IconService', 'Topo2ZoomService', 'Topo2HostsPanelService',
-        function (_c_, NodeModel, _t2vs_, is, zs, t2hds) {
+        'IconService', 'Topo2ZoomService', 'Topo2HostsPanelService', 'PrefsService',
+        function (_c_, NodeModel, _t2vs_, is, zs, t2hds, ps) {
 
             Collection = _c_;
 
@@ -95,6 +95,10 @@
                     this.el.select('g').selectAll('*')
                         .style('transform', 'scale(' + multipler + ')');
                 },
+                setVisibility: function () {
+                    var visible = ps.getPrefs('topo2_prefs')['hosts'];
+                    this.el.style('visibility', visible ? 'visible' : 'hidden');
+                },
                 onEnter: function (el) {
                     var node = d3.select(el),
                         icon = this.icon(),
@@ -127,6 +131,7 @@
 
                     this.setScale();
                     this.setUpEvents();
+                    this.setVisibility();
                 }
             });