From e21a117cbeb9c441b7dc6f8ad769307947714c42 Mon Sep 17 00:00:00 2001 From: Davide Franco Date: Tue, 21 Dec 2010 14:37:50 +0100 Subject: [PATCH] bacula-web: Improved Jobs page - Improved apparence for last jobs - Added scrollbar for last jobs - Possibility to choose how many jobs to see in the list (20,40 or 60) --- gui/bacula-web/jobs.php | 12 ++++++- gui/bacula-web/style/default.css | 18 +++++----- gui/bacula-web/templates/jobs.tpl | 60 +++++++++++++++++++++---------- 3 files changed, 62 insertions(+), 28 deletions(-) diff --git a/gui/bacula-web/jobs.php b/gui/bacula-web/jobs.php index e4fe0bfc4b..c140a6c0b5 100644 --- a/gui/bacula-web/jobs.php +++ b/gui/bacula-web/jobs.php @@ -73,7 +73,12 @@ $query .= "LEFT JOIN Pool ON Job.PoolId=Pool.PoolId "; $query .= "LEFT JOIN Status ON Job.JobStatus = Status.JobStatus "; $query .= "ORDER BY Job.EndTime DESC "; - $query .= "LIMIT 20"; + + // Determine how many jobs to display + if( isset($_POST['limit']) ) + $query .= "LIMIT " . $_POST['limit']; + else + $query .= "LIMIT 20 "; $jobsresult = $dbSql->db_link->query( $query ); @@ -82,10 +87,15 @@ die("Unable to get last failed jobs from catalog" . $jobsresult->getMessage() ); }else { while( $job = $jobsresult->fetchRow( DB_FETCHMODE_ASSOC ) ) { + // Determine icon for job if( $job['JobStatus'] == 'T' ) $job['Job_icon'] = "s_ok.gif"; else $job['Job_icon'] = "s_error.gif"; + + // Odd or even row + if( count($last_jobs) % 2) + $job['Job_classe'] = 'odd'; array_push( $last_jobs, $job); } diff --git a/gui/bacula-web/style/default.css b/gui/bacula-web/style/default.css index ef4573b51c..47563384cb 100644 --- a/gui/bacula-web/style/default.css +++ b/gui/bacula-web/style/default.css @@ -89,7 +89,7 @@ a:hover { color: #736F6E } #main_center { position: absolute; left:10px; - width: 900px; + width: 1000px; /*border: 1px solid red; */ margin-top: 0px; } @@ -137,7 +137,7 @@ a:hover { color: #736F6E } .box table.list { border-collapse: collapse; - width: 100%; + /*width: 100%;*/ margin: 0px; } @@ -154,7 +154,7 @@ a:hover { color: #736F6E } .box table tr td { - padding: 2px; + padding: 5px; font-size: 8pt; height: 20px; } @@ -170,18 +170,22 @@ a:hover { color: #736F6E } margin: 2px; } -.box table tr td.info +.box table td.info { text-align: center; vertical-align: middle; - /* padding-right: 8em; */ + padding-right: 8em; font-weight: bold; background-color: #E0E0E0; height: auto; padding: 5px; + margin:0px; } .box table tr td.info a { font-size: 8pt;} + +.odd { background-color: #DCDCDC; } + table { width: 100%; margin: 0px; @@ -291,9 +295,7 @@ td,input,select { font-size : 13px; color: red; } -.header { - font-size : 18px; -} + .size_small { font-size: 9px; } diff --git a/gui/bacula-web/templates/jobs.tpl b/gui/bacula-web/templates/jobs.tpl index c8608898f6..344231c1b0 100644 --- a/gui/bacula-web/templates/jobs.tpl +++ b/gui/bacula-web/templates/jobs.tpl @@ -47,33 +47,55 @@ {/foreach} - + +

Last jobs

- +
- - - - - - - - + + + + + + + + +
StatusJob IDBackupJobStart TimeEnd TimeElapsed timeLevelPoolStatusJob IDBackupJobStart TimeEnd TimeElapsed timeLevelPool
+
+ {foreach from=$last_jobs item=job} - - - - - - - - + + + + + + + + + + {/foreach} +
{$job.JobId}{$job.Job_name}{$job.StartTime}{$job.EndTime}{$job.elapsed}{$job.Level}{$job.Pool_name} + + {$job.JobId}{$job.Job_name}{$job.StartTime}{$job.EndTime}{$job.elapsed}{$job.Level}{$job.Pool_name}
+
+
+ + + - {/foreach}
+ Limit to + + +
+
-- 2.39.5