Merge branch 'MakeLinksFQ' into develop

This commit is contained in:
Conrad Lara - KG6JEI 2015-01-25 21:08:16 -08:00
commit dc24e1d05d
2 changed files with 23 additions and 4 deletions

View File

@ -128,16 +128,23 @@ foreach(`cat /var/run/services_olsr 2>/dev/null`)
chomp;
($url, $junk, $name) = split /\|/, $_;
next unless defined $name;
($host, $port) = $url =~ /^\w+:\/\/([\w\-\.]+):(\d+)/;
($protocol, $host, $port, $path) = $url =~ /^(\w+):\/\/([\w\-\.]+):(\d+)\/(.*)/;
next unless defined $path;
($name, $originator) = split /\#/, $name;
$name =~ s/\s+$//;
if ( $host !~ /\./ )
{
$host="${host}.local.mesh";
}
#$host = $originator eq " my own service" ? $node : $hosts{$originator}{name};
# attempt to work around olsr never forgetting defunct services
# assume that the first entry in the file by this name is the most recent, ignore the rest
next if $services{$host}{$name};
$services{$host}{$name} = $port ? "<a href='$url'>$name</a>" : $name;
$services{$host}{$name} = $port ? "<a href='${protocol}://${host}:${port}/${path}'>$name</a>" : $name;
}
# load the node history
@ -221,7 +228,7 @@ if(keys %localhosts)
foreach $ip (keys %localhosts)
{
$host = $localhosts{$ip}{name};
$host = $localhosts{$ip}{name} . ".local.mesh";
$tactical = $localhosts{$ip}{tactical} ? " / " . $localhosts{$ip}{tactical} : "";
$rows{$host} = sprintf "<tr><td valign=top><nobr>%s</nobr></td><td colspan=3>&nbsp;</td><td>\n", $host . $tactical;
foreach(sort keys %{$services{$host}})
@ -266,6 +273,11 @@ foreach $ip (keys %hosts)
$tactical = $hosts{$ip}{tactical} ? " / " . $hosts{$ip}{tactical} : "";
$etx = "unknown";
if ( $host !~ /\./ )
{
$host="${host}.local.mesh";
}
if($routes{$ip}) # get the etx directly
{
$etx = sprintf "%.2f", $routes{$ip}{etx};
@ -333,7 +345,14 @@ if(keys %links)
{
$host = $hosts{$ip}{name} ? $hosts{$ip}{name} : $ip;
$tactical = $hosts{$ip}{tactical} ? " / " . $hosts{$ip}{tactical} : "";
if ( $host !~ /\./ )
{
$host="${host}.local.mesh";
}
$rows{$host} = sprintf "<tr><td valign=top><nobr><a href='http://%s:8080/'>%s</a>", $host, $host . $tactical;
if($midnum = $hosts{$ip}{mid}) # show mid interfaces
{
$midnum = ($midnum > 1) ? "*$midnum" : "";

View File

@ -49,7 +49,7 @@ if($config eq "mesh")
print "&nbsp;&nbsp;&nbsp;";
print "<button type=button onClick='window.location=\"mesh\"' title='See what is on the mesh'>Mesh Status</button>\n";
print "&nbsp;&nbsp;&nbsp;";
print "<button type=button onClick='window.location=\"http://$node:1978/\"' title='See the OLSR routing details'";
print "<button type=button onClick='window.location=\"http://${node}.local.mesh:1978/\"' title='See the OLSR routing details'";
#print " disabled" unless -f "/var/run/hosts_olsr";
print ">OLSR Status</button>\n";
}