sebthom commented on a change in pull request #3389:
URL: https://github.com/apache/activemq-artemis/pull/3389#discussion_r548320978



##########
File path: 
artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/components/addresses.js
##########
@@ -59,17 +60,43 @@ var Artemis;
     function AddressesController($scope, workspace, jolokia, localStorage, 
artemisMessage, $location, $timeout, $filter, $sanitize, pagination, 
artemisAddress) {
         var ctrl = this;
         ctrl.pagination = pagination;
+        ctrl.pagination.reset();
         var mbean = Artemis.getBrokerMBean(workspace, jolokia);
         ctrl.allAddresses = [];
         ctrl.addresses = [];
         ctrl.workspace = workspace;
         ctrl.refreshed = false;
+        ctrl.dtOptions = {
+           // turn of ordering as we do it ourselves
+           ordering: false,
+           columns: [
+                {name: "ID", visible: true},
+                {name: "Name", visible: true},
+                {name: "Routing Types", visible: true},
+                {name: "Queue Count", visible: true}
+           ]
+        };
+
+        Artemis.log.debug('sessionStorage: addressColumnDefs =', 
localStorage.getItem('addressColumnDefs'));
+        if (localStorage.getItem('addressColumnDefs')) {
+            ctrl.dtOptions.columns = 
JSON.parse(localStorage.getItem('addressColumnDefs'));
+        }
+
+        ctrl.updateColumns = function () {
+            var attributes = [];
+            ctrl.dtOptions.columns.forEach(function (column) {
+                attributes.push({name: column.name, visible: column.visible});
+            });
+            Artemis.log.debug("saving columns " + JSON.stringify(attributes));
+            localStorage.setItem('addressColumnDefs', 
JSON.stringify(attributes));
+        }
+
         ctrl.filter = {
             fieldOptions: [
-                {id: 'ID', name: 'ID'},
-                {id: 'NAME', name: 'Name'},
-                {id: 'ROUTING_TYPES', name: 'Queue Count'},
-                {id: 'QUEUE_COUNT', name: 'User'}
+                {id: 'id', name: 'ID'},
+                {id: 'name', name: 'Name'},
+                {id: 'routingTypes', name: 'Queue Count'},

Review comment:
       Can you also fix the name attribute for this and the next field? I think 
they are mixed up. 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to