diff --git a/source/lib/RippingCluster/Job.class.php b/source/lib/RippingCluster/Job.class.php
index 37de6f2..80bc428 100644
--- a/source/lib/RippingCluster/Job.class.php
+++ b/source/lib/RippingCluster/Job.class.php
@@ -183,10 +183,12 @@ class RippingCluster_Job {
$database = RippingCluster_Main::instance()->database();
$database->insert(
'INSERT INTO jobs
- (id,name,source,destination,title,format,video_codec,video_width,video_height,quantizer,deinterlace,audio_tracks,audio_codecs,audio_names,subtitle_tracks)
+ (id,name,source_plugin,rip_plugin,source,destination,title,format,video_codec,video_width,video_height,quantizer,deinterlace,audio_tracks,audio_codecs,audio_names,subtitle_tracks)
VALUES(NULL,:name,:source,:destination,:title,:format,:video_codec,:video_width,:video_height,:quantizer,:deinterlace,:audio_tracks,:audio_codecs,:audio_names,:subtitle_tracks)',
array(
array('name' => 'name', 'value' => $this->name, 'type' => PDO::PARAM_STR),
+ array('name' => 'source_plugin', 'value' => $this->source_plugin, 'type' => PDO::PARAM_STR),
+ array('name' => 'rip_plugin', 'value' => $this->rip_plugin, 'type' => PDO::PARAM_STR),
array('name' => 'source', 'value' => $this->source_filename, 'type' => PDO::PARAM_STR),
array('name' => 'destination', 'value' => $this->destination_filename, 'type' => PDO::PARAM_STR),
array('name' => 'title', 'value' => $this->title, 'type' => PDO::PARAM_INT),
@@ -332,6 +334,14 @@ class RippingCluster_Job {
public function name() {
return $this->name;
}
+
+ public function sourcePlugin() {
+ return $this->source_plugin;
+ }
+
+ public function ripPlugin() {
+ return $this->rip_plugin;
+ }
public function sourceFilename() {
return $this->source_filename;
diff --git a/webui/source/pages/job-details.php b/webui/source/pages/job-details.php
deleted file mode 100644
index 86df585..0000000
--- a/webui/source/pages/job-details.php
+++ /dev/null
@@ -1,15 +0,0 @@
-request->get('id');
-$job = RippingCluster_Job::fromId($job_id);
-$this->smarty->assign('job', $job);
-
-$log = RippingCluster_Main::instance()->log();
-
-$client_log_entries = RippingCluster_LogEntry::recentEntriesByField($log, 'webui', 'job_id', $job_id, 'ctime', SihnonFramework_Log::ORDER_DESC, 30);
-$worker_log_entries = RippingCluster_LogEntry::recentEntriesByField($log, 'worker', 'job_id', $job_id, 'ctime', SihnonFramework_Log::ORDER_DESC, 30);
-$this->smarty->assign('client_log_entries', $client_log_entries);
-$this->smarty->assign('worker_log_entries', $worker_log_entries);
-
-
-?>
diff --git a/webui/source/pages/jobs/details.php b/webui/source/pages/jobs/details.php
new file mode 100644
index 0000000..ff03013
--- /dev/null
+++ b/webui/source/pages/jobs/details.php
@@ -0,0 +1,45 @@
+request();
+$log = $main->log();
+$config = $main->config();
+
+$job_id = $req->get('id');
+$job = RippingCluster_Job::fromId($job_id);
+$this->smarty->assign('job', $job);
+
+// Fetch log entries for this job
+$log_count = $req->get('logs', $config->get('job.logs.default_display_count'));
+
+$default_log_order = $config->get('job.logs.default_order');
+$log_order = $req->get('order', $default_log_order);
+if ( ! in_array($log_order, array(SihnonFramework_Log::ORDER_ASC, SihnonFramework_Log::ORDER_DESC))) {
+ $log_order = $default_log_order;
+}
+$this->smarty->assign('log_order', $log_order);
+$this->smarty->assign('log_order_reverse', ($log_order == SihnonFramework_Log::ORDER_ASC ? SihnonFramework_Log::ORDER_DESC : SihnonFramework_Log::ORDER_ASC));
+
+$client_log_entries = array();
+$worker_log_entries = array();
+
+$log_count_display = null;
+if ($log_count == 'all') {
+ $log_count_display = 'all';
+ $log_count = '18446744073709551615'; // see mysql man page for LIMIT
+} else if(!is_int($log_count)) {
+ $log_count = $config->get('job.logs.default_display_count');
+ $log_count_display = $log_count;
+} else {
+ $log_count_display = $log_count;
+}
+
+$client_log_entries = RippingCluster_LogEntry::recentEntriesByField($log, 'webui', 'job_id', $job_id, 'ctime', $log_order, $log_count);
+$worker_log_entries = RippingCluster_LogEntry::recentEntriesByField($log, 'worker', 'job_id', $job_id, 'ctime', $log_order, $log_count);
+
+$this->smarty->assign('log_count_display', $log_count_display);
+$this->smarty->assign('client_log_entries', $client_log_entries);
+$this->smarty->assign('worker_log_entries', $worker_log_entries);
+
+
+?>
diff --git a/webui/source/templates/home.tpl b/webui/source/templates/home.tpl
index c7289c5..8e3b714 100644
--- a/webui/source/templates/home.tpl
+++ b/webui/source/templates/home.tpl
@@ -4,7 +4,7 @@
{if $running_jobs}
{foreach from=$running_jobs item=job}
-
{$job->name()} ({$job->currentStatus()->ripProgress()}%)
+ {$job->name()} ({$job->currentStatus()->ripProgress()}%)
{/foreach}
{else}
There are no currently running jobs.
@@ -14,7 +14,7 @@
{if $queued_jobs}
{foreach from=$queued_jobs item=job}
- {$job->name()}
+ {$job->name()}
{/foreach}
{else}
There are no currently running jobs.
@@ -25,7 +25,7 @@
{if $completed_jobs}
{else}
@@ -37,7 +37,7 @@
{if $failed_jobs}
{else}
diff --git a/webui/source/templates/job-details.tpl b/webui/source/templates/job-details.tpl
deleted file mode 100644
index d760c02..0000000
--- a/webui/source/templates/job-details.tpl
+++ /dev/null
@@ -1,57 +0,0 @@
-Job Details
-
-Summary
-
-Summary details here
-
-Recent Client Logs
-
-{if $client_log_entries}
-
-
-
- | Level |
- Time |
- Message |
-
-
-
- {foreach from=$client_log_entries item=log_entry}
-
- | {$log_entry->level()} |
- {$log_entry->ctime()|date_format:"%Y-%m-%d %H:%M:%S"} |
- {$log_entry->message()} |
-
- {/foreach}
-
-
-{else}
- There are no client log entries.
-{/if}
-
-
-Recent Worker Logs
-
-{if $worker_log_entries}
-
-
-
- | Level |
- Time |
- Message |
-
-
-
- {foreach from=$worker_log_entries item=log_entry}
-
- | {$log_entry->level()} |
- {$log_entry->ctime()|date_format:"%Y-%m-%d %H:%M:%S"} |
- {$log_entry->message()} |
-
- {/foreach}
-
-
-{else}
- There are no worker log entries.
-{/if}
-
diff --git a/webui/source/templates/jobs.tpl b/webui/source/templates/jobs.tpl
index 3f0e337..bf421b3 100644
--- a/webui/source/templates/jobs.tpl
+++ b/webui/source/templates/jobs.tpl
@@ -42,7 +42,7 @@
{foreach from=$jobs item=job}
{assign var=current_status value=$job->currentStatus()}
- | {$job->name()} |
+ {$job->name()} |
{$job->destinationFilename()}
{if $job->isFinished()}
diff --git a/webui/source/templates/jobs/details.tpl b/webui/source/templates/jobs/details.tpl
new file mode 100644
index 0000000..50fc74d
--- /dev/null
+++ b/webui/source/templates/jobs/details.tpl
@@ -0,0 +1,91 @@
+Job Details
+
+Summary
+
+
+ - Source Plugin
+ - {$job->sourcePlugin()}
+
+ - Rip Plugin
+ - {$job->ripPlugin()}
+
+ - Source Filename
+ - {$job->sourceFilename()}
+
+ - Source Title
+ - {$job->title()}
+
+ - Status
+ - {$job->currentStatus()->statusName()} ({$job->currentStatus()->mtime()|date_format:'%Y-%m-%d %H:%M:%S'})
+
+ - Destination Filename
+ - {$job->destinationFilename()}
+
+ {if $job->isFinished()}
+ - Destination Filesize
+ - {$job->outputFilesize()|formatFilesize}
+ {/if}
+
+
+Log messages
+Options
+
+
+Recent Client Logs
+{if $client_log_entries}
+
+
+
+ | Level |
+ Time |
+ Message |
+
+
+
+ {foreach from=$client_log_entries item=log_entry}
+
+ | {$log_entry->level()} |
+ {$log_entry->ctime()|date_format:"%Y-%m-%d %H:%M:%S"} |
+ {$log_entry->message()} |
+
+ {/foreach}
+
+
+{else}
+ There are no client log entries.
+{/if}
+
+
+Recent Worker Logs
+{if $worker_log_entries}
+
+
+
+ | Level |
+ Time |
+ Hostname |
+ Message |
+
+
+
+ {foreach from=$worker_log_entries item=log_entry}
+
+ | {$log_entry->level()} |
+ {$log_entry->ctime()|date_format:"%Y-%m-%d %H:%M:%S"} |
+ {$log_entry->hostname()} |
+ {$log_entry->message()} |
+
+ {/foreach}
+
+
+{else}
+ There are no worker log entries.
+{/if}
+
|