--- lib/PXElator/httpd.pm 2009/08/30 11:20:18 363 +++ lib/PXElator/httpd.pm 2009/08/30 15:54:30 379 @@ -19,8 +19,25 @@ use IO::Socket::INET; use Regexp::Common qw/net/; -sub menu {qq{ +our $title; +sub html_start { +qq{ + + +$title + + +}} + +sub html_end { +qq{ + + +}} + +sub menu { +qq{
home server @@ -109,7 +126,7 @@ } sub ok { - qq|HTTP/1.0 200 OK\r\nContent-Type: text/html\r\nConnection: close\r\n\r\n| . menu() + qq|HTTP/1.0 200 OK\r\nContent-Type: text/html\r\nConnection: close\r\n\r\n| . html_start() . menu() } sub redirect { @@ -125,6 +142,8 @@ CouchDB::audit( 'request', { path => $path, param => $param, peerhost => $client->peerhost } ); + $title = $path; + if ( my $found = static( $client,$path ) ) { warn "static $found" if $debug; } elsif ( $path eq '/' ) { @@ -211,6 +230,7 @@ ; } elsif ( $path =~ m!^/client(?:/$RE{net}{IPv4}{-keep})?! ) { my $ip = $1; + $title = $ip; if ( $param->{action} eq 'remove' ) { client::remove( $param->{change_ip} ); @@ -249,7 +269,10 @@ my $nmap = qq|nmap|; my @table = ( - 'ping' => ping::host($ip) ? qq|up $nmap| : qq|down wol $nmap|, + 'ping' => ping::host($ip) + ? qq|up $nmap| + : qq|down wol $nmap| + , 'ip' => qq|