--- lib/PXElator/html.pm 2009/08/27 14:31:49 307 +++ lib/PXElator/html.pm 2009/08/30 15:54:02 378 @@ -1,6 +1,7 @@ package html; use Data::Dump qw/dump/; +use amt; sub table { my $cols = shift; @@ -45,6 +46,7 @@ sub select { my $name = shift; my $selected_option = shift; + unshift @_, '' unless $selected_option; return join("\n" , qq|| ) + } else { + if ( $name eq 'amt' ) { + $html = qq|$ENV{AMT_HOST}|; + + $html .= qq| power: | + . ( amt::power_on($ip) + ? qq|on| + : qq|off| + ) if $format ne 'inline'; + } elsif ( $name eq 'ssh' ) { + $html =~ s{\s(\S{16}).+(\S{16})\s}{ $1..$2 }; + chomp($html); + } + $html = qq|
$html
| + unless + $html =~ s{\b(\S+)\t(\S+)\t(\S+)\b}{$3 }gs; + + if ( $format =~ /edit|table/ ) { + ( $name, $html ); + } else { + qq|$name $html
| + } + } + } sort keys %$conf; + + $format eq 'inline' ? join("\n", @opts) : @opts; +} + warn "loaded"; 1;