Skip to content

Instantly share code, notes, and snippets.

@fbraem
Created Feb 28, 2019
Embed
What would you like to do?
MQ Clusterdiagram using MQWeb and vis.js
<html>
<head>
<link rel="stylesheet" href="/node_modules/vis/dist/vis.min.css"></link>
<script type="text/javascript" src="/node_modules/vis/dist/vis.min.js"></script>
<script type="text/javascript" src="/node_modules/axios/dist/axios.min.js"></script>
<title>CLuster View</title>
</head>
<body>
<h1>Cluster View</h1>
<div id="clusterView"></div>
<script type="text/javascript">
axios.post('http://localhost:8081/api/clusqmgr/inquire/PIGEON')
.then(function(response) {
var dotStr = "dinetwork { ";
for(var e in response.data.data) {
var data = response.data.data[e];
dotStr += data.QMgrName.value + " -> " + data.ClusterName.value + ";";
};
dotStr += " }";
var container = document.getElementById('clusterView');
var parsed = vis.network.convertDot(dotStr);
var networkData = {
nodes: parsed.nodes,
edges: parsed.edges
};
var network = new vis.Network(container, networkData, {});
});
</script>
</body>
</html>
@fbraem
Copy link
Author

fbraem commented Feb 28, 2019

Used MQWeb, axios and vis.js. To create a quick prototype I used DOT graph description language.
On our test environment this results in the following diagram:
clusterview

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment