Skip to content

Commit

Permalink
hack to list eureka apps
Browse files Browse the repository at this point in the history
  • Loading branch information
Diego Pacheco committed May 3, 2016
1 parent bfe4ecb commit 2258444
Showing 1 changed file with 23 additions and 14 deletions.
37 changes: 23 additions & 14 deletions hystrix-dashboard/src/main/webapp/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,21 +46,30 @@
}
});
});

$.get( "http://127.0.0.1:8080/eureka/v2/apps", function( data ) {
$.each(data, function(i, item){
$('#eurekaApp').append($("<option></option>")
.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($("<option></option>")
.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");
});

});

});

</script>
</head>
Expand All @@ -73,7 +82,7 @@
<br>

<h2>Hystrix Dashboard</h2>
<select id="eurekaApp" name="eurekaApp"class="eurekaApp"></select>
Eureka Application: <select id="eurekaApp" name="eurekaApp"class="eurekaApp"></select>
<input id="stream" type="textfield" size="120" placeholder="http://hostname:port/turbine/turbine.stream"></input>
<br><br>
<i>Cluster via Turbine (default cluster):</i> http://turbine-hostname:port/turbine.stream
Expand Down

0 comments on commit 2258444

Please sign in to comment.