From 225844455730d55591d13c50d59d025e65c5912f Mon Sep 17 00:00:00 2001 From: Diego Pacheco Date: Tue, 3 May 2016 16:37:07 -0300 Subject: [PATCH] hack to list eureka apps --- hystrix-dashboard/src/main/webapp/index.html | 37 ++++++++++++-------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/hystrix-dashboard/src/main/webapp/index.html b/hystrix-dashboard/src/main/webapp/index.html index 38e7698d9..ac893ce86 100644 --- a/hystrix-dashboard/src/main/webapp/index.html +++ b/hystrix-dashboard/src/main/webapp/index.html @@ -46,21 +46,30 @@ } }); }); - - $.get( "http://127.0.0.1:8080/eureka/v2/apps", function( data ) { - $.each(data, function(i, item){ - $('#eurekaApp').append($("") - .attr("value",item.name) - .text(item.name)); - $('#repos').bind('change',function(item){ - var $this = $(this), - $value = $this.val(); - $('#eurekaApp').text($value) - }); + $.get("http://127.0.0.1:8080/eureka/v2/apps/", function( data ) { - }); - }); + app = $(data.children).find("application").each(function(index,item){ + appName = $(item).find("name")[0].innerHTML + + ip = null; + $($(item).find("instance")).each(function(i,d){ + ip = $(d).find("ipAddr")[0].innerHTML; + }); + + $('#eurekaApp').append($("") + .attr("value",ip) + .text(appName)); + + $('#eurekaApp').bind('change',function(item){ + var $this = $(this), + $value = $this.val(); + $('#stream').val("http://" + $value + ":7001/turbine.stream?cluster=default"); + }); + + }); + + }); @@ -73,7 +82,7 @@

Hystrix Dashboard

- + Eureka Application:

Cluster via Turbine (default cluster): http://turbine-hostname:port/turbine.stream