--- lib/PXElator/httpd.pm 2009/08/30 15:22:41 376
+++ 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{
+
+
+
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} );
@@ -275,7 +295,7 @@
}
}
- print $client qq|
amt info
|, amt::info( $ip );
+ print $client qq|
amt info
|, amt::info( $ip ) if $conf->{amt};
} else {
@@ -417,7 +437,7 @@
warn "500 $request";
}
- print $client menu() if $client->connected;
+ print $client menu() . html_end() if $client->connected;
}