24 |
<div style="font-size: 80%; color: #888"> |
<div style="font-size: 80%; color: #888"> |
25 |
<a href=/>home</a> |
<a href=/>home</a> |
26 |
<a href=/server>server</a> |
<a href=/server>server</a> |
27 |
|
<a href=/ip>ip</a> |
28 |
<a href=/client>client</a> |
<a href=/client>client</a> |
29 |
</div> |
</div> |
30 |
|
|
50 |
use kvm; |
use kvm; |
51 |
use browser; |
use browser; |
52 |
use network; |
use network; |
53 |
|
use ip; |
54 |
|
use wireshark; |
55 |
|
|
56 |
use CouchDB; |
use CouchDB; |
57 |
|
|
139 |
if ( -e $proc ) { |
if ( -e $proc ) { |
140 |
$html .= qq|<a href=/start_stop/$name>$pid</a>|; |
$html .= qq|<a href=/start_stop/$name>$pid</a>|; |
141 |
if ( $debug ) { |
if ( $debug ) { |
142 |
$html .= qq| <a name=$pid href=#proc-$pid>?</a>|; |
$html .= qq| <a name=$pid href=#proc-$pid>?</a>| if $name->can('start'); |
143 |
|
|
144 |
$debug_proc |
$debug_proc |
145 |
.= qq|<a name=proc-$pid href=#$pid>$proc</a><pre style="font-size: 10%">| |
.= qq|<a name=proc-$pid href=#$pid>$proc</a><pre style="font-size: 10%">| |
148 |
; |
; |
149 |
} |
} |
150 |
|
|
151 |
if ( $name->can('start_fork') ) { |
if ( $name->can('fork_if_active') ) { |
152 |
$html .= qq| <a href=/start_stop/kvm/$_>$_</a>| foreach $name->start_fork; |
$html .= qq| <a href=/start_stop/$name/$_>$_</a>| foreach $name->fork_if_active; |
153 |
} |
} |
154 |
|
|
155 |
if ( $name->can('actions') ) { |
if ( $name->can('actions') ) { |
156 |
$html .= qq| <a href=/action/kvm/$_>$_</a>| foreach $name->actions; |
$html .= qq| <a href=/action/$name/$_>$_</a>| foreach $name->actions; |
157 |
} |
} |
158 |
} else { |
} else { |
159 |
$html .= qq|<a href=/start_stop/$name>restart</a> $pid exited|; |
$html .= qq|<a href=/start_stop/$name>restart</a> $pid exited| if $name->can('start'); |
160 |
|
if ( $name->can('fork_actions') ) { |
161 |
|
$html .= qq| <a href=/start_stop/$name/$_>$_</a>| foreach $name->fork_actions; |
162 |
|
} |
163 |
} |
} |
164 |
|
|
165 |
push @rows, ( $name => $html ); |
push @rows, ( $name => $html ); |
272 |
) |
) |
273 |
; |
; |
274 |
} |
} |
275 |
|
} elsif ( $path =~ m{^/ip/?(\w+)?} ) { |
276 |
|
print $client ok |
277 |
|
, join("\n", map { qq|<a href=/ip/$_>$_</a>| } ( qw/link addr route neigh ntable tunnel maddr mroute xfrm/ )) |
278 |
|
, ip::html( $1 ) |
279 |
|
; |
280 |
} elsif ( $path =~ m{^/our/(\w+)/(\S+)} ) { |
} elsif ( $path =~ m{^/our/(\w+)/(\S+)} ) { |
281 |
eval 'our $' . $1 . ' = ' . $2; |
eval 'our $' . $1 . ' = ' . $2; |
282 |
warn $@ if $@; |
warn $@ if $@; |