
playground.server.pages.js.circuitbreaker.js Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gateleen-playground Show documentation
Show all versions of gateleen-playground Show documentation
Middleware library based on Vert.x to build advanced JSON/REST communication servers
$(function(){
var baseURL = "";
$("#getAllBtn").click(getAllCircuits);
$("#closeAllBtn").click(closeAllCircuits);
getAllCircuits();
function showError(message){
$("#circuitsErrorLabel").show();
$("#circuitsErrorLabel").html(message);
}
function hideError(){
$("#circuitsErrorLabel").hide();
}
function getAllCircuits(){
hideError();
$("#circuitsTable > tbody").html("");
$.ajax({url: baseURL+"/playground/server/queuecircuitbreaker/circuit/", dataType:"json"}).done(function(data) {
if (data) {
$.each(data, function(circuitHash, circuit) {
var $tableRow = $('')
.data("circuitHash", circuitHash)
.appendTo($('table#circuitsTable #circuitsTableBody'))
.append($('').text(circuit.infos.circuit))
.append($(' ').html(buildStatusLabel(circuit.status)))
.append($(' ').text(circuit.infos.failRatio));
if(circuit.status != 'closed'){
$tableRow.append($(' ')
.append($('