Browse Source

admin panel: inspect queue

tags/3.4.2^2
Tobias Diekershoff 5 years ago
parent
commit
f439ac47c4
3 changed files with 54 additions and 2 deletions
  1. +28
    -1
      mod/admin.php
  2. +25
    -0
      view/templates/admin_queue.tpl
  3. +1
    -1
      view/templates/admin_summary.tpl

+ 28
- 1
mod/admin.php View File

@@ -105,7 +105,8 @@ function admin_content(&$a) {
'users' => Array($a->get_baseurl(true)."/admin/users/", t("Users") , "users"),
'plugins'=> Array($a->get_baseurl(true)."/admin/plugins/", t("Plugins") , "plugins"),
'themes' => Array($a->get_baseurl(true)."/admin/themes/", t("Themes") , "themes"),
'dbsync' => Array($a->get_baseurl(true)."/admin/dbsync/", t('DB updates'), "dbsync"),
'dbsync' => Array($a->get_baseurl(true)."/admin/dbsync/", t('DB updates'), "dbsync"),
'queue' => Array($a->get_baseurl(true)."/admin/queue/", t('Inspect Queue'), "queue"),
//'update' => Array($a->get_baseurl(true)."/admin/update/", t("Software Update") , "update")
);

@@ -165,6 +166,9 @@ function admin_content(&$a) {
case 'update':
$o = admin_page_remoteupdate($a);
break;
case 'queue':
$o = admin_page_queue($a);
break;
default:
notice( t("Item not found.") );
}
@@ -181,7 +185,30 @@ function admin_content(&$a) {
}
}

/**
* Admin Inspect Queue Page
* @param App $a
* return string
*/
function admin_page_queue(&$a) {
// get content from the queue table
$r = q("SELECT c.name,c.nurl,q.id,q.network,q.created,q.last from queue as q, contact as c where c.id=q.cid order by q.cid, q.created;");

$t = get_markup_template("admin_queue.tpl");
return replace_macros($t, array(
'$title' => t('Administration'),
'$page' => t('Inspect Queue'),
'$count' => sizeof($r),
'id_header' => t('ID'),
'$to_header' => t('Recipient Name'),
'$url_header' => t('Recipient Profile'),
'$network_header' => t('Network'),
'$created_header' => t('Created'),
'$last_header' => t('Last Tried'),
'$info' => t('This page lists the content of the queue for outgoing postings. These are postings the initial delivery failed for. They will be resend later and eventually deleted if the delivery fails permanently.'),
'$entries' => $r,
));
}
/**
* Admin Summary Page
* @param App $a


+ 25
- 0
view/templates/admin_queue.tpl View File

@@ -0,0 +1,25 @@
<div id='adminpage'>
<h1>{{$title}} - {{$page}} ({{$count}})</h1>
<p>{{$info}}</p>
<table>
<tr>
<th>{{$id_header}}</th>
<th>{{$to_header}}</th>
<th>{{$url_header}}</th>
<th>{{$network_header}}</th>
<th>{{$created_header}}</th>
<th>{{$last_header}}</th>
</tr>
{{foreach $entries as $e}}
<tr>
<td>{{$e.id}}</td>
<td>{{$e.name}}</td>
<td><a href="{{$e.nurl}}">{{$e.nurl}}</a></td>
<td>{{$e.network}}</td>
<td>{{$e.created}}</td>
<td>{{$e.last}}</td>
</tr>
{{/foreach}}
</table>
</div>

+ 1
- 1
view/templates/admin_summary.tpl View File

@@ -4,7 +4,7 @@

<dl>
<dt>{{$queues.label}}</dt>
<dd>{{$queues.deliverq}} - {{$queues.queue}}</dd>
<dd>{{$queues.deliverq}} - <a href="/admin/queue">{{$queues.queue}}</a></dd>
</dl>
<dl>
<dt>{{$pending.0}}</dt>


Loading…
Cancel
Save