index.ftl 1.87 KB
Newer Older
1
<#import "/spring.ftl" as spring />
Dave Syer committed
2 3 4
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
5
<base href="${basePath}">
Dave Syer committed
6 7 8 9
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Hystrix Dashboard</title>

	<!-- Javascript to monitor and display -->
10
	<script src="<@spring.url '/webjars/jquery/2.1.1/jquery.min.js'/>" type="text/javascript"></script>
Dave Syer committed
11 12 13 14 15
	
	<script>
		function sendToMonitor() {
			
			if($('#stream').val().length > 0) {
16
				var url = "<@spring.url '/hystrix'/>/monitor?stream=" + encodeURIComponent($('#stream').val()) + "";
Dave Syer committed
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
				if($('#delay').val().length > 0) {	
					url += "&delay=" + $('#delay').val();
				}
				if($('#title').val().length > 0) {	
					url += "&title=" + encodeURIComponent($('#title').val());
				}
				location.href= url;
			} else {
				$('#message').html("The 'stream' value is required.");
			}
		}
	</script>
</head>
<body>
<div style="width:800px;margin:0 auto;">
	
	<center>
34
	<img width="264" height="233" src="<@spring.url '/hystrix'/>/images/hystrix-logo.png">
Dave Syer committed
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
	<br>
	<br>
	
	<h2>Hystrix Dashboard</h2>
	<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
	<br>
	<i>Cluster via Turbine (custom cluster):</i> http://turbine-hostname:port/turbine.stream?cluster=[clusterName]
	<br>
	<i>Single Hystrix App:</i> http://hystrix-app:port/hystrix.stream
	<br><br>
	Delay: <input id="delay" type="textfield" size="10" placeholder="2000"></input>ms 
	&nbsp;&nbsp;&nbsp;&nbsp; 
	Title: <input id="title" type="textfield" size="60" placeholder="Example Hystrix App"></input><br>
	<br>
	<button onclick="sendToMonitor()">Monitor Stream</button>
	<br><br>
	<div id="message" style="color:red"></div>
	
	</center>
</div>
</body>
</html>