[1/2] activemq-artemis git commit: This closes #2410

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[1/2] activemq-artemis git commit: This closes #2410

michaelpearce
Repository: activemq-artemis
Updated Branches:
  refs/heads/master 51ba9bcd5 -> 55cb2dbf4


This closes #2410


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/55cb2dbf
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/55cb2dbf
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/55cb2dbf

Branch: refs/heads/master
Commit: 55cb2dbf45b38c6e7fc31b014ba555453360824c
Parents: 51ba9bc a65e711
Author: Michael Andre Pearce <[hidden email]>
Authored: Thu Nov 8 23:50:08 2018 +0000
Committer: Michael Andre Pearce <[hidden email]>
Committed: Thu Nov 8 23:50:08 2018 +0000

----------------------------------------------------------------------
 .../src/main/webapp/plugin/js/browse.js         | 106 +++++++++++--------
 1 file changed, 62 insertions(+), 44 deletions(-)
----------------------------------------------------------------------


Reply | Threaded
Open this post in threaded view
|

[2/2] activemq-artemis git commit: ARTEMIS-2125 Tabs preference changes to display columns not persistent through page refresh

michaelpearce
ARTEMIS-2125 Tabs preference changes to display columns not persistent through page refresh


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/a65e711f
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/a65e711f
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/a65e711f

Branch: refs/heads/master
Commit: a65e711fbcca19d7da043ac1f7151722ca99190f
Parents: 51ba9bc
Author: feuillemorte <[hidden email]>
Authored: Fri Nov 2 13:53:43 2018 +0100
Committer: Michael Andre Pearce <[hidden email]>
Committed: Thu Nov 8 23:50:08 2018 +0000

----------------------------------------------------------------------
 .../src/main/webapp/plugin/js/browse.js         | 106 +++++++++++--------
 1 file changed, 62 insertions(+), 44 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/a65e711f/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/browse.js
----------------------------------------------------------------------
diff --git a/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/browse.js b/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/browse.js
index 807122f..5d7989b 100644
--- a/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/browse.js
+++ b/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/browse.js
@@ -20,6 +20,67 @@
 var ARTEMIS = (function(ARTEMIS) {
 
     ARTEMIS.BrowseQueueController = function ($scope, workspace, ARTEMISService, jolokia, localStorage, artemisMessage, $location, $timeout) {
+
+    var defaultAttributes = [
+      {
+         field: 'messageID',
+         displayName: 'Message ID',
+         cellTemplate: '<div class="ngCellText"><a ng-click="openMessageDialog(row)">{{row.entity.messageID}}</a></div>',
+         // for ng-grid
+         width: '10%'
+      },
+      {
+         field: 'userID',
+         displayName: 'User ID',
+         width: '10%'
+      },
+      {
+         field: 'type',
+         displayName: 'Type',
+         width: '10%'
+      },
+      {
+         field: 'durable',
+         displayName: 'Durable',
+         width: '10%'
+      },
+      {
+         field: 'priority',
+         displayName: 'Priority',
+         width: '7%'
+      },
+      {
+         field: 'timestamp',
+         displayName: 'Timestamp',
+         width: '19%'
+      },
+      {
+         field: 'expiration',
+         displayName: 'Expires',
+         width: '10%'
+      },
+      {
+         field: 'redelivered',
+         displayName: 'Redelivered',
+         width: '10%'
+      }
+    ];
+   var attributes = defaultAttributes;
+   if (sessionStorage.getItem('browseColumnDefs')) {
+      attributes = JSON.parse(sessionStorage.getItem('browseColumnDefs'));
+   }
+   $scope.$on('ngGridEventColumns', function (newColumns) {
+      ARTEMIS.log.debug('ngGridEventColumns:', newColumns);
+      var visibles = newColumns.targetScope.columns.reduce(function (visibles, column) {
+          visibles[column.field] = column.visible;
+          return visibles;
+      }, {});
+      ARTEMIS.log.debug('ngGridEventColumns: visibles =', visibles);
+      attributes.forEach(function (attribute) {
+          attribute.visible = visibles[attribute.field];
+      });
+      sessionStorage.setItem('browseColumnDefs', JSON.stringify(attributes));
+   });
     $scope.pagingOptions = {
           pageSizes: [50, 100, 200],
           pageSize: 100,
@@ -53,50 +114,7 @@ var ARTEMIS = (function(ARTEMIS) {
           selectWithCheckboxOnly: true,
           showSelectionCheckbox: true,
           maintainColumnRatios: false,
-          columnDefs: [
-             {
-                field: 'messageID',
-                displayName: 'Message ID',
-                cellTemplate: '<div class="ngCellText"><a ng-click="openMessageDialog(row)">{{row.entity.messageID}}</a></div>',
-                // for ng-grid
-                width: '10%'
-             },
-             {
-                field: 'userID',
-                displayName: 'User ID',
-                width: '10%'
-             },
-             {
-                field: 'type',
-                displayName: 'Type',
-                width: '10%'
-             },
-             {
-                field: 'durable',
-                displayName: 'Durable',
-                width: '10%'
-             },
-             {
-                field: 'priority',
-                displayName: 'Priority',
-                width: '7%'
-             },
-             {
-                field: 'timestamp',
-                displayName: 'Timestamp',
-                width: '19%'
-             },
-             {
-                field: 'expiration',
-                displayName: 'Expires',
-                width: '10%'
-             },
-              {
-                 field: 'redelivered',
-                 displayName: 'Redelivered',
-                 width: '10%'
-              }
-          ],
+          columnDefs: attributes,
           afterSelectionChange: afterSelectionChange
        };
        $scope.showMessageDetails = false;