/[Sack]/trunk/lib/Sack/Server.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 /trunk/lib/Sack/Server.pm

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

revision 237 by dpavlin, Tue Nov 24 00:55:29 2009 UTC revision 241 by dpavlin, Thu Nov 26 15:22:12 2009 UTC
# Line 19  use lib '/srv/Sack/lib'; Line 19  use lib '/srv/Sack/lib';
19  use Sack::Merge;  use Sack::Merge;
20  use Sack::Server::HTTP;  use Sack::Server::HTTP;
21  use Sack::Server::HTML;  use Sack::Server::HTML;
22    use Sack::Server::Gnuplot;
23    
24  my @cloud;  my @cloud;
25  my $cloud_path = $ENV{CLOUD} || "etc/cloud";  my $cloud_path = $ENV{CLOUD} || "etc/cloud";
# Line 139  while (1) { Line 140  while (1) {
140                                          print $send "HTTP/1.0 200 OK\r\nContent-Type: text/html\r\n\r\n";                                          print $send "HTTP/1.0 200 OK\r\nContent-Type: text/html\r\n\r\n";
141                                          Sack::Server::HTML::send_out( $send, Sack::Merge->out, $1, $param );                                          Sack::Server::HTML::send_out( $send, Sack::Merge->out, $1, $param );
142                                          return 1;                                          return 1;
143                                    } elsif ( $method =~ m{^/gnuplot} ) {
144                                            eval {
145                                                    my $path = Sack::Server::Gnuplot::date( Sack::Merge->out );
146                                                    if ( -e $path ) {
147                                                            print $send "HTTP/1.0 200 OK\r\nContent-Type: image/png\r\n\r\n";
148                                                            open(my $fh, '<', $path) || die $path;
149                                                            my $b;
150                                                            while ( read($fh, $b, 4096) ) {
151                                                                    print $send $b;
152                                                            }
153                                                            return 1;
154                                                    }
155                                            };
156                                            warn "ERROR: $@" if $@;
157                                  }                                  }
158    
159                                  print $send "HTTP/1.0 200 OK\r\nContent-Type: text/html\r\n\r\n";                                  print $send "HTTP/1.0 200 OK\r\nContent-Type: text/html\r\n\r\n";
# Line 211  while (1) { Line 226  while (1) {
226                                          ;                                          ;
227    
228                                  my $out = Sack::Merge->out;                                      my $out = Sack::Merge->out;    
229                                  print $send qq|<h1>Results</h1><ul>|                                  if ( my $li = join("\n", map { qq|<li><a href="/out/$_" target="$_">$_</a>| } keys %$out ) ) {
230                                          , join("\n", map { qq|<li><a href="/out/$_" target="$_">$_</a>| } keys %$out )                                          print $send qq|<h1>Results</h1><ul>$li</ul><img src="/gnuplot/">\n|;
231                                          , qq|</ul>|                                  }
                                         ;  
232    
233                                  print $send qq|<h1>Nodes</h1>                                  print $send qq|<h1>Nodes</h1>
234                                  |, join("\n", map {                                  |, join("\n", map {

Legend:
Removed from v.237  
changed lines
  Added in v.241

  ViewVC Help
Powered by ViewVC 1.1.26