Commit 9b2115e2 authored by Olav Kvittem's avatar Olav Kvittem

Recognize and allow ipv6 addresses

parent e3e96084
......@@ -123,7 +123,7 @@ function make_select( elm, url){
html+= 'action="javascript:traceroute( $(\'#tr_host\').val(), $(\'#tr_times\').val(), $(\'#tr_size\').val(), $(\'#tr_interval\').val() )">';
html+='<table><tr><td>';
html+='<input type="submit" value="Trace route" class="btn btn-primary btn-lg" /> to ';
// html+='<input id=tr_host value="" placeholder="my host" title="Automatisk utfylling av mleplenavn"></input>';
html+='<input id=tr_host value="" placeholder="my host" title="Automatisk utfylling av mleplenavn"></input>';
var html2=' <td> &nbsp;';
html2='<input id=tr_times value=3 style="width:3em;text-align:right"> times</input>';
html2+=', using <input id=tr_size value=64 style="width:3em;text-align:right"> bytes packets</input>';
......@@ -132,13 +132,14 @@ function make_select( elm, url){
html2+='</form>';
// $(elm).html(html);
html+= '<select name="tr_opt" id="tr_opt" style=width:15em>';
html+= '<option value="">My-own-host</option>';
// html+= '<select name="tr_opt" id="tr_opt" style=width:15em>';
// html+= '<option value="">My-own-host</option>';
var items=["caida.org", "uninett.no", "nordu.net"];
for (var item in items){
/* for (var item in items){
html+= '<option value="' + items[item] + '">' + items[item] + '</option>';
}
*/
var request=$.ajax( {url: url, type: 'GET', dataType: 'json', crossDomain: true } );
request.done( function( mps){
......@@ -155,13 +156,14 @@ function make_select( elm, url){
});
$.each(mps, function(mp) {
items.push( mps[mp].navn);
html+='<option value="' + mps[mp].navn + '">' + mps[mp].navn + '</option>';
// html+='<option value="' + mps[mp].navn + '">' + mps[mp].navn + '</option>';
// + mps[mp].nettinstallasjon + ': '
});
html+='</select></form>';
// html+='</select>'
html+='</form>';
$(elm).html(html+html2);
// $( "#tr_host" ).autocomplete({ source: items });
$("#tr_opt").select2();
$( "#tr_host" ).autocomplete({ source: items });
// $("#tr_opt").select2();
});
request.fail( function( jqXHR, status, error){
console.log('Listing beacons faild from '+ url + ' : ' + status + ', ' + error);
......
......@@ -31,7 +31,7 @@ if ( $q->http('HTTP_X_TOKEN') ne "virre-virre-vapp"){
my $nobs = $q->param('nobs'); # && ( $nobs =~ m/^[0-9]+$/ );
my $psize = $q->param('psize'); # && ( psize =~ m/^[0-9]+$/ );
my $interval = $q->param('interval'); # && ( psize =~ m/^[0-9]+$/ );
$host =~ s/[^a-zA-Z0-9\.\/\-_]+/_/g; # protect
$host =~ s/[^a-zA-Z0-9\.\/\-_\:]+/_/g; # protect
$nobs =~ s/[^0-9]+/_/g;
$psize =~ s/[^0-9]+/_/g;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment