Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
hack to list eureka apps
  • Loading branch information
Diego Pacheco committed May 3, 2016
commit 225844455730d55591d13c50d59d025e65c5912f
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