[Bio] / FigWebServices / seed_ctl.cgi Repository:
ViewVC logotype

Diff of /FigWebServices/seed_ctl.cgi

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

revision 1.1, Thu Apr 1 20:59:35 2004 UTC revision 1.2, Mon Jun 14 22:05:38 2004 UTC
# Line 110  Line 110 
110  {  {
111      if ($action =~ /^delete_job_(\d+)/)      if ($action =~ /^delete_job_(\d+)/)
112      {      {
113          unlink("$job_dir/$1");          system("rm -r $job_dir/$1");
114          push(@html, $cgi->p("Removed job $1"));          push(@html, $cgi->p("Removed job $1"));
115      }      }
116      elsif ($action =~ /^kill_job_(\d+)/)      elsif ($action =~ /^kill_job_(\d+)/)
117      {      {
118          kill(1, -$1);          my $ret = kill(1, -$1);
119          push(@html, $cgi->p("Killed job $1"));          push(@html, $cgi->p("Killed job $1; return code is $ret"));
120      }      }
121  }  }
122    
# Line 190  Line 190 
190    
191  if (@jobs > 0)  if (@jobs > 0)
192  {  {
193      push(@html, $cgi->start_table({-border => 1}));      my @hdrs;
194        my $tbl = [];
195    
196      push(@html, $cgi->TR($cgi->th(["Process", "Status", "Description","Action"])));      @hdrs = ("Process", "Running", "Status", "Description", "Output", "Action");
197    
198      for my $job (@jobs)      for my $job (@jobs)
199      {      {
200          my($status, $but);          my($running, $status, $but, $output, $info);
201    
202          if (kill(0, $job) > 0)          if (kill(0, $job) > 0)
203          {          {
204              $status = "Running";              $running = "Running";
205              $but = $cgi->submit(-value => "Kill process", -name => "kill_job_$job");              $but = $cgi->submit(-value => "Kill process", -name => "kill_job_$job");
206          }          }
207          else          else
208          {          {
209              $status = "Dead";              $running = "Dead";
210              $but = $cgi->submit(-value => "Remove entry", -name => "delete_job_$job");              $but = $cgi->submit(-value => "Remove entry", -name => "delete_job_$job");
211          }          }
212    
213          push(@html, $cgi->start_TR());          $status = &FIG::file_read("$job_dir/$job/STATUS");
214          push(@html, $cgi->td($job));          $info = &FIG::file_read("$job_dir/$job/INFO");
215          push(@html, $cgi->td($status));          $output = &FIG::file_read("$job_dir/$job/OUTPUT");
   
         open my $fh, "<$job_dir/$job";  
         local $/;  
         my $job_status = <$fh>;  
         push(@html, $cgi->td($cgi->pre($job_status)));  
   
         push(@html, $cgi->td($but));  
         push(@html, $cgi->end_TR());  
         push(@html, "\n");  
216    
217            push(@$tbl, [$job, $running, $status, $info, "<pre>$output</pre>", $but]);
218      }      }
219      push(@html, $cgi->end_table());      push(@html, &HTML::make_table(\@hdrs, $tbl));
220  }  }
221  else  else
222  {  {

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3