bind to all IP addresses and nost just $server::ip (insecure, but convinient
[pxelator] / lib / PXElator / httpd.pm
index 949e42f..c01a1f4 100644 (file)
@@ -39,12 +39,13 @@ qq{
 sub menu {
 qq{
 <div style="font-size: 80%; color: #888">
-<a href=/>home</a>
-<a href=/server>server</a>
-<a href=/brctl>brctl</a>
-<a href=/ip>ip</a>
-<a href=/nmap>nmap</a>
-<a href=/client>client</a>
+<a href=/ target=/>home</a>
+<a href=/server target=server>server</a>
+<a href=/brctl target=brctl>brctl</a>
+<a href=/ip target=ip>ip</a>
+<a href=/nmap target=nmap>nmap</a>
+<a href=/client target=client>client</a>
+<a href=http://$server::ip:5984/_utils/ target=couchdb>couchdb</a>
 </div>
 
 }}
@@ -218,12 +219,12 @@ warn "XXX pids = ", dump( $daemons::pids );
                }
 
                my $kvm = kvm::next_nr;
-               $kvm = qq|<a href=/start_stop/kvm?nr=$kvm>new kvm $kvm</a>|;
+               $kvm = qq|<div><a href=/start_stop/kvm?nr=$kvm>create new kvm $kvm</a></div>|;
 
                print $client ok
                        , html::table( 2, @rows )
-                       , $kvm
                        , $below_table
+                       , $kvm
                        , html::tabs( log::mac_changes )
                        , $debug_proc
                        ;
@@ -355,8 +356,10 @@ warn "XXX pids = ", dump( $daemons::pids );
                                                        . '"'
                                                        if $ping;
                                                $style ||= '';
+                                               my $ip_text = qq|<tt>$ip</tt>|;
+                                               $ip_text = qq|<tt><b>$ip</b></tt>| if ip::in_dhcp_range($ip);
                                                (
-                                                       qq|<a $style name=$ip target=$ip href=/client/$ip>$ip</a>|
+                                                       qq|<a $style name=$ip target=$ip href=/client/$ip>$ip_text</a>|
                                                        , format::mac( $mac => 'html' )
                                                        , $arp->{$mac}
                                                        , delete $conf->{hostname}
@@ -462,7 +465,7 @@ sub start {
 
        my $server = IO::Socket::INET->new(
                        Proto     => 'tcp',
-                       LocalAddr => $server::ip,
+#                      LocalAddr => $server::ip,
                        LocalPort => $httpd::port,
                        Listen    => SOMAXCONN,
                        Reuse     => 1