Commit 7016e0fc authored by Olav Kvittem's avatar Olav Kvittem

ipv6 address recognized, port and parallels

parent 9b2115e2
......@@ -114,71 +114,6 @@ function iperf(host, nobs, interval){
//------------------------------------------------------------------------------
//
function make_select_ny( elm, url){
// var html='<button id=traceroute onclick="traceroute( $(\'#tr_host\').val(), $(\'#tr_times\').val(), $(\'#tr_size\').val(), $(\'#tr_interval\').val() )">Trace route</button> to ';
// commented code is to produce a select_menu rather than jquery ui autocomplete
// html+= '<form name="traceroute_form" id="traceroute_form">';
// html+= '<select name="tr_opt" id="tr_opt">';
// html+= '<option value="">My host</option>';
var html='<form name="traceroute_form" id="traceroute_form"';
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>';
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>';
html2+=', every <input id=tr_interval value=0.1 style="width:3em;text-align:right"> seconds.';
html2+='</table>';
html2+='</form>';
// $(elm).html(html);
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){
html+= '<option value="' + items[item] + '">' + items[item] + '</option>';
}
var request=$.ajax( {url: url, type: 'GET', dataType: 'json', crossDomain: true } );
request.done( function( mps){
// console.log(mps);
mps.sort( function(a, b) {
var textA = a.navn.toLowerCase();
var textB = b.navn.toLowerCase();
if (textA < textB)
return -1;
if (textA > textB)
return 1;
return 0;
});
$.each(mps, function(mp) {
items.push( mps[mp].navn);
html+='<option value="' + mps[mp].navn + '">' + mps[mp].navn + '</option>';
// + mps[mp].nettinstallasjon + ': '
});
html+='</select></form>';
$(elm).html(html+html2);
// $( "#tr_host" ).autocomplete({ source: items });
$("#tr_opt").select2();
});
request.fail( function( jqXHR, status, error){
console.log('Listing beacons faild from '+ url + ' : ' + status + ', ' + error);
});
/* var rq=$.JSONget(url, function(data){console.log(data)});
rq.fail( function( jqXHR, error){
console.log(error+ url);
});
*/
}
//--------------------------------------------------------------------------------
function make_select( elm, url){
// var html='<button id=iperf onclick="iperf( $(\'#tr_host\').val(), $(\'#tr_times\').val(), $(\'#tr_size\').val(), $(\'#tr_interval\').val() )">Trace route</button> to ';
......@@ -187,22 +122,15 @@ function make_select( elm, url){
// html+= '<select name="tr_opt" id="tr_opt">';
// html+= '<option value="">My host</option>';
var html='<form name="iperf_form" id="iperf_form"';
html+= 'action="javascript:iperf( $(\'#tr_host\').val(), $(\'#tr_times\').val(), $(\'#tr_interval\').val() )">';
html+='<table><tr><td>';
html+= 'action="javascript:iperf( $(\'#tr_host\').val(), $(\'#tr_times\').val(), $(\'#tr_interval\').val() )">';
html+='<input class="btn btn-primary btn-lg" type="submit" value="Test" class=button/> to ';
// html+='<input id=tr_host value="" placeholder="my host" title="Automatisk utfylling av mleplenavn"></input>';
html+='<span id=select-house></span>';
var html2=' <td> &nbsp;';
html2+=' for <input id=tr_times value=3 style="width:3em;text-align:right"> seconds</input>';
html+='<input id=tr_host value="" placeholder="my host" title="Automatisk utfylling av målepålenavn"></input>';
html+=' for <input id=tr_times value=3 style="width:3em;text-align:right"> seconds</input>';
// html+=', using <input id=tr_size value=64 style="width:3em;text-align:right"> bytes packets</input>';
html2+=', report every <input id=tr_interval value=1 style="width:3em;text-align:right"> seconds.';
html2+='</table>';
html2+='</form>';
$(elm).html(html+html2); // make sure something is shown
html+=', report every <input id=tr_interval value=1 style="width:3em;text-align:right"> seconds.';
html+='</form>';
$(elm).html(html);
html = '<select name="tr_opt" id="tr_opt" style=width:15em>';
html+= '<option value="">My-own-host</option>';
var items=[];
var request=$.ajax( {url: url, type: 'GET', dataType: 'json', crossDomain: true } );
request.done( function( mps){
......@@ -217,16 +145,14 @@ function make_select( elm, url){
return 1;
return 0;
});
$.each(mps, function(mp) {
$.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>';
// $(elm).html(html+'</select></form>');
$("#select-house").html(html);
// $( "#tr_host" ).autocomplete({ source: items });
$("#tr_opt").select2();
$( "#tr_host" ).autocomplete({ source: items });
});
request.fail( function( jqXHR, status, error){
console.log('Listing beacons faild from '+ url + ' : ' + status + ', ' + error);
......
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