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 POSIX qw(strftime); |
22 |
|
|
23 |
our $title; |
our $title; |
24 |
|
|
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=store href=$store_url >store</a> |
<a target=store href=$store_url >MongoDB</a> |
81 |
<a target=store href=/store/query >query</a> |
<a target=store href=/store/latest >latest</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> |
270 |
| |
| |
271 |
; |
; |
272 |
|
|
273 |
} elsif ( $path =~ m{^/store/query} ) { |
} elsif ( $path =~ m{^/store/latest} ) { |
274 |
print $client ok |
print $client ok |
275 |
, qq| |
, qq| |
276 |
<style type=text/css> |
<style type=text/css> |
299 |
delete( $o->{_id} ); |
delete( $o->{_id} ); |
300 |
|
|
301 |
if ( ! @cols ) { |
if ( ! @cols ) { |
302 |
@cols = keys %$p; |
#@cols = keys %$p; |
303 |
|
@cols = qw( time name ); |
304 |
print $client qq|<tr><th>| |
print $client qq|<tr><th>| |
305 |
, join(qq|</th><th>|, @cols) |
, join(qq|</th><th>|, @cols) |
306 |
, qq|</th><th></th></tr>| |
, qq|</th><th></th></tr>| |
308 |
} |
} |
309 |
|
|
310 |
# XXX sigh, dump dies if we don't do this |
# XXX sigh, dump dies if we don't do this |
311 |
delete $o->{$_} foreach ( grep { ! defined $o->{$_} } keys %$o ); |
# delete $o->{$_} foreach ( grep { ! defined $o->{$_} } keys %$o ); |
312 |
|
|
313 |
print $client qq|<tr$s1><td>| |
print $client qq|<tr$s1>| |
314 |
, join(qq|</td><td>|, map { $p->{$_} } @cols ) |
, strftime( qq|<td title="%Y-%m-%d">%H:%M:%S</td>|, localtime($p->{time}) ) |
315 |
, qq|</td><td><pre>| |
, map { qq|<td>$_<td>| } ( $p->{name} , html::pre_dump($o) ) |
316 |
, dump( $o ) |
, qq|</tr>\n| |
|
, qq|</pre></td></tr>\n| |
|
317 |
; |
; |
318 |
( $s1, $s2 ) = ( $s2, $s1 ); |
( $s1, $s2 ) = ( $s2, $s1 ); |
319 |
}); |
}); |