diff --git a/web/gui/src/main/java/org/onosproject/ui/impl/UiExtensionManager.java b/web/gui/src/main/java/org/onosproject/ui/impl/UiExtensionManager.java index 0d511a34b4..254e807606 100644 --- a/web/gui/src/main/java/org/onosproject/ui/impl/UiExtensionManager.java +++ b/web/gui/src/main/java/org/onosproject/ui/impl/UiExtensionManager.java @@ -136,7 +136,6 @@ public class UiExtensionManager // FIXME: leave commented out for now, while still under development // (remember to also comment out inclusions in index.html) // new UiView(NETWORK, "topo2", "New-Topo"), -// new UiView(NETWORK, "topoX", "Topo-X"), new UiView(NETWORK, "device", "Devices", "nav_devs"), new UiViewHidden("flow"), diff --git a/web/gui/src/main/webapp/app/view/topoX/topoX-theme.css b/web/gui/src/main/webapp/app/view/topoX/topoX-theme.css deleted file mode 100644 index af95a40155..0000000000 --- a/web/gui/src/main/webapp/app/view/topoX/topoX-theme.css +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright 2016-present Open Networking Laboratory - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* - * Copyright 2016-present Open Networking Laboratory - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -/* - ONOS GUI -- Topology View (theme) -- CSS file - */ - -/* --- Base SVG Layer --- */ - -#ov-topoX svg { - /*background-color: #f4f4f4;*/ - background-color: goldenrod; /* just for testing */ -} - -/* --- "No Devices" Layer --- */ - -#ov-topoX svg .noDevsBird { - fill: #db7773; -} - -#ov-topoX svg #topoX-noDevsLayer text { - fill: #7e9aa8; -} - -/* --- Topo Map --- */ - -#ov-topoX svg #topoX-map { - stroke-width: 2px; - stroke: #f4f4f4; - fill: #e5e5e6; -} - diff --git a/web/gui/src/main/webapp/app/view/topoX/topoX.css b/web/gui/src/main/webapp/app/view/topoX/topoX.css deleted file mode 100644 index 938e03d4d8..0000000000 --- a/web/gui/src/main/webapp/app/view/topoX/topoX.css +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright 2016-present Open Networking Laboratory - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -/* - ONOS GUI -- Topology View (test layout) -- CSS file - */ - -/* --- Base SVG Layer --- */ - -#ov-topoX svg { - /* prevents the little cut/copy/paste square that would appear on iPad */ - -webkit-user-select: none; -} - -#topoXtmp { - height: 700px; - width: 98%; - overflow-y: scroll; -} - -#topoXtmp div { - padding: 2px 24px; - margin: 6px; - background-color: #ddddff; -} -#topoXtmp div div { - padding: 0 10px; -} -#topoXtmp div div span { - color: purple; - font-style: italic; - font-weight: bold; -} - -#topoXtmp h4 { - margin: 0 -} -#topoXtmp p { - margin: 0 -} -#topoXtmp .nav-me:hover { - background-color: #bbbbdd; -} -#topoXtmp .nav-me { - font-weight: bold; - text-decoration: underline; - cursor: pointer; - color: blue; -} - -.subRegions div p { - width: 40px; -} diff --git a/web/gui/src/main/webapp/app/view/topoX/topoX.html b/web/gui/src/main/webapp/app/view/topoX/topoX.html deleted file mode 100644 index 472f571592..0000000000 --- a/web/gui/src/main/webapp/app/view/topoX/topoX.html +++ /dev/null @@ -1,53 +0,0 @@ - -
-
-
-

Instances

-
-
-
- -

Layout Data

- -
- Layout ID: - -
-
- Layout Parent: - -
-
- Region ID: - -
-
- Region Name: - -
-
- Breadcrumbs: -
- -
-
- This Region ID: -
-
-

Subregions

-
-
-
-

Devices

-
-
-
-

Hosts

-
-
- -
-

Peers

-
-
-
-
diff --git a/web/gui/src/main/webapp/app/view/topoX/topoX.js b/web/gui/src/main/webapp/app/view/topoX/topoX.js deleted file mode 100644 index 88114c8969..0000000000 --- a/web/gui/src/main/webapp/app/view/topoX/topoX.js +++ /dev/null @@ -1,214 +0,0 @@ -/* - * Copyright 2016-present Open Networking Laboratory - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* - * Copyright 2016-present Open Networking Laboratory - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* - ONOS GUI -- Topology View Module - - NOTE: currently under development to support Regions. - */ - -(function () { - 'use strict'; - - // references to injected services - var $scope, $log, $loc, - fs, mast, ks, zs, - gs, ms, sus, flash, - wss, ps, th, - tXes, tXfs; - - // DOM elements - var ovtopoX, svg, defs, zoomLayer, mapG, spriteG, forceG, noDevsLayer; - - // Internal state - var zoomer, actionMap; - - - // === Helper Functions - - // callback invoked when the SVG view has been resized.. - function svgResized(s) { - $log.debug("topoX view resized", s); - } - - function setUpKeys(overlayKeys) { - $log.debug('topoX: set up keys....'); - } - - // === Controller Definition ----------------------------------------- - - angular.module('ovTopoX', ['onosUtil', 'onosSvg', 'onosRemote']) - .controller('OvTopoXCtrl', - ['$scope', '$log', '$location', - 'FnService', 'MastService', 'KeyService', 'ZoomService', - 'GlyphService', 'MapService', 'SvgUtilService', 'FlashService', - 'WebSocketService', 'PrefsService', 'ThemeService', - 'TopoXEventService', 'TopoXForceService', - - function (_$scope_, _$log_, _$loc_, - _fs_, _mast_, _ks_, _zs_, - _gs_, _ms_, _sus_, _flash_, - _wss_, _ps_, _th_, - _tXes_, _tXfs_) { - - var params = _$loc_.search(), - projection, - dim, - wh, - uplink = { - // provides function calls back into this space - // showNoDevs: showNoDevs, - // projection: function () { return projection; }, - // zoomLayer: function () { return zoomLayer; }, - // zoomer: function () { return zoomer; }, - // opacifyMap: opacifyMap, - // topoStartDone: topoStartDone - }; - - $scope = _$scope_; - $log = _$log_; - $loc = _$loc_; - - fs = _fs_; - mast = _mast_; - ks = _ks_; - zs = _zs_; - - gs = _gs_; - ms = _ms_; - sus = _sus_; - flash = _flash_; - - wss = _wss_; - ps = _ps_; - th = _th_; - - tXes = _tXes_; - tXfs = _tXfs_; - - // capture selected intent parameters (if they are set in the - // query string) so that the traffic overlay can highlight - // the path for that intent - if (params.intentKey && params.intentAppId && params.intentAppName) { - $scope.intentData = { - key: params.intentKey, - appId: params.intentAppId, - appName: params.intentAppName - }; - } - - $scope.notifyResize = function () { - svgResized(fs.windowSize(mast.mastHeight())); - }; - - // Cleanup on destroyed scope.. - $scope.$on('$destroy', function () { - $log.log('OvTopoXCtrl is saying Buh-Bye!'); - tXes.stop(); - ks.unbindKeys(); - tXfs.destroy(); - }); - - // svg layer and initialization of components - ovtopoX = d3.select('#ov-topoX'); - svg = ovtopoX.select('svg'); - // set the svg size to match that of the window, less the masthead - wh = fs.windowSize(mast.mastHeight()); - $log.debug('setting topo SVG size to', wh); - svg.attr(wh); - dim = [wh.width, wh.height]; - - - // set up our keyboard shortcut bindings - setUpKeys(); - - // make sure we can respond to topology events from the server - tXes.bindHandlers(); - - // initialize the force layout, ready to render the topology - tXfs.init(); - - - // =-=-=-=-=-=-=-=- - // TODO: in future, we will load background map data - // asynchronously (hence the promise) and then chain off - // there to send the topoXstart event to the server. - // For now, we'll send the event inline... - tXes.start(); - - - // === ORIGINAL CODE === - - // setUpKeys(); - // setUpToolbar(); - // setUpDefs(); - // setUpZoom(); - // setUpNoDevs(); - /* - setUpMap().then( - function (proj) { - var z = ps.getPrefs('topo_zoom', { tx:0, ty:0, sc:1 }); - zoomer.panZoom([z.tx, z.ty], z.sc); - $log.debug('** Zoom restored:', z); - - projection = proj; - $log.debug('** We installed the projection:', proj); - flash.enable(false); - toggleMap(prefsState.bg); - flash.enable(true); - mapShader(true); - - // now we have the map projection, we are ready for - // the server to send us device/host data... - tes.start(); - // need to do the following so we immediately get - // the summary panel data back from the server - restoreSummaryFromPrefs(); - } - ); - */ - // tes.bindHandlers(); - // setUpSprites(); - - // forceG = zoomLayer.append('g').attr('id', 'topo-force'); - // tfs.initForce(svg, forceG, uplink, dim); - // tis.initInst({ showMastership: tfs.showMastership }); - // tps.initPanels(); - - // restoreConfigFromPrefs(); - // ttbs.setDefaultOverlay(prefsState.ovidx); - - // $log.debug('registered overlays...', tov.list()); - - $log.log('OvTopoXCtrl has been created'); - }]); -}()); diff --git a/web/gui/src/main/webapp/app/view/topoX/topoXEvent.js b/web/gui/src/main/webapp/app/view/topoX/topoXEvent.js deleted file mode 100644 index a9f7a99d4b..0000000000 --- a/web/gui/src/main/webapp/app/view/topoX/topoXEvent.js +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright 2016-present Open Networking Laboratory - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* - ONOS GUI -- Topology Event Module. - - Defines the conduit between the client and the server: - - provides a clean API for sending events to the server - - dispatches incoming events from the server to the appropriate sub-module - - */ - -(function () { - 'use strict'; - - // injected refs - var $log, wss, tXfs; - - // internal state - var handlerMap, - openListener; - - // ========================== Helper Functions - - function createHandlerMap() { - handlerMap = { - topo2AllInstances: tXfs, - topo2CurrentLayout: tXfs, - topo2CurrentRegion: tXfs, - topo2PeerRegions: tXfs, - topo2StartDone: tXfs - - // Add further event names / module references as needed - }; - } - - function wsOpen(host, url) { - $log.debug('topoXEvent: WSopen - cluster node:', host, 'URL:', url); - // tell the server we are ready to receive topo events - wss.sendEvent('topo2Start'); - } - - // bind our event handlers to the web socket service, so that our - // callbacks get invoked for incoming events - function bindHandlers() { - wss.bindHandlers(handlerMap); - $log.debug('topoX event handlers bound'); - } - - // tell the server we are ready to receive topology events - function start() { - // in case we fail over to a new server, - // listen for wsock-open events - openListener = wss.addOpenListener(wsOpen); - wss.sendEvent('topo2Start'); - $log.debug('topoX comms started'); - } - - // tell the server we no longer wish to receive topology events - function stop() { - wss.sendEvent('topo2Stop'); - wss.unbindHandlers(handlerMap); - wss.removeOpenListener(openListener); - openListener = null; - $log.debug('topoX comms stopped'); - } - - // ========================== Main Service Definition - - angular.module('ovTopoX') - .factory('TopoXEventService', - ['$log', 'WebSocketService', 'TopoXForceService', - - function (_$log_, _wss_, _tXfs_) { - $log = _$log_; - wss = _wss_; - tXfs = _tXfs_; - - // deferred creation of handler map, so module references are good - createHandlerMap(); - - return { - bindHandlers: bindHandlers, - start: start, - stop: stop - }; - }]); -}()); diff --git a/web/gui/src/main/webapp/app/view/topoX/topoXForce.js b/web/gui/src/main/webapp/app/view/topoX/topoXForce.js deleted file mode 100644 index 3f515095fa..0000000000 --- a/web/gui/src/main/webapp/app/view/topoX/topoXForce.js +++ /dev/null @@ -1,207 +0,0 @@ -/* - * Copyright 2016-present Open Networking Laboratory - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* - ONOS GUI -- Topology Force Module. - Visualization of the topology in an SVG layer, using a D3 Force Layout. - */ - -(function () { - 'use strict'; - - // injected refs - var $log, wss; - - // selected DOM refs - var topdiv; - - // ========================== Helper Functions - - function init() { - topdiv = d3.select('#topoXtmp'); - $log.debug('Initialize topo force layout'); - } - - function destroy() { - $log.debug('Destroy topo force layout'); - } - - function rmP(div) { - div.selectAll('p').remove(); - } - - function navRequest(rid) { - wss.sendEvent('topo2navRegion', { - rid: rid - }); - } - - function doTmpInstances(data) { - var idiv = topdiv.select('.instances').select('div'); - data.members.forEach(function (m) { - idiv.append('div').text(m.id); - }); - } - - function doTmpCurrentLayout(data) { - var ldDiv = topdiv.select('.layoutData'), - bcs = ldDiv.select('.l_crumbs'); - - function setSpan(v, val) { - var cls = '.l_' + v, - span = ldDiv.select(cls).select('span'), - value = val || data[v]; - span.html(value); - } - - setSpan('id'); - setSpan('parent'); - setSpan('region'); - setSpan('regionName'); - - addCrumbNav(bcs, data.crumbs, data.region); - } - - function addCrumbNav(span, array, id) { - var rev = []; - - span.selectAll('span').remove(); - - array.forEach(function (a) { - rev.unshift(a.id); - }); - - rev.forEach(function (rid, idx) { - if (idx) { - span.append('span').text(' +++ '); - } - if (rid != id) { - addNavigable(span, 'span', rid); - } else { - span.append('span').text(rid); - } - }); - } - - function addNavigable(span, what, rid) { - span.append(what).classed('nav-me', true) - .text(rid) - .on('click', function () { navRequest(rid); }); - } - - function doTmpCurrentRegion(data) { - var span = topdiv.select('.thisRegion').select('span'); - var div; - span.text(data.id); - - div = topdiv.select('.subRegions').select('div'); - rmP(div); - data.subregions.forEach(function (r) { - addNavigable(div, 'p', r.id); - }); - - div = topdiv.select('.devices').select('div'); - rmP(div); - data.layerOrder.forEach(function (tag, idx) { - var devs = data.devices[idx]; - devs.forEach(function (d) { - div.append('p') - .text('[' + tag + '] ' + d.id); - }); - - }); - - div = topdiv.select('.hosts').select('div'); - rmP(div); - data.layerOrder.forEach(function (tag, idx) { - var hosts = data.hosts[idx]; - hosts.forEach(function (h) { - div.append('p') - .text('[' + tag + '] ' + h.id); - }); - }); - - div = topdiv.select('.links').select('div'); - rmP(div); - data.links.forEach(function (lnk) { - div.append('p') - .text(lnk.id); - }); - } - - function doTmpPeerRegions(data) { - var peerDiv = topdiv.select('.peers').select('div'); - rmP(peerDiv); - - function logPeer(p) { - var o = peerDiv.append('p'), - id = p.id, - nt = p.nodeType; - o.text('[' + nt + '] id = ' + id); - } - - data.peers.forEach(function (p) { - logPeer(p); - }); - } - - // ========================== Event Handlers - - function allInstances(data) { - $log.debug('>> topo2AllInstances event:', data); - doTmpInstances(data); - } - - function currentLayout(data) { - $log.debug('>> topo2CurrentLayout event:', data); - doTmpCurrentLayout(data); - } - - function currentRegion(data) { - $log.debug('>> topo2CurrentRegion event:', data); - doTmpCurrentRegion(data); - } - - function peerRegions(data) { - $log.debug('>> topo2PeerRegions event:', data); - doTmpPeerRegions(data); - } - - function startDone(data) { - $log.debug('>> topo2StartDone event:', data); - } - - // ========================== Main Service Definition - - angular.module('ovTopoX') - .factory('TopoXForceService', - ['$log', 'WebSocketService', - - function (_$log_, _wss_) { - $log = _$log_; - wss = _wss_; - - return { - init: init, - destroy: destroy, - topo2AllInstances: allInstances, - topo2CurrentLayout: currentLayout, - topo2CurrentRegion: currentRegion, - topo2PeerRegions: peerRegions, - topo2StartDone: startDone - }; - }]); -}()); diff --git a/web/gui/src/main/webapp/index.html b/web/gui/src/main/webapp/index.html index a3b47ca516..c33e5cf45c 100644 --- a/web/gui/src/main/webapp/index.html +++ b/web/gui/src/main/webapp/index.html @@ -167,11 +167,6 @@ --> -