2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-11-25 19:10:10 +00:00
confluent/confluent_web/consoles.js
Jarrod Johnson bea9cd4149 Add web assets to confluent tree
This adds web assets so web developers can have a widget that can
be integrated into a web ui.
2014-06-04 16:11:06 -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