From a2944c7e3086f0cecd60775131e42698c54f81c8 Mon Sep 17 00:00:00 2001 From: Conrad Lara - KG6JEI Date: Fri, 23 Jan 2015 18:25:25 -0800 Subject: [PATCH 1/2] Configure status page to present FQDN's as long as the link does not contain a period. --- files/www/cgi-bin/mesh | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/files/www/cgi-bin/mesh b/files/www/cgi-bin/mesh index 4fbcc0cd..13f7224e 100755 --- a/files/www/cgi-bin/mesh +++ b/files/www/cgi-bin/mesh @@ -127,16 +127,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 ? "$name" : $name; + $services{$host}{$name} = $port ? "$name" : $name; } # load the node history @@ -220,7 +227,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 "%s \n", $host . $tactical; foreach(sort keys %{$services{$host}}) @@ -265,6 +272,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}; @@ -332,7 +344,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 "%s", $host, $host . $tactical; + if($midnum = $hosts{$ip}{mid}) # show mid interfaces { $midnum = ($midnum > 1) ? "*$midnum" : ""; From 7c22853a1715452fb73648db281b1c01a889183b Mon Sep 17 00:00:00 2001 From: Conrad Lara - KG6JEI Date: Fri, 23 Jan 2015 18:30:39 -0800 Subject: [PATCH 2/2] Change OLSR Status button to use node FQDN --- files/www/cgi-bin/status | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/www/cgi-bin/status b/files/www/cgi-bin/status index 27853b23..671093a9 100755 --- a/files/www/cgi-bin/status +++ b/files/www/cgi-bin/status @@ -49,7 +49,7 @@ if($config eq "mesh") print "   "; print "\n"; print "   "; - print "\n"; }