Skip to content

Commit

Permalink
#790 allow filtering of the diagram by destination names
Browse files Browse the repository at this point in the history
  • Loading branch information
jstrachan committed Nov 29, 2013
1 parent 3075624 commit 6015b36
Showing 1 changed file with 31 additions and 20 deletions.
51 changes: 31 additions & 20 deletions hawtio-web/src/main/webapp/app/fabric/js/brokerDiagram.ts
Expand Up @@ -24,6 +24,10 @@ module Fabric {
$scope.$watch(watch, redrawGraph);
});

$scope.$watch("searchFilter", (newValue, oldValue) => {
redrawGraph();
});

if (Fabric.hasMQManager) {
Core.register(jolokia, $scope, {type: 'exec', mbean: Fabric.mqManagerMBean, operation: "loadBrokerStatus()"}, onSuccess(onBrokerData));
}
Expand Down Expand Up @@ -156,6 +160,9 @@ module Fabric {
function getOrAddDestination(properties) {
var typeName = properties.destType
var destinationName = properties.destinationName;
if (!destinationName || ($scope.searchFilter && destinationName.indexOf($scope.searchFilter) < 0)) {
return null;
}
return getOrAddNode(typeName, destinationName, properties, () => {
return {
popup: {
Expand All @@ -179,16 +186,18 @@ module Fabric {
var consumerId = properties.consumerId;
if (consumerId) {
var destination = getOrAddDestination(properties);
addLink(container.destinationLinkNode, destination, "destination");
var consumer = getOrAddNode("consumer", consumerId, properties, () => {
return {
popup: {
title: "Consumer: " + consumerId,
content: "<p>client: " + (properties.clientId || "") + " broker: " + (properties.brokerName || "") + "</p>"
}
};
});
addLink(destination, consumer, "consumer");
if (destination) {
addLink(container.destinationLinkNode, destination, "destination");
var consumer = getOrAddNode("consumer", consumerId, properties, () => {
return {
popup: {
title: "Consumer: " + consumerId,
content: "<p>client: " + (properties.clientId || "") + " broker: " + (properties.brokerName || "") + "</p>"
}
};
});
addLink(destination, consumer, "consumer");
}
}
}
}
Expand Down Expand Up @@ -222,16 +231,18 @@ module Fabric {
destinationProperties.destType = "topic";
}
var destination = getOrAddDestination(destinationProperties);
addLink(container.destinationLinkNode, destination, "destination");
var producer = getOrAddNode("producer", producerId, properties, () => {
return {
popup: {
title: "Producer: " + producerId,
content: "<p>client: " + (properties.clientId || "") + " broker: " + (properties.brokerName || "") + "</p>"
}
};
});
addLink(producer, destination, "producer");
if (destination) {
addLink(container.destinationLinkNode, destination, "destination");
var producer = getOrAddNode("producer", producerId, properties, () => {
return {
popup: {
title: "Producer: " + producerId,
content: "<p>client: " + (properties.clientId || "") + " broker: " + (properties.brokerName || "") + "</p>"
}
};
});
addLink(producer, destination, "producer");
}
graphModelUpdated();
}));
}
Expand Down

0 comments on commit 6015b36

Please sign in to comment.