// last_run_report.tpl
if ( $mode == "Lite" && $_GET['Full_popup'] == "yes" ) {
+/*
// Total Elapsed Time. Only for single Job.
if ( $dbSql->driver == "mysql" )
$ret = $dbSql->db_link->query("select UNIX_TIMESTAMP(EndTime)-UNIX_TIMESTAMP(StartTime) as elapsed from Job where EndTime <= NOW() and UNIX_TIMESTAMP(EndTime) > UNIX_TIMESTAMP(NOW())-84600")
$TotalElapsed = gmstrftime("%H:%M:%S", $TotalElapsed);
$smarty->assign('TotalElapsed',$TotalElapsed);
$ret->free();
-
+*/
}
else if ($mode == "Full" || $_GET['Full_popup'] == "yes" ){
+/*
$tmp1 = array();
if ( $dbSql->driver == "mysql")
$query = "select SEC_TO_TIME( UNIX_TIMESTAMP(Job.EndTime)-UNIX_TIMESTAMP(Job.StartTime) )
}
$smarty->assign('clients',$tmp1);
-}
-
-
+*/
+}
if ($_GET['Full_popup'] == "yes" || $_GET['pop_graph1'] == "yes" || $_GET['pop_graph2'] == "yes")
$smarty->display('full_popup.tpl');
else
--- /dev/null
+<?php
+/*
++-------------------------------------------------------------------------+
+| Copyright (C) 2004 Juan Luis Francés Jiménez |
+| |
+| This program is free software; you can redistribute it and/or |
+| modify it under the terms of the GNU General Public License |
+| as published by the Free Software Foundation; either version 2 |
+| of the License, or (at your option) any later version. |
+| |
+| This program is distributed in the hope that it will be useful, |
+| but WITHOUT ANY WARRANTY; without even the implied warranty of |
+| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
+| GNU General Public License for more details. |
++-------------------------------------------------------------------------+
+*/
+ session_start();
+ require ("paths.php");
+ require($smarty_path."Smarty.class.php");
+ include "classes.inc.php";
+
+ $smarty = new Smarty();
+ $dbSql = new Bweb();
+
+ require("lang.php");
+
+ // Smarty configuration
+ $smarty->compile_check = true;
+ $smarty->debugging = false;
+ $smarty->force_compile = true;
+
+ $smarty->template_dir = "./templates";
+ $smarty->compile_dir = "./templates_c";
+ $smarty->config_dir = "./configs";
+
+ // Get the last 10 failed jobs
+ $query = "";
+ $failed_jobs = array();
+
+ switch( $dbSql->driver )
+ {
+ case 'mysql':
+ $query = "SELECT SEC_TO_TIME( UNIX_TIMESTAMP(Job.EndTime)-UNIX_TIMESTAMP(Job.StartTime) ) AS elapsed, Job.JobId, Job.Name AS job_name, Job.StartTime, Job.EndTime, Job.Level, Pool.Name AS pool_name, Job.JobStatus ";
+ $query .= "FROM Job ";
+ $query .= "LEFT JOIN Pool ON Job.PoolId=Pool.PoolId ";
+ $query .= "WHERE Job.JobStatus = 'f' ";
+ //$query .= "WHERE Job.EndTime BETWEEN <= NOW() and UNIX_TIMESTAMP(EndTime) >UNIX_TIMESTAMP(NOW())-86400 ";
+ $query .= "ORDER BY Job.EndTime DESC ";
+ $query .= "LIMIT 10";
+
+ break;
+
+ case 'pgsql':
+ $query = "select (Job.EndTime - Job.StartTime ) AS elapsed, Job.Name, Job.StartTime, Job.EndTime, Job.Level, Pool.Name, Job.JobStatus ";
+ $query .= "FROM Job ";
+ $query .= "LEFT JOIN Pool ON Job.PoolId=Pool.PoolId ";
+ $query .= "WHERE EndTime <= NOW() and EndTime > NOW() - 86400 * interval '1 second' ";
+ $query .= "ORDER BY Job.EndTime DESC";
+ $query .= "LIMIT 10";
+ break;
+ }
+ $jobsresult = $dbSql->db_link->query( $query );
+
+ if( PEAR::isError( $jobsresult ) ) {
+ echo "SQL query = $query <br />";
+ die("Unable to get last failed jobs from catalog" . $jobsresult->getMessage() );
+ }else {
+ while( $job = $jobsresult->fetchRow( DB_FETCHMODE_ASSOC ) ) {
+ array_push( $failed_jobs, $job);
+ }
+ }
+ $smarty->assign( 'failed_jobs', $failed_jobs );
+
+ $smarty->display('jobs.tpl');
+?>
--- /dev/null
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+ "http://www.w3.org/TR/html4/loose.dtd">
+<html lang="en">
+<head>
+<title>bacula-web</title>
+<link rel="stylesheet" type="text/css" href="style/default.css">
+{literal}
+<script type="text/javascript">
+ function OpenWin(URL,wid,hei) {
+ window.open(URL,"window1","width="+wid+",height="+hei+",scrollbars=yes,menubar=no,location=no,resizable=no")
+ }
+</script>
+{/literal}
+
+</head>
+<body>
+{popup_init src='./js/overlib.js'}
+{include file=header.tpl}
+<a href="index.php">Back to main page</a>
+
+<div id="main_center">
+ <div class="box">
+ <p class="title">Last failed jobs (limited to 10)</p>
+ <table>
+ <tr>
+ <th>Status</th>
+ <th>Job ID</th>
+ <th>BackupJob</th>
+ <th>Start Time</th>
+ <th>End Time</th>
+ <th>Elapsed time</th>
+ <th>Level</th>
+ <th>Pool</th>
+ </tr>
+ {foreach from=$failed_jobs item=job}
+ <tr>
+ <td> <img width="20px" src="style/images/s_error.gif" alt=""/> </td>
+ <td>{$job.JobId}</td>
+ <td>{$job.job_name}</td>
+ <td>{$job.StartTime}</td>
+ <td>{$job.EndTime}</td>
+ <td>{$job.elapsed}</td>
+ <td align="center">{$job.Level}</td>
+ <td>{$job.pool_name}</td>
+ </tr>
+ {/foreach}
+ </table>
+ </div>
+ <div class="box">
+ <p class="title">Last completed jobs</p>
+ bkjlajkdjaf
+ </div>
+</div>
+
+{include file="footer.tpl"}
\ No newline at end of file