2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-11-23 10:02:04 +00:00
confluent/confluent_web/js/consoles.js
2014-07-27 19:19:27 -04:00

23 lines
696 B
JavaScript

$(document).ready(function() {
$.getJSON("/confluent-api/nodes/", function( data) {
var items = [];
var options = [];
var nodename = "";
$.each( data["_links"]["item"], function( key, val ) {
if (typeof(val) == "object") {
nodename = val.href;
} else {
nodename = val;
}
nodename = nodename.replace('/', '');
$("#nodes").append("<button id="+nodename+">"+nodename+"</button><br>");
$("#"+nodename).button().click(function( event ) {
var tname = this.id;
var url = "/confluent-api/nodes/" + tname + "/console/session";
new ConsoleWindow(url, tname);
});
});
});
}); // end document