From commits-return-48297-archive-asf-public=cust-asf.ponee.io@qpid.apache.org Thu May 9 19:44:03 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id 85C67180649 for ; Thu, 9 May 2019 21:44:03 +0200 (CEST) Received: (qmail 29047 invoked by uid 500); 9 May 2019 19:44:03 -0000 Mailing-List: contact commits-help@qpid.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@qpid.apache.org Delivered-To: mailing list commits@qpid.apache.org Received: (qmail 29031 invoked by uid 99); 9 May 2019 19:44:02 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 May 2019 19:44:02 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id B2295872E3; Thu, 9 May 2019 19:44:02 +0000 (UTC) Date: Thu, 09 May 2019 19:44:02 +0000 To: "commits@qpid.apache.org" Subject: [qpid-dispatch] branch master updated: DISPATCH-1331 Add router info popup to console's topology page MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Message-ID: <155743104264.1614.619360807027979181@gitbox.apache.org> From: eallen@apache.org X-Git-Host: gitbox.apache.org X-Git-Repo: qpid-dispatch X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: 7b3a8e25b0fbebe5e10228a8b9de9c7c01c545d2 X-Git-Newrev: ca6f853661a995b58473daa276e427278c7e7494 X-Git-Rev: ca6f853661a995b58473daa276e427278c7e7494 X-Git-NotificationType: ref_changed_plus_diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated This is an automated email from the ASF dual-hosted git repository. eallen pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/qpid-dispatch.git The following commit(s) were added to refs/heads/master by this push: new ca6f853 DISPATCH-1331 Add router info popup to console's topology page ca6f853 is described below commit ca6f853661a995b58473daa276e427278c7e7494 Author: Ernest Allen AuthorDate: Thu May 9 15:43:32 2019 -0400 DISPATCH-1331 Add router info popup to console's topology page --- console/stand-alone/main.js | 2 + console/stand-alone/plugin/html/qdrTopology.html | 4 +- .../stand-alone/plugin/html/tmplRouterDetail.html | 123 +++++++++++++++++++++ .../stand-alone/plugin/js/dlgRouterController.js | 37 +++++++ console/stand-alone/plugin/js/topology/links.js | 4 + console/stand-alone/plugin/js/topology/nodes.js | 22 +++- .../stand-alone/plugin/js/topology/qdrTopology.js | 60 +++++++--- 7 files changed, 228 insertions(+), 24 deletions(-) diff --git a/console/stand-alone/main.js b/console/stand-alone/main.js index 11445c1..8ad5e37 100644 --- a/console/stand-alone/main.js +++ b/console/stand-alone/main.js @@ -41,6 +41,7 @@ import { ListController } from './plugin/js/qdrList.js'; import { TopAddressesController } from './plugin/js/qdrTopAddressesController.js'; import { ChartDialogController } from './plugin/js/dlgChartController.js'; import { DetailDialogController, SubTable } from './plugin/js/dlgDetailController.js'; +import { RouterDialogController } from './plugin/js/dlgRouterController.js'; import { SettingsController } from './plugin/js/qdrSettings.js'; import { SchemaController } from './plugin/js/qdrSchema.js'; import { ChartsController } from './plugin/js/qdrCharts.js'; @@ -286,6 +287,7 @@ import { posint } from './plugin/js/posintDirective.js'; QDR.module.controller('QDR.TopAddressesController', TopAddressesController); QDR.module.controller('QDR.ChartDialogController', ChartDialogController); QDR.module.controller('QDR.DetailDialogController', DetailDialogController); + QDR.module.controller('QDR.RouterDialogController', RouterDialogController); QDR.module.controller('QDR.SettingsController', SettingsController); QDR.module.controller('QDR.TopologyController', TopologyController); QDR.module.controller('QDR.ChordController', ChordController); diff --git a/console/stand-alone/plugin/html/qdrTopology.html b/console/stand-alone/plugin/html/qdrTopology.html index 14b5c8b..4c1a7d2 100644 --- a/console/stand-alone/plugin/html/qdrTopology.html +++ b/console/stand-alone/plugin/html/qdrTopology.html @@ -305,6 +305,8 @@ td.more-info {
  • Freeze in place
  • Unfreeze
  • +
  • Unselect
  • +
  • Select
@@ -321,4 +323,4 @@ td.more-info { \ No newline at end of file + diff --git a/console/stand-alone/plugin/html/tmplRouterDetail.html b/console/stand-alone/plugin/html/tmplRouterDetail.html new file mode 100644 index 0000000..b479ceb --- /dev/null +++ b/console/stand-alone/plugin/html/tmplRouterDetail.html @@ -0,0 +1,123 @@ + + + + +
+ + + +
diff --git a/console/stand-alone/plugin/js/dlgRouterController.js b/console/stand-alone/plugin/js/dlgRouterController.js new file mode 100644 index 0000000..3920828 --- /dev/null +++ b/console/stand-alone/plugin/js/dlgRouterController.js @@ -0,0 +1,37 @@ +/* +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. +*/ + +export class RouterDialogController { + constructor(QDRService, $scope, $timeout, $uibModalInstance, d, tip) { + this.controllerName = 'QDR.RouterDialogController'; + this.rates = {}; + + $scope.d = d; // the node object + $scope.detail = { + template: 'loading.html', + }; + $scope.tip = tip; + + // close button clicked + $scope.okClick = function () { + $uibModalInstance.close(true); + }; + } +} +RouterDialogController.$inject = ['QDRService', '$scope', '$timeout', '$uibModalInstance', 'd', 'tip']; diff --git a/console/stand-alone/plugin/js/topology/links.js b/console/stand-alone/plugin/js/topology/links.js index 1260415..82806e8 100644 --- a/console/stand-alone/plugin/js/topology/links.js +++ b/console/stand-alone/plugin/js/topology/links.js @@ -136,6 +136,10 @@ export class Links { onode.connection.results[c] ); + // we need a unique connection.container + if (connection.container === '') { + connection.container = utils.uuidv4(); + } // this is a connection to another interior router if (connection.role === "inter-router") { const target = getContainerIndex(connection.container, nodeInfo); diff --git a/console/stand-alone/plugin/js/topology/nodes.js b/console/stand-alone/plugin/js/topology/nodes.js index 26ac9bc..00cabad 100644 --- a/console/stand-alone/plugin/js/topology/nodes.js +++ b/console/stand-alone/plugin/js/topology/nodes.js @@ -71,13 +71,13 @@ export class Node { return ""; } } - toolTip(topology) { + toolTip(topology, verbose) { return new Promise( function (resolve) { if (this.nodeType === "normal" || this.nodeType === "edge") { resolve(this.clientTooltip()); } else - this.routerTooltip(topology).then(function (toolTip) { + this.routerTooltip(topology, verbose).then(function (toolTip) { resolve(toolTip); }); }.bind(this) @@ -99,7 +99,7 @@ export class Node { return title; } - routerTooltip(topology) { + routerTooltip(topology, verbose) { return new Promise( function (resolve) { topology.ensureEntities( @@ -109,8 +109,7 @@ export class Node { attrs: ["role", "port", "http"] }, { - entity: "router", - attrs: ["name", "version", "hostName"] + entity: "router" } ], function (foo, nodes) { @@ -148,6 +147,19 @@ export class Node { title += "Ports" + ports.join(", ") + ""; } + // add verbose rows + if (verbose) { + title += + "Addresses" + r.addrCount + ""; + title += + "Connections" + r.connectionCount + ""; + title += + "Links" + r.linkCount + ""; + title += + "Auto links" + r.autoLinkCount + ""; + title += + "Link routes" + r.linkRouteCount + ""; + } title += ""; resolve(title); return title; diff --git a/console/stand-alone/plugin/js/topology/qdrTopology.js b/console/stand-alone/plugin/js/topology/qdrTopology.js index c9dec02..88df593 100644 --- a/console/stand-alone/plugin/js/topology/qdrTopology.js +++ b/console/stand-alone/plugin/js/topology/qdrTopology.js @@ -164,17 +164,34 @@ export class TopologyController { }; // show the details dialog for a client or group of clients - function doDialog(d) { + function doDialog(d, type, toolTip) { + const dlgs = { + router: { + templateUrl: "tmplRouterDetail.html", + controller: "QDR.RouterDialogController", + size: "sm" + }, + client: { + templateUrl: "tmplClientDetail.html", + controller: "QDR.DetailDialogController", + size: "md" + } + }; + const which = dlgs[type]; $uibModal .open({ + size: which.size, backdrop: true, keyboard: true, backdropClick: true, - templateUrl: QDRTemplatePath + "tmplClientDetail.html", - controller: "QDR.DetailDialogController", + templateUrl: QDRTemplatePath + which.templateUrl, + controller: which.controller, resolve: { d: function () { return d; + }, + tip: function () { + return toolTip; } } }) @@ -195,6 +212,22 @@ export class TopologyController { if (!$scope.contextNode) return false; return $scope.contextNode.fixed; }; + $scope.isSelectable = function () { + if (!$scope.contextNode) return false; + const d = $scope.contextNode; + return d.nodeType !== "normal" && + d.nodeType !== "on-demand" && + d.nodeType !== "edge" && + d.nodeTYpe !== "_edge"; + }; + $scope.isSelected = function () { + return $scope.isSelectable() && $scope.contextNode === selected_node; + }; + $scope.setSelected = function (b) { + selected_node = b ? $scope.contextNode : null; + restart(); + }; + $scope.addressStyle = function (address) { return { "background-color": $scope.addressColors[address] @@ -707,27 +740,18 @@ export class TopologyController { return; } - // if this node was selected, unselect it - if ($scope.mousedown_node === selected_node) { - selected_node = null; - } else { - if ( - d.nodeType !== "normal" && - d.nodeType !== "on-demand" && - d.nodeType !== "edge" && - d.nodeTYpe !== "_edge" - ) - selected_node = $scope.mousedown_node; - } clearAllHighlights(); $scope.mousedown_node = null; - if (!$scope.$$phase) $scope.$apply(); // handle clicking on nodes that represent multiple sub-nodes if (d.normals && !d.isArtemis && !d.isQpid) { - doDialog(d); + doDialog(d, 'client'); + } else if (d.nodeType === '_topo') { + d.toolTip(QDRService.management.topology, true).then(function (toolTip) { + doDialog(d, 'router', toolTip); + }); } // apply any data changes to the interface - restart(); + $timeout(restart); }) .on("dblclick", function (d) { // circle --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org For additional commands, e-mail: commits-help@qpid.apache.org