Massive refactor to use SihnonFramework and PEAR's Net_Gearman
This commit is contained in:
9
webui/source/pages/errors/404.php
Normal file
9
webui/source/pages/errors/404.php
Normal file
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
$main = RippingCluster_Main::instance();
|
||||
$req = $main->request();
|
||||
|
||||
$this->smarty->assign('requested_page', htmlspecialchars($req->request_string()));
|
||||
|
||||
|
||||
?>
|
||||
10
webui/source/pages/errors/unhandled-exception.php
Normal file
10
webui/source/pages/errors/unhandled-exception.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
$main = RippingCluster_Main::instance();
|
||||
$config = $main->config();
|
||||
|
||||
$this->smarty->assign('display_exceptions', $config->get('debug.display_exceptions'));
|
||||
$this->smarty->assign('exception', $exception);
|
||||
$this->smarty->assign('exception_type', get_class($exception));
|
||||
|
||||
?>
|
||||
11
webui/source/pages/home.php
Normal file
11
webui/source/pages/home.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
$running_jobs = RippingCluster_Job::allWithStatus(RippingCluster_JobStatus::RUNNING, 5);
|
||||
$completed_jobs = RippingCluster_Job::allWithStatus(RippingCluster_JobStatus::COMPLETE, 5);
|
||||
$failed_jobs = RippingCluster_Job::allWithStatus(RippingCluster_JobStatus::FAILED, 5);
|
||||
|
||||
$this->smarty->assign('running_jobs', $running_jobs);
|
||||
$this->smarty->assign('completed_jobs', $completed_jobs);
|
||||
$this->smarty->assign('failed_jobs', $failed_jobs);
|
||||
|
||||
?>
|
||||
13
webui/source/pages/job-details.php
Normal file
13
webui/source/pages/job-details.php
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
$job_id = $this->request->get('id');
|
||||
$job = RippingCluster_Job::fromId($job_id);
|
||||
$this->smarty->assign('job', $job);
|
||||
|
||||
$client_log_entries = RippingCluster_ClientLogEntry::recentForJob($job_id, 30);
|
||||
$worker_log_entries = RippingCluster_WorkerLogEntry::recentForJob($job_id, 30);
|
||||
$this->smarty->assign('client_log_entries', $client_log_entries);
|
||||
$this->smarty->assign('worker_log_entries', $worker_log_entries);
|
||||
|
||||
|
||||
?>
|
||||
96
webui/source/pages/jobs.php
Normal file
96
webui/source/pages/jobs.php
Normal file
@@ -0,0 +1,96 @@
|
||||
<?php
|
||||
|
||||
$main = RippingCluster_Main::instance();
|
||||
$req = $main->request();
|
||||
$config = $main->config();
|
||||
|
||||
if ($req->get('submit')) {
|
||||
$action = RippingCluster_Main::issetelse($_POST['action'], 'RippingCluster_Exception_InvalidParameters');
|
||||
|
||||
# If a bulk action was selected, the action will be a single term, otherwise it will also contain
|
||||
# the id of the single item to act upon. Work out which was used now.
|
||||
$matches = $job_ids = array();
|
||||
if (preg_match('/^(.*)\[(\d+)\]$/', $action, $matches)) {
|
||||
$action = $matches[1];
|
||||
$job_ids = array($matches[2]);
|
||||
}
|
||||
else {
|
||||
$job_ids = $_POST['include'];
|
||||
}
|
||||
|
||||
$jobs = array();
|
||||
foreach ($job_ids as $job_id) {
|
||||
$job = RippingCluster_Job::fromId($job_id);
|
||||
if (!$job) {
|
||||
throw new RippingCluster_Exception_InvalidParameters('job_id');
|
||||
}
|
||||
$jobs[] = $job;
|
||||
}
|
||||
|
||||
switch ($action) {
|
||||
case 'mark-failed': {
|
||||
foreach ($jobs as $job) {
|
||||
$job->updateStatus(RippingCluster_JobStatus::FAILED);
|
||||
}
|
||||
} break;
|
||||
|
||||
case 'retry': {
|
||||
# Clone each of the selected jobs
|
||||
foreach ($jobs as $job) {
|
||||
$new_job = clone $job;
|
||||
}
|
||||
|
||||
# Dispatch all the jobs in one run
|
||||
RippingCluster_Job::runAllJobs();
|
||||
|
||||
# Redirect to the job queued page to show the jobs were successfully dispatched
|
||||
RippingCluster_Page::redirect('rips/setup-rip/queued');
|
||||
} break;
|
||||
|
||||
case 'delete': {
|
||||
foreach ($jobs as $job) {
|
||||
$job->delete();
|
||||
}
|
||||
} break;
|
||||
|
||||
case 'fix-broken-timestamps': {
|
||||
foreach ($jobs as $job) {
|
||||
$job->fixBrokenTimestamps();
|
||||
}
|
||||
} break;
|
||||
|
||||
default: {
|
||||
throw new RippingCluster_Exception_InvalidParameters('action');
|
||||
}
|
||||
}
|
||||
|
||||
RippingCluster_Page::redirect('jobs');
|
||||
|
||||
} else {
|
||||
|
||||
if (isset($_POST['view'])) {
|
||||
$statusName = urlencode($_POST['view']);
|
||||
RippingCluster_Page::redirect("jobs/view/{$statusName}");
|
||||
}
|
||||
|
||||
$statusName = $req->get('view', 'any');
|
||||
switch ($statusName) {
|
||||
case 'any': $status = null; break;
|
||||
case 'queued': $status = RippingCluster_JobStatus::QUEUED; break;
|
||||
case 'running': $status = RippingCluster_JobStatus::RUNNING; break;
|
||||
case 'complete': $status = RippingCluster_JobStatus::COMPLETE; break;
|
||||
case 'failed': $status = RippingCluster_JobStatus::FAILED; break;
|
||||
default: throw new RippingCluster_Exception_InvalidParameters('view');
|
||||
}
|
||||
|
||||
$jobs = array();
|
||||
if ($status) {
|
||||
$jobs = RippingCluster_Job::allWithStatus($status);
|
||||
} else {
|
||||
$jobs = RippingCluster_Job::all();
|
||||
}
|
||||
|
||||
$this->smarty->assign('jobs', $jobs);
|
||||
}
|
||||
|
||||
?>
|
||||
9
webui/source/pages/logs.php
Normal file
9
webui/source/pages/logs.php
Normal file
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
$client_log_entries = RippingCluster_ClientLogEntry::recent(30);
|
||||
$worker_log_entries = RippingCluster_WorkerLogEntry::recent(30);
|
||||
|
||||
$this->smarty->assign('client_log_entries', $client_log_entries);
|
||||
$this->smarty->assign('worker_log_entries', $worker_log_entries);
|
||||
|
||||
?>
|
||||
36
webui/source/pages/rips/setup-rip.php
Normal file
36
webui/source/pages/rips/setup-rip.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
$main = RippingCluster_Main::instance();
|
||||
$req = $main->request();
|
||||
$config = $main->config();
|
||||
|
||||
// Grab the name of this source
|
||||
$encoded_filename = null;
|
||||
if ($req->get('submit')) {
|
||||
$encoded_filename = RippingCluster_Main::issetelse($_POST['id'], 'RippingCluster_Exception_InvalidParameters');
|
||||
|
||||
// Create the jobs from the request
|
||||
$jobs = RippingCluster_Job::fromPostRequest($_POST['plugin'], $_POST['id'], $_POST['rip-options'], $_POST['rips']);
|
||||
|
||||
// Spawn the background client process to run all the jobs
|
||||
RippingCluster_Job::runAllJobs();
|
||||
|
||||
RippingCluster_Page::redirect('rips/setup-rip/queued');
|
||||
|
||||
} elseif ($req->get('queued')) {
|
||||
$this->smarty->assign('rips_submitted', true);
|
||||
|
||||
} else {
|
||||
$this->smarty->assign('rips_submitted', false);
|
||||
$encoded_filename = $req->get('id', 'RippingCluster_Exception_InvalidParameters');
|
||||
|
||||
$plugin = $req->get('plugin', 'RippingCluster_Exception_InvalidParameters');
|
||||
$source = RippingCluster_Source_PluginFactory::loadEncoded($plugin, $encoded_filename);
|
||||
|
||||
$this->smarty->assign('source', $source);
|
||||
$this->smarty->assign('titles', $source->titles());
|
||||
$this->smarty->assign('longest_title', $source->longestTitle());
|
||||
$this->smarty->assign('default_output_directory', $config->get('rips.default.output_directory'));
|
||||
}
|
||||
|
||||
?>
|
||||
13
webui/source/pages/rips/source-details.php
Normal file
13
webui/source/pages/rips/source-details.php
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
$main = RippingCluster_Main::instance();
|
||||
$req = $main->request();
|
||||
$config = $main->config();
|
||||
|
||||
$plugin = $req->get('plugin', 'RippingCluster_Exception_InvalidParameters');
|
||||
$source = RippingCluster_Source_PluginFactory::loadEncoded($plugin, $req->get('id', 'RippingCluster_Exception_InvalidParameters'));
|
||||
|
||||
$this->smarty->assign('source', $source);
|
||||
$this->smarty->assign('titles', $source->titles());
|
||||
|
||||
?>
|
||||
9
webui/source/pages/rips/sources.php
Normal file
9
webui/source/pages/rips/sources.php
Normal file
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
$main = RippingCluster_Main::instance();
|
||||
$config = $main->config();
|
||||
|
||||
$all_sources = RippingCluster_Source_PluginFactory::enumerateAll();
|
||||
$this->smarty->assign('all_sources', $all_sources);
|
||||
|
||||
?>
|
||||
28
webui/source/pages/sources/delete.php
Normal file
28
webui/source/pages/sources/delete.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
$main = RippingCluster_Main::instance();
|
||||
$req = $main->request();
|
||||
$config = $main->config();
|
||||
|
||||
// Grab the name of this source
|
||||
$encoded_filename = null;
|
||||
if ($req->get('confirm')) {
|
||||
$plugin = $req->get('plugin', 'RippingCluster_Exception_InvalidParameters');
|
||||
$encoded_filename = $req->get('id', 'RippingCluster_Exception_InvalidParameters');
|
||||
|
||||
$source = RippingCluster_Source_PluginFactory::loadEncoded($plugin, $encoded_filename, false);
|
||||
$source->delete();
|
||||
|
||||
// Redirect back to the sources page
|
||||
RippingCluster_Page::redirect('rips/sources');
|
||||
|
||||
} else {
|
||||
$plugin = $req->get('plugin', 'RippingCluster_Exception_InvalidParameters');
|
||||
$encoded_filename = $req->get('id', 'RippingCluster_Exception_InvalidParameters');
|
||||
|
||||
$source = RippingCluster_Source_PluginFactory::loadEncoded($plugin, $encoded_filename, false);
|
||||
|
||||
$this->smarty->assign('source', $source);
|
||||
}
|
||||
|
||||
?>
|
||||
1
webui/source/templates/admin/settings.tpl
Normal file
1
webui/source/templates/admin/settings.tpl
Normal file
@@ -0,0 +1 @@
|
||||
Not yet implemented.
|
||||
6
webui/source/templates/errors/404.tpl
Normal file
6
webui/source/templates/errors/404.tpl
Normal 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>
|
||||
46
webui/source/templates/errors/unhandled-exception.tpl
Normal file
46
webui/source/templates/errors/unhandled-exception.tpl
Normal 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}
|
||||
36
webui/source/templates/home.tpl
Normal file
36
webui/source/templates/home.tpl
Normal 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}
|
||||
|
||||
54
webui/source/templates/index.tpl
Normal file
54
webui/source/templates/index.tpl
Normal 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>
|
||||
57
webui/source/templates/job-details.tpl
Normal file
57
webui/source/templates/job-details.tpl
Normal 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}
|
||||
|
||||
83
webui/source/templates/jobs.tpl
Normal file
83
webui/source/templates/jobs.tpl
Normal 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}
|
||||
|
||||
59
webui/source/templates/logs.tpl
Normal file
59
webui/source/templates/logs.tpl
Normal 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}
|
||||
|
||||
5
webui/source/templates/navigation.tpl
Normal file
5
webui/source/templates/navigation.tpl
Normal 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>
|
||||
168
webui/source/templates/rips/setup-rip.tpl
Normal file
168
webui/source/templates/rips/setup-rip.tpl
Normal 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}
|
||||
76
webui/source/templates/rips/source-details.tpl
Normal file
76
webui/source/templates/rips/source-details.tpl
Normal 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}
|
||||
41
webui/source/templates/rips/sources.tpl
Normal file
41
webui/source/templates/rips/sources.tpl
Normal 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}
|
||||
11
webui/source/templates/sidebar.tpl
Normal file
11
webui/source/templates/sidebar.tpl
Normal 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>
|
||||
7
webui/source/templates/sources/delete.tpl
Normal file
7
webui/source/templates/sources/delete.tpl
Normal 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>
|
||||
Reference in New Issue
Block a user