Skip to content

Commit

Permalink
#123 use the correct icon for the endpoints on diagrams; based on the…
Browse files Browse the repository at this point in the history
… kinds of endpoint it is
  • Loading branch information
jstrachan committed Jun 18, 2013
1 parent 125b735 commit 8f880cc
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
10 changes: 10 additions & 0 deletions hawtio-web/src/main/webapp/app/camel/js/endpointChooser.ts
Expand Up @@ -132,6 +132,16 @@ module Camel {
}
};

export function getEndpointIcon(endpointName) {
var value = Camel.getEndpointConfig(endpointName, null);
var answer = Core.pathGet(value, ["icon"]);
if (!answer) {
var category = getEndpointCategory(endpointName);
answer = Core.pathGet(category, ["endpointIcon"]);
}
return answer || endpointIcon;
}

export function getEndpointConfig(endpointName, category) {
var answer = endpointConfigurations[endpointName];
if (!answer) {
Expand Down
15 changes: 14 additions & 1 deletion hawtio-web/src/main/webapp/app/camel/js/helpers.ts
Expand Up @@ -827,8 +827,21 @@ module Camel {
if (uri) {
label += " " + uri;
}
var tooltip = nodeSettings["tooltip"] || nodeSettings["description"] || name;
var tooltip = nodeSettings["tooltip"] || nodeSettings["description"] || label;
var imageUrl = getRouteNodeIcon(nodeSettings);
if ((nodeId === "from" || nodeId === "to") && uri) {
var idx = uri.indexOf(":");
if (idx > 0) {
var componentScheme = uri.substring(0, idx);
//console.log("lets find the endpoint icon for " + componentScheme);
if (componentScheme) {
var value = Camel.getEndpointIcon(componentScheme);
if (value) {
imageUrl = url(value);
}
}
}
}

//console.log("Image URL is " + imageUrl);
var cid = route.getAttribute("_cid") || route.getAttribute("id");
Expand Down

0 comments on commit 8f880cc

Please sign in to comment.