]> git.mxchange.org Git - friendica.git/commitdiff
admin panel: inspect queue
authorTobias Diekershoff <tobias.diekershoff@gmx.net>
Wed, 12 Aug 2015 13:44:59 +0000 (15:44 +0200)
committerTobias Diekershoff <tobias.diekershoff@gmx.net>
Wed, 12 Aug 2015 13:44:59 +0000 (15:44 +0200)
mod/admin.php
view/templates/admin_queue.tpl [new file with mode: 0644]
view/templates/admin_summary.tpl

index d725c4581191785b4e392f5698804eea6f26ec0a..9c3a4d5f0d26b8f754cc7c6af7e7428b8d26238b 100644 (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
diff --git a/view/templates/admin_queue.tpl b/view/templates/admin_queue.tpl
new file mode 100644 (file)
index 0000000..aaca9b0
--- /dev/null
@@ -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>
index 8a3ac5bf0ad8b46255eaccb8e9dfb42eff58f305..05a4f0b31ad2119862642c6edde9964e1acce961 100644 (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>