]> git.sur5r.net Git - bacula/bacula/commitdiff
bacula-web: Dynamic jobs per page filter in jobs page
authorDavide Franco <bacula-dev@dflc.ch>
Mon, 17 Jan 2011 16:25:28 +0000 (17:25 +0100)
committerKern Sibbald <kern@sibbald.com>
Sat, 20 Apr 2013 12:43:36 +0000 (14:43 +0200)
 - Jobs per page option list is automaticaly set to current now
 - More options now (25,50,75,100,150) jobs per page

gui/bacula-web/jobs.php
gui/bacula-web/templates/jobs.tpl

index f085d3bf01f01d9dd65afc85619de47d5ac47600..4a74a3246958806c594f069e39036d2df7b9fb59 100644 (file)
   $job_status = array( 'Any', 'Waiting', 'Running', 'Completed', 'Failed', 'Canceled' );
   $smarty->assign( 'job_status', $job_status );
   
+  // Jobs per page
+  $jobs_per_page = array( 25,50,75,100,150 );
+  $smarty->assign( 'jobs_per_page', $jobs_per_page );
+
   // Global variables
   $job_level = array( 'D' => 'Diff', 'I' => 'Incr', 'F' => 'Full' );
   
   $query .= "ORDER BY Job.JobId DESC ";
   
   // Determine how many jobs to display
-  if( isset($_POST['limit']) )
-       $query .= "LIMIT " . $_POST['limit'];
+  if( isset($_POST['jobs_per_page']) )
+       $query .= "LIMIT " . $_POST['jobs_per_page'];
   else
-       $query .= "LIMIT 20 ";
+       $query .= "LIMIT 25 ";
   
   //echo $query . '<br />';
   
index b10e01045699399f24d7b7d06bcc997031af9afb..cdf00ee474f040089e78eaaf1a0823022a3746b9 100644 (file)
                </td>
                <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 name="jobs_per_page">
+                         {foreach from=$jobs_per_page item=nb_jobs}
+                           <option value="{$nb_jobs}" {if $smarty.post.jobs_per_page == $nb_jobs}Selected{/if} >{$nb_jobs}
+                         {/foreach}
                        </select>
                </td>
                <td class="info" width="200">
                        Job Status
                        <select name="status">
                                {foreach from=$job_status item=status_label}
-                               <option value="{$status_label}" {if $smarty.post.status == $status_label}Selected{/if}>{$status_label}
-<!--
-                               <option value="waiting">Waiting
-                               <option value="running">Running
-                               <option value="completed">Completed
-                               <option value="failed">Failed
-                               <option value="canceled">Canceled
--->                    
+                                 <option value="{$status_label}" {if $smarty.post.status == $status_label}Selected{/if} >{$status_label}
                                {/foreach}
                        </select>
                </td>