<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<title>{appname} - Ramona administation console</title>
	<link href="/static/bootstrap/css/bootstrap.min.css" rel="stylesheet">
	<link rel="shortcut icon" href="/static/img/favicon.ico" />
</head>
<body>
	<div class="container">
		<h1>{appname}</h1><p class="lead">Ramona web administration console</p>
		{logmsg}
		<p>
		  <a href="/" id="refreshButton" class="btn btn-large btn-primary">Refresh</a>
		  <a href="/?action=start" class="btn btn-large btn-success">Start all</a>
		  <a href="/?action=stop" class="btn btn-large btn-danger">Stop all</a>
		  <a href="/?action=restart" class="btn btn-large btn-warning">Restart all</a>
		  <a href="/?action=start&amp;force=1" class="btn btn-large btn-inverse">Start all (force)</a>
		  <img src="/static/img/ajax-loader.gif" style="display: none" id="loader" alt="Loading..." />
		</p>		
		{statuses}
		<form id="raform" style="display: none">
		  <label class="checkbox">
		    <input type="checkbox" checked="checked" id="refreshAutomatically"> Refresh automatically
		  </label>
		  </form>
	</div>

	<script src="/static/jquery/jquery-1.8.1.min.js"></script>
	<script src="/static/bootstrap/js/bootstrap.min.js"></script>
	<script type="text/javascript">
	jQuery.ajaxSetup({{
	  beforeSend: function() {{
	     $('#loader').show();
	  }},
	  complete: function(){{
	     $('#loader').hide();
	  }},
	  success: function() {{}}
	}});
	
	function refreshStatuses() {{
		$.get('/ajax/statusTable', function(data) {{
		  $('#statusTable').html(data);
		}});
	}}
	
	setInterval(function() {{
		if($("#refreshAutomatically").is(":checked")) {{
			refreshStatuses();
		}}
	}}, 5000);
	
	
	$(document).ready(function() {{
	  $("#refreshButton").click(function(event) {{
		event.preventDefault();
		refreshStatuses();
	  }});
	  $("#raform").show();
		
	}});
	</script>
	
</body>
</html>