]> git.sur5r.net Git - bacula/bacula/commitdiff
bacula-web: New features and improvments in jobs page
authorDavide Franco <bacula-dev@dflc.ch>
Tue, 21 Dec 2010 16:23:48 +0000 (17:23 +0100)
committerKern Sibbald <kern@sibbald.com>
Sat, 20 Apr 2013 12:43:34 +0000 (14:43 +0200)
 - Added Jobs Status filter (completed, failed and canceled)
 - Added more choice in <Jobs per page> list

gui/bacula-web/jobs.php
gui/bacula-web/style/default.css
gui/bacula-web/templates/jobs.tpl

index c140a6c0b5af139de9557ff058ae50a03a3e6e1d..07bc885a49216432b5d24b458d5f0eb8a1eaeea4 100644 (file)
   $query .= "FROM Job ";
   $query .= "LEFT JOIN Pool ON Job.PoolId=Pool.PoolId ";
   $query .= "LEFT JOIN Status ON Job.JobStatus = Status.JobStatus ";
+  
+  // Filter by status
+  if( isset( $_POST['status'] ) ) {
+       switch( $_POST['status'] )
+       {
+               case 'completed':
+                       $query .= "WHERE Job.JobStatus = 'T' ";
+               break;
+               case 'failed':
+                       $query .= "WHERE Job.JobStatus = 'f' ";
+               break;
+               case 'canceled':
+                       $query .= "WHERE Job.JobStatus = 'A' ";
+               break;
+       }
+  }
+  
   $query .= "ORDER BY Job.EndTime DESC ";
   
   // Determine how many jobs to display
@@ -82,6 +99,8 @@
   
   $jobsresult = $dbSql->db_link->query( $query );
   
+  //var_dump( $_POST );
+  
   if( PEAR::isError( $jobsresult ) ) {
          echo "SQL query = $query <br />";
          die("Unable to get last failed jobs from catalog" . $jobsresult->getMessage() );
index 47563384cb3471eb25f05443bb43c3e971080850..f8dc0bd0f5c1e290e3072f75bf32ba0c5f357881 100644 (file)
@@ -137,21 +137,10 @@ a:hover { color: #736F6E }
 .box table.list
 {
  border-collapse: collapse;
- /*width: 100%;*/
+ /width: 100%;
  margin: 0px;
 }
 
-.box table
-{
- border-collapse: separate;
- margin: 0px;
-}
-
-.box table th {
- font-size: 10pt;
- background-color: #CACACA;
-}
-
 .box table tr td
 {
  padding: 5px;
index 344231c1b0443fb48cf72958918126a47f69d957..b1d7ce8df571bb48df57515eeadc3a14d37943bf 100644 (file)
                <td width="50" class="{$job.Job_classe}">{$job.Level}</td>
                <td width="80" class="{$job.Job_classe}">{$job.Pool_name}</td>
          </tr>
-       {/foreach}
+         {/foreach}
        </table>
        </div> <!-- end div class=listbox -->
+       
        <form action="jobs.php" method="post">
-       <table>
+       <table class="list" border="0">
          <tr>
-               <td class="info" colspan="8">
-                       Limit to
+               <td class="info" colspan="5" style="text-align: right;">
+                       Jobs / Page
                        <select name="limit">
                                <option value="20">20
                                <option value="40">40
                                <option value="60">60
+                               <option value="80">80
+                               <option value="100">100
+                       </select>
+               </td>
+               <td class="info" width="200">
+                       Job Status
+                       <select name="status">
+                               <option value="Any">Any
+                               <option value="completed">Completed
+                               <option value="failed">Failed
+                               <option value="canceled">Canceled
                        </select>
+               </td>
+               <td class="info" width="120">
                        <input type="submit" value="Update" />
                </td>
          </tr>