Topo2: ONOS-5640, ONOS-5641 ONOS-5645 Show details for Hosts, Links, Sub-Regions
Added Links panel
Details panel shared between Details, Link, Hosts and Regions
Refactored List content for panel views
Reference to the PanelService Element had a name change
Added a Base UIView to extend future views from
Extend method was being repeated

Change-Id: I3fa070fc5140e98720e47f4b90e3571cb0347596
diff --git a/web/gui/src/main/webapp/app/view/topo2/topo2DeviceDetailsPanel.js b/web/gui/src/main/webapp/app/view/topo2/topo2DeviceDetailsPanel.js
index 624b234..741f942 100644
--- a/web/gui/src/main/webapp/app/view/topo2/topo2DeviceDetailsPanel.js
+++ b/web/gui/src/main/webapp/app/view/topo2/topo2DeviceDetailsPanel.js
@@ -23,17 +23,13 @@
     'use strict';
 
     // Injected Services
-    var Panel, gs, wss, flash, bs, fs, ns;
+    var Panel, gs, wss, flash, bs, fs, ns, listProps;
 
     // Internal State
     var detailsPanel;
 
     // configuration
     var id = 'topo2-p-detail',
-        className = 'topo-p',
-        panelOpts = {
-            width: 260          // summary and detail panel width
-        },
         handlerMap = {
             'showDetails': showDetails
         };
@@ -69,43 +65,7 @@
     function init() {
 
         bindHandlers();
-
-        var options = angular.extend({}, panelOpts, {
-            class: className
-        });
-
-        detailsPanel = new Panel(id, options);
-        detailsPanel.p.classed(className, true);
-    }
-
-    function addProp(tbody, label, value) {
-        var tr = tbody.append('tr'),
-            lab;
-        if (typeof label === 'string') {
-            lab = label.replace(/_/g, ' ');
-        } else {
-            lab = label;
-        }
-
-        function addCell(cls, txt) {
-            tr.append('td').attr('class', cls).html(txt);
-        }
-        addCell('label', lab + ' :');
-        addCell('value', value);
-    }
-
-    function addSep(tbody) {
-        tbody.append('tr').append('td').attr('colspan', 2).append('hr');
-    }
-
-    function listProps(tbody, data) {
-        data.propOrder.forEach(function (p) {
-            if (p === '-') {
-                addSep(tbody);
-            } else {
-                addProp(tbody, p, data.props[p]);
-            }
-        });
+        detailsPanel = Panel();
     }
 
     function addBtnFooter() {
@@ -136,10 +96,6 @@
                     cb: function () { ns.navTo(path, { devId: devId }); }
                 });
             }
-            // TODO: Implement Overlay service
-            // else if (btn = _getButtonDef(id, data)) {
-            //     addAction(btn);
-            // }
         });
     }
 
@@ -196,17 +152,17 @@
     }
 
     function toggle() {
-        var on = detailsPanel.p.toggle(),
+        var on = detailsPanel.el.toggle(),
             verb = on ? 'Show' : 'Hide';
         flash.flash(verb + ' Details Panel');
     }
 
     function show() {
-        detailsPanel.p.show();
+        detailsPanel.el.show();
     }
 
     function hide() {
-        detailsPanel.p.hide();
+        detailsPanel.el.hide();
     }
 
     function destroy() {
@@ -216,9 +172,9 @@
 
     angular.module('ovTopo2')
     .factory('Topo2DeviceDetailsPanel',
-    ['Topo2PanelService', 'GlyphService', 'WebSocketService', 'FlashService',
-    'ButtonService', 'FnService', 'NavService',
-        function (_ps_, _gs_, _wss_, _flash_, _bs_, _fs_, _ns_) {
+    ['Topo2DetailsPanelService', 'GlyphService', 'WebSocketService', 'FlashService',
+    'ButtonService', 'FnService', 'NavService', 'ListService', 
+        function (_ps_, _gs_, _wss_, _flash_, _bs_, _fs_, _ns_, _listService_) {
 
             Panel = _ps_;
             gs = _gs_;
@@ -227,6 +183,7 @@
             bs = _bs_;
             fs = _fs_;
             ns = _ns_;
+            listProps = _listService_;
 
             return {
                 init: init,