bird-lg/templates/layout.html

120 lines
3.1 KiB
HTML
Raw Normal View History

2011-12-16 11:02:24 +01:00
<!doctype html>
<title>Tetaneutral.net looking glass</title>
<link rel=stylesheet type=text/css href="{{ url_for('static', filename='style.css') }}">
<script type="text/javascript" src="{{url_for('static', filename='jquery.js') }}"></script>
<script type="text/javascript">
$(function() {
2011-12-16 19:05:36 +01:00
$("#typ option[value={{typ}}]").attr("selected", "selected")
$("#host option[value='{{host}}']").attr("selected", "selected")
$("#host").change()
2011-12-16 11:02:24 +01:00
$("#typ").change(function(){
$("#name").hide()
$("#prefix").hide()
2011-12-16 19:05:36 +01:00
$("#submit").hide()
2011-12-16 11:02:24 +01:00
switch ($("#typ").val())
{
case "summary":
2011-12-16 19:05:36 +01:00
if ($("#typ").val() != "{{typ}}")
$("#submit").click()
2011-12-16 11:02:24 +01:00
break;
case "detail":
$("#name").show()
2011-12-16 19:05:36 +01:00
$("#submit").show()
2011-12-16 11:02:24 +01:00
break;
case "prefix":
2011-12-16 19:05:36 +01:00
$("#submit").show()
2011-12-16 11:02:24 +01:00
$("#prefix").show()
2011-12-16 19:05:36 +01:00
if ($("#prefix").val()) {
$("#submit").click()
}
2011-12-16 11:02:24 +01:00
break;
2011-12-18 12:32:00 +01:00
case "prefix_detail":
$("#submit").show()
$("#prefix").show()
if ($("#prefix").val()) {
$("#submit").click()
}
break;
2011-12-16 11:02:24 +01:00
}
});
2011-12-16 19:05:36 +01:00
$("#typ").change()
2011-12-16 11:02:24 +01:00
$("#submit").click( function(){
switch ($("#typ").val())
{
case "summary":
2012-01-16 14:13:49 +01:00
document.location = "/summary/" + $("#host").val() ;
2011-12-16 11:02:24 +01:00
break;
case "detail":
2012-01-16 14:13:49 +01:00
document.location = "/detail/" + $("#host").val() + "/" + $("#name").val() ;
2011-12-16 11:02:24 +01:00
break;
case "prefix":
2012-01-16 14:13:49 +01:00
document.location = "/prefix/" + $("#host").val() + "/" + $("#prefix").val() ;
2011-12-16 11:02:24 +01:00
break;
2011-12-18 12:32:00 +01:00
case "prefix_detail":
2012-01-16 14:13:49 +01:00
document.location = "/prefix_detail/" + $("#host").val() + "/" + $("#prefix").val() ;
2011-12-18 12:32:00 +01:00
break;
2011-12-16 11:02:24 +01:00
}
});
2011-12-16 12:59:00 +01:00
keypress_handler = function(e) {
if (e.which == 13) {
$("#submit").click()
}
};
$("#prefix").keypress(keypress_handler)
$("#name").keypress(keypress_handler)
2011-12-16 19:05:36 +01:00
$("#host").change(function (){
switch ($("#typ").val())
{
case "summary":
$("#submit").click()
break;
case "detail":
if ($("#name").val()) {
$("#submit").click()
}
break;
case "prefix":
if ($("#prefix").val()) {
$("#submit").click()
}
2011-12-18 12:32:00 +01:00
case "prefix_detail":
if ($("#prefix").val()) {
$("#submit").click()
}
2011-12-16 19:05:36 +01:00
break;
}
});
2012-01-03 10:11:24 +01:00
if (document.location.pathname == "/"){
$("#submit").click()
}
2011-12-16 19:05:36 +01:00
2011-12-16 11:02:24 +01:00
});
</script>
<div id="page">
<h1>Tetaneutral.net Looking Glass</h1>
<form>
<select id="host">
<option value="gw/ipv4">gw (ipv4)</option>
<option value="gw/ipv6">gw (ipv6)</option>
2011-12-16 19:05:36 +01:00
<option value="h3/ipv4">h3 (ipv4)</option>
2011-12-16 11:02:24 +01:00
<option value="h3/ipv6">h3 (ipv6)</option>
</select>
<select id="typ">
<option value="summary">summary</option>
<option value="detail">detail</option>
<option value="prefix">prefix</option>
2011-12-18 12:32:00 +01:00
<option value="prefix_detail">prefix detail</option>
2011-12-16 11:02:24 +01:00
</select>
<input type="text" id="name" style="display:none" value="{{ name }}"></input>
<input type="text" id="prefix" style="display:none" value="{{ prefix }}"></input>
<input type="button" id="submit" value="submit"></input>
</form>
{% block body %}{% endblock %}
</div>