diff options
| author | Keith Wall <kwall@apache.org> | 2014-08-01 14:41:45 +0000 |
|---|---|---|
| committer | Keith Wall <kwall@apache.org> | 2014-08-01 14:41:45 +0000 |
| commit | 5bbff8c0c74e94c51a653327970883a38540f0e5 (patch) | |
| tree | 6936f43805be697e65d82e9a7646457a2808fad0 /qpid/java/broker-plugins/management-http | |
| parent | 2dca80f0ebda2def3773fb13af87f0eb6d5051da (diff) | |
| download | qpid-python-5bbff8c0c74e94c51a653327970883a38540f0e5.tar.gz | |
QPID-5953: [Java Broker] Restore the auto refesh behaviour of tables within tabs of the web management ui
This commit reverts some changes made by r1598232 (which introduced the regression).
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1615123 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/broker-plugins/management-http')
2 files changed, 43 insertions, 12 deletions
diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/UpdatableStore.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/UpdatableStore.js index b89ea3932c..64d557c242 100644 --- a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/UpdatableStore.js +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/UpdatableStore.js @@ -31,7 +31,7 @@ define(["dojo/json", var GridType = DataGrid; that.memoryStore = new Memory({data: data, idProperty: "id"}); - that.store = notObservable? that.memoryStore : new Observable(that.memoryStore); + that.store = notObservable ? that.memoryStore : new Observable(that.memoryStore); that.dataStore = ObjectStore({objectStore: that.store}); var gridProperties = { store: that.dataStore, @@ -86,19 +86,37 @@ define(["dojo/json", // iterate over data... if(data) { - for(var i=0; i < data.length; i++) { - if(theItem = store.get(data[i].id)) { - var modified = !util.equals(theItem, data[i]); - if(modified) { - store.put(data[i], {overwrite: true}); - if (store.notify) + for(var i=0; i < data.length; i++) + { + if(theItem = store.get(data[i].id)) + { + var modified = !util.equals(theItem, data[i]); + if(modified) + { + if (store.notify) + { + // Seems that we are required to update the item that the store already holds + for(var propName in data[i]) + { + if(data[i].hasOwnProperty(propName)) { - store.notify(theItem, data[i].id); + if(theItem[ propName ] != data[i][ propName ]) + { + theItem[ propName ] = data[i][ propName ]; + } } - changed = true; + } + // and tell it we have done so + store.notify(theItem, data[i].id); } + else + { + store.put(data[i], {overwrite: true}); + } + changed = true; + } } else { - // ,,, if not in the store then add + // if not in the store then add store.put(data[i]); changed = true; } diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/VirtualHost.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/VirtualHost.js index d0ffb49c2e..dd79fbc385 100644 --- a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/VirtualHost.js +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/VirtualHost.js @@ -219,8 +219,21 @@ define(["dojo/_base/xhr", that.updateHeader(); that.queuesGrid = new UpdatableStore(that.vhostData.queues, findNode("queues"), [ { name: "Name", field: "name", width: "90px"}, - { name: "Messages", field: "queueDepthMessages", width: "90px"}, - { name: "Arguments", field: "arguments", width: "100%"} + { name: "Type", field: "type", width: "90px"}, + { name: "Consumers", field: "consumerCount", width: "90px"}, + { name: "Depth (msgs)", field: "queueDepthMessages", width: "90px"}, + { name: "Depth (bytes)", field: "queueDepthBytes", width: "100%", + get: function(rowIndex, item) + { + if(!item){ + return; + } + var store = this.grid.store; + var qdb = store.getValue(item, "queueDepthBytes"); + var bytesFormat = formatter.formatBytes( qdb ); + return bytesFormat.value + " " + bytesFormat.units; + } + } ], function(obj) { |
