Massive refactor to use SihnonFramework and PEAR's Net_Gearman

This commit is contained in:
2011-04-21 23:31:21 +01:00
parent fa7b54b861
commit d3fe08d40f
75 changed files with 290 additions and 1410 deletions

View File

@@ -0,0 +1 @@
Not yet implemented.

View File

@@ -0,0 +1,6 @@
<h2>The requested page could not be found</h2>
<p>
The file you requested ({$requested_page}) could not be found.
If you typed in the address manually, check that you have spelled it correctly,
or if you followed a link, let us know and we'll look into it.
</p>

View File

@@ -0,0 +1,46 @@
<h2>An unhandled error has occurred</h2>
<p>
There was a problem trying to complete the requested action. Please try again and if the problem persists, let us know.
</p>
{if $display_exceptions}
<p>
An unhandled exception was caught during the page template processing. The full details are shown below:
</p>
<table class="exception-details">
<colgroup id="header">
<col />
</colgroup>
<colgroup>
<col />
</colgroup>
<tbody>
<tr>
<th>Exception</th>
<td>{$exception_type}</td>
</tr>
<tr>
<th>File</th>
<td>{$exception->getFile()}</td>
</tr>
<tr>
<th>Line</th>
<td>{$exception->getLine()}</td>
</tr>
<tr>
<th>Message</th>
<td>{$exception->getMessage()}</td>
</tr>
<tr>
<th>Stack Trace</th>
<td><pre>{$exception->getTrace()|print_r}</pre></td>
</tr>
</tbody>
</table>
<p>
<em>Note:</em> Exception details should not be displayed on production systems.
Disable the <a href="{$base_uri}admin/settings/key/debug.show_exceptions/"><code>debug.show_exceptions</code></a>
setting to omit the exception details from this page.
</p>
{/if}

View File

@@ -0,0 +1,36 @@
<h2>Summary</h2>
<h3>Running Jobs</h3>
{if $running_jobs}
{foreach from=$running_jobs item=job}
<li><a href="{$base_uri}job-details/id/{$job->id()}" title="View job details">Job {$job->id()}</a></li>
{/foreach}
{else}
<em>There are no currently running jobs.</em>
{/if}
<h3>Recently Completed Jobs</h3>
{if $completed_jobs}
<ul>
{foreach from=$completed_jobs item=job}
<li><a href="{$base_uri}job-details/id/{$job->id()}" title="View job details">Job {$job->id()}</a></li>
{/foreach}
</ul>
{else}
<em>There are no recently completed jobs.</em>
{/if}
<h3>Recently Failed Jobs</h3>
{if $failed_jobs}
<ul>
{foreach from=$failed_jobs item=job}
<li><a href="{$base_uri}job-details/id/{$job->id()}" title="View job details">Job {$job->id()}</a></li>
{/foreach}
</ul>
{else}
<em>There are no recently failed jobs.</em>
{/if}

View File

@@ -0,0 +1,54 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Ripping Cluster WebUI</title>
<script lang="javascript">
</script>
<link rel="stylesheet" type="text/css" href="{$base_uri}styles/normal.css" />
<link type="text/css" href="{$base_uri}styles/3rdparty/jquery-ui/smoothness/jquery-ui-1.8.custom.css" rel="Stylesheet" />
<script type="text/javascript" src="{$base_uri}scripts/3rdparty/jquery-1.4.2.js"></script>
<script type="text/javascript" src="{$base_uri}scripts/3rdparty/jquery-ui-1.8.custom.min.js"></script>
</head>
<body>
<div id="container">
<div id="banner">
<h1>Ripping Cluster WebUI</h1>
</div>
<div id="navigation">
{include file="navigation.tpl"}
</div>
<div id="page-container">
<div id="sidebar">
{include file="sidebar.tpl"}
</div>
<div id="page">
{if $messages}
<div id="messages">
{foreach from=$messages item=message}
{$message}
{/foreach}
</div>
{/if}
{$page_content}
</div>
</div>
<div id="footer">
Powered by RippingCluster WebUI {$version}. Written by Ben Roberts.
</div>
</div>
</body>
</html>

View File

@@ -0,0 +1,57 @@
<h2>Job Details</h2>
<h3>Summary</h3>
<em>Summary details here</em>
<h3>Recent Client Logs</h3>
{if $client_log_entries}
<table>
<thead>
<tr>
<th>Level</th>
<th>Time</th>
<th>Message</th>
</tr>
</thead>
<tbody>
{foreach from=$client_log_entries item=log_entry}
<tr>
<td>{$log_entry->level()}</td>
<td>{$log_entry->ctime()|date_format:"%Y-%m-%d %H:%M:%S"}</td>
<td>{$log_entry->message()}</td>
</tr>
{/foreach}
</tbody>
</table>
{else}
<em>There are no client log entries.</em>
{/if}
<h3>Recent Worker Logs</h3>
{if $worker_log_entries}
<table>
<thead>
<tr>
<th>Level</th>
<th>Time</th>
<th>Message</th>
</tr>
</thead>
<tbody>
{foreach from=$worker_log_entries item=log_entry}
<tr>
<td>{$log_entry->level()}</td>
<td>{$log_entry->ctime()|date_format:"%Y-%m-%d %H:%M:%S"}</td>
<td>{$log_entry->message()}</td>
</tr>
{/foreach}
</tbody>
</table>
{else}
<em>There are no worker log entries.</em>
{/if}

View File

@@ -0,0 +1,83 @@
<h2>Jobs</h2>
{if $jobs}
<form name="view-jobs" id="view-jobs" action="{$base_uri}jobs" method="post">
<fieldset>
<legend>View</legend>
<label for="view-status">View only jobs with status:</label>
<select id="view-status" name="view">
<option value="any">Any Status</option>
<option value="queued">Queued</option>
<option value="running">Running</option>
<option value="complete">Complete</option>
<option value="failed">Failed</option>
</select>
<input type="submit" name="submit" value="view" />
</fieldset>
</form>
<form name="manage-jobs" id="manage-jobs" action="{$base_uri}jobs/submit" method="post">
<fieldset>
<legend>Bulk Actions</legend>
<input type="image" class="icon" name="action" id="mark-failed-top" value="mark-failed" src="{$base_uri}images/caution.png" alt="Mark all marked jobs as failed" />
<input type="image" class="icon" name="action" id="redo-top" value="retry" src="{$base_uri}images/redo.png" alt="Repeat all marked jobs" />
<input type="image" class="icon" name="action" id="delete-top" value="delete" src="{$base_uri}images/trash.png" alt="Delete all marked jobs" />
<input type="image" class="icon" name="action" id="fix-broken-timestamps-top" value="fix-broken-timestamps" src="{$base_uri}images/clock.png" alt="Fix Broken Timestamps in Statuses" />
</fieldset>
<table>
<thead>
<tr>
<th>Name</th>
<th>Destination</th>
<th>Title</th>
<th>Status</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
{foreach from=$jobs item=job}
{assign var=current_status value=$job->currentStatus()}
<tr>
<td><a href="{$base_uri}job-details/id/{$job->id()}" title="View job details">{$job->name()}</a></td>
<td>{$job->destinationFilename()}</td>
<td>{$job->title()}</td>
<td>
{$current_status->statusName()}
{if $current_status->hasProgressInfo()}
<br />
Started: <em>{$current_status->ctime()|date_format:"%D %T"}</em><br />
Progress: {$current_status->ripProgress()}%<br />
Last update: <em>{$current_status->mtime()|date_format:"%D %T"}</em><br />
ETA: <em>{$job->calculateETA()|formatDuration}</em>
{/if}
</td>
<td>
<fieldset>
<input type="checkbox" name="include[]" value="{$job->id()}" />
<input type="image" class="icon" name="action" id="mark-failed-{$job->id()}" value="mark-failed[{$job->id()}]" src="{$base_uri}images/caution.png" alt="Mark job as failed" />
<input type="image" class="icon" name="action" id="redo-{$job->id()}" value="retry[{$job->id()}]" src="{$base_uri}images/redo.png" alt="Repeat job" />
<input type="image" class="icon" name="action" id="delete-{$job->id()}" value="delete[{$job->id()}]" src="{$base_uri}images/trash.png" alt="Delete job" />
<input type="image" class="icon" name="action" id="fix-broken-timestamps-{$job->id()}" value="fix-broken-timestamps[{$job->id()}]" src="{$base_uri}images/clock.png" alt="Fix broken status timestamps" />
</fieldset>
</td>
</tr>
{/foreach}
</tbody>
</table>
<fieldset>
<legend>Bulk Actions</legend>
<input type="image" class="icon" name="action" id="mark-failed-bottom" value="mark-failed" src="{$base_uri}images/caution.png" alt="Mark all marked jobs as failed" />
<input type="image" class="icon" name="action" id="redo-bottom" value="retry" src="{$base_uri}images/redo.png" alt="Repeat all marked jobs" />
<input type="image" class="icon" name="action" id="delete-bottom" value="delete" src="{$base_uri}images/trash.png" alt="Delete all marked jobs" />
<input type="image" class="icon" name="action" id="fix-broken-timestamps-bottom" value="fix-broken-timestamps" src="{$base_uri}images/clock.png" alt="Fix Broken Timestamps in Statuses" />
</fieldset>
</form>
{else}
<em>There are no jobs</em>
{/if}

View File

@@ -0,0 +1,59 @@
<h2>Recent Client Logs</h2>
{if $client_log_entries}
<table>
<thead>
<tr>
<th>Job</th>
<th>Level</th>
<th>Time</th>
<th>Hostname</th>
<th>Message</th>
</tr>
</thead>
<tbody>
{foreach from=$client_log_entries item=log_entry}
<tr>
<td>{$log_entry->jobId()}</td>
<td>{$log_entry->level()}</td>
<td>{$log_entry->ctime()|date_format:"%Y-%m-%d %H:%M:%S"}</td>
<td>{$log_entry->hostname()}</td>
<td>{$log_entry->message()}</td>
</tr>
{/foreach}
</tbody>
</table>
{else}
<em>There are no client log entries.</em>
{/if}
<h2>Recent Worker Logs</h2>
{if $worker_log_entries}
<table>
<thead>
<tr>
<th>Job</th>
<th>Level</th>
<th>Time</th>
<th>Hostname</th>
<th>Message</th>
</tr>
</thead>
<tbody>
{foreach from=$worker_log_entries item=log_entry}
<tr>
<td>{$log_entry->jobId()}</td>
<td>{$log_entry->level()}</td>
<td>{$log_entry->ctime()|date_format:"%Y-%m-%d %H:%M:%S"}</td>
<td>{$log_entry->hostname()}</td>
<td>{$log_entry->message()}</td>
</tr>
{/foreach}
</tbody>
</table>
{else}
<em>There are no worker log entries.</em>
{/if}

View File

@@ -0,0 +1,5 @@
<ul>
<li><a href="{$base_uri}home/" title="Home">Home</a></li>
<li><a href="{$base_uri}jobs/" title="Jobs">Jobs</a></li>
<li><a href="{$base_uri}logs/" title="Logs">Logs</a></li>
</ul>

View File

@@ -0,0 +1,168 @@
<h2>Setup Rips</h2>
{if $rips_submitted}
<h3>Jobs Queued</h3>
<p>
The rips have been queued, and processing has begun in the background. View the <a href="{$base_uri}jobs/" title="View running jobs">Jobs</a> page
to see a list of running jobs, or the <a href="{$base_uri}logs/" title="View logs">logs</a> page for more detailed progress information.
</p>
{else}
<h3>{$source->filename()|escape:"html"}</h3>
<form name="setup-rips" id="setup-rips" action="{$base_uri}rips/setup-rip/submit/" method="post">
<input type="hidden" name="plugin" value="{$source->plugin()|escape:"html"}" />
<fieldset>
<legend>Configure global rip options</legend>
<input type="hidden" name="id" value="{$source->filenameEncoded()|escape:"html"}" />
<div>
<label for="global-output-directory">Output directory</label>
<input type="text" id="global-ouput-directory" name="rip-options[output-directory]" value="{$default_output_directory}" />
</div>
<div>
<label for="global-format">Output format</label>
<select id="global-format" name="rip-options[format]">
<option value="mkv" selected="selected">MKV</option>
</select>
</div>
<div>
<label for="global-video-codec">Video codec</label>
<select id="global-video-codec" name="rip-options[video-codec]">
<option value="x264" selected="selected">x264</option>
</select>
</div>
<div>
<label for="global-video-width">Video width</label>
<input type="text" id="global-video-width" name="rip-options[video-width]" value="0" />
<em>(Use 0 to leave size unchanged from source.)</em>
</div>
<div>
<label for="global-video-height">Video height</label>
<input type="text" id="global-video-width" name="rip-options[video-width]" value="0" />
<em>(Use 0 to leave size unchanged from source.)</em>
</div>
<div>
<label for="global-quantizer">Quantizer</label>
<input type="text" id="global-quantizer" name="rip-options[quantizer]" value="" readonly="readonly" />
<em>(Defaults to 0.61, x264's quantizer value for 20)</em>
<div id="quantizer-slider"></div>
</div>
<div>
<input type="submit" name="submit" value="Queue rips" />
</div>
</fieldset>
<div id="available-titles">
{foreach from=$titles item=title}
<h3 id="configure-rip-{$title->id()}"><a href="#">Title {$title->id()} (Duration: {$title->duration()}, Chapters: {$title->chapterCount()})</a></h3>
<div id="rips-{$title->id()}">
<fieldset>
<legend>Configure title rip options</legend>
<div>
<label for="rip-title-{$title->id()}">Rip this title</label>
<input type="checkbox" id="rip-title-{$title->id()}" name="rips[{$title->id()}][queue]" value="1" />
</div>
<div>
<label for="rip-name-{$title->id()}">Short Name</label>
<input type="text" id="rip-name-{$title->id()}" name="rips[{$title->id()}][name]" value="" />
</div>
<div>
<label for="rip-audio-{$title->id()}">Audio tracks</label>
<select id="rip-audio-{$title->id()}" name="rips[{$title->id()}][audio][]" size="5" multiple="multiple" class="rip-streams">
{foreach from=$title->audioTracks() item=audio}
<option value="{$audio->id()}">{$audio->name()} - {$audio->channels()} ({$audio->language()}) </option>
{/foreach}
</select>
<table class="audio-tracks">
<caption>Selected audio tracks</caption>
<thead>
<tr>
<th>Track</th>
<th>Encoder</th>
<th>Name</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
<div>
<label for="rip-subtitle-{$title->id()}">Subtitle tracks</label>
<select id="rip-subtitle-{$title->id()}" name="rips[{$title->id()}][subtitles][]" size="5" multiple="multiple" class="rip-streams">
{foreach from=$title->subtitleTracks() item=subtitle}
<option value="{$subtitle->id()}">{$subtitle->language()}</option>
{/foreach}
</select>
<table class="subtitle-tracks">
<caption>Selected subtitle tracks</caption>
<thead>
<tr>
<th>Track</th>
<th>Language</th>
<th>Format</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
<div>
<label for="rips-output-{$title->id()}">Output filename</label>
<input type="text" id="rips-output-{$title->id()}" name="rips[{$title->id()}][output_filename]" value="" />
</div>
<div>
<label for="rip-deinterlace-{$title->id()}">Deinterlacing</label>
<select id="rip-deinterlace-{$title->id()}" name="rips[{$title->id()}][deinterlace]">
<option value="0">None</option>
<option value="1">Full</option>
<option value="2" selected="selected">Selective</option>
</select>
</div>
</fieldset>
</div>
{/foreach}
</div>
<fieldset>
<legend>Queue rips</legend>
<input type="submit" name="submit" value="Queue rips" />
</fieldset>
</form>
{literal}
<script language="javascript">
$(function() {
$("#available-titles").accordion({active: {/literal}{$source->longestTitleIndex()}{literal}});
$("input:submit").button();
$("#quantizer-slider").slider({
value:0.61,
min: 0,
max: 1.0,
step: 0.01,
slide: function(event, ui) {
$("#global-quantizer").val(ui.value);
}
});
$("#global-quantizer").val($("#quantizer-slider").slider("value"));
});
</script>
{/literal}
{/if}

View File

@@ -0,0 +1,76 @@
<h2>Source details</h2>
{if $source}
<table class="source-details">
<colgroup class="header">
<col />
</colgroup>
<colgroup>
<col />
</colgroup>
<tbody>
<tr>
<th>Source</th>
<td>{$source->filename()|escape:"html"}</td>
</tr>
{if $titles}
<tr>
<th>Titles</th>
<td>
<table class="titles">
<colgroup class="title-number">
<col />
</colgroup>
<colgroup class="title-header">
<col />
</colgroup>
<colgroup>
<col />
</colgroup>
<tbody>
{foreach from=$titles item=title}
<tr>
<th rowspan="5">{$title->id()}</th>
<td>Duration</td>
<td>{$title->duration()}</td>
</tr>
<tr>
<td>Display</td>
<td>
<ul>
<li>Size: {$title->width()}x{$title->height()}</li>
<li>Pixel aspect ratio: {$title->pixelAspect()}</li>
<li>Display aspect ratio: {$title->displayAspect()}</li>
<li>Framerate: {$title->framerate()}</li>
<li>Autocrop: {$title->autocrop()}</li>
</ul>
</td>
</tr>
<tr>
<td>Chapters</td>
<td>{$title->chapterCount()}</td>
</tr>
<tr>
<td>Audio Tracks</td>
<td>{$title->audioTrackCount()}</td>
</tr>
<tr>
<td>Subtitle Tracks</td>
<td>{$title->subtitleTrackCount()}</td>
</tr>
{/foreach}
</tbody>
</table>
</td>
</tr>
{/if}
</tbody>
</table>
{else}
<p>
<em>This is not a valid source.</em>
</p>
{/if}

View File

@@ -0,0 +1,41 @@
<h2>Sources</h2>
{if $all_sources}
<p>
The list below contains all the DVD sources that are available and ready for ripping.
</p>
<p>
Sources that have recently been scanned are marked <em>(cached)</em> and will load fairly quickly.
Sources that have not been cached will be scanned when the link is clicked, and this may take several minutes so please be patient.
</p>
<ul>
{foreach from=$all_sources key=type item=sources}
<li>{$type}
{if $sources}
<ul>
{foreach from=$sources item=source}
{assign var='source_plugin' value=$source->plugin()}
{assign var='source_filename' value=$source->filename()}
{assign var='source_filename_encoded' value=$source->filenameEncoded()}
{assign var='source_cached' value=$source->isCached()}
<li>
[ <a href="{$base_uri}rips/source-details/plugin/{$source_plugin}/id/{$source_filename_encoded}" title="Browse source details">Browse</a> |
<a href="{$base_uri}rips/setup-rip/plugin/{$source_plugin}/id/{$source_filename_encoded}" title="Rip this source">Rip</a> |
<a href="{$base_uri}sources/delete/plugin/{$source_plugin}/id/{$source_filename_encoded}" title="Delete this source">Delete</a> ]
{$source_filename|escape:'html'}{if $source_cached} (cached){/if}
</li>
{/foreach}
</ul>
{else}
<p>
<em>There are no {$type} sources available to rip.</em>
</p>
{/if}
</li>
{/foreach}
</ul>
{else}
<p>
<em>There are currently no sources available to rip.</em>
</p>
{/if}

View File

@@ -0,0 +1,11 @@
<ul>
<li><a href="{$base_uri}home/" title="Home">Home</a></li>
<li><a href="{$base_uri}jobs/" title="Jobs">Jobs</a></li>
<li><a href="{$base_uri}logs/" title="Logs">Logs</a></li>
<li>Browse
<ul>
<li><a href="{$base_uri}rips/sources" title="Browse Sources">Sources</a></li>
</ul>
</li>
</ul>

View File

@@ -0,0 +1,7 @@
<h2>Delete Source</h2>
<p>
Are you sure you want to delete {$source->plugin()|escape:"html"}:{$source->filename()|escape:"html"}?
[ <a href="{$base_uri}sources/delete/plugin/{$source->plugin()}/id/{$source->filenameEncoded()}/confirm" title="Delete it">Delete</a>
| <a href="{$base_uri}rips/sources" title="Return to sources list">Cancel</a> ]
</p>