2009-01-01 00:23:29 +00:00
|
|
|
<?php defined("SYSPATH") or die("No direct script access.") ?>
|
2009-01-11 22:56:52 +00:00
|
|
|
<div id="gAdminMaintenance">
|
2009-01-08 17:13:06 +00:00
|
|
|
<h1> <?= t("Maintenance Tasks") ?> </h1>
|
2008-12-28 10:12:41 +00:00
|
|
|
<p>
|
2009-01-08 17:13:06 +00:00
|
|
|
<?= t("Occasionally your Gallery will require some maintenance. Here are some tasks you can use to keep it running smoothly.") ?>
|
2008-12-28 10:12:41 +00:00
|
|
|
</p>
|
|
|
|
|
|
|
|
|
|
<div id="gAvailableTasks">
|
2009-01-08 17:13:06 +00:00
|
|
|
<h2> <?= t("Available Tasks") ?> </h2>
|
2009-01-24 20:06:13 +00:00
|
|
|
<table>
|
2008-12-28 10:12:41 +00:00
|
|
|
<tr>
|
2008-12-28 23:48:15 +00:00
|
|
|
<th>
|
2009-01-08 17:13:06 +00:00
|
|
|
<?= t("Name") ?>
|
2008-12-28 23:48:15 +00:00
|
|
|
</th>
|
|
|
|
|
<th>
|
2009-01-08 17:13:06 +00:00
|
|
|
<?= t("Description") ?>
|
2008-12-28 23:48:15 +00:00
|
|
|
</th>
|
|
|
|
|
<th>
|
2009-01-08 17:13:06 +00:00
|
|
|
<?= t("Action") ?>
|
2008-12-28 23:48:15 +00:00
|
|
|
</th>
|
|
|
|
|
</tr>
|
2009-01-16 04:49:56 +00:00
|
|
|
<? foreach ($task_definitions as $task): ?>
|
2008-12-28 23:48:15 +00:00
|
|
|
<tr class="<?= log::severity_class($task->severity) ?>">
|
|
|
|
|
<td>
|
|
|
|
|
<?= $task->name ?>
|
|
|
|
|
</td>
|
2008-12-28 10:12:41 +00:00
|
|
|
<td>
|
|
|
|
|
<?= $task->description ?>
|
|
|
|
|
</td>
|
|
|
|
|
<td>
|
2008-12-28 23:48:15 +00:00
|
|
|
<a href="<?= url::site("admin/maintenance/start/$task->callback?csrf=$csrf") ?>"
|
2009-07-08 08:26:14 -07:00
|
|
|
class="gDialogLink gButtonLink ui-icon-left ui-state-default ui-corner-all">
|
2009-01-08 17:13:06 +00:00
|
|
|
<?= t("run") ?>
|
2008-12-28 10:12:41 +00:00
|
|
|
</a>
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
2009-01-16 04:49:56 +00:00
|
|
|
<? endforeach ?>
|
2008-12-28 10:12:41 +00:00
|
|
|
</table>
|
|
|
|
|
</div>
|
|
|
|
|
|
2009-03-09 07:28:19 +00:00
|
|
|
<? if ($running_tasks->count()): ?>
|
2008-12-28 10:12:41 +00:00
|
|
|
<div id="gRunningTasks">
|
2009-01-08 17:13:06 +00:00
|
|
|
<h2> <?= t("Running Tasks") ?> </h2>
|
2009-04-21 04:17:56 +00:00
|
|
|
<a href="<?= url::site("admin/maintenance/cancel_running_tasks?csrf=$csrf") ?>"
|
|
|
|
|
class="gButtonLink ui-icon-left ui-state-default ui-corner-all right">
|
|
|
|
|
<?= t("cancel all") ?></a>
|
2008-12-28 10:12:41 +00:00
|
|
|
|
2009-01-24 20:06:13 +00:00
|
|
|
<table>
|
2008-12-28 23:48:15 +00:00
|
|
|
<tr>
|
|
|
|
|
<th>
|
2009-01-08 17:13:06 +00:00
|
|
|
<?= t("Last Updated") ?>
|
2008-12-28 23:48:15 +00:00
|
|
|
</th>
|
|
|
|
|
<th>
|
2009-01-08 17:13:06 +00:00
|
|
|
<?= t("Name") ?>
|
2008-12-28 23:48:15 +00:00
|
|
|
</th>
|
|
|
|
|
<th>
|
2009-01-08 17:13:06 +00:00
|
|
|
<?= t("Status") ?>
|
2008-12-28 23:48:15 +00:00
|
|
|
</th>
|
|
|
|
|
<th>
|
2009-01-08 17:13:06 +00:00
|
|
|
<?= t("Info") ?>
|
2008-12-28 23:48:15 +00:00
|
|
|
</th>
|
2009-02-27 16:28:20 +00:00
|
|
|
<th>
|
|
|
|
|
<?= t("Owner") ?>
|
|
|
|
|
</th>
|
2008-12-28 23:48:15 +00:00
|
|
|
<th>
|
2009-01-08 17:13:06 +00:00
|
|
|
<?= t("Action") ?>
|
2008-12-28 23:48:15 +00:00
|
|
|
</th>
|
|
|
|
|
</tr>
|
|
|
|
|
<? foreach ($running_tasks as $task): ?>
|
|
|
|
|
<tr class="<?= $task->state == "stalled" ? "gWarning" : "" ?>">
|
|
|
|
|
<td>
|
2009-06-12 22:44:51 -07:00
|
|
|
<?= gallery::date_time($task->updated) ?>
|
2008-12-28 23:48:15 +00:00
|
|
|
</td>
|
|
|
|
|
<td>
|
|
|
|
|
<?= $task->name ?>
|
|
|
|
|
</td>
|
|
|
|
|
<td>
|
|
|
|
|
<? if ($task->done): ?>
|
|
|
|
|
<? if ($task->state == "cancelled"): ?>
|
2009-01-08 17:13:06 +00:00
|
|
|
<?= t("Cancelled") ?>
|
2008-12-28 23:48:15 +00:00
|
|
|
<? endif ?>
|
2009-07-10 14:19:33 -07:00
|
|
|
<?= t("Close") ?>
|
2008-12-28 23:48:15 +00:00
|
|
|
<? elseif ($task->state == "stalled"): ?>
|
2009-01-08 17:13:06 +00:00
|
|
|
<?= t("Stalled") ?>
|
2008-12-28 23:48:15 +00:00
|
|
|
<? else: ?>
|
2009-01-15 10:02:41 +00:00
|
|
|
<?= t("%percent_complete% Complete", array("percent_complete" => $task->percent_complete)) ?>
|
2008-12-28 23:48:15 +00:00
|
|
|
<? endif ?>
|
|
|
|
|
</td>
|
|
|
|
|
<td>
|
|
|
|
|
<?= $task->status ?>
|
|
|
|
|
</td>
|
2009-02-27 16:28:20 +00:00
|
|
|
<td>
|
2009-05-31 00:11:48 -07:00
|
|
|
<?= p::clean($task->owner()->name) ?>
|
2009-02-27 16:28:20 +00:00
|
|
|
</td>
|
2008-12-28 23:48:15 +00:00
|
|
|
<td>
|
|
|
|
|
<? if ($task->state == "stalled"): ?>
|
2009-07-08 08:26:14 -07:00
|
|
|
<a class="gDialogLink gButtonLink ui-icon-left ui-state-default ui-corner-all"
|
|
|
|
|
href="<?= url::site("admin/maintenance/resume/$task->id?csrf=$csrf") ?>">
|
2009-01-08 17:13:06 +00:00
|
|
|
<?= t("resume") ?>
|
2008-12-28 23:48:15 +00:00
|
|
|
</a>
|
|
|
|
|
<? endif ?>
|
2009-07-08 08:26:14 -07:00
|
|
|
<a href="<?= url::site("admin/maintenance/cancel/$task->id?csrf=$csrf") ?>"
|
|
|
|
|
class="gButtonLink ui-icon-left ui-state-default ui-corner-all right">
|
2009-01-08 17:13:06 +00:00
|
|
|
<?= t("cancel") ?>
|
2008-12-28 23:48:15 +00:00
|
|
|
</a>
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<? endforeach ?>
|
|
|
|
|
</table>
|
|
|
|
|
</div>
|
2009-03-09 07:28:19 +00:00
|
|
|
<? endif ?>
|
2008-12-28 23:48:15 +00:00
|
|
|
|
2009-03-09 07:28:19 +00:00
|
|
|
<? if ($finished_tasks->count()): ?>
|
2008-12-28 23:48:15 +00:00
|
|
|
<div id="gFinishedTasks">
|
2009-03-16 05:50:05 +00:00
|
|
|
<a href="<?= url::site("admin/maintenance/remove_finished_tasks?csrf=$csrf") ?>"
|
|
|
|
|
class="gButtonLink ui-icon-left ui-state-default ui-corner-all right">
|
|
|
|
|
<span class="ui-icon ui-icon-trash"></span><?= t("remove all finished") ?></a>
|
2008-12-28 23:48:15 +00:00
|
|
|
|
2009-03-16 05:50:05 +00:00
|
|
|
<h2> <?= t("Finished Tasks") ?> </h2>
|
2009-01-24 20:06:13 +00:00
|
|
|
<table>
|
2008-12-28 23:48:15 +00:00
|
|
|
<tr>
|
|
|
|
|
<th>
|
2009-01-08 17:13:06 +00:00
|
|
|
<?= t("Last Updated") ?>
|
2008-12-28 23:48:15 +00:00
|
|
|
</th>
|
|
|
|
|
<th>
|
2009-01-08 17:13:06 +00:00
|
|
|
<?= t("Name") ?>
|
2008-12-28 23:48:15 +00:00
|
|
|
</th>
|
|
|
|
|
<th>
|
2009-01-08 17:13:06 +00:00
|
|
|
<?= t("Status") ?>
|
2008-12-28 23:48:15 +00:00
|
|
|
</th>
|
|
|
|
|
<th>
|
2009-01-08 17:13:06 +00:00
|
|
|
<?= t("Info") ?>
|
2008-12-28 23:48:15 +00:00
|
|
|
</th>
|
2009-02-27 16:28:20 +00:00
|
|
|
<th>
|
|
|
|
|
<?= t("Owner") ?>
|
|
|
|
|
</th>
|
2008-12-28 23:48:15 +00:00
|
|
|
<th>
|
2009-01-08 17:13:06 +00:00
|
|
|
<?= t("Action") ?>
|
2008-12-28 23:48:15 +00:00
|
|
|
</th>
|
|
|
|
|
</tr>
|
|
|
|
|
<? foreach ($finished_tasks as $task): ?>
|
|
|
|
|
<tr class="<?= $task->state == "success" ? "gSuccess" : "gError" ?>">
|
|
|
|
|
<td>
|
2009-06-12 22:44:51 -07:00
|
|
|
<?= gallery::date_time($task->updated) ?>
|
2008-12-28 23:48:15 +00:00
|
|
|
</td>
|
|
|
|
|
<td>
|
|
|
|
|
<?= $task->name ?>
|
|
|
|
|
</td>
|
|
|
|
|
<td>
|
|
|
|
|
<? if ($task->state == "success"): ?>
|
2009-01-08 17:13:06 +00:00
|
|
|
<?= t("Success") ?>
|
2008-12-28 23:48:15 +00:00
|
|
|
<? elseif ($task->state == "error"): ?>
|
2009-01-08 17:13:06 +00:00
|
|
|
<?= t("Failed") ?>
|
2008-12-28 23:48:15 +00:00
|
|
|
<? elseif ($task->state == "cancelled"): ?>
|
2009-01-08 17:13:06 +00:00
|
|
|
<?= t("Cancelled") ?>
|
2008-12-28 23:48:15 +00:00
|
|
|
<? endif ?>
|
|
|
|
|
</td>
|
|
|
|
|
<td>
|
|
|
|
|
<?= $task->status ?>
|
|
|
|
|
</td>
|
2009-02-27 16:28:20 +00:00
|
|
|
<td>
|
2009-03-09 07:28:19 +00:00
|
|
|
<?= $task->owner()->name ?>
|
2009-02-27 16:28:20 +00:00
|
|
|
</td>
|
2008-12-28 23:48:15 +00:00
|
|
|
<td>
|
|
|
|
|
<? if ($task->done): ?>
|
2009-07-07 21:49:54 -07:00
|
|
|
<a href="<?= url::site("admin/maintenance/remove/$task->id?csrf=$csrf") ?>" class="gButtonLink ui-state-default ui-corner-all">
|
2009-01-08 17:13:06 +00:00
|
|
|
<?= t("remove") ?>
|
2008-12-28 23:48:15 +00:00
|
|
|
</a>
|
2009-07-07 12:49:21 -07:00
|
|
|
<? if ($task->get_log()): ?>
|
2009-07-07 21:49:54 -07:00
|
|
|
<a href="<?= url::site("admin/maintenance/show_log/$task->id?csrf=$csrf") ?>" class="gDialogLink gButtonLink ui-state-default ui-corner-all">
|
2009-07-05 17:38:49 -07:00
|
|
|
<?= t("browse log") ?>
|
|
|
|
|
</a>
|
|
|
|
|
<? endif ?>
|
2008-12-28 23:48:15 +00:00
|
|
|
<? else: ?>
|
2009-07-07 21:49:54 -07:00
|
|
|
<a href="<?= url::site("admin/maintenance/resume/$task->id?csrf=$csrf") ?>" class="gDialogLink gButtonLink" ui-state-default ui-corner-all>
|
2009-01-08 17:13:06 +00:00
|
|
|
<?= t("resume") ?>
|
2008-12-28 23:48:15 +00:00
|
|
|
</a>
|
2009-07-07 21:49:54 -07:00
|
|
|
<a href="<?= url::site("admin/maintenance/cancel/$task->id?csrf=$csrf") ?>" class="gButtonLink ui-state-default ui-corner-all">
|
2009-01-08 17:13:06 +00:00
|
|
|
<?= t("cancel") ?>
|
2008-12-28 23:48:15 +00:00
|
|
|
</a>
|
|
|
|
|
<? endif ?>
|
2009-07-07 21:49:54 -07:00
|
|
|
</ul>
|
2008-12-28 23:48:15 +00:00
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<? endforeach ?>
|
|
|
|
|
</table>
|
2008-12-28 10:12:41 +00:00
|
|
|
</div>
|
2009-03-09 07:28:19 +00:00
|
|
|
<? endif ?>
|
2008-12-28 10:12:41 +00:00
|
|
|
</div>
|