diff --git a/index.php b/index.php index fffab37..2f1b400 100644 --- a/index.php +++ b/index.php @@ -1,14 +1,18 @@ smarty(); - -$page = new HandBrakeCluster_Page($smarty, $main->request()); -$page->evaluate(); - -$smarty->assign('page_content', $smarty->fetch($page->template_filename())); - -$smarty->display('index.tpl'); +try { + $main = HandBrakeCluster_Main::instance(); + $smarty = $main->smarty(); + + $page = new HandBrakeCluster_Page($smarty, $main->request()); + $page->evaluate(); + + $smarty->assign('page_content', $smarty->fetch($page->template_filename())); + + $smarty->display('index.tpl'); +} catch (HandBrakeCluster_Exception $e) { + die("Uncaught Exception: " . $e->getMessage()); +} ?> diff --git a/pages/home.php b/pages/home.php index 7fb848a..08fc7b0 100644 --- a/pages/home.php +++ b/pages/home.php @@ -1,11 +1,11 @@ smarty->assign('running_jobs', $running_jobs); - $this->smarty->assign('completed_jobs;', $completed_jobs); + $this->smarty->assign('completed_jobs', $completed_jobs); + $this->smarty->assign('failed_jobs', $failed_jobs); ?> diff --git a/pages/job-details.php b/pages/job-details.php index 6637f57..6942e72 100644 --- a/pages/job-details.php +++ b/pages/job-details.php @@ -1,8 +1,13 @@ request->get('id'); -$job = new HandBrakeCluster_Job($job_id); - +$job = HandBrakeCluster_Job::fromId($job_id); $this->smarty->assign('job', $job); +$client_log_entries = HandBrakeCluster_ClientLogEntry::recentForJob($job_id, 30); +$worker_log_entries = HandBrakeCluster_WorkerLogEntry::recentForJob($job_id, 30); +$this->smarty->assign('client_log_entries', $client_log_entries); +$this->smarty->assign('worker_log_entries', $worker_log_entries); + + ?> diff --git a/pages/jobs.php b/pages/jobs.php index e69de29..a31e23a 100644 --- a/pages/jobs.php +++ b/pages/jobs.php @@ -0,0 +1,6 @@ +database()); +$this->smarty->assign('jobs', $jobs); + +?> diff --git a/pages/logs.php b/pages/logs.php index e69de29..1e77d61 100644 --- a/pages/logs.php +++ b/pages/logs.php @@ -0,0 +1,9 @@ +smarty->assign('client_log_entries', $client_log_entries); +$this->smarty->assign('worker_log_entries', $worker_log_entries); + +?> diff --git a/templates/home.tpl b/templates/home.tpl index 244dfd3..f9c1417 100644 --- a/templates/home.tpl +++ b/templates/home.tpl @@ -10,7 +10,7 @@ There are no currently running jobs. {/if} -

Completed Jobs

+

Recently Completed Jobs

{if $completed_jobs}