/[pxelator]/lib/PXElator/httpd.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /lib/PXElator/httpd.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 486 by dpavlin, Sat Jan 23 19:45:11 2010 UTC revision 487 by dpavlin, Sat Jan 23 20:47:17 2010 UTC
# Line 18  use File::Slurp; Line 18  use File::Slurp;
18  #use JSON;  #use JSON;
19  use IO::Socket::INET;  use IO::Socket::INET;
20  use Regexp::Common qw/net/;  use Regexp::Common qw/net/;
21    use YAML;
22    
23  our $title;  our $title;
24    
# Line 66  use store; Line 67  use store;
67    
68    
69  sub menu {  sub menu {
70          my $couch_url = $url;          my $store_url = $url;
71          $couch_url =~ s{:\d+.+}{:5984/_utils/};          $store_url =~ s{:\d+.+}{:28017};
72  qq{  qq{
73  <div style="font-size: 80%; color: #888">  <div style="font-size: 80%; color: #888">
74  <a target=pids href=/ >home</a>  <a target=pids href=/ >home</a>
# Line 76  qq{ Line 77  qq{
77  <a target=server href=/brctl >brctl</a>  <a target=server href=/brctl >brctl</a>
78  <a target=server href=/ip >ip</a>  <a target=server href=/ip >ip</a>
79  |  |
80  <a target=couch href=$couch_url >couchdb</a>  <a target=store href=$store_url >store</a>
81    <a target=store href=/store/query >query</a>
82  |  |
83  <a target=client href=/nmap >nmap</a>  <a target=client href=/nmap >nmap</a>
84  <a target=client href=/client >client</a>  <a target=client href=/client >client</a>
# Line 268  warn "XXX pids = ", dump( $daemons::pids Line 270  warn "XXX pids = ", dump( $daemons::pids
270                          |                          |
271                          ;                          ;
272    
273            } elsif ( $path =~ m{^/store/query} ) {
274                    print $client ok
275                            , qq|<table>|
276                    ;
277                    store::query( sub {
278                            my $o = shift;
279                            my $p = delete( $o->{package} );
280                            delete( $o->{_id} );
281                            # XXX sigh, dump dies if we don't do this
282                            my $tmp = delete( $o->{param} );
283                            $o->{param} = $tmp if defined $tmp;
284                            print $client qq|<tr><td>|, join(qq|</td><td>|, map { $p->{$_} } keys %$p ), qq|</td><td><pre>|, dump( $o ), qq|</pre></td></tr>\n|;
285                    });
286                    print $client qq|</table>|;
287    
288          } elsif ( $path =~ m!^/client(?:/$RE{net}{IPv4}{-keep})?! ) {          } elsif ( $path =~ m!^/client(?:/$RE{net}{IPv4}{-keep})?! ) {
289                  my $ip = $1;                  my $ip = $1;
290                  $title = $ip if $ip;                  $title = $ip if $ip;

Legend:
Removed from v.486  
changed lines
  Added in v.487

  ViewVC Help
Powered by ViewVC 1.1.26