GUI - Cleanup of old files.
Change-Id: I2fd30f32d15ecb0b97ee7f380523ebb8513a6a01
Showing
24 changed files
with
27 additions
and
300 deletions
| ... | @@ -26,20 +26,20 @@ | ... | @@ -26,20 +26,20 @@ |
| 26 | <title>ONOS GUI</title> | 26 | <title>ONOS GUI</title> |
| 27 | 27 | ||
| 28 | <!--TODO: use the minified version of d3, once debugging is complete --> | 28 | <!--TODO: use the minified version of d3, once debugging is complete --> |
| 29 | - <script src="libs/d3.js"></script> | 29 | + <script src="../libs/d3.js"></script> |
| 30 | - <script src="libs/jquery-2.1.1.min.js"></script> | 30 | + <script src="../libs/jquery-2.1.1.min.js"></script> |
| 31 | 31 | ||
| 32 | - <link rel="stylesheet" href="base.css"> | 32 | + <link rel="stylesheet" href="../base.css"> |
| 33 | <link rel="stylesheet" href="onos.css"> | 33 | <link rel="stylesheet" href="onos.css"> |
| 34 | 34 | ||
| 35 | - <script src="geometry.js"></script> | 35 | + <script src="../geometry.js"></script> |
| 36 | <script src="onos.js"></script> | 36 | <script src="onos.js"></script> |
| 37 | 37 | ||
| 38 | </head> | 38 | </head> |
| 39 | <body> | 39 | <body> |
| 40 | <div id="frame"> | 40 | <div id="frame"> |
| 41 | <div id="mast"> | 41 | <div id="mast"> |
| 42 | - <img id="logo" src="img/onos-logo.png"> | 42 | + <img id="logo" src="../img/onos-logo.png"> |
| 43 | <span class="title">Open Network Operating System</span> | 43 | <span class="title">Open Network Operating System</span> |
| 44 | <span id="displayModes" class="right"> | 44 | <span id="displayModes" class="right"> |
| 45 | <span id="showAll" class="radio active">All Layers</span> | 45 | <span id="showAll" class="radio active">All Layers</span> | ... | ... |
File moved
File moved
| ... | @@ -157,8 +157,8 @@ | ... | @@ -157,8 +157,8 @@ |
| 157 | d3.json(url , function (err, data) { | 157 | d3.json(url , function (err, data) { |
| 158 | if (err) { | 158 | if (err) { |
| 159 | alert('Oops! Error reading JSON...\n\n' + | 159 | alert('Oops! Error reading JSON...\n\n' + |
| 160 | - 'URL: ' + url + '\n\n' + | 160 | + 'URL: ' + url + '\n\n' + |
| 161 | - 'Error: ' + err.message); | 161 | + 'Error: ' + err.message); |
| 162 | return; | 162 | return; |
| 163 | } | 163 | } |
| 164 | // console.log("here is the JSON data..."); | 164 | // console.log("here is the JSON data..."); |
| ... | @@ -263,7 +263,7 @@ | ... | @@ -263,7 +263,7 @@ |
| 263 | .attr('y', 15) | 263 | .attr('y', 15) |
| 264 | .style('font-size', '20pt') | 264 | .style('font-size', '20pt') |
| 265 | .text('keyCode: ' + d3.event.keyCode + | 265 | .text('keyCode: ' + d3.event.keyCode + |
| 266 | - ' applied to : ' + contextLabel()) | 266 | + ' applied to : ' + contextLabel()) |
| 267 | .transition().duration(2000) | 267 | .transition().duration(2000) |
| 268 | .style('font-size', '2pt') | 268 | .style('font-size', '2pt') |
| 269 | .style('fill-opacity', 0.01) | 269 | .style('fill-opacity', 0.01) |
| ... | @@ -474,7 +474,7 @@ | ... | @@ -474,7 +474,7 @@ |
| 474 | 'xlink:href': config.backgroundUrl | 474 | 'xlink:href': config.backgroundUrl |
| 475 | }) | 475 | }) |
| 476 | .style('visibility', | 476 | .style('visibility', |
| 477 | - config.options.loadBackground ? 'visible' : 'hidden'); | 477 | + config.options.loadBackground ? 'visible' : 'hidden'); |
| 478 | 478 | ||
| 479 | // function zoomRedraw() { | 479 | // function zoomRedraw() { |
| 480 | // d3.select("#zoomable").attr("transform", | 480 | // d3.select("#zoomable").attr("transform", |
| ... | @@ -493,9 +493,9 @@ | ... | @@ -493,9 +493,9 @@ |
| 493 | glow.append('feColorMatrix') | 493 | glow.append('feColorMatrix') |
| 494 | .attr('type', 'matrix') | 494 | .attr('type', 'matrix') |
| 495 | .attr('values', '0 0 0 0 0 ' + | 495 | .attr('values', '0 0 0 0 0 ' + |
| 496 | - '0 0 0 0 0 ' + | 496 | + '0 0 0 0 0 ' + |
| 497 | - '0 0 0 0 .7 ' + | 497 | + '0 0 0 0 .7 ' + |
| 498 | - '0 0 0 1 0 '); | 498 | + '0 0 0 1 0 '); |
| 499 | 499 | ||
| 500 | glow.append('feGaussianBlur') | 500 | glow.append('feGaussianBlur') |
| 501 | .attr('stdDeviation', 3) | 501 | .attr('stdDeviation', 3) |
| ... | @@ -596,14 +596,14 @@ | ... | @@ -596,14 +596,14 @@ |
| 596 | 596 | ||
| 597 | if (d.source.type) | 597 | if (d.source.type) |
| 598 | 598 | ||
| 599 | - network.linkSrcPort.append('rect').attr({ | 599 | + network.linkSrcPort.append('rect').attr({ |
| 600 | - id: 'srcPort-' + safeId(d.id), | 600 | + id: 'srcPort-' + safeId(d.id), |
| 601 | - class: 'port ' + srcType, | 601 | + class: 'port ' + srcType, |
| 602 | - width: pw, | 602 | + width: pw, |
| 603 | - height: ph, | 603 | + height: ph, |
| 604 | - rx: 4, | 604 | + rx: 4, |
| 605 | - ry: 4 | 605 | + ry: 4 |
| 606 | - }).style('visibility', portVis); | 606 | + }).style('visibility', portVis); |
| 607 | 607 | ||
| 608 | network.linkTgtPort.append('rect').attr({ | 608 | network.linkTgtPort.append('rect').attr({ |
| 609 | id: 'tgtPort-' + safeId(d.id), | 609 | id: 'tgtPort-' + safeId(d.id), |
| ... | @@ -673,15 +673,15 @@ | ... | @@ -673,15 +673,15 @@ |
| 673 | width: 100, | 673 | width: 100, |
| 674 | height: 12 | 674 | height: 12 |
| 675 | }); | 675 | }); |
| 676 | - // note that width/height are adjusted to fit the label text | 676 | + // note that width/height are adjusted to fit the label text |
| 677 | - // then padded, and space made for the icon. | 677 | + // then padded, and space made for the icon. |
| 678 | 678 | ||
| 679 | network.node.filter('.device').each(function(d) { | 679 | network.node.filter('.device').each(function(d) { |
| 680 | var node = d3.select(this), | 680 | var node = d3.select(this), |
| 681 | icon = iconUrl(d); | 681 | icon = iconUrl(d); |
| 682 | 682 | ||
| 683 | node.append('text') | 683 | node.append('text') |
| 684 | - // TODO: add label cycle behavior | 684 | + // TODO: add label cycle behavior |
| 685 | .text(d.id) | 685 | .text(d.id) |
| 686 | .attr('dy', '1.1em'); | 686 | .attr('dy', '1.1em'); |
| 687 | 687 | ||
| ... | @@ -1100,8 +1100,8 @@ | ... | @@ -1100,8 +1100,8 @@ |
| 1100 | d3.json(url, function (err, data) { | 1100 | d3.json(url, function (err, data) { |
| 1101 | if (err) { | 1101 | if (err) { |
| 1102 | alert('Oops! Error reading JSON...\n\n' + | 1102 | alert('Oops! Error reading JSON...\n\n' + |
| 1103 | - 'URL: ' + url + '\n\n' + | 1103 | + 'URL: ' + url + '\n\n' + |
| 1104 | - 'Error: ' + err.message); | 1104 | + 'Error: ' + err.message); |
| 1105 | return; | 1105 | return; |
| 1106 | } | 1106 | } |
| 1107 | // console.log("JSON data... " + url); | 1107 | // console.log("JSON data... " + url); | ... | ... |
| ... | @@ -24,13 +24,10 @@ | ... | @@ -24,13 +24,10 @@ |
| 24 | <html> | 24 | <html> |
| 25 | <head> | 25 | <head> |
| 26 | <meta charset="utf-8"> | 26 | <meta charset="utf-8"> |
| 27 | - <title>ONOS GUI (v1.1)</title> | 27 | + <title>ONOS</title> |
| 28 | 28 | ||
| 29 | <link rel="shortcut icon" href="img/onos-logo.png"> | 29 | <link rel="shortcut icon" href="img/onos-logo.png"> |
| 30 | 30 | ||
| 31 | - <!-- first script to be run --> | ||
| 32 | - <script src="preamble.js"></script> | ||
| 33 | - | ||
| 34 | <!-- Third party library code included here --> | 31 | <!-- Third party library code included here --> |
| 35 | <!--TODO: use the minified version of d3, once debugging is complete --> | 32 | <!--TODO: use the minified version of d3, once debugging is complete --> |
| 36 | <script src="libs/d3.js"></script> | 33 | <script src="libs/d3.js"></script> |
| ... | @@ -48,7 +45,6 @@ | ... | @@ -48,7 +45,6 @@ |
| 48 | <!-- This is where contributed stylesheets get INJECTED --> | 45 | <!-- This is where contributed stylesheets get INJECTED --> |
| 49 | <!-- TODO: replace with template marker and inject refs server-side --> | 46 | <!-- TODO: replace with template marker and inject refs server-side --> |
| 50 | <link rel="stylesheet" href="topo2.css"> | 47 | <link rel="stylesheet" href="topo2.css"> |
| 51 | - <link rel="stylesheet" href="webSockTrace.css"> | ||
| 52 | 48 | ||
| 53 | 49 | ||
| 54 | <!-- General library modules included here--> | 50 | <!-- General library modules included here--> |
| ... | @@ -86,8 +82,7 @@ | ... | @@ -86,8 +82,7 @@ |
| 86 | var ONOS = $.onos({ | 82 | var ONOS = $.onos({ |
| 87 | comment: 'configuration options', | 83 | comment: 'configuration options', |
| 88 | theme: 'dark', | 84 | theme: 'dark', |
| 89 | - startVid: 'topo', | 85 | + startVid: 'topo' |
| 90 | - trace: false | ||
| 91 | }); | 86 | }); |
| 92 | </script> | 87 | </script> |
| 93 | 88 | ||
| ... | @@ -112,8 +107,6 @@ | ... | @@ -112,8 +107,6 @@ |
| 112 | 107 | ||
| 113 | <!-- Contributed (application) views injected here --> | 108 | <!-- Contributed (application) views injected here --> |
| 114 | <!-- TODO: replace with template marker and inject refs server-side --> | 109 | <!-- TODO: replace with template marker and inject refs server-side --> |
| 115 | - <script src="webSockTrace.js"></script> | ||
| 116 | - | ||
| 117 | <script src="topo2.js"></script> | 110 | <script src="topo2.js"></script> |
| 118 | 111 | ||
| 119 | <!-- finally, build the UI--> | 112 | <!-- finally, build the UI--> | ... | ... |
web/gui/src/main/webapp/preamble.js
deleted
100644 → 0
| 1 | -/* | ||
| 2 | - * Copyright 2014 Open Networking Laboratory | ||
| 3 | - * | ||
| 4 | - * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 5 | - * you may not use this file except in compliance with the License. | ||
| 6 | - * You may obtain a copy of the License at | ||
| 7 | - * | ||
| 8 | - * http://www.apache.org/licenses/LICENSE-2.0 | ||
| 9 | - * | ||
| 10 | - * Unless required by applicable law or agreed to in writing, software | ||
| 11 | - * distributed under the License is distributed on an "AS IS" BASIS, | ||
| 12 | - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 13 | - * See the License for the specific language governing permissions and | ||
| 14 | - * limitations under the License. | ||
| 15 | - */ | ||
| 16 | - | ||
| 17 | -/* | ||
| 18 | - ONOS GUI -- Preamble -- the first thing we do | ||
| 19 | - | ||
| 20 | - @author Simon Hunt | ||
| 21 | - */ | ||
| 22 | - | ||
| 23 | -(function () { | ||
| 24 | - | ||
| 25 | - // NOTE: DON'T Want to do this.. we want to be able to | ||
| 26 | - // use the parameter section, for example: | ||
| 27 | - // #viewId,context?flag1,flag2,flag3 | ||
| 28 | - | ||
| 29 | - // Check if the URL in the address bar contains a parameter section | ||
| 30 | - // (delineated by '?'). If this is the case, rewrite using '#' instead. | ||
| 31 | - | ||
| 32 | - //var m = /([^?]*)\?(.*)/.exec(window.location.href); | ||
| 33 | - //if (m) { | ||
| 34 | - // window.location.href = m[1] + '#' + m[2]; | ||
| 35 | - //} | ||
| 36 | - | ||
| 37 | -}()); |
| 1 | -/* | ||
| 2 | - * Copyright 2014 Open Networking Laboratory | ||
| 3 | - * | ||
| 4 | - * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 5 | - * you may not use this file except in compliance with the License. | ||
| 6 | - * You may obtain a copy of the License at | ||
| 7 | - * | ||
| 8 | - * http://www.apache.org/licenses/LICENSE-2.0 | ||
| 9 | - * | ||
| 10 | - * Unless required by applicable law or agreed to in writing, software | ||
| 11 | - * distributed under the License is distributed on an "AS IS" BASIS, | ||
| 12 | - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 13 | - * See the License for the specific language governing permissions and | ||
| 14 | - * limitations under the License. | ||
| 15 | - */ | ||
| 16 | - | ||
| 17 | -/* | ||
| 18 | - ONOS GUI -- Web Socket Trace -- CSS file | ||
| 19 | - | ||
| 20 | - @author Simon Hunt | ||
| 21 | - */ | ||
| 22 | - | ||
| 23 | -#webSockTrace .toolbar { | ||
| 24 | - height: 36px; | ||
| 25 | - padding: 4px; | ||
| 26 | - vertical-align: baseline; | ||
| 27 | - font-size: 12pt; | ||
| 28 | - margin-top: 6px; | ||
| 29 | -} | ||
| 30 | - | ||
| 31 | -/* theme-related */ | ||
| 32 | -#webSockTrace .toolbar { | ||
| 33 | - background-color: #448; | ||
| 34 | - color: #fff; | ||
| 35 | -} | ||
| 36 | - | ||
| 37 | -#webSockTrace .output { | ||
| 38 | - overflow-y: scroll; | ||
| 39 | -} | ||
| 40 | - | ||
| 41 | -/* theme-related */ | ||
| 42 | -#webSockTrace .output { | ||
| 43 | - background-color: #eef; | ||
| 44 | - color: #226; | ||
| 45 | -} | ||
| 46 | - | ||
| 47 | -#webSockTrace .output p { | ||
| 48 | - margin: 2px 8px; | ||
| 49 | - font-size: 10pt; | ||
| 50 | - padding-left: 6px; | ||
| 51 | -} | ||
| 52 | - | ||
| 53 | -/* theme-related */ | ||
| 54 | -#webSockTrace .output p.tx { | ||
| 55 | - color: magenta; | ||
| 56 | -} | ||
| 57 | -#webSockTrace .output p.rx { | ||
| 58 | - color: blue; | ||
| 59 | -} | ||
| 60 | - | ||
| 61 | - | ||
| 62 | -#webSockTrace .output p.subtitle { | ||
| 63 | - margin: 6px 8px; | ||
| 64 | - padding-left: 2px; | ||
| 65 | - font-size: 12pt; | ||
| 66 | - font-weight: bold; | ||
| 67 | - font-style: italic; | ||
| 68 | -} | ||
| 69 | - | ||
| 70 | -/* theme-related */ | ||
| 71 | -#webSockTrace .output p.subtitle { | ||
| 72 | - color: #626; | ||
| 73 | -} |
| 1 | -/* | ||
| 2 | - * Copyright 2014 Open Networking Laboratory | ||
| 3 | - * | ||
| 4 | - * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 5 | - * you may not use this file except in compliance with the License. | ||
| 6 | - * You may obtain a copy of the License at | ||
| 7 | - * | ||
| 8 | - * http://www.apache.org/licenses/LICENSE-2.0 | ||
| 9 | - * | ||
| 10 | - * Unless required by applicable law or agreed to in writing, software | ||
| 11 | - * distributed under the License is distributed on an "AS IS" BASIS, | ||
| 12 | - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 13 | - * See the License for the specific language governing permissions and | ||
| 14 | - * limitations under the License. | ||
| 15 | - */ | ||
| 16 | - | ||
| 17 | -/* | ||
| 18 | - View that traces messages across the websocket. | ||
| 19 | - | ||
| 20 | - @author Simon Hunt | ||
| 21 | - */ | ||
| 22 | - | ||
| 23 | -(function (onos) { | ||
| 24 | - 'use strict'; | ||
| 25 | - | ||
| 26 | - var v, | ||
| 27 | - $d, | ||
| 28 | - tb, | ||
| 29 | - out, | ||
| 30 | - which = 'tx', | ||
| 31 | - keyDispatch = { | ||
| 32 | - space: function () { | ||
| 33 | - output(which, "Simon woz 'ere... " + which); | ||
| 34 | - which = (which === 'tx') ? 'rx' : 'tx'; | ||
| 35 | - } | ||
| 36 | - }; | ||
| 37 | - | ||
| 38 | - | ||
| 39 | - function addHeader() { | ||
| 40 | - tb = $d.append('div') | ||
| 41 | - .attr('class', 'toolbar'); | ||
| 42 | - tb.append('span').text('Web Socket Trace'); | ||
| 43 | - } | ||
| 44 | - | ||
| 45 | - function addOutput() { | ||
| 46 | - out = $d.append('div') | ||
| 47 | - .attr('class', 'output'); | ||
| 48 | - } | ||
| 49 | - | ||
| 50 | - function subtitle(msg) { | ||
| 51 | - out.append('p').attr('class', 'subtitle').text(msg); | ||
| 52 | - } | ||
| 53 | - | ||
| 54 | - function output(rxtx, msg) { | ||
| 55 | - out.append('p').attr('class', rxtx).text(msg); | ||
| 56 | - } | ||
| 57 | - | ||
| 58 | - // invoked only the first time the view is loaded | ||
| 59 | - function preload(view, ctx, flags) { | ||
| 60 | - // NOTE: view.$div is a D3 selection of the view's div | ||
| 61 | - v = view; | ||
| 62 | - $d = v.$div; | ||
| 63 | - addHeader(); | ||
| 64 | - addOutput(); | ||
| 65 | - | ||
| 66 | - | ||
| 67 | - // hack for now, to allow topo access to our API | ||
| 68 | - // TODO: add 'exportApi' and 'importApi' to views. | ||
| 69 | - onos.exported.webSockTrace = { | ||
| 70 | - subtitle: subtitle, | ||
| 71 | - output: output | ||
| 72 | - }; | ||
| 73 | - } | ||
| 74 | - | ||
| 75 | - // invoked just prior to loading the view | ||
| 76 | - function reset(view, ctx, flags) { | ||
| 77 | - | ||
| 78 | - } | ||
| 79 | - | ||
| 80 | - // invoked when the view is loaded | ||
| 81 | - function load(view, ctx, flags) { | ||
| 82 | - resize(view, ctx, flags); | ||
| 83 | - view.setKeys(keyDispatch); | ||
| 84 | - subtitle('Waiting for messages...'); | ||
| 85 | - } | ||
| 86 | - | ||
| 87 | - // invoked when the view is resized | ||
| 88 | - function resize(view, ctx, flags) { | ||
| 89 | - var h = view.height(); | ||
| 90 | - out.style('height', h + 'px'); | ||
| 91 | - | ||
| 92 | - } | ||
| 93 | - | ||
| 94 | - // == register the view here, with links to lifecycle callbacks | ||
| 95 | - | ||
| 96 | - onos.ui.addView('webSockTrace', { | ||
| 97 | - preload: preload, | ||
| 98 | - load: load, | ||
| 99 | - resize: resize | ||
| 100 | - }); | ||
| 101 | - | ||
| 102 | -}(ONOS)); |
web/gui/src/main/webapp/ws.html
deleted
100644 → 0
| 1 | -<html> | ||
| 2 | -<head> | ||
| 3 | - <title>Web Sockets Demo</title> | ||
| 4 | - | ||
| 5 | - <script src="libs/jquery-2.1.1.min.js"></script> | ||
| 6 | - | ||
| 7 | - <script type='text/javascript'> | ||
| 8 | - if (!window.WebSocket) | ||
| 9 | - alert("WebSocket not supported by this browser"); | ||
| 10 | - | ||
| 11 | - var server = { | ||
| 12 | - connect : function() { | ||
| 13 | - var location = document.location.toString().replace('http://', | ||
| 14 | - 'ws://').replace('https://', 'wss://').replace('ws.html','ws/topology'); | ||
| 15 | - this.ws = new WebSocket(location); | ||
| 16 | - | ||
| 17 | - this.ws.onopen = function() { | ||
| 18 | - server._send("Hi there!"); | ||
| 19 | - }; | ||
| 20 | - | ||
| 21 | - this.ws.onmessage = function(m) { | ||
| 22 | - if (m.data) { | ||
| 23 | - $('#log').append(m.data).append($('<br/>')); | ||
| 24 | - } | ||
| 25 | - }; | ||
| 26 | - | ||
| 27 | - this.ws.onclose = function(m) { | ||
| 28 | - this.ws = null; | ||
| 29 | - }; | ||
| 30 | - }, | ||
| 31 | - | ||
| 32 | - _send : function(message) { | ||
| 33 | - if (this.ws) { | ||
| 34 | - this.ws.send(message); | ||
| 35 | - } | ||
| 36 | - }, | ||
| 37 | - | ||
| 38 | - send : function(text) { | ||
| 39 | - if (text != null && text.length > 0) { | ||
| 40 | - server._send(text); | ||
| 41 | - } | ||
| 42 | - } | ||
| 43 | - }; | ||
| 44 | - </script> | ||
| 45 | -</head> | ||
| 46 | -<body> | ||
| 47 | -<pre id='log'></pre> | ||
| 48 | - | ||
| 49 | -<script type='text/javascript'> | ||
| 50 | - server.connect(); | ||
| 51 | -</script> | ||
| 52 | - | ||
| 53 | -</body> | ||
| 54 | -</html> |
-
Please register or login to post a comment