Skip to content

Commit

Permalink
fixes #753 so we now reliably show the metrics again (I think its the…
Browse files Browse the repository at this point in the history
… loading of the tree of processor nodes that maybe broke this sometimes)
  • Loading branch information
jstrachan committed Nov 20, 2013
1 parent ed7143a commit 01b848e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
19 changes: 16 additions & 3 deletions hawtio-web/src/main/webapp/app/camel/js/camel.ts
@@ -1,6 +1,8 @@

module Camel {

export function CamelController($scope, $element, workspace:Workspace, jolokia, localStorage) {
var log:Logging.Logger = Logger.get("Camel");

$scope.routes = [];
$scope.routeNodes = {};

Expand Down Expand Up @@ -175,7 +177,15 @@ module Camel {
var completed = stat.getAttribute("exchangesCompleted");
var tooltip = "";
if (id && completed) {
var node = isRoute ? $scope.routeNodes[id]: $scope.nodes[id];
var container = isRoute ? $scope.routeNodes: $scope.nodes;
var node = container[id];
if (!node) {
angular.forEach(container, (value, key) => {
if (!node && id === value.elementId) {
node = value;
}
});
}
if (node) {
var total = 0 + parseInt(completed);
var failed = stat.getAttribute("exchangesFailed");
Expand All @@ -196,7 +206,10 @@ module Camel {
node["tooltip"] = tooltip;
} else {
// we are probably not showing the route for these stats
//console.log("Warning, could not find " + id);
/*
var keys = Object.keys(container).sort();
log.info("Warning, could not find node for " + id + " when keys were: " + keys);
*/
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion hawtio-web/src/main/webapp/app/camel/js/helpers.ts
Expand Up @@ -839,7 +839,8 @@ module Camel {

//console.log("Image URL is " + imageUrl);
var cid = route.getAttribute("_cid") || route.getAttribute("id");
node = { "name": name, "label": label, "labelSummary": labelSummary, "group": 1, "id": id, "x": x, "y:": y, "imageUrl": imageUrl, "cid": cid, "tooltip": tooltip};
node = { "name": name, "label": label, "labelSummary": labelSummary, "group": 1, "id": id, "elementId": elementID,
"x": x, "y:": y, "imageUrl": imageUrl, "cid": cid, "tooltip": tooltip};
if (rid) {
node["rid"] = rid;
if (!$scope.routeNodes) $scope.routeNodes = {};
Expand Down

0 comments on commit 01b848e

Please sign in to comment.