2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-11-29 13:00:03 +00:00
confluent/confluent_web/consoles.js

23 lines
696 B
JavaScript
Raw Normal View History

$(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