mirror of
https://github.com/sileht/bird-lg.git
synced 2024-12-22 12:34:42 +01:00
120 lines
3.1 KiB
HTML
120 lines
3.1 KiB
HTML
<!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() {
|
|
|
|
$("#typ option[value={{typ}}]").attr("selected", "selected")
|
|
$("#host option[value='{{host}}']").attr("selected", "selected")
|
|
$("#host").change()
|
|
|
|
$("#typ").change(function(){
|
|
$("#name").hide()
|
|
$("#prefix").hide()
|
|
$("#submit").hide()
|
|
switch ($("#typ").val())
|
|
{
|
|
case "summary":
|
|
if ($("#typ").val() != "{{typ}}")
|
|
$("#submit").click()
|
|
break;
|
|
case "detail":
|
|
$("#name").show()
|
|
$("#submit").show()
|
|
break;
|
|
case "prefix":
|
|
$("#submit").show()
|
|
$("#prefix").show()
|
|
if ($("#prefix").val()) {
|
|
$("#submit").click()
|
|
}
|
|
break;
|
|
case "prefix_detail":
|
|
$("#submit").show()
|
|
$("#prefix").show()
|
|
if ($("#prefix").val()) {
|
|
$("#submit").click()
|
|
}
|
|
break;
|
|
}
|
|
|
|
});
|
|
$("#typ").change()
|
|
$("#submit").click( function(){
|
|
switch ($("#typ").val())
|
|
{
|
|
case "summary":
|
|
document.location = "/summary/" + $("#host").val() ;
|
|
break;
|
|
case "detail":
|
|
document.location = "/detail/" + $("#host").val() + "/" + $("#name").val() ;
|
|
break;
|
|
case "prefix":
|
|
document.location = "/prefix/" + $("#host").val() + "/" + $("#prefix").val() ;
|
|
break;
|
|
case "prefix_detail":
|
|
document.location = "/prefix_detail/" + $("#host").val() + "/" + $("#prefix").val() ;
|
|
break;
|
|
}
|
|
});
|
|
|
|
keypress_handler = function(e) {
|
|
if (e.which == 13) {
|
|
$("#submit").click()
|
|
}
|
|
};
|
|
$("#prefix").keypress(keypress_handler)
|
|
$("#name").keypress(keypress_handler)
|
|
|
|
$("#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()
|
|
}
|
|
case "prefix_detail":
|
|
if ($("#prefix").val()) {
|
|
$("#submit").click()
|
|
}
|
|
break;
|
|
}
|
|
});
|
|
if (document.location.pathname == "/"){
|
|
$("#submit").click()
|
|
}
|
|
|
|
});
|
|
</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>
|
|
<option value="h3/ipv4">h3 (ipv4)</option>
|
|
<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>
|
|
<option value="prefix_detail">prefix detail</option>
|
|
</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>
|