Open DragonPulse opened 5 years ago
I also have the same problem using Docker -> a page with 2 inputs ("Filter beans" and "Highlight beans") is displayed, as well as a message Loading data
next to the Redraw button, but nothing is displayed...
In the console docker displays Beans info located on: http://user:pass@10.104.0.120:8080/actuator/beans
and effectively if I click on the link a JSON is displayed.
I also think that in the README should be added the docker option -p 3000:3000
otherwise is not easy to see anything...
Finally I've got my graph by modifying index.html as shown below:
var beans = typeFilter != ''
? json.contexts.application.beans.filter(function(b) { return beanTypeContains(b, typeFilter)})
: json.contexts.application.beans;
var beansArray = Object.keys(beans).map((bean) => ({
bean,
...beans[bean],
}));
var beanNodes = beansArray.map(function (b) {
return {
name: b.bean,
group: 1,
isHighlighted: beanTypeContains(b, highlightBeans)
}
});
...
var beanLinks = beansArray.flatMap(beanToLinks);
IDK, but it is not worked for me :( My solution:
var beans = typeFilter != ''
? json.contexts.application.beans.filter(function(b) { return beanTypeContains(b, typeFilter)})
: json.contexts.application.beans;
var beansArray = Object.keys(beans).map((bean) => ({
bean,
...beans[bean],
}));
var beanNodes = beansArray.map(function (b) {
return {
name: b.bean,
group: 1,
isHighlighted: beanTypeContains(b, highlightBeans)
}
});
beans = Object.entries(beans).map(function ([k,v],_){
v.bean = k;
return v;
});
var beanNodes = beans.map(function (b){
return {
name: b.bean,
group: 1,
isHighlighted: beanTypeContains(b, highlightBeans)
}
});
var beanNodesHash = {};
beanNodes.forEach(function (n, index){ beanNodesHash[n.name] = index; })
function nameToId(name) {
return beanNodesHash[name];
}
function beanToLinks(bean) {
return bean.dependencies.map(function (reference) {
return {
source: nameToId(reference),
target: nameToId(bean.bean),
value: 1
};
}).filter(function (link){
return link.source != undefined && link.target != undefined;
});
}
var beanLinks = beansArray.flatMap(beanToLinks);
The Graph is not getting plotted. the issue is in index.html var beans = typeFilter != '' ? json[0].beans.filter(function(b){ return beanTypeContains(b, typeFilter)}) : json[0].beans;
json[o].beans is undefined.
but the app.js line 41 res.send(body) is able to send the response. Seems like some issue with parsing the json form server