qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eal...@apache.org
Subject qpid-dispatch git commit: DISPATCH-1206 Consolidated console templates into directive
Date Wed, 05 Dec 2018 14:12:23 GMT
Repository: qpid-dispatch
Updated Branches:
  refs/heads/master e8eb87a7a -> 588a35db0


DISPATCH-1206 Consolidated console templates into directive


Project: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/commit/588a35db
Tree: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/tree/588a35db
Diff: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/diff/588a35db

Branch: refs/heads/master
Commit: 588a35db0a7a38509f57e9db938f35c2f51e9774
Parents: e8eb87a
Author: Ernest Allen <eallen@redhat.com>
Authored: Wed Dec 5 09:12:10 2018 -0500
Committer: Ernest Allen <eallen@redhat.com>
Committed: Wed Dec 5 09:12:10 2018 -0500

----------------------------------------------------------------------
 console/stand-alone/main.js                     |   3 +-
 console/stand-alone/plugin/css/dispatch.css     |   2 +-
 .../plugin/html/tmplClientDetail.html           | 111 +++++++------------
 console/stand-alone/plugin/js/amqp/topology.js  |   2 +-
 .../plugin/js/dlgDetailController.js            |  31 ++++--
 .../plugin/js/topology/qdrTopology.js           |   5 +-
 6 files changed, 67 insertions(+), 87 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/588a35db/console/stand-alone/main.js
----------------------------------------------------------------------
diff --git a/console/stand-alone/main.js b/console/stand-alone/main.js
index 4cf2d32..0fc5c30 100644
--- a/console/stand-alone/main.js
+++ b/console/stand-alone/main.js
@@ -39,7 +39,7 @@ import { ChordController } from './plugin/js/chord/qdrChord.js';
 import { ListController } from './plugin/js/qdrList.js';
 import { TopAddressesController } from './plugin/js/qdrTopAddressesController.js';
 import { ChartDialogController } from './plugin/js/dlgChartController.js';
-import { DetailDialogController } from './plugin/js/dlgDetailController.js';
+import { DetailDialogController, SubTable } from './plugin/js/dlgDetailController.js';
 import { SettingsController } from './plugin/js/qdrSettings.js';
 import { SchemaController } from './plugin/js/qdrSchema.js';
 import { ChartsController } from './plugin/js/qdrCharts.js';
@@ -258,6 +258,7 @@ import { posint } from './plugin/js/posintDirective.js';
   QDR.module.service('QDRService', QDRService);
   QDR.module.service('QDRChartService', QDRChartService);
   QDR.module.directive('posint', posint);
+  QDR.module.directive('subTable', SubTable.create);
   //  .directive('exampleDirective', () => new ExampleDirective);
 }({}));
 

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/588a35db/console/stand-alone/plugin/css/dispatch.css
----------------------------------------------------------------------
diff --git a/console/stand-alone/plugin/css/dispatch.css b/console/stand-alone/plugin/css/dispatch.css
index 6b0ef2e..f41754b 100644
--- a/console/stand-alone/plugin/css/dispatch.css
+++ b/console/stand-alone/plugin/css/dispatch.css
@@ -1088,7 +1088,7 @@ svg {
       stroke-dasharray: 10,2;
   }
   text {
-    font: 12px sans-serif;
+    /*font: 12px sans-serif;*/
     pointer-events: none;
     /*font-family: monospace;*/
   

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/588a35db/console/stand-alone/plugin/html/tmplClientDetail.html
----------------------------------------------------------------------
diff --git a/console/stand-alone/plugin/html/tmplClientDetail.html b/console/stand-alone/plugin/html/tmplClientDetail.html
index d96cda3..e6190cc 100644
--- a/console/stand-alone/plugin/html/tmplClientDetail.html
+++ b/console/stand-alone/plugin/html/tmplClientDetail.html
@@ -154,29 +154,34 @@
             ng-click="expandClicked(info.container)"
         >
             <td colspan="6">
-                <div class="sub-table">
-                    <div class="sub-table-row header">
-                        <span class="sub-table-col client" 
-                            ng-style="{ width: fieldWidth(field, info.sizes) }" 
-                            ng-repeat="field in fields.linkFields.cols">
-                            {{field | humanify}}
-                        </span>
-                    </div>
-                    <div class="sub-table-row body" ng-repeat="link in info.links">
-                        <span class="sub-table-col client" 
-                            ng-style="{ width: fieldWidth(field, info.sizes) }" 
-                            ng-repeat="field in fields.linkFields.cols">
-                            {{link[field] | pretty}}
-                        </span>
-                    </div>
-                </div>
+                <sub-table 
+                    sizes="info.sizes" 
+                    cols="fields.linkFields.cols"
+                    rows="info.links"></sub-table>
             </td>
         </tr>
     </table>
 </script>
 
-<script type="text/ng-template" id="consoles.html">
-
+<script type="text/ng-template" id="sub-table.html">
+    <div class="sub-table">
+            <div class="sub-table-row header">
+                <span 
+                    class="sub-table-col client" 
+                    ng-style="{ width: fieldWidth(field, sizes) }" 
+                    ng-repeat="field in cols">
+                    {{field | humanify}}
+                </span>
+            </div>
+            <div class="sub-table-row body" ng-repeat="link in rows">
+                <span 
+                    class="sub-table-col client" 
+                    ng-style="{ width: fieldWidth(field, sizes) }" 
+                    ng-repeat="field in cols">
+                    {{link[field] | pretty}}
+                </span>
+            </div>
+        </div>
 </script>
 
 <script type="text/ng-template" id="edgeRouters.html">
@@ -207,6 +212,7 @@
             <td class="right">{{info.addrCount}}</td>
             <td class="right">{{info.acceptedDeliveries | pretty}}</td>
         </tr>
+        <!-- hidden row that is exposed when above row is clicked-->
         <tr ng-repeat-end
             ng-class="{hiddenRow: !expanded(info.name)}"
             ng-click="expandClicked(info.name)"
@@ -223,63 +229,22 @@
                 </dl>
     
                 <h4>Link routes</h4>
-                <div class="sub-table">
-                    <div class="sub-table-row header">
-                        <span 
-                            class="sub-table-col client" 
-                            ng-style="{ width: fieldWidth(field, info.linkRouteSizes) }"

-                            ng-repeat="field in fields.linkRouteFields.cols">
-                            {{field | humanify}}
-                        </span>
-                    </div>
-                    <div class="sub-table-row body" ng-repeat="link in info.linkRoutes">
-                        <span 
-                            class="sub-table-col client" 
-                            ng-style="{ width: fieldWidth(field, info.linkRouteSizes) }"

-                            ng-repeat="field in fields.linkRouteFields.cols">
-                            {{link[field] | pretty}}
-                        </span>
-                    </div>
-                </div>
-    
+                <sub-table 
+                    sizes="info.linkRouteSizes" 
+                    cols="fields.linkRouteFields.cols"
+                    rows="info.linkRoutes"></sub-table>
+
                 <h4>Autolinks</h4>
-                <div class="sub-table">
-                    <div class="sub-table-row header">
-                        <span 
-                            class="sub-table-col client" 
-                            ng-style="{ width: fieldWidth(field, info.autoLinkSizes) }" 
-                            ng-repeat="field in fields.autoLinkFields.cols">
-                            {{field | humanify}}
-                        </span>
-                    </div>
-                    <div class="sub-table-row body" ng-repeat="link in info.autoLinks">
-                        <span 
-                            class="sub-table-col client" 
-                            ng-style="{ width: fieldWidth(field, info.autoLinkSizes) }" 
-                            ng-repeat="field in fields.autoLinkFields.cols">
-                            {{link[field] | pretty}}
-                        </span>
-                    </div>
-                </div>
+                <sub-table 
+                    sizes="info.autoLinkSizes" 
+                    cols="fields.autoLinkFields.cols"
+                    rows="info.autoLinks"></sub-table>
+
                 <h4>Addresses</h4>
-                <div class="sub-table">
-                    <div class="sub-table-row header">
-                        <span 
-                            class="sub-table-col client" 
-                            ng-style="{ width: fieldWidth(field, info.addressSizes) }" 
-                            ng-repeat="field in fields.addressFields.cols">
-                            {{field | humanify}}
-                        </span>
-                    </div>
-                    <div class="sub-table-row body" ng-repeat="link in info.addresses">
-                        <span 
-                            class="sub-table-col client" 
-                            ng-style="{ width: fieldWidth(field, info.addressSizes) }" 
-                            ng-repeat="field in fields.addressFields.cols">
-                            {{link[field] | pretty}}
-                        </span>
-                    </div>
-                </div>
+                <sub-table 
+                    sizes="info.addressSizes" 
+                    cols="fields.addressFields.cols"
+                    rows="info.addresses"></sub-table>
             </td>
         </tr>
     </table>

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/588a35db/console/stand-alone/plugin/js/amqp/topology.js
----------------------------------------------------------------------
diff --git a/console/stand-alone/plugin/js/amqp/topology.js b/console/stand-alone/plugin/js/amqp/topology.js
index 02f1fe9..24f504e 100644
--- a/console/stand-alone/plugin/js/amqp/topology.js
+++ b/console/stand-alone/plugin/js/amqp/topology.js
@@ -23,7 +23,7 @@ class Topology {
     this.connection = connectionManager;
     this.updatedActions = {};
     this.entities = []; // which entities to request each topology update
-    this.entityAttribs = {};
+    this.entityAttribs = {connection: []};
     this._nodeInfo = {}; // info about all known nodes and entities
     this.filtering = false; // filter out nodes that don't have connection info
     this.timeout = 5000;

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/588a35db/console/stand-alone/plugin/js/dlgDetailController.js
----------------------------------------------------------------------
diff --git a/console/stand-alone/plugin/js/dlgDetailController.js b/console/stand-alone/plugin/js/dlgDetailController.js
index 0742f2a..bb81dcc 100644
--- a/console/stand-alone/plugin/js/dlgDetailController.js
+++ b/console/stand-alone/plugin/js/dlgDetailController.js
@@ -102,13 +102,6 @@ export class DetailDialogController {
     $scope.expanded = function (id) {
       return expandedRows.has(id);
     };
-    $scope.cellWidth = function (key, val) {
-      if (key === 'autoLinkFields') {
-        return val === 'addr' ? '40%' : '20%';
-      }
-      let totalChars = $scope.fields[key].count;
-      return `${Math.round(val.length * 100 / totalChars)}%`;
-    };
     $scope.fieldWidth = function (val, sizes) {
       if (!sizes)
         return '10%';
@@ -255,4 +248,26 @@ export class DetailDialogController {
 
   }
 }
-DetailDialogController.$inject = ['QDRService', '$scope', '$timeout', '$uibModalInstance',
'd'];
\ No newline at end of file
+DetailDialogController.$inject = ['QDRService', '$scope', '$timeout', '$uibModalInstance',
'd'];
+
+export class SubTable {
+  constructor () {
+    this.restrict = 'E';
+    this.scope = {
+      sizes: '=sizes',
+      cols: '=cols',
+      rows: '=rows'
+    };
+    this.templateUrl = 'sub-table.html';
+  }
+  link (scope) {
+    scope.fieldWidth = function (val, sizes) {
+      if (!sizes)
+        return '10%';
+      return `${Math.round(sizes[val] * 100 / sizes.total)}%`;
+    };
+  }
+  static create() {
+    return new SubTable();
+  }
+}

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/588a35db/console/stand-alone/plugin/js/topology/qdrTopology.js
----------------------------------------------------------------------
diff --git a/console/stand-alone/plugin/js/topology/qdrTopology.js b/console/stand-alone/plugin/js/topology/qdrTopology.js
index 68b3797..ea24102 100644
--- a/console/stand-alone/plugin/js/topology/qdrTopology.js
+++ b/console/stand-alone/plugin/js/topology/qdrTopology.js
@@ -406,7 +406,6 @@ export class TopologyController {
           force: true}], 
         function () {
           let nodeInfo = QDRService.management.topology.nodeInfo();
-          console.log(nodeInfo);
           forceData.nodes = nodes = new Nodes(QDRLog);
           nodes.initialize(nodeInfo, localStorage, width, height);
           forceData.links = links = new Links(QDRLog);
@@ -570,7 +569,7 @@ export class TopologyController {
       // circle (node) group
       // nodes are known by router id, or for groups, by the router id + 1st connectionId
       circle = circle.data(nodes.nodes, function(d) {
-        return d.uid(QDRService);
+        return d.uid();
       });
 
       // update existing nodes visual states
@@ -1050,8 +1049,8 @@ export class TopologyController {
       // we only need to update connections during steady-state
       QDRService.management.topology.setUpdateEntities(['connection']);
       // we currently have all entities available on all routers
-      saveChanged();
       initForceGraph();
+      saveChanged();
       // after the graph is displayed fetch all .router.node info. This is done so highlighting
between nodes
       // doesn't incur a delay
       QDRService.management.topology.addUpdateEntities([


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message