Add output filesize to jobs summary page
This commit is contained in:
@@ -271,7 +271,20 @@ class RippingCluster_Job {
|
|||||||
|
|
||||||
return $new_status;
|
return $new_status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function isFinished() {
|
||||||
|
$current_status = $this->currentStatus()->status();
|
||||||
|
return ($current_status == RippingCluster_JobStatus::COMPLETE || $current_status == RippingCluster_JobStatus::FAILED);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function outputFilesize() {
|
||||||
|
if (file_exists($this->destination_filename)) {
|
||||||
|
return filesize($this->destination_filename);
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
public function calculateETA() {
|
public function calculateETA() {
|
||||||
$current_status = $this->currentStatus();
|
$current_status = $this->currentStatus();
|
||||||
if ($current_status->status() != RippingCluster_JobStatus::RUNNING) {
|
if ($current_status->status() != RippingCluster_JobStatus::RUNNING) {
|
||||||
|
|||||||
@@ -18,13 +18,15 @@ class RippingCluster_Main extends SihnonFramework_Main {
|
|||||||
|
|
||||||
switch (HBC_File) {
|
switch (HBC_File) {
|
||||||
case 'index': {
|
case 'index': {
|
||||||
|
$smarty_tmp = '/tmp/ripping-cluster';
|
||||||
$this->smarty = new Smarty();
|
$this->smarty = new Smarty();
|
||||||
$this->smarty->template_dir = './source/templates';
|
$this->smarty->template_dir = static::makeAbsolutePath('./source/templates');
|
||||||
$this->smarty->compile_dir = './tmp/templates';
|
$this->smarty->compile_dir = static::makeAbsolutePath($smarty_tmp . '/tmp/templates');
|
||||||
$this->smarty->cache_dir = './tmp/cache';
|
$this->smarty->cache_dir = static::makeAbsolutePath($smarty_tmp . '/tmp/cache');
|
||||||
$this->smarty->config_dir = './config';
|
$this->smarty->config_dir = static::makeAbsolutePath($smarty_tmp . '/config');
|
||||||
|
|
||||||
$this->smarty->registerPlugin('modifier', 'formatDuration', array('RippingCluster_Main', 'formatDuration'));
|
$this->smarty->registerPlugin('modifier', 'formatDuration', array('RippingCluster_Main', 'formatDuration'));
|
||||||
|
$this->smarty->registerPlugin('modifier', 'formatFilesize', array('RippingCluster_Main', 'formatFilesize'));
|
||||||
|
|
||||||
$this->smarty->assign('version', '0.1');
|
$this->smarty->assign('version', '0.1');
|
||||||
$this->smarty->assign('messages', array());
|
$this->smarty->assign('messages', array());
|
||||||
|
|||||||
@@ -43,7 +43,12 @@
|
|||||||
{assign var=current_status value=$job->currentStatus()}
|
{assign var=current_status value=$job->currentStatus()}
|
||||||
<tr>
|
<tr>
|
||||||
<td><a href="{$base_uri}job-details/id/{$job->id()}" title="View job details">{$job->name()}</a></td>
|
<td><a href="{$base_uri}job-details/id/{$job->id()}" title="View job details">{$job->name()}</a></td>
|
||||||
<td>{$job->destinationFilename()}</td>
|
<td>
|
||||||
|
{$job->destinationFilename()}
|
||||||
|
{if $job->isFinished()}
|
||||||
|
({$job->outputFilesize()|formatFilesize})
|
||||||
|
{/if}
|
||||||
|
</td>
|
||||||
<td>{$job->title()}</td>
|
<td>{$job->title()}</td>
|
||||||
<td>
|
<td>
|
||||||
{$current_status->statusName()}
|
{$current_status->statusName()}
|
||||||
|
|||||||
Reference in New Issue
Block a user