This is an automated email from the ASF dual-hosted git repository.

michaelpearce pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/activemq-artemis.git


The following commit(s) were added to refs/heads/master by this push:
     new a0631ec  ARTEMIS-2281 Enhancements for addresses/queues of web console
     new f7744b5  This closes #2589
a0631ec is described below

commit a0631ec1da8e4cd194d215c83257603775f3908e
Author: sebthom <sebt...@users.noreply.github.com>
AuthorDate: Thu Mar 21 18:05:23 2019 +0100

    ARTEMIS-2281 Enhancements for addresses/queues of web console
---
 .../src/main/webapp/plugin/js/addresses.js         | 26 +++++++++++-------
 .../src/main/webapp/plugin/js/queues.js            | 31 +++++++++++++++++-----
 2 files changed, 40 insertions(+), 17 deletions(-)

diff --git 
a/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/addresses.js 
b/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/addresses.js
index 6cc10b0..66070eb 100644
--- a/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/addresses.js
+++ b/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/addresses.js
@@ -30,13 +30,13 @@ var ARTEMIS = (function(ARTEMIS) {
         var objectType = "address";
         var method = 'listAddresses(java.lang.String, int, int)';
         var defaultAttributes = [
-           {
-               field: 'manage',
-               displayName: 'manage',
-               width: '*',
-               cellTemplate: '<div class="ngCellText"><a 
ng-click="navigateToAddressAtts(row)">attributes</a>&nbsp;<a 
ng-click="navigateToAddressOps(row)">operations</a></div>'
-           },
-           {
+            {
+                field: 'manage',
+                displayName: 'manage',
+                width: '*',
+                cellTemplate: '<div class="ngCellText"><a 
ng-click="navigateToAddressAtts(row)">attributes</a>&nbsp;<a 
ng-click="navigateToAddressOps(row)">operations</a></div>'
+            },
+            {
                 field: 'id',
                 displayName: 'ID',
                 width: '*'
@@ -44,7 +44,8 @@ var ARTEMIS = (function(ARTEMIS) {
             {
                 field: 'name',
                 displayName: 'Name',
-                width: '*'
+                width: '*',
+                cellTemplate: '<div class="ngCellText" 
title="{{row.entity.name}}">{{row.entity.name}}</div>'
             },
             {
                 field: 'routingTypes',
@@ -56,6 +57,7 @@ var ARTEMIS = (function(ARTEMIS) {
                 field: 'queueCount',
                 displayName: 'Queue Count',
                 width: '*',
+                cellTemplate: '<div class="ngCellText"><a 
ng-click="selectQueues(row)">{{row.entity.queueCount}}</a></div>',
                 sortable: false
             }
         ];
@@ -118,6 +120,10 @@ var ARTEMIS = (function(ARTEMIS) {
         $scope.navigateToAddressOps = function (row) {
             $location.path("jmx/operations").search({"tab": "artemis", "nid": 
ARTEMIS.getAddressNid(row.entity, $location)});
         };
+        $scope.selectQueues = function (row) {
+            artemisAddress.address = row.entity;
+            $location.path("artemis/queues");
+        };
         $scope.workspace = workspace;
         $scope.objects = [];
         $scope.totalServerItems = 0;
@@ -168,9 +174,9 @@ var ARTEMIS = (function(ARTEMIS) {
             $scope.loadTable();
         };
         $scope.loadTable = function () {
-               $scope.filter.values.sortColumn = $scope.sortOptions.fields[0];
+            $scope.filter.values.sortColumn = $scope.sortOptions.fields[0];
             $scope.filter.values.sortBy = $scope.sortOptions.directions[0];
-               $scope.filter.values.sortOrder = 
$scope.sortOptions.directions[0];
+            $scope.filter.values.sortOrder = $scope.sortOptions.directions[0];
             var mbean = getBrokerMBean(jolokia);
             if (mbean.includes("undefined")) {
                 onBadMBean();
diff --git a/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/queues.js 
b/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/queues.js
index e43d88a..3cd9ea0 100644
--- a/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/queues.js
+++ b/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/queues.js
@@ -19,7 +19,7 @@
  */
 var ARTEMIS = (function(ARTEMIS) {
 
-    ARTEMIS.QueuesController = function ($scope, $location, workspace, 
ARTEMISService, jolokia, localStorage, artemisConnection, artemisSession, 
artemisQueue) {
+    ARTEMIS.QueuesController = function ($scope, $location, workspace, 
ARTEMISService, jolokia, localStorage, artemisConnection, artemisSession, 
artemisQueue, artemisAddress) {
 
         var artemisJmxDomain = localStorage['artemisJmxDomain'] || 
"org.apache.activemq.artemis";
 
@@ -44,12 +44,14 @@ var ARTEMIS = (function(ARTEMIS) {
             {
                 field: 'name',
                 displayName: 'Name',
-                width: '*'
+                width: '*',
+                cellTemplate: '<div class="ngCellText" 
title="{{row.entity.name}}">{{row.entity.name}}</div>'
             },
             {
                 field: 'address',
                 displayName: 'Address',
-                width: '*'
+                width: '*',
+                cellTemplate: '<div class="ngCellText" 
title="{{row.entity.address}}"><a 
ng-click="selectAddress(row)">{{row.entity.address}}</a></div>'
             },
             {
                 field: 'routingType',
@@ -59,7 +61,8 @@ var ARTEMIS = (function(ARTEMIS) {
             {
                 field: 'filter',
                 displayName: 'Filter',
-                width: '*'
+                width: '*',
+                cellTemplate: '<div class="ngCellText" 
title="{{row.entity.filter}}">{{row.entity.filter}}</div>'
             },
             {
                 field: 'durable',
@@ -89,7 +92,8 @@ var ARTEMIS = (function(ARTEMIS) {
             {
                 field: 'messageCount',
                 displayName: 'Message Count',
-                width: '*'
+                width: '*',
+                cellTemplate: '<div class="ngCellText"><a 
ng-click="navigateToBrowseQueue(row)">{{row.entity.messageCount}}</a></div>'
             },
 
             // Hidden
@@ -204,6 +208,12 @@ var ARTEMIS = (function(ARTEMIS) {
          *
          *  TODO Refactor into new separate files
          */
+        if (artemisAddress.address) {
+            $scope.filter.values.field = $scope.filter.fieldOptions[3].id;
+            $scope.filter.values.operation = 
$scope.filter.operationOptions[0].id;
+            $scope.filter.values.value = artemisAddress.address.name;
+            artemisAddress.address = null;
+        }
         if (artemisQueue.queue) {
             $scope.filter.values.field = $scope.filter.fieldOptions[1].id;
             $scope.filter.values.operation = 
$scope.filter.operationOptions[0].id;
@@ -218,6 +228,13 @@ var ARTEMIS = (function(ARTEMIS) {
         $scope.navigateToQueueOps = function (row) {
             $location.path("jmx/operations").search({"tab": "artemis", "nid": 
ARTEMIS.getQueueNid(row.entity, $location)});
         };
+        $scope.navigateToBrowseQueue = function (row) {
+            $location.path("artemis/browseQueue").search({"tab": "artemis", 
"nid": ARTEMIS.getQueueNid(row.entity, $location)});
+        };
+        $scope.selectAddress = function (row) {
+            artemisAddress.address = row.entity;
+            $location.path("artemis/addresses");
+        };
         $scope.workspace = workspace;
         $scope.objects = [];
         $scope.totalServerItems = 0;
@@ -268,9 +285,9 @@ var ARTEMIS = (function(ARTEMIS) {
             $scope.loadTable();
         };
         $scope.loadTable = function () {
-               $scope.filter.values.sortColumn = $scope.sortOptions.fields[0];
+            $scope.filter.values.sortColumn = $scope.sortOptions.fields[0];
             $scope.filter.values.sortBy = $scope.sortOptions.directions[0];
-               $scope.filter.values.sortOrder = 
$scope.sortOptions.directions[0];
+            $scope.filter.values.sortOrder = $scope.sortOptions.directions[0];
             var mbean = getBrokerMBean(jolokia);
             if (mbean.includes("undefined")) {
                 onBadMBean();

Reply via email to