From: Davide Franco Date: Tue, 21 Dec 2010 16:23:48 +0000 (+0100) Subject: bacula-web: New features and improvments in jobs page X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=f49b7bf0490ec3d911338dcaacdf86ee3cbec127;p=bacula%2Fbacula bacula-web: New features and improvments in jobs page - Added Jobs Status filter (completed, failed and canceled) - Added more choice in list --- diff --git a/gui/bacula-web/jobs.php b/gui/bacula-web/jobs.php index c140a6c0b5..07bc885a49 100644 --- a/gui/bacula-web/jobs.php +++ b/gui/bacula-web/jobs.php @@ -72,6 +72,23 @@ $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
"; die("Unable to get last failed jobs from catalog" . $jobsresult->getMessage() ); diff --git a/gui/bacula-web/style/default.css b/gui/bacula-web/style/default.css index 47563384cb..f8dc0bd0f5 100644 --- a/gui/bacula-web/style/default.css +++ b/gui/bacula-web/style/default.css @@ -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; diff --git a/gui/bacula-web/templates/jobs.tpl b/gui/bacula-web/templates/jobs.tpl index 344231c1b0..b1d7ce8df5 100644 --- a/gui/bacula-web/templates/jobs.tpl +++ b/gui/bacula-web/templates/jobs.tpl @@ -78,19 +78,33 @@ {$job.Level} {$job.Pool_name} - {/foreach} + {/foreach} +
- +
- + +
- Limit to + + Jobs / Page + + Job Status + +