/[pxelator]/lib/PXElator/html.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/html.pm

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

revision 362 by dpavlin, Sun Aug 30 10:38:13 2009 UTC revision 386 by dpavlin, Mon Aug 31 15:14:43 2009 UTC
# Line 1  Line 1 
1  package html;  package html;
2    
3  use Data::Dump qw/dump/;  use Data::Dump qw/dump/;
4    use amt;
5    
6  sub table {  sub table {
7          my $cols = shift;          my $cols = shift;
# Line 83  sub conf { Line 84  sub conf {
84                          ( $name, qq|<input name=$name value="$html" size=$size>| )                          ( $name, qq|<input name=$name value="$html" size=$size>| )
85                  } else {                  } else {
86                          if ( $name eq 'amt' ) {                          if ( $name eq 'amt' ) {
87                                  $html = qq|<a title="$html" href=http://$ip:16992/logon.htm>logon</a>|;                                  my $amt_ip = amt::ip($ip,$html);
88                                    $html = qq|<a title="$html" href=http://$amt_ip:16992/logon.htm target=$amt_ip>$amt_ip</a>|;
89    
90                                    if ( $format ne 'inline' ) {
91                                            my $power = amt::power_on($ip);
92                                            $html .= qq| power: |
93                                            . ( $power
94                                                    ? qq|<a href=/amt/PowerDown/$ip title="turn off">on</a>|
95                                                    : qq|<a href=/amt/PowerUp/$ip   title="turn on" >off</a>|
96                                            );
97                                            client::conf( $ip, 'power' => $power ? 'on' : 'off' );
98                                    }
99                          } elsif ( $name eq 'ssh' ) {                          } elsif ( $name eq 'ssh' ) {
100                                  $html =~ s{\s(\S{16}).+(\S{16})\s}{ $1..$2 };                                  $html =~ s{\s(\S{16}).+(\S{16})\s}{ $1..$2 };
101                                  chomp($html);                                  chomp($html);
# Line 98  sub conf { Line 110  sub conf {
110                                  qq|<em>$name</em> $html<br>|                                  qq|<em>$name</em> $html<br>|
111                          }                          }
112                  }                  }
113          } sort keys %$conf;          } grep { length($conf->{$_}) > 0 } sort keys %$conf;
114    
115          $format eq 'inline' ? join("\n", @opts) : @opts;          $format eq 'inline' ? join("\n", @opts) : @opts;
116  }  }

Legend:
Removed from v.362  
changed lines
  Added in v.386

  ViewVC Help
Powered by ViewVC 1.1.26