Commit 316ce233 authored by Olav Kvittem's avatar Olav Kvittem
Browse files

show to name in traceroute

parent 14a64da0
......@@ -646,7 +646,7 @@ function link_popup(link){
to_adr = name_to_ip[link.to];
var url = 'tracetree.html?topo=/' + parms.net + '/mp/' + link.from + '/' + dato
+ '/trace/' + to_adr + '1.json';
+ '/trace/' + to_adr + '1.json' + '&to=' + link.to;
html += '\n<p><button class=knapp><a title="See the routes graph and stats in this period" target="_blank" href="' + url + '">See routes' + '</a></button>' + "\n";
// var knapp=" <button class=knapp onclick=document.open('javascript:document.documentElement.innerHTML=\"" + encodeURI(gap_list(link.from, link.to)) + "\"');>Gap list</button>";
......@@ -1620,7 +1620,7 @@ function get_connections(){
$.getJSON( url,
function(resp){
if (resp.hits.total.value > 0){
if (resp.hits && resp.hits.total.value > 0){
var nrecs=resp.hits.total.value.toString();
if ( etype === "gapsum" || etype === "routesum" ){
......
......@@ -99,7 +99,7 @@ table.sortable thead {
<h1>Traceroute charts <span id=tracepath></span></h1>
<button onclick="navigate('previous')">Previous</button>
<button onclick="navigate('next')">Next</button>
<button onclick="navigate('up')">Up</button>
<!-- <button onclick="navigate('up')">Up</button> -->
<button id="simple" onclick="plot_tree_json(collapse_nodes(tr_data));">Simple</button>
<button id="full" onclick="plot_tree_json(tr_data);">Full</button>
<button id="stopp" onclick="tree.stopSimulation();">Stop</button>
......@@ -171,7 +171,8 @@ varies port numbers and by hit different flows each time and causes the various
<div id="error"></div>
<script>
var tree;
var tree;
var urlParams;
function fetch_and_plot(tpath) {
// Get trace data from <pre> element of input path
......@@ -769,9 +770,12 @@ function get_path(url,type){
// var adre=/\/([^\/]*)\/([^\/]*)\/trace\/([^\/]*).\.json$/;
var fre=/\/([^\/]*)\/([^\/]*)\/trace\//;
var from=fre.exec(path[1]);
var adre=/\/trace\/([^\/]*).\.json$/;
var adre=/\/trace\/([^\/]*).\.json[^&]*/;
var adr=adre.exec(path[1]);
return 'from ' + from[1] + ' to ' + adr[1] + ' on ' + from[2];
let to=adr[1];
if ( urlParams['to'] )
to=urlParams['to'];
return 'from ' + from[1] + ' to ' + to + ' on ' + from[2];
}
}
......@@ -807,15 +811,7 @@ function navigate(direction){
//--------------------------------------------------------------------------------
$(document).ready( function(){
$(function(){
$( "#tabs" ).tabs();
} );
/* get url parameteres*/
document.getElementById("tracepath").innerHTML=get_path(document.URL, 'Description');
(window.onpopstate = function () {
// (window.onpopstate = function () {
var match,
pl = /\+/g, // Regex for replacing addition symbol with a space
search = /([^&=]+)=?([^&]*)/g,
......@@ -832,7 +828,16 @@ $(document).ready( function(){
if ( urlParams['intern'])
; // plot_trace();
//$( "#tabs" ).tabs();
})();
// })();
$(function(){
$( "#tabs" ).tabs();
} );
/* get url parameteres*/
document.getElementById("tracepath").innerHTML=get_path(document.URL, 'Description');
});
</script>
......
Supports Markdown
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