MCPcopy Create free account
hub / github.com/apache/storm / handleNodeClickEvent

Function handleNodeClickEvent

storm-webapp/src/main/webapp/js/visualization.js:205–244  ·  view source on GitHub ↗
(nodeId)

Source from the content-addressed store, hash-verified

203}
204
205function handleNodeClickEvent(nodeId) {
206 // if nodeId is null, hide
207 if (nodeId == null) {
208 // Ensure slider is hidden
209 $("#bolt_slideout_inner").css("display", "none");
210 return;
211 }
212
213 // add new values
214 var nodeDetails = json[nodeId];
215 //console.log(nodeDetails);
216
217 // Prep the json slightly
218 nodeDetails[":id"] = nodeId;
219 nodeDetails[":inputs_length"] = nodeDetails[":inputs"].length;
220 nodeDetails[":stats_length"] = nodeDetails[":stats"].length;
221
222 // Conditionally link to component
223 for (x=0; x<nodeDetails[":inputs"].length; x++) {
224 var showLink = true;
225 if (nodeDetails[":inputs"][x][":component"].startsWith("__")) {
226 showLink = false;
227 }
228 nodeDetails[":inputs"][x][":show_link"] = showLink;
229 }
230
231 // Calculate uptime in a nice format.
232 for (x=0; x<nodeDetails[":stats"].length; x++) {
233 nodeDetails[":stats"][x][":uptime_str"] = secondsToString(nodeDetails[":stats"][x][":uptime_secs"]);
234 }
235
236 // Render and display template.
237 var template = $('#bolt_info_template').html();
238 var html = Mustache.render(template, nodeDetails);
239 $("#bolt-details").html(html);
240
241 // Ensure slider is viewable
242 $("#bolt_slideout_inner").css("display", "inline");
243 return;
244}
245
246function parseNode(nodeJson, nodeId) {
247 // Conditional hack for system components

Callers 3

createNetworkFunction · 0.85
handleClickEventFunction · 0.85
visualization.jsFile · 0.85

Calls 1

secondsToStringFunction · 0.85

Tested by

no test coverage detected