in src/main/resources/static/src/controller.js [338:373]
var callback = function (resp) {
$scope.barChart.hideLoading();
if (resp.status == 0) {
var clusterAddrTable = resp.data.clusterInfo.clusterAddrTable;
var brokerMap = resp.data.clusterInfo.brokerAddrTable;
var brokerDetail = resp.data.brokerServer;
var clusterMap = tools.generateBrokerMap(brokerDetail,clusterAddrTable,brokerMap);
$scope.brokerArray = [];
$.each(clusterMap,function(clusterName,brokers){
$.each(brokers,function(i,broker){
$scope.brokerArray.push(broker)
})
});
//sort the brokerArray
$scope.brokerArray.sort(function(firstBroker,lastBroker){
var firstTotalMsg = parseFloat(firstBroker.msgGetTotalTodayNow);
var lastTotalMsg = parseFloat(lastBroker.msgGetTotalTodayNow);
return lastTotalMsg-firstTotalMsg;
});
var xAxisData = [],
data = [];
$.each($scope.brokerArray,function(i,broker){
if(i > 9){
return false;
}
xAxisData.push(broker.brokerName + ":" + broker.index);
data.push(broker.msgGetTotalTodayNow);
})
getBrokerBarChartOp(xAxisData,data);
}else{
Notification.error({message: resp.errMsg, delay: 2000});
}
}