DISPATCH-989 Removing this testing tool
Project: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/repo Commit: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/commit/6502523b Tree: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/tree/6502523b Diff: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/diff/6502523b Branch: refs/heads/1.1.x Commit: 6502523b06193e66635bbb7e44801bcfd0aa4798 Parents: 55bda75 Author: Ernest Allen <eal...@redhat.com> Authored: Wed May 9 09:39:24 2018 -0400 Committer: Ganesh Murthy <gmur...@redhat.com> Committed: Wed May 9 10:06:52 2018 -0400 ---------------------------------------------------------------------- console/test/css/brokers.ttf | Bin 2272 -> 0 bytes console/test/css/dispatch.css | 706 ---------- console/test/css/mock.css | 32 - console/test/css/plugin.css | 1019 -------------- console/test/fake.py | 317 ----- console/test/html/qdrConnect.html | 105 -- console/test/html/qdrTopology.html | 143 -- console/test/index.html | 114 -- console/test/js/dispatchPlugin.js | 259 ---- console/test/js/navbar.js | 77 -- console/test/js/qdrService.js | 269 ---- console/test/js/qdrSettings.js | 179 --- console/test/js/qdrTopology.js | 2140 ------------------------------ console/test/mock/__init__.py | 22 - console/test/mock/entities.py | 358 ----- console/test/mock/nexthop.py | 145 -- console/test/package.json | 14 - console/test/topologies/schema.json | 1814 ------------------------- 18 files changed, 7713 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/6502523b/console/test/css/brokers.ttf ---------------------------------------------------------------------- diff --git a/console/test/css/brokers.ttf b/console/test/css/brokers.ttf deleted file mode 100644 index ae83968..0000000 Binary files a/console/test/css/brokers.ttf and /dev/null differ http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/6502523b/console/test/css/dispatch.css ---------------------------------------------------------------------- diff --git a/console/test/css/dispatch.css b/console/test/css/dispatch.css deleted file mode 100644 index 0096f95..0000000 --- a/console/test/css/dispatch.css +++ /dev/null @@ -1,706 +0,0 @@ -/* -Licensed to the Apache Software Foundation (ASF) under one -or more contributor license agreements. See the NOTICE file -distributed with this work for additional information -regarding copyright ownership. The ASF licenses this file -to you 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. -*/ - -svg { - background-color: transparent; - cursor: default; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - -o-user-select: none; - user-select: none; -} - -svg:not(.active):not(.ctrl) { - cursor: crosshair; -} -#end-arrow-selected, #start-arrow-selected { - stroke: #33F; - fill: #33F; -} -path.link.selected { - /* stroke-dasharray: 10,2; */ - stroke: #33F !important; -} - -path.link { - fill: #000; - stroke: #000; - stroke-width: 4px; - cursor: default; -} - -svg:not(.active):not(.ctrl) path.link { - cursor: pointer; -} - -path.link.small { - stroke-width: 2.5; - stroke: darkgray; -} -path.link.highlighted { - stroke: #6F6 !important; -} -marker#start-arrow-highlighted, -marker#end-arrow-highlighted { - fill: #6F6; -} -marker#start-arrow-small, -marker#end-arrow-small { - fill: darkgray; -} - -path.link.dragline { - pointer-events: none; -} - -path.link.hidden { - stroke-width: 0; -} - -circle.node { - stroke-width: 1.5px; - cursor: pointer; - stroke: darkgray; -} - -circle.node.reflexive { - stroke: #F00 !important; - stroke-width: 2.5px; -} -circle.node.selected { - stroke: #6F6 !important; - stroke-width: 2px; - fill: #e0e0ff !important; -} -circle.node.highlighted { - stroke: #6F6; -} -circle.node.inter-router { - fill: #EAEAEA; -} -circle.node.normal.in { - fill: #F0F000; -} -circle.node.normal.out { - fill: #C0F0C0; -} -circle.node.on-demand { - fill: #C0FFC0; -} -circle.node.on-demand.artemis { - fill: #FCC; - /*opacity: 0.2; */ -} - -circle.node.fixed { - stroke-dasharray: 10,2; -} -text { - font: 12px sans-serif; - pointer-events: none; - /*font-family: monospace;*/ - -} - -.tooltipsy -{ - padding: 10px; -/* max-width: 320px;*/ - color: #303030; - background-color: #fcfcfe; - border: 1px solid #deca7e; - border-radius: 5px; -} - -.tiptable { - -} -.tiptable tr { - border-bottom: 1px solid #ccc; -} - -.tiptable tr:last-child { - border-bottom: 0px; -} - -.tiptable tr:nth-child(even) { - background: #fcfcfe; -} -.tiptable tr:nth-child(odd) { - background: #FFF -} - -text.id { - text-anchor: middle; - font-weight: bold; -} - -text.label { - text-anchor: start; - font-weight: bold; -} - -.row-fluid.tertiary { - position: relative; - left: 20px; -} - -.row-fluid.tertiary.left { - float: left; -} - -.row-fluid.tertiary.panel { - width: 410px; - /*height: 100%; */ -} - -div#topologyForm .ngViewport, div#topologyForm .gridStyle { - height: auto !important; - min-height: initial !important; - overflow: initial; -} - -div#multiple_details, div#link_details { - height: 300px; - width: 700px; - display: none; - padding: 0.5em; - border: 1px solid; - position: absolute; - background-color: white; - max-height: 330px !important; - overflow: hidden; -} -div#multiple_details div.ngRow.selected { - background-color: #c9dde1 !important; -} - -div.grid-values { - text-align: right; -} - -div.grid-values.ngCellText span { - padding-right: 4px; -} - -.panel-adjacent { - margin-left: 430px; -} - -/* globe */ -.land { - fill: #999; - stroke-opacity: 1; -} - -.graticule { - fill: none; - stroke: black; - stroke-width:.5; - opacity:.1; -} - -.labels { - font: 18px sans-serif; - fill: black; - opacity: .85; - text-anchor: middle; -} - -.noclicks { pointer-events:none; } - -.point { opacity:.6; } - -.arcs { - opacity:.7; - stroke: darkgreen; - stroke-width: 3; -} -.flyers { - stroke-width:1; - opacity: 0; - stroke: darkred; -} -.arc, .flyer { - stroke-linejoin: round; - fill:none; -} -.arc { } -.arc:hover { - stroke: darkred; -} -.flyer { } -.flyer:hover { - stroke: darkgreen; -} -.arc.inter-router { - stroke: darkblue; -} - -#addNodeForm { - padding: 1em; -} - - -li.currentStep { - font-weight: bold; -} - -.qdrTopology div.panel { - position: absolute; -} -/* -.ui-dialog-titlebar { - border: 0; - background: transparent; -} -*/ - -/* -.ui-tabs.ui-tabs-vertical { - padding: 0; - width: 48em; -} -.ui-tabs.ui-tabs-vertical .ui-widget-header { - border: none; -} -.ui-tabs.ui-tabs-vertical .ui-tabs-nav { - float: left; - width: 10em; - background: #CCC; - border-radius: 4px 0 0 4px; - border-right: 1px solid gray; -} -.ui-tabs.ui-tabs-vertical .ui-tabs-nav li { - clear: left; - width: 100%; - margin: 0.1em 0; - border: 1px solid gray; - border-width: 1px 0 1px 1px; - border-radius: 4px 0 0 4px; - overflow: hidden; - position: relative; - right: -2px; - z-index: 2; -} -.ui-tabs.ui-tabs-vertical .ui-tabs-nav li a { - display: block; - width: 100%; - padding: 0.1em 1em; -} -.ui-tabs.ui-tabs-vertical .ui-tabs-nav li a:hover { - cursor: pointer; -} -.ui-tabs.ui-tabs-vertical .ui-tabs-nav li.ui-tabs-active { - margin-bottom: 0.2em; - padding-bottom: 0; - border-right: 1px solid white; -} -.ui-tabs.ui-tabs-vertical .ui-tabs-nav li:last-child { - margin-bottom: 10px; -} -.ui-tabs.ui-tabs-vertical .ui-tabs-panel { - float: left; - width: 34em; - border-left: 1px solid gray; - border-radius: 0; - position: relative; - left: -1px; -} - -.ui-tabs .ui-tabs-nav li.ui-tabs-selected { - right: -3px !important; -} - -.ui-tabs li i.ui-icon { - display: inline-block; -} -*/ -.ui-tabs .ui-tabs-panel { - /* padding-top: 0 !important; */ -} - -.ui-widget-content fieldset { - float: left; - padding: 0 1em 0 0; -} - -.entity-description { - color: #960; - font-size: 90%; -} - -.attr-description { - padding-top: 1.5em; - float: right; - width: 17em; -} -.attr-annotations { - padding-top: 2.5em; - clear: both; -} -.attr-annotations > span { - padding-top: 0.5em; - border-top: 1px dashed darkgray; - display: block; -} - -.attr-type { - color: #990; - font-size: 85%; -} -.attr-required { - color: red; - font-size: 85%; -} -.attr-unique { - color: green; - font-size: 85%; -} - -#tabs.nodeEntities { - border: 0; -} - -#tabs ul.nodeTabs { - background: #fff; -} - -#tabs #Container { - border-left: 1px solid #aaa; -} - -#tabs.ui-tabs .ui-tabs-nav li { - border-bottom: 1px solid #aaa !important; -} - -.entity-fields { - /* height: 400px; */ - overflow-y: scroll; - overflow-x: hidden; -} - -div.boolean label:first-child { - float: left; - margin-right: 1em; -} -div.boolean { - padding-bottom: 1em; -} - -.entity-fields label { - font-weight: 600; - margin-top: 0.5em; - display: inline; -} - -.aggregate { - text-align: right; -} - -.aggregate i { - float: right; - /* margin: 3px 3px 3px 8px; */ -} - -.aggregate .hastip { - padding: 5px; -} - -.subTip .tipsy-inner { - background-color: white; - color: black; - font-size: 1.3em; - border: 1px solid black; -} - -.subTip .tipsy-arrow-n { border-bottom-color: black; } -.subTip .tipsy-arrow-s { border-top-color: black; } -.subTip .tipsy-arrow-e { border-left-color: black; } -.subTip .tipsy-arrow-w { border-right-color: black; } - - -.contextMenu { - display:none; - position:absolute; - left:30px; - top:-30px; - z-index:999; - /* width:300px; */ -} -.contextMenu ul { - width:300px; - margin:0; - padding-left:0; - list-style:none; - background:#fff; - color:#333; - font-weight: 600; - /* -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px; */ - -moz-box-shadow:5px 5px 5px #ddd; -webkit-box-shadow:5px 5px 5px #999; box-shadow:5px 5px 5px #ddd; - border: 1px solid #aaa; -} -.contextMenu ul li { - padding:5px 10px; - /* border-bottom: solid 1px #ccc; */ -} -.contextMenu ul li:hover { - background:#4a90d9; color:#fff; -} -.contextMenu ul li:last-child { - border:none; -} - -.na { - display: none; -} -.contextMenu ul li.new { - display: block; -} -.contextMenu ul li.adding, .contextMenu ul li.adding + li { - display: block; -} -.contextMenu ul li.force-display { - display: block; -} -.contextMenu ul li.context-separator { - background-color: lightgray; - height: 1px; - padding: 0; -} - -.ui-tabs.ui-tabs-vertical .ui-tabs-nav li.separated { - margin-top: 1em; -} - -#crosssection { - display: none; - position: absolute; - top: 200px; - left: 600px; -} - -.cross-rect { - /* fill: #cfe2f3; */ -} -.cross-line { - stroke: black; - stroke-width: 4px; -} - -.node circle { -/* fill: rgb(31, 119, 180); - fill-opacity: .25; */ - fill: #cfe2f3; - fill-opacity: .98; - stroke: black; - stroke-width: 3px; -} - -circle.subcircle { - stroke-width: 1px; - /* stroke-dasharray: 2; */ - fill-opacity: 0; - stroke: darkgray; -} - -.leaf circle { - fill: #6fa8dc; - fill-opacity: 0.95; - stroke-width: 3px; -} - -.leaf circle[title] { - font-family: monospace; - -} - -#svg_legend { - position: absolute; - top: 110px; - right: 0; - border: 1px solid #ccc; - border-radius: 5px; - background-color: #fcfcfc; - margin-right: 1.3em; - padding: 1em; -} - -#svg_legend svg { - height: 235px; - width: 180px; -} - -#multiple_details div.gridStyle { -/* height: 50em; */ - min-height: 70px !important; - height: auto !important; -} - -#multiple_details .ngViewport { - height: auto !important; -} - -#multiple_details .gridCellButton button, #link_details .gridCellButton button { - margin: .25em .4em; - font-size: 12px; - height: 2em; - padding-top: .1em; -} - -#linkFilter { - display: none; - padding: 0.5em; - border: 1px solid grey; - background-color: #F0F0F0; - position: absolute; - z-index: 100; - right: 1em; -} -div.formLine label, div.formLine input { - display: inline-block; - padding: 0 8px; -} - -span.filter-icon { - padding-left: 1em; -} - -button.filter-close { - width: 15px; - height: 20px; - padding: 0; - position: absolute; - right: 4px; - top: 4px; -} - -div.filter-title h6 { - margin: 0 0 0.5em 0; -} - -.links button.btn-filter { - padding: 0 1em 0 0; - margin-left: 1em; - font-size: 1em; -} - -button.btn-filter { - float: right; -} -span.fancytree-expanded button.btn-filter, -a.fancytree-title:hover button.btn-filter { - visibility: visible; -} - -div.hdash-button a { - color: white; -} - -.linkDirIn { - color: red; - background-color: #f3f3f3; -} - -.linkDirOut { - color: blue; - background-color: white; -} - -div.topoGrid .ui-grid-viewport { - overflow: hidden !important; -} - -@-moz-document url-prefix() { - .btn {padding: 2px 12px 8px !important;} - #overview-controller .btn {padding: 4px 12px !important;} - #overview-controller .btn.filter-close {padding: 0 !important;} -} - -.ui-fancytree.fancytree-container { - font-size: 14px; -} - -.grid-title { - background-color: #FAFAFA; - background-image: -moz-linear-gradient(top, #ffffff, #f2f2f2); - background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#f2f2f2)); - background-image: -webkit-linear-gradient(top, #ffffff, #f2f2f2); - background-image: -o-linear-gradient(top, #ffffff, #f2f2f2); - background-image: linear-gradient(to bottom, #ffffff, #f2f2f2); - background-repeat: repeat-x; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFF', endColorstr='#F2F2F2', GradientType=0); - border-bottom: 1px solid #d4d4d4; - text-shadow: 0 1px 0 #FFFFFF; - border-top-left-radius: 5px; - border-top-right-radius: 5px; - margin: 0 0 10px 0; - padding-bottom: 4px; -} - -.expand-collapse { - float: right; - margin-right: 0.5em; -} - -.pane-viewport { - top: 26px !important; -} -.fancytree-node.loading { - position: initial; -} - -.newChart { - float: right; -} - -select.unique, input.unique { - border: 2px solid blue; -} -select.required, input.required { - border: 2px solid black; -} - -.required-indicator { - padding-left: 0.5em; - font-size: 0.85em; - vertical-align: super; -} - -.required-indicator::before { - content: '(required)' -} - -.unique-indicator { - padding-left: 0.5em; - font-size: 0.85em; - vertical-align: super; -} - -.unique-indicator::before { - content: '(must be unique if supplied)' -} - -.unique-indicator - -.error { - color: red; - font-weight: bold; -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/6502523b/console/test/css/mock.css ---------------------------------------------------------------------- diff --git a/console/test/css/mock.css b/console/test/css/mock.css deleted file mode 100644 index 374359d..0000000 --- a/console/test/css/mock.css +++ /dev/null @@ -1,32 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you 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 -*/ - -#buttonBar { - margin-left: 2em; -} - -#buttonBar select { - position: relative; - top: 6px; -} - -path.more { - stroke-width: 1; - stroke: black; -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/6502523b/console/test/css/plugin.css ---------------------------------------------------------------------- diff --git a/console/test/css/plugin.css b/console/test/css/plugin.css deleted file mode 100644 index f7259dd..0000000 --- a/console/test/css/plugin.css +++ /dev/null @@ -1,1019 +0,0 @@ -/* -Licensed to the Apache Software Foundation (ASF) under one -or more contributor license agreements. See the NOTICE file -distributed with this work for additional information -regarding copyright ownership. The ASF licenses this file -to you 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. -*/ -main-display > .span8 { - height: 100%; - position: relative; -} - -ul.qdrListNodes > li > span { - padding: 6px 20px; 6px; 6px; - display: block; -} - -.qdrList .grid { - width: 20em; - margin-right: 0; - float: left; -} - - -.qdrList div.gridDetails { - width: auto; -} - -.selectedItems { - /* margin-left: 21em; */ -} - -.qdrListPane { - top: 110px; -} - -.qdrListActions { - width: auto; - margin-left: 1em; -} - -div.listAttrName { - padding-top: 5px; -} - -div.listAttrName button { - float: right; - margin: 3px 5px; -} - -div.listAggrValue button { - margin: 3px 5px; -} - -@-moz-document url-prefix() { - div.listAttrName button { - top: -24px; - position: relative; - margin: 3px 0px; - padding: 0 5px !important; - } -} - -div.listAttrName i.icon-bar-chart.active, div.hastip i.icon-bar-chart.active, li.haschart i { - /*background-color: #AAFFAA; */ -} - -div#main div ul.nav li a:not(.btn) { - background: initial !important; -} - -div#main div ul.nav li.active a { - background-color: #f0f0ff !important; -} - -div#main.qdr { - margin-top: 56px !important; -} - -div.charts-header { - font-size: 1.2em; - color: #666666; - margin: 1em 0; -} - -.selectedNode, .selectedAction, .selectedEntity { - font-weight: 600; - color: #606066; -} - -.okButton { - text-align: center; - margin: 1em; -} - -span.showChartsLink { - border: 1px solid blue; - padding: 1px 2px; -} - -div.listGraphs p { - margin: 1em 0 2em 2em; - text-align: center; -} - -div.centered { - text-align: center; - margin: 4em; -} - -.modal-body.centered { - margin: 0; -} - -/* dialog */ -div.aChart { - height: 200px; - width: 400px; - margin: 1em; -} - -/* dashboard */ -div.aChart.hDash { - /* width: 21em; */ - /* height: 17em; */ - width: 100%; - height: 87%; - margin: 0; - padding: 0; - -} -div.chartContainer { - float: left; - width: 100%; - height: 100%; - overflow: hidden; -} - -/* the x and y axis lines */ -.d3Chart g.axis path.domain { - stroke-width: 1; - stroke: black; -} - -/* the line surrounding the area chart */ -div.d3Chart path { -/* stroke: black; */ -/* stroke-width: 0; */ -/* opacity: 0.5; */ -} - -/* the line above the area chart */ -/* the color gets overridden */ -div.d3Chart path.line { - stroke: steelblue; - stroke-width: 1.5; - fill: none; - opacity: 1; -} - -.mo-rect { - fill: #ffffdd; - stroke: #f0f0f0; - stroke-width: 1; -} - -.mo-guide { - fill: none; - stroke: #d0d0d0; - stroke-width: 2; - stroke-dasharray: 3,3; -} - -div.d3Chart .title { - text-decoration: underline; -} - - -.axis line, .axis path { - fill: none; - shape-rendering: crispEdges; - stroke-width: 1; - stroke: #000000; -} - -.axis line { - stroke: #C0C0C0; - stroke-dasharray: 1,1; - opacity: 0.5; -} - -.y.axis text, .x.axis text, .focus text, div.d3Chart .title { - font-size: 12px; -} - -.y.axis path { - stroke: #000; - } - -.overlay { - fill: none; - pointer-events: all; - } - -.focus circle { - fill: none; - stroke: steelblue; - } -.focus .fo-table { - /* box-shadow: 2px 2px 3px #EEE; */ -} - -div.d3Chart { - /* padding: 1em 0; */ - /* border: 1px solid #C0C0C0; */ - margin-bottom: 2em; -} -div.d3Chart.hDash { - border: 0px; -} - -div.d3Chart .axis path { - display: inherit; -} - -.c3-circle { - /* display: none; */ -} - -.fo-table { - border: 1px solid darkgray; - background-color: white; - font-size: .85em; -} - -.fo-table td { - padding: 4px; - border-left: 1px solid darkgray; -} -.fo-table tr.detail td { - padding: 1px 4px; -} -.fo-title { - color: white; - background-color: darkgray; -} - -.fo-table-legend { - width: 8px; - height: 8px; - border: 1px solid black; - margin: 0 4px; - display: inline-block; -} - -svg .legend { - dominant-baseline: central; -} - -div.chartContainer div.aChart { - margin-top: 0.5em; -} - -div#main.qdr div ul.nav li.active a { - background-color: #e0e0ff !important; - color: #000000; -} - -div#main.qdr .selected, .box.selected { - color: #000000; - text-shadow: none; -} - -/* the selected node on the list page */ -div.qdrList li.active, ul.qdrListNodes li.active { - background-color: #e0e0ff; -} - -div.qdr-attributes span.fancytree-selected a { - background-color: #e0e0ff; -} -div.qdr-attributes.pane, div.qdr-topology.pane { - position: absolute; - margin-left: 10px; -} -div.qdr-overview.pane { - position: absolute; -} -div.qdr-topology.pane.left { - width: auto; - /*border-right: 1px solid lightgray; */ -} - -/* the selected row in the name table */ -div#main.qdr div.qdrList div.selected { - background-color: #e0e0ff !important; -} - -#dialogChart, #dialogEditChart { - height: 220px; -} - -.chartOptions .modal-body { - overflow-y: initial; -} - -div.qdrCharts p.chartLabels button { - float: right; -} - -div.qdrCharts p.chartLabels { - padding-right: 1em;; - } - -p.dialogHeader { - text-align: center; -} - -p.dialogHeader input { - margin-top: 10px; - width: 480px; -} - -.ui-slider-tick { - position: absolute; - background-color: #666; - width: 2px; - height: 8px; - top: 12px; - z-index: -1; -} - -label.rateGroup { - float: left; -} - -div.chartOptions div.dlg-slider { - float: left; - width: 28em; - font-size: 14px; -} - -div.chartOptions div.duration { - width: 35em !important; -} - -div.chartOptions .slider { - margin-top: 1em; - margin-bottom: 1em; -} - -input[type="radio"] { - margin-top: 0 !important; -} - -div.chartOptions legend { - font-size: 1.2em; - font-weight: bold; - margin-bottom: 10px; -} - -div.chartOptions tab > div { - margin-left: 1em; -} - -div.chartOptions span.minicolors-swatch { - width: 14px; - height: 14px; -} - -.minicolors-input { - width: 4em; - padding: 0 0 0 24px !important; -} - -div.colorPicker div.colorText { - display: inline-block; - width: 10em; -} -div.colorPicker div:nth-of-type(1), /* first span under div.colorPicker */ - div.minicolors{ - float:left; - margin-right: 0.5em; -} - -div.chartOptions p.sep { - height: 1em; -} - -ul.nav-tabs { - border-bottom: 1px solid #ddd !important; -} - -.chartOptions ul.nav-tabs { - margin-bottom: 0px !important; -} - -div.tabbable div.tab-content { - overflow: visible; -} - -div.tabbable ul.nav-tabs > .active > a { - background-color: #f8f8f8; - border: 1px solid #ddd; - border-bottom-color: transparent; -} - - -div.tabbable .tab-pane { - background-color: #f8f8f8; - padding: 12px; - border-right: 1px solid #ddd; - border-left: 1px solid #ddd; - border-bottom: 1px solid #ddd; -} -div.dlg-large div.tabbable .tab-pane { - margin-left: 11em; -} - -div.tabbable ul.nav-tabs { - margin-bottom: 0; -} - -ul.qdrTopoModes { - position: relative; - top: -10px; -} -.overview.section { - /* width: 35em; */ -} -.overview.section .ngGrid { - height: 12em !important; - min-height: 12em !important; -} - -.overview.routers.section .ngGrid { - height: 16em !important; - min-height: 16em !important; -} -.overview.routers.section { - /*width: 15em; */ - } - -.grid-align-value { - text-align: right; -} - -.grid-align-value .ngCellText { - padding-right: 10px; -} - -.overview .ngRow:hover { - background:#e0e0ff; -} - -.overview-cell .ngCell:hover { - background:#e0e0ff; -} -.overview-cell .ngCell.col0:hover, .overview-cell .ngCell.col1:hover { - background: initial; -} - - -.qdr-overview.pane.left, .qdr-attributes.pane.left { - top: 104px; -} -.qdr-topology.pane.left { - top: 104px; -} -.qdr-overview.pane.left, .qdr-attributes.pane.left, .qdr-topology.pane.left { - left: 10px; -} - -.overview-tree, .qdr-attributes { - min-height: calc(100vh - 90px) -} -/* -.treeContainer { - width: 100%; - float: left; -} -*/ -.pane-content { - overflow: auto; -} - -#entityNames { - width: 20em; - float: left; -} - -.treeDetails { - margin-left: 260px; -} - -.grid:not(.noHighlight) .ui-grid-row:hover .ui-grid-cell-contents { - /*background-color: #e0e0ff; */ - background-color: #e9f2f9 -} -.ngCellText { - padding: 4px 0 0 4px; -} - -.ui-grid-row.ui-grid-row-selected > [ui-grid-row] > .ui-grid-cell { - background-color: #e0e0ff; -} - -.tab-content .tab-pane { - background-color: #f8f8f8; - padding: 12px; - border-right: 1px solid #ddd; - border-left: 1px solid #ddd; - border-bottom: 1px solid #ddd; -} - -div.chartOptions ul.nav-tabs > .active > a { - background-color: #f8f8f8; - border: 1px solid #ddd; - border-bottom-color: transparent; -} - -div.chartOptions label:nth-of-type(2) { - margin-left: 1em; -} -div.chartOptions label { - font-weight: normal; - display: inline-block; -} - -/* -.form-horizontal .control-label { - float: left; - width: 160px; - padding-top: 5px; - text-align: right; -} - -.form-horizontal .controls { - margin-left: 180px; -} - -.form-horizontal input, { - display: inline-block; - margin-bottom: 0; - vertical-align: middle; -} - -input[type="text"], input[type="number"], input[type="password"] { - background-color: #ffffff; - border: 1px solid #cccccc; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); - -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); - -webkit-transition: border linear 0.2s, box-shadow linear 0.2s; - -moz-transition: border linear 0.2s, box-shadow linear 0.2s; - -o-transition: border linear 0.2s, box-shadow linear 0.2s; - transition: border linear 0.2s, box-shadow linear 0.2s; -} - -input[type="text"], input[type="number"], input[type="password"] { - display: inline-block; - width: 200px; - padding: 4px 6px; - margin-bottom: 10px; - font-size: 14px; - line-height: 20px; - color: #555555; - vertical-align: middle; - -webkit-border-radius: 4px; - -moz-border-radius: 4px; - border-radius: 4px; -} - -.login input[type="checkbox"] { - margin-top: 0.75em; -} -*/ - -#dispatch-login-container { - /* width: 18.5em; */ - margin-top: 2em; -} -/* -div.login.container { - width: 550px; -} -*/ - - -#overtree .fancytree-container { - border: 0px; -} - -#overtree span.fancytree-alert-icon.ui-icon-refresh { - background-position: -64px -80px; -} -#overtree span.fancytree-alert-icon.ui-icon-transfer-e-w { - background-position: -112px -80px; -} - -#alerts { - position: fixed; - right: 0; - top: 0; - z-index: 100; -} - -.alert-enter, -.alert-leave, -.alert-move { - -webkit-transition: 1s linear all; - -moz-transition: 1s linear all; - -o-transition: 1s linear all; - transition: 1s linear all; - position:relative; -} - -.alert-enter { - left:-10px; - opacity:0; -} -.alert-enter.alert-enter-active { - left:0; - opacity:1; -} - -.alert-leave { - left:0; - opacity:1; -} -.alert-leave.alert-leave-active { - left:-10px; - opacity:0; -} - -.alert-move { - opacity:0.5; -} -.alert-move.alert-move-active { - opacity:1; -} - -.overview .table-striped tr:hover td { - background-color: #e0e0ff !important; -} - -#entityNames div.ngViewport { - overflow-x: hidden; -} - -.connect-column.connect-form { - width: 20em; -} - -.chartLabels button a { - text-decoration: none; -} - -.fancytree-ico-c.router .fancytree-icon { - -} - -.tabs-left .nav-tabs { - float: left; -} -.tabs-left .nav-tabs > li { -/* float: initial; */ -} - -div.modal.dlg-large { - width: 53em; -} - -button.hdash-button a { - text-decoration: none; - color: #fff; -} - -div.widget-body > div { - height: 100%; -} - -div.qdrCharts { - height: 100%; -} - -ul.dispatch-view { - margin-bottom: 0 !important; -} - -.qdr-overview.pane.left span:not(.fancytree-has-children) .fancytree-icon:before, -.qdr-attributes.pane.left span:not(.fancytree-has-children) .fancytree-icon:before { - color: green; -} - -span:not(.fancytree-has-children).address .fancytree-icon:before, -span:not(.fancytree-has-children).router\.address .fancytree-icon:before { - font-family: FontAwesome; - content: "\f0ac"; -} -span:not(.fancytree-has-children).address.mobile .fancytree-icon:before, -span:not(.fancytree-has-children).router\.address.mobile .fancytree-icon:before { - font-family: FontAwesome; - content: "\f109"; -} -span:not(.fancytree-has-children).address.internal.mobile .fancytree-icon:before, -span:not(.fancytree-has-children).router\.address.internal.mobile .fancytree-icon:before { - font-family: FontAwesome; - content: "\f0ac"; -} -span:not(.fancytree-has-children).address.router .fancytree-icon:before, -span:not(.fancytree-has-children).router\.address.router .fancytree-icon:before { - font-family: FontAwesome; - content: "\f047"; -} - -span.address-link .fancytree-icon:before { - font-family: FontAwesome; - content: "\f0ac"; -} - -span:not(.fancytree-has-children).connection.external .fancytree-icon:before { - font-family: FontAwesome; - content: "\f109"; -} -span:not(.fancytree-has-children).connection.normal .fancytree-icon:before { - font-family: FontAwesome; - content: "\f08e"; -} -span:not(.fancytree-has-children).connection.external.quiesced .fancytree-icon:before { - font-family: FontAwesome; - content: "\f14c"; - color: red; -} -span:not(.fancytree-has-children).connection.inter-router .fancytree-icon:before { - font-family: FontAwesome; - content: "\f07e"; -} -span:not(.fancytree-has-children).connection.router-control .fancytree-icon:before { - font-family: FontAwesome; - content: "\f013"; -} -span:not(.fancytree-has-children).no-data .fancytree-icon:before { - font-family: FontAwesome; - content: "\f05e"; - color: red !important; -} -span:not(.fancytree-has-children).loading .fancytree-icon:before { - font-family: FontAwesome; - content: "\f254"; -} -span:not(.fancytree-has-children).connector .fancytree-icon:before { - font-family: FontAwesome; - content: "\f126"; -} -span:not(.fancytree-has-children).container .fancytree-icon:before { - font-family: FontAwesome; - content: "\f16c"; -} -span:not(.fancytree-has-children).log .fancytree-icon:before { - font-family: FontAwesome; - content: "\f0f6"; -} -span:not(.fancytree-has-children).router\.node .fancytree-icon:before { - font-family: FontAwesome; - content: "\f013"; -} -span:not(.fancytree-has-children).link.inter-router .fancytree-icon:before, -span:not(.fancytree-has-children).router\.link.inter-router .fancytree-icon:before{ - font-family: FontAwesome; - content: "\f07e"; -} -span:not(.fancytree-has-children).link.router-control .fancytree-icon:before, -span:not(.fancytree-has-children).router\.link.router-control .fancytree-icon:before{ - font-family: FontAwesome; - content: "\f013"; -} -span:not(.fancytree-has-children).link.endpoint .fancytree-icon:before, -span:not(.fancytree-has-children).router\.link.endpoint .fancytree-icon:before{ - font-family: FontAwesome; - content: "\f109"; -} -span:not(.fancytree-has-children).link.console .fancytree-icon:before, -span:not(.fancytree-has-children).router\.link.console .fancytree-icon:before { - font-family: FontAwesome; - content: "\f108"; -} -span:not(.fancytree-has-children).listener .fancytree-icon:before { - font-family: FontAwesome; - content: "\f025"; -} -span:not(.fancytree-has-children).connection .fancytree-icon:before { - font-family: FontAwesome; - content: "\f07e"; -} -span:not(.fancytree-has-children).connection.console .fancytree-icon:before { - font-family: FontAwesome; - content: "\f108"; -} -span:not(.fancytree-has-children).waypoint .fancytree-icon:before { - font-family: FontAwesome; - content: "\f0ec"; -} -span:not(.fancytree-has-children).router .fancytree-icon:before { - font-family: FontAwesome; - content: "\f047"; -} -span:not(.fancytree-has-children).fixedAddress .fancytree-icon:before { - font-family: FontAwesome; - content: "\f015"; -} -span:not(.fancytree-has-children).linkRoutePattern .fancytree-icon:before { - font-family: FontAwesome; - content: "\f039"; -} -span:not(.fancytree-has-children).allocator .fancytree-icon:before { - font-family: FontAwesome; - content: "\f170"; -} -span:not(.fancytree-has-children).policy .fancytree-icon:before { - font-family: FontAwesome; - content: "\f256"; -} -span:not(.fancytree-has-children).logStats .fancytree-icon:before { - font-family: FontAwesome; - content: "\f080"; -} -span:not(.fancytree-has-children).autoLink .fancytree-icon:before { - font-family: FontAwesome; - content: "\f0c1"; -} -span:not(.fancytree-has-children).authServicePlugin .fancytree-icon:before { - font-family: FontAwesome; - content: "\f0c1"; -} -span:not(.fancytree-has-children).sslProfile .fancytree-icon:before { - font-family: FontAwesome; - content: "\f023"; -} -span:not(.fancytree-has-children).vhost .fancytree-icon:before { - font-family: FontAwesome; - content: "\f108"; -} -span:not(.fancytree-has-children).vhostStats .fancytree-icon:before { - font-family: FontAwesome; - content: "\f080"; -} - - -.ngCellText { -/* color: #333333; */ -} - -.changed { - color: #339933; -} - -div.dispatch-router div.help { - width: auto; - padding: 1em; - background-color: lavender; - border-radius: 6px; - margin-top: 1em; - text-align: center; -} - -div.operations tr:nth-child(even) { - background: #f3f3f3; -} -div.operations tr:nth-child(odd), div.operations tr:last-child { - background: #fff; -} - -div.operations tr input { - margin: 0; - padding: 3px 6px; -} -div.operations table { - width: 100%; -} -div.operations th { - width: 50%; - border-bottom: 1px solid #cccccc; - text-align: left; -} -div.operations td:nth-child(odd), div.operations th:nth-child(odd) { - border-right: 1px solid #cccccc; -} -div.operations td:nth-child(odd) { - padding-left: 0; -} -div.operations td:nth-child(even), div.operations th:nth-child(even) { - padding-left: 5px; -} -div.operations th { - padding: 5px; -} -div.operations .tab-pane.active { - padding: 12px 12px 12px 0; -} -div.operations label { - padding-top: 4px; - margin-bottom: 4px; -} -.qdrListActions .ngGrid { - /*min-height: 40em; - height: 100%; */ -} -div.qdrListActions .ngViewport { - height: initial !important; -} - -div.operations .boolean { - padding-bottom: 0; -} - -table.log-entry { - margin-bottom: 1em; - border-top: 1px solid black; -} - -table.log-entry pre { - background-color: #f5f5f5; - color: inherit; - margin: 0; - white-space: pre-wrap; -} - -circle.node.normal.console { - fill: lightcyan; -} -circle.node.artemis { - fill: lightgreen; -} -circle.node.route-container { - fill: orange; -} - -text.console, text.on-demand, text.normal { - font-family: FontAwesome; - font-weight: normal; - font-size: 16px; -} - -@font-face { - font-family:"Brokers"; - src: url("brokers.ttf") /* TTF file for CSS3 browsers */ -} - -text.artemis { - font-family: Brokers; - font-size: 20px; - font-weight: bold; -} - -text.qpid-cpp { - font-family: Brokers; - font-size: 18px; - font-weight: bold; -} - -i.red { - color: red; -} - -.qdrListActions div.delete { - width: 20em; - margin: auto; - border: 1px solid #eaeaea; - height: 5em; - padding: 4em; - background-color: #fcfcfc; -} - -.btn:focus { - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6); -} - -select:focus, input[type="file"]:focus, input[type="radio"]:focus, input[type="checkbox"]:focus { - outline:3px solid rgba(82, 168, 236, 0.6); - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6); - outline: 5px auto -webkit-focus-ring-color; - outline-offset: -2px; -} - -btn.disabled, .btn[disabled] { - opacity: 0.35; -} - -#dispatch-login-container .ng-invalid-range { - border-color: #e9322d !important; -} - -div#durationSlider, div#rateSlider { - margin-top: 1em; -} - -.list-grid { - padding-left: 10px; -} - -.ngViewport.ng-scope { - height: auto !important; -} - -.listening-on { - background-color: #CCFFCC; -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/6502523b/console/test/fake.py ---------------------------------------------------------------------- diff --git a/console/test/fake.py b/console/test/fake.py deleted file mode 100755 index 532d549..0000000 --- a/console/test/fake.py +++ /dev/null @@ -1,317 +0,0 @@ -#!/usr/bin/env python -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you 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. -# - -import optparse -from proton import Endpoint, generate_uuid -from proton import Message -from proton.handlers import MessagingHandler -from proton.reactor import Container -import json -from pprint import pprint -import os -import string -import random -import shutil -from mock import Connection, RouterLink, Schema, Listener, RouterNode, Hopper, Router, Address, Policy, Connector, \ - RouterAddresses, Allocators, Logs -import pdb - -def id_generator(size=6, chars=string.ascii_uppercase + string.digits): - return ''.join(random.choice(chars) for _ in range(size)) - -class Manager(object): - def __init__(self, topology, verbose): - self.topology = topology - self.verbose = verbose - self.base = "topologies/" - - def operation(self, op, request): - m = op.replace("-", "_") - try: - method = getattr(self, m) - except AttributeError: - print op + " is not implemented yet" - return [] - if self.verbose: - print "Got request " + op - return method(request) - - def GET_LOG(self, request): - return [] - - def GET_SCHEMA(self, request): - with open(self.base + "schema.json") as fp: - data = json.load(fp) - return data - - def GET_MGMT_NODES(self, request): - onlyfiles = [] - if not os.path.exists(self.base + self.topology): - os.makedirs(self.base + self.topology) - - for f in os.listdir(self.base + self.topology): - if os.path.isfile(os.path.join(self.base + self.topology, f)): - if os.path.splitext(f)[1] == ".json": - onlyfiles.append(unicode("amqp:/_topo_/0/" + os.path.splitext(f)[0] + "/$management")) - ''' - onlyfiles = [ - unicode("amqp:/_topo/0/" + os.path.splitext(f)[0] + "/$management", "utf-8") - for f in os.listdir(self.topology) - if os.path.isfile(os.path.join(self.topology, f)) and os.path.splitext(f)[1] == ".json" - ] - ''' - if self.verbose: - pprint (onlyfiles) - return onlyfiles - - def QUERY(self, request): - #pdb.set_trace() - if not getattr(request, "address"): - nodes = self.GET_MGMT_NODES(request) - node = nodes[0] - else: - node = request.address - print "node is" - pprint (node) - nid = node.split('/')[-2] - fullentity = request.properties["entityType"] - entity = fullentity[len("org.apache.qpid.dispatch"):] - if self.verbose: - pprint("nid is " + nid + " entity is " + entity) - if not "arrtibuteNmaes" in request.body: - requestedAttrs = [] - else: - requestedAttrs = request.body["attributeNames"] - if not os.path.isfile(self.base + self.topology + "/" + nid + ".json"): - return {"results": [], "attributeNames": requestedAttrs} - with open(self.base + self.topology + "/" + nid + ".json") as fp: - data = json.load(fp) - ent = data.get(entity, {'attributeNames': [], 'results': []}) - attributeNames = ent['attributeNames'] - allresults = ent['results'] - if len(requestedAttrs) == 0: - requestedAttrs = attributeNames - results = [] - for result in allresults: - newresult = [] - for atr in requestedAttrs: - atrindex = attributeNames.index(atr) - if atrindex < 0 or atrindex >= len(result): - newresult.append('not found') - else: - newresult.append(result[atrindex]) - results.append(newresult) - newdata = {"results": results, "attributeNames": requestedAttrs} - - if self.verbose: - pprint(newdata) - return newdata - - def LOAD(self, request): - topology = request.properties["topology"] - fname = self.base + topology + "/nodeslinks.dat" - if not os.path.isfile(fname): - if self.verbose: - print "returning empty topology for " + topology - return {"nodes": [], "links": [], "topology": topology} - - with open(fname) as fp: - data = json.load(fp) - return data - - def GET_TOPOLOGY(self, request): - if self.verbose: - pprint (self.topology) - return unicode(self.topology) - - def GET_TOPOLOGY_LIST(self, request): - return [unicode(f) for f in os.listdir(self.base) if os.path.splitext(f)[1] != ".json"] - - def SWITCH(self, request): - self.topology = request.properties["topology"] - return self.LOAD(request) - - def PUBLISH(self, request): - nodes = request.properties["nodes"] - links = request.properties["links"] - topology = request.properties["topology"] - if self.verbose: - print("PUBLISHing to " + topology) - shutil.rmtree(self.base + topology) - - if not os.path.exists(self.base + topology): - os.makedirs(self.base + topology) - - with open(self.base + topology + "/nodeslinks.dat", "w+") as fp: - fp.write(json.dumps({"nodes": nodes, "links": links, "topology": topology}, indent=2)) - - port = 20001 - clients = {} - connectionId = 1 - # cache any connections and links for clients first - for node in nodes: - if node['nodeType'] != 'inter-router': - if not node['key'] in clients: - clients[node['key']] = {"connections": [], "links": [], "addresses": []} - - for normal in node["normals"]: - clients[node['key']]["connections"].append(Connection(node, connectionId).vals()) - ldir = "in" if node['cdir'] == "in" else "out" - owningAddr = "M0" + normal['addr'] if "console_identifier" not in node['properties'] else "" - clients[node['key']]["links"].append(RouterLink(node, str(len(clients[node['key']]["links"])), - ldir, owningAddr, "endpoint", connectionId).vals()) - if node['cdir'] == "both": - otherAddr = "M0" + normal['addr'] if "console_identifier" not in node['properties'] \ - else "Ltemp." + id_generator(15) - clients[node['key']]["links"].append(RouterLink(node, - str(len(clients[node['key']]["links"])), "in", - otherAddr, "endpoint", connectionId).vals()) - connectionId += 1 - - - hopper = Hopper(self.verbose) - for node in nodes: - if node['nodeType'] == 'inter-router': - nodeInfo = {} - - # this should be driven by the schema and not hard coded like this - nname = node["name"] - entities = ("connection", "router", "router.link", "router.node", "allocator", - "sslProfile", "autoLink", "linkRoute", "address", "policy", "log", - "vhost", "vhostStats", "listener", "router.address", "connector") - for entity in entities: - savedAs = entity - if entity == "address": - savedAs = "router.config.address" - nodeInfo["."+savedAs] = {"results": [], "attributeNames": Schema.schema[entity]["attributeNames"]} - - # find all the other nodes that are linked to this node - nodeCons = [] - nodeLinks = [] - # if the link source or target is this node's id - for link in links: - # only process links to other routers - if link['cls'] != "small": - toNode = None - if link['source']['name'] == node['name']: - toNode = link['target'] - toNode["cdir"] = "in" - if link['target']['name'] == node['name']: - toNode = link['source'] - toNode["cdir"] = "out" - if toNode: - toNode["container"] = toNode["name"] - nodeCons.append(Connection(toNode, connectionId).vals()) - - nodeLinks.append(RouterLink(toNode, str(len(nodeLinks)+1), "in", - '', "router-control", connectionId).vals()) - nodeLinks.append(RouterLink(toNode, str(len(nodeLinks)+1), "out", - '', "router-control", connectionId).vals()) - nodeLinks.append(RouterLink(toNode, str(len(nodeLinks)+1), "in", - '', "inter-router", connectionId).vals()) - nodeLinks.append(RouterLink(toNode, str(len(nodeLinks)+1), "out", - '', "inter-router", connectionId).vals()) - connectionId += 1 - - nodeInfo[".connection"]["results"] = nodeCons - nodeInfo[".router.link"]["results"] = nodeLinks - - # add any connections and links for clients - if node['key'] in clients: - nodeInfo[".connection"]["results"].extend(clients[node['key']]["connections"]) - nodeInfo[".router.link"]["results"].extend(clients[node['key']]["links"]) - - nodeInfo[".listener"]["results"].append(Listener(port).vals()) - port += 1 - - nodeInfo[".router"]["results"].append(Router(node).vals()) - nodeInfo[".router.config.address"]["results"].append(Address().vals()) - nodeInfo[".policy"]["results"].append(Policy().vals()) - - for connection in nodeInfo[".connection"]["results"]: - dir = connection[Schema.i("connection", "dir")] - if dir == "out": - hostIndex = Schema.i("connection", "host") - connhost, connport = connection[hostIndex].split(":") - nodeInfo[".connector"]["results"].append(Connector(connhost, connport).vals()) - - for n in nodes: - if n['nodeType'] == 'inter-router': - nodeInfo[".router.node"]["results"].append(RouterNode(node['name'], n['name'], links, hopper).vals()) - - nodeInfo[".router.address"]["results"] = RouterAddresses(node, nodes).vals() - nodeInfo[".allocator"]["results"] = Allocators().vals() - nodeInfo[".log"]["results"] = Logs().vals() - - with open(self.base + topology + "/" + nname + ".json", "w+") as fp: - fp.write(json.dumps(nodeInfo, indent=2, sort_keys=True)) - - return "published" - -class MockRouter(MessagingHandler): - def __init__(self, url, topology, verbose): - super(MockRouter, self).__init__() - self.url = url - self.manager = Manager(topology, verbose) - self.senders = {} - self.verbose = verbose - - def on_start(self, event): - self.acceptor = event.container.listen(self.url) - - def on_link_opening(self, event): - if event.link.is_sender: - if event.link.remote_source.dynamic: - if self.verbose: - print("opening dynamic sender") - address = str(generate_uuid()) - event.link.source.address = address - elif event.link.remote_source.address: - if self.verbose: - print("opening remote_source address sender") - event.link.source.address = event.link.remote_source.address - else: - print("received unknown sender link") - self.senders[event.link.source.address] = event.link - - elif event.link.is_receiver: - if self.verbose: - print "got a receiver link" - event.link.target.address = event.link.remote_target.address - - def on_message(self, event): - ret = self.manager.operation(event.message.properties["operation"], event.message) - m = Message(address=event.message.reply_to, body=ret, - correlation_id=event.message.correlation_id, - properties={"statusCode": 200} ) - self.senders[event.message.reply_to].send(m) - -parser = optparse.OptionParser(usage="usage: %prog [options]") -parser.add_option("-a", "--address", default="localhost:5672", - help="address router listens on (default %default)") -parser.add_option("-t", "--topology", default="config-80", - help="which topology directory to return (default %default)") -parser.add_option("-v", "--verbose", default=False, - help="display requests and responses to stdout (default %default)") -opts, args = parser.parse_args() - -try: - Container(MockRouter(opts.address, opts.topology, opts.verbose)).run() -except KeyboardInterrupt: pass http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/6502523b/console/test/html/qdrConnect.html ---------------------------------------------------------------------- diff --git a/console/test/html/qdrConnect.html b/console/test/html/qdrConnect.html deleted file mode 100644 index b3500c4..0000000 --- a/console/test/html/qdrConnect.html +++ /dev/null @@ -1,105 +0,0 @@ -<!-- -Licensed to the Apache Software Foundation (ASF) under one -or more contributor license agreements. See the NOTICE file -distributed with this work for additional information -regarding copyright ownership. The ASF licenses this file -to you 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. ---> - -<style> - .alert { - margin-top: 4em; - } - - .login:after { - content: ''; - display: block; - clear: both; -} - -</style> -<div class="row-fluid" ng-controller="QDR.SettingsController"> - <div class="login" ng-hide="connecting"> - <div class="col-xs-1"></div> - <div class="col-xs-10"> - <div class="alert alert-success"> - <p> - Enter the address and a HTML-enabled port of a <strong><a href="http://qpid.apache.org/components/dispatch-router/" target="_blank">Qpid Dispatch Router</a></strong>. - </p> - <!-- - <p> - If Autostart is checked, you will be automatically logged in to the router the next time you start the console. - </p> --> - - </div> - <div class="connect-form"> - <form class="form-horizontal no-bottom-margin" novalidate ng-submit="connect()" name="settings"> - <div class="form-group"> - <label class="col-md-2 control-label" for="address">Address: </label> - <div class="col-md-6"> - <input tabindex="1" id="address" type="text" ng-model="formEntity.address" placeholder="localhost" name="address" autofocus="autofocus" class="ng-pristine ng-valid ng-valid-required"></div> - </div> - <div class="form-group"> - <label tabindex="-1" class="col-md-2 control-label" title="Ports to connect to, by default 5673" for="port">Port: </label> - <div class="col-md-6"> - <input tabindex="2" id="port" posint type="number" placeholder="5673" tooltip="Ports to connect to, by default 5673" ng-model="formEntity.port" name="port" title="Ports to connect to, by default 5673"> - <span ng-show="settings.port.$error.range">Must be 1 through 65535</span> - </div> - </div> - <div class="form-group"> - <label tabindex="-1" class="col-md-2 control-label" title="User name" for="username">User name: </label> - <div class="col-md-6"> - <input tabindex="3" id="username" type="text" placeholder="username" tooltip="User name" ng-model="formEntity.username" name="username" title="User name"> - </div> - </div> - <div class="form-group"> - <label tabindex="-1" class="col-md-2 control-label" title="Password" for="password">Password: </label> - <div class="col-md-6"> - <input tabindex="4" id="password" type="password" placeholder="password" tooltip="Password" ng-model="formEntity.password" name="password" title="Password"> - </div> - </div> -<!-- - <div class="form-group"> - <label tabindex="-1" class="col-md-2 control-label" title="Whether or not the connection should be started as soon as you log in" for="autostart">Autostart: </label> - <div class="col-md-6"> - <input tabindex="3" id="autostart" type="checkbox" tooltip="Whether or not the connection should be started as soon as you log into hawtio" ng-model="formEntity.autostart" name="autostart" title="Whether or not the connection should be started as soon as you log into hawtio" - class="ng-scope ng-pristine ng-valid"></div> - </div> ---> - <input tabindex="-1" type="submit" style="position: absolute; left: -9999px; width: 1px; height: 1px;"> - <p></p> - <div class="form-group"> - <label tabindex="-1" class="col-md-2 control-label" title="button"></label> - <div class="col-md-6"> - <button type="submit" tabindex="4" class="btn btn-primary pull-left" ng-disabled="settings.$invalid">{{buttonText()}}</button> - </div> - </div> - </form> - - - </div> - </div> - <div class="col-xs-1"></div> - </div> - - <div class="centered" ng-show="connecting"> - <i class="icon-spin icon-spinner icon-4x"></i> - <p>Please wait, connecting now...</p> - </div> - <div class="centered error" ng-show="connectionError"> - <p>There was a connection error: {{connectionErrorText}}</p> - </div> - -</div> - http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/6502523b/console/test/html/qdrTopology.html ---------------------------------------------------------------------- diff --git a/console/test/html/qdrTopology.html b/console/test/html/qdrTopology.html deleted file mode 100644 index 403a66c..0000000 --- a/console/test/html/qdrTopology.html +++ /dev/null @@ -1,143 +0,0 @@ -<!-- -Licensed to the Apache Software Foundation (ASF) under one -or more contributor license agreements. See the NOTICE file -distributed with this work for additional information -regarding copyright ownership. The ASF licenses this file -to you 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. ---> -<div class="qdrTopology row-fluid" ng-controller="QDR.TopologyController"> - <div class="qdr-topology pane left" ng-controller="QDR.TopologyFormController"> - <div id="topologyForm" ng-class="{selected : isSelected()}"> - <!-- <div ng-repeat="form in forms" ng-show="isVisible(form)" ng-class='{selected : isSelected(form)}'> --> - <div ng-show="form == 'router'"> - <h4>Router Info</h4> - <div class="gridStyle" ng-grid="topoGridOptions"></div> - </div> - <div ng-show="form == 'connection'"> - <h4>Connection Info</h4> - <div class="gridStyle" ng-grid="topoGridOptions"></div> - </div> - <div id="addNodeForm" ng-show="form == 'add'"> - <h4>Add a new router</h4> - <ul> - <li>Click on an existing router to create a connection to the new router</li> - <li>Double-click on the new router to <button ng-click="editNewRouter()">edit</button> its properties</li> - <li ng-show="addingNode.hasLink" >Right-click on a new connection to edit its properties</li> - </ul> - <button ng-click="cancel()">Cancel</button> - </div> - </div> - <button ng-if="panelVisible" ng-click="hideLeftPane()" class="hideLeft" title="Hide"><i class="icon-step-backward"></i></button> - <button ng-if="!panelVisible" ng-click="showLeftPane()" class="hideLeft" title="Show"><i class="icon-step-forward"></i></button> - </div> - <div class="panel-adjacent"> - <div id="buttonBar"> - <button class="btn btn-primary" type="button" ng-click="Publish()">Publish</button> - <button class="btn btn-primary" type="button" ng-click="Duplicate()">Duplicate</button> - <button class="btn btn-primary" type="button" ng-click="Clear()">Clear</button> - <select ng-model="mockTopologyDir" ng-options="item for item in mockTopologies"></select> - <button class="btn btn-primary" type="button" ng-click="settings()">Settings</button> - </div> - <!-- - <ul class="nav nav-tabs ng-scope qdrTopoModes"> - <li ng-repeat="mode in modes" ng-class="{active : isModeActive(mode.name), 'pull-right' : isRight(mode)}" ng-click="selectMode('{{mode.name}}')" > - <a data-placement="bottom" class="ng-binding"> {{mode.name}} </a></li> - </ul> ---> - <div id="topology" ng-show="mode == 'Diagram'"><!-- d3 toplogy here --></div> - <div id="geology" ng-show="mode == 'Globe'"><!-- d3 globe here --></div> - <div id="crosssection"><!-- d3 pack here --></div> - <!-- <div id="addRouter" ng-show="mode == 'Add Node'"></div> --> - <div id="node_context_menu" class="contextMenu"> - <ul> - <li class="na" ng-class="{'force-display': !isFixed()}" ng-click="setFixed(true)">Freeze in place</li> - <li class="na" ng-class="{'force-display': isFixed()}" ng-click="setFixed(false)">Unfreeze</li> - <li ng-class="{'na': contextNode.nodeType !== 'inter-router'}" class="context-separator"></li> - <li ng-class="{'na': contextNode.nodeType !== 'inter-router'}" ng-click="addToNode('sender')">Add a sender</li> - <li ng-class="{'na': contextNode.nodeType !== 'inter-router'}" ng-click="addToNode('receiver')">Add a receiver</li> - <li ng-class="{'na': contextNode.nodeType !== 'inter-router'}" ng-click="addToNode('both')">Add a sender/receiver</li> - <li ng-class="{'na': contextNode.nodeType !== 'inter-router'}" ng-click="addToNode('console')">Add a console</li> - <li ng-class="{'na': contextNode.nodeType !== 'inter-router'}" class="context-separator"></li> - <li ng-class="{'na': contextNode.nodeType !== 'inter-router'}" ng-click="addToNode('Artemis')">Add an Artemis broker</li> - <li ng-class="{'na': contextNode.nodeType !== 'inter-router'}" ng-click="addToNode('Qpid')">Add a Qpid broker</li> - <li ng-class="{'na': contextNode.nodeType !== 'inter-router'}" class="context-separator"></li> - <li ng-click="delNode()">Delete this node</li> - </ul> - </div> - <div id="svg_context_menu" class="contextMenu"> - <ul> - <li ng-click="addAnotherNode()">Add a new router</li> - </ul> - </div> - <div id="link_context_menu" class="contextMenu"> - <ul> - <li ng-click="reverseLink()">Reverse connection direction</li> - <li ng-click="removeLink()">Remove connection</li> - </ul> - </div> - <div id="svg_legend"></div> - </div> -</div> - - -<script type="text/ng-template" id="titleHeaderCellTemplate.html"> - <div title="{{col.displayName}}" class="ngHeaderSortColumn {{col.headerClass}}" ng-style="{'cursor': col.cursor}" ng-class="{ 'ngSorted': !noSortVisible }"> - <div ng-click="col.sort($event)" ng-class="'colt' + col.index" class="ngHeaderText">{{col.displayName}}</div> - <div class="ngSortButtonDown" ng-show="col.showSortButtonDown()"></div> - <div class="ngSortButtonUp" ng-show="col.showSortButtonUp()"></div> - <div class="ngSortPriority">{{col.sortPriority}}</div> - </div> -</script> -<script type="text/ng-template" id="titleCellTemplate.html"> - <div title="{{row.entity[col.field]}}" class="ngCellText">{{row.entity[col.field]}}</div> -</script> - -<!-- - This is the template for the node edit dialog that is displayed. ---> -<script type="text/ng-template" id="node-config-template.html"> - <div class="modal-header"> - <h3 class="modal-title">Configure new routers/clients</h3> - </div> - <div class="modal-body"> - <form novalidate name="editForm"> - - <div class="entity-description">{{entity.description}}</div> - <fieldset> - <div ng-repeat="attribute in entity.attributes"> - <label for="{{attribute.name}}">{{attribute.humanName}}</label> -<!-- we can't do <input type="{angular expression}"> because... jquery throws an exception because... --> - <div ng-if="attribute.input == 'input'"> - <!-- ng-pattern="testPattern(attribute)" --> - <input ng-if="attribute.type == 'number'" type="number" name="{{attribute.name}}" id="{{attribute.name}}" ng-model="attribute.value" ng-required="attribute.required" class="ui-widget-content ui-corner-all"/> - <input ng-if="attribute.type == 'text'" type="text" name="{{attribute.name}}" id="{{attribute.name}}" ng-model="attribute.value" ng-required="attribute.required" class="ui-widget-content ui-corner-all"/> - </div> - <div ng-if="attribute.input == 'select'"> - <select id="{{attribute.name}}" ng-model="attribute.selected" ng-options="item for item in attribute.rawtype"></select> - </div> - <div ng-if="attribute.input == 'boolean'" class="boolean"> - <label><input type="radio" ng-model="attribute.value" value="true"> True</label> - <label><input type="radio" ng-model="attribute.value" value="false"> False</label> - </div> - </div> - </fieldset> - - </form> - </div> - <div class="modal-footer"> - <button class="btn btn-primary" type="button" ng-click="setSettings()">OK</button> - <button class="btn btn-warning" type="button" ng-click="cancel()">Cancel</button> - </div> -</script> - http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/6502523b/console/test/index.html ---------------------------------------------------------------------- diff --git a/console/test/index.html b/console/test/index.html deleted file mode 100644 index 0545aa7..0000000 --- a/console/test/index.html +++ /dev/null @@ -1,114 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<!-- -Licensed to the Apache Software Foundation (ASF) under one -or more contributor license agreements. See the NOTICE file -distributed with this work for additional information -regarding copyright ownership. The ASF licenses this file -to you 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. ---> -<html xmlns:ng="http://angularjs.org"> - -<head> - - <meta charset="utf-8"/> - <meta name="viewport" content="width=device-width, initial-scale=1.0"/> - <title>Qpid Dispatch Console</title> - - <link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'> - <link rel="stylesheet" href="https://code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css"> - <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jquery.tipsy/1.0.2/jquery.tipsy.css" type="text/css"/> - <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ng-grid/2.0.11/ng-grid.min.css" type="text/css"/> - <link rel="stylesheet" href="https://cdn.rawgit.com/mar10/dynatree/master/dist/skin/ui.dynatree.css" type="text/css"> - <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/twitter-bootstrap/2.2.1/css/bootstrap-combined.min.css" type="text/css"> - <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.min.css"> - - <link rel="stylesheet" href="css/plugin.css" type="text/css"/> - <link rel="stylesheet" href="css/dispatch.css" type="text/css"/> - <link rel="stylesheet" href="css/site-base.css" type="text/css"/> - <link rel="stylesheet" href="css/mock.css" type="text/css"/> - <link rel="stylesheet" href="https://cdn.rawgit.com/mohsen1/json-formatter/master/dist/json-formatter.min.css" type="text/css"/> - -</head> - -<body ng-app="QDR"> - -<div id="core" ng-controller="QDR.Core"> - <div id="alerts"> - <uib-alert ng-repeat="alert in alerts" type="{{alert.type}}">{{alert.msg}}</uib-alert> - </div> - <div id="main-nav" class="navbar navbar-fixed-top" ng-controller="QDR.MainController"> - <div class="navbar-inner main-nav-lower"> - <div class="container"> - <div class="pull-left"> - <ul class="nav"> - <li ng-repeat="nav in topLevelTabs track by $index" - ng-class="{active : !nav.isActive()}" - ng-show="nav.isValid()"> - <a ng-href="{{nav.href}}" title="{{nav.title}}" data-placement="bottom" ng-bind="nav.content"> - </a> - </li> - </ul> - </div> - </div> - </div> - </div> - - <div id="main-body" > - <div id="main" class="container-fluid ng-cloak qdr"> - <div ng-include src="'html/qdrLayout.html'"></div> - </div> - </div> -</div> - -<!-- <script src="http://d3js.org/d3.v3.min.js"></script> - <script src="http://d3js.org/queue.v1.min.js"></script> --> - <script src='https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.14/d3.min.js'></script> - <script src='https://cdnjs.cloudflare.com/ajax/libs/d3-queue/3.0.3/d3-queue.min.js'></script> - - <script src="http://d3js.org/topojson.v0.min.js"></script> - - <script src="http://code.jquery.com/jquery-1.8.3.min.js"></script> - - <script src="https://maxcdn.bootstrapcdn.com/twitter-bootstrap/2.2.1/js/bootstrap.min.js"></script> - - <script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.1.5/angular.min.js"></script> - <script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.1.5/angular-sanitize.min.js"></script> - <script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.1.5/angular-resource.min.js"></script> - - <script src="https://cdnjs.cloudflare.com/ajax/libs/angular-ui-bootstrap/0.4.0/ui-bootstrap-tpls.min.js"></script> - - <script src="https://cdn.rawgit.com/jaz303/tipsy/master/src/javascripts/jquery.tipsy.js"></script> - <script src="https://cdn.rawgit.com/briancray/tooltipsy/master/tooltipsy.min.js"></script> - <script src="https://cdn.rawgit.com/angular-ui/ui-slider/master/src/slider.js"></script> - <script src="https://code.jquery.com/ui/1.11.4/jquery-ui.min.js"></script> - <script src="https://cdnjs.cloudflare.com/ajax/libs/ng-grid/2.0.11/ng-grid.min.js"></script> - <script src="https://cdnjs.cloudflare.com/ajax/libs/notify/0.4.2/notify.min.js"></script> - <script src="https://cdnjs.cloudflare.com/ajax/libs/FileSaver.js/2014-11-29/FileSaver.min.js"></script> - - <script type="text/javascript" src="js/dispatchPlugin.js"></script> - <script type="text/javascript" src="js/navbar.js"></script> - <script type="text/javascript" src="js/qdrService.js"></script> - <script type="text/javascript" src="js/qdrTopology.js"></script> - <script type="text/javascript" src="js/qdrSettings.js"></script> - - <script type="text/javascript" src="lib/rhea-min.js"></script> - - <script src="https://cdn.rawgit.com/mar10/dynatree/master/dist/jquery.dynatree.min.js"></script> - - <script type="text/javascript"> - angular.element(document.getElementsByTagName('head')).append(angular.element('<base href="' + window.location.pathname + '" />')); - </script> -</body> -</html> - http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/6502523b/console/test/js/dispatchPlugin.js ---------------------------------------------------------------------- diff --git a/console/test/js/dispatchPlugin.js b/console/test/js/dispatchPlugin.js deleted file mode 100644 index b30d9c1..0000000 --- a/console/test/js/dispatchPlugin.js +++ /dev/null @@ -1,259 +0,0 @@ -/* -Licensed to the Apache Software Foundation (ASF) under one -or more contributor license agreements. See the NOTICE file -distributed with this work for additional information -regarding copyright ownership. The ASF licenses this file -to you 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. -*/ -/** - * @module QDR - * @main QDR - * - * The main entry point for the QDR module - * - */ -var QDR = (function(QDR) { - - /** - * @property pluginName - * @type {string} - * - * The name of this plugin - */ - QDR.pluginName = "QDR"; - QDR.pluginRoot = ""; - QDR.isStandalone = true; - - /** - * @property log - * @type {Logging.Logger} - * - * This plugin's logger instance - */ - //HIO QDR.log = Logger.get(QDR.pluginName); - /** - * @property templatePath - * @type {string} - * - * The top level path to this plugin's partials - */ - QDR.srcBase = ""; - QDR.templatePath = QDR.srcBase + "html/"; - QDR.cssPath = QDR.srcBase + "css/"; - /** - * @property SETTINGS_KEY - * @type {string} - * - * The key used to fetch our settings from local storage - */ - QDR.SETTINGS_KEY = 'QDRSettings'; - QDR.LAST_LOCATION = "QDRLastLocation"; - - /** - * @property module - * @type {object} - * - * This plugin's angularjs module instance - */ - QDR.module = angular.module(QDR.pluginName, ['ngResource', 'ngGrid', 'ui.bootstrap', 'ui.slider'/*, 'minicolors' */]); - - Core = { - notification: function (severity, msg) { - $.notify(msg, severity); - } - } - - // set up the routing for this plugin - QDR.module.config(function($routeProvider) { - $routeProvider - .when('/', { - templateUrl: QDR.templatePath + 'qdrConnect.html' - }) - .when('/topology', { - templateUrl: QDR.templatePath + 'qdrTopology.html' - }) - .when('/connect', { - templateUrl: QDR.templatePath + 'qdrConnect.html' - }) - .otherwise({ - templateUrl: QDR.templatePath + 'qdrConnect.html' - }) - }); - - QDR.module.config(function ($compileProvider) { - var cur = $compileProvider.urlSanitizationWhitelist(); - $compileProvider.urlSanitizationWhitelist(/^\s*(https?|ftp|mailto|file|blob):/); - cur = $compileProvider.urlSanitizationWhitelist(); - }) - - QDR.module.filter('to_trusted', ['$sce', function($sce){ - return function(text) { - return $sce.trustAsHtml(text); - }; - }]); - - QDR.module.filter('humanify', function (QDRService) { - return function (input) { - return QDRService.humanify(input); - }; - }); - - QDR.module.filter('Pascalcase', function () { - return function (str) { - if (!str) - return ""; - return str.replace(/(\w)(\w*)/g, - function(g0,g1,g2){return g1.toUpperCase() + g2.toLowerCase();}); - } - }) - - QDR.module.filter('safePlural', function () { - return function (str) { - var es = ['x', 'ch', 'ss', 'sh'] - for (var i=0; i<es.length; ++i) { - if (str.endsWith(es[i])) - return str + 'es' - } - if (str.endsWith('y')) - return str.substr(0, str.length-2) + 'ies' - if (str.endsWith('s')) - return str; - return str + 's' - } - }) - - QDR.logger = function ($log) { - var log = $log; - - this.debug = function (msg) { msg = "QDR: " + msg; log.debug(msg)}; - this.error = function (msg) {msg = "QDR: " + msg; log.error(msg)} - this.info = function (msg) {msg = "QDR: " + msg; log.info(msg)} - this.warn = function (msg) {msg = "QDR: " + msg; log.warn(msg)} - - return this; - } - // one-time initialization happens in the run function - // of our module - QDR.module.run( ["$rootScope", '$route', '$timeout', "$location", "$log", "QDRService", function ($rootScope, $route, $timeout, $location, $log, QDRService) { - QDR.log = new QDR.logger($log); - QDR.log.info("*************creating Dispatch Console************"); - var curPath = $location.path() - var org = curPath.substr(1) - if (org && org.length > 0 && org !== "connect") { - $location.search('org', org) - } else { - $location.search('org', null) - } - QDR.queue = d3.queue; - - QDRService.initProton(); - var settings = angular.fromJson(localStorage[QDR.SETTINGS_KEY]); - if (settings && settings.autostart) { - QDRService.addDisconnectAction( function () { - $timeout(function () { - var lastLocation = localStorage[QDR.LAST_LOCATION] || "/overview"; - org = lastLocation.substr(1) - $location.path("/connect"); - $location.search('org', org) - }) - }) - QDRService.addConnectAction(function() { - QDRService.getSchema(function () { - QDR.log.debug("got schema after connection") -/* - QDRService.addUpdatedAction("initialized", function () { - QDRService.delUpdatedAction("initialized") - QDR.log.debug("got initial topology") - $timeout(function() { - if ($location.path().startsWith(QDR.pluginRoot)) { - var searchObject = $location.search(); - var goto = "overview"; - if (searchObject.org && searchObject.org !== "connect") { - goto = searchObject.org; - } - $location.search('org', null) - $location.path(QDR.pluginRoot + "/" + goto); - } - }) - }) - QDR.log.debug("requesting a topology") - QDRService.setUpdateEntities([]) - QDRService.topology.get() -*/ - }) - }); - QDRService.connect(settings); - } else { - $timeout(function () { - $location.path('/connect') - $location.search('org', org) - }) - } - - $rootScope.$on('$routeChangeSuccess', function() { - var path = $location.path(); - if (path !== "/connect") { - localStorage[QDR.LAST_LOCATION] = path; - } - }); - - }]); - - QDR.module.controller ("QDR.MainController", ['$scope', '$location', function ($scope, $location) { - QDR.log.debug("started QDR.MainController with location.url: " + $location.url()); - QDR.log.debug("started QDR.MainController with window.location.pathname : " + window.location.pathname); - $scope.topLevelTabs = []; - $scope.topLevelTabs.push({ - id: "qdr", - content: "Qpid Dispatch Router Console Test Data Creator", - title: "Dispatch Router Console", - isValid: function() { return true; }, - href: function() { return "#connect"; }, - isActive: function() { return true; } - }); - }]) - - QDR.module.controller ("QDR.Core", function ($scope, $rootScope) { - $scope.alerts = []; - $scope.closeAlert = function(index) { - $scope.alerts.splice(index, 1); - }; - $scope.$on('newAlert', function(event, data) { - $scope.alerts.push(data); - $scope.$apply(); - }); - $scope.$on("clearAlerts", function () { - $scope.alerts = []; - $scope.$apply(); - }) - - }) - - return QDR; -}(QDR || {})); - -var Folder = (function () { - function Folder(title) { - this.title = title; - this.children = []; - this.folder = true; - } - return Folder; -})(); -var Leaf = (function () { - function Leaf(title) { - this.title = title; - } - return Leaf; -})(); http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/6502523b/console/test/js/navbar.js ---------------------------------------------------------------------- diff --git a/console/test/js/navbar.js b/console/test/js/navbar.js deleted file mode 100644 index dba74ec..0000000 --- a/console/test/js/navbar.js +++ /dev/null @@ -1,77 +0,0 @@ -/* -Licensed to the Apache Software Foundation (ASF) under one -or more contributor license agreements. See the NOTICE file -distributed with this work for additional information -regarding copyright ownership. The ASF licenses this file -to you 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. -*/ -/** - * @module QDR - */ -var QDR = (function (QDR) { - - /** - * @property breadcrumbs - * @type {{content: string, title: string, isValid: isValid, href: string}[]} - * - * Data structure that defines the sub-level tabs for - * our plugin, used by the navbar controller to show - * or hide tabs based on some criteria - */ - QDR.breadcrumbs = [ - { - content: '<i class="icon-cogs"></i> Connect', - title: "Connect to a router", - isValid: function () { return true; }, - href: "#" + QDR.pluginRoot + "/connect" - }, - { - content: '<i class="icon-star-empty"></i> Topology', - title: "View router network topology", - isValid: function (QDRService) { return QDRService.isConnected(); }, - href: "#" + QDR.pluginRoot + "/topology" - }, - ]; - /** - * @function NavBarController - * - * @param $scope - * @param workspace - * - * The controller for this plugin's navigation bar - * - */ - QDR.module.controller("QDR.NavBarController", ['$scope', 'QDRService', '$routeParams', '$location', function($scope, QDRService, $routeParams, $location) { - $scope.breadcrumbs = QDR.breadcrumbs; - $scope.isValid = function(link) { - return link.isValid(QDRService, $location); - }; - - $scope.isActive = function(href) { - // highlight the connect tab if we are on the root page - if (($location.path() === QDR.pluginRoot) && (href.split("#")[1] === QDR.pluginRoot + "/connect")) - return true - return href.split("#")[1] == $location.path(); - }; - - $scope.isRight = function (link) { - return angular.isDefined(link.right); - }; - - }]); - - - return QDR; - -} (QDR || {})); --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org For additional commands, e-mail: commits-h...@qpid.apache.org