From 6b93325f7005c39b38c570425b3be665f3946e7d Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Wed, 12 Aug 2015 15:44:03 +0200 Subject: [PATCH 1/3] make Inspect Queue link visible in admin adide menu --- view/templates/admin_aside.tpl | 1 + 1 file changed, 1 insertion(+) diff --git a/view/templates/admin_aside.tpl b/view/templates/admin_aside.tpl index 0f28a1cf3..4a6af8814 100644 --- a/view/templates/admin_aside.tpl +++ b/view/templates/admin_aside.tpl @@ -17,6 +17,7 @@ + {{if $admin.update}} From f439ac47c4e4dea316bfc12885ee4c10b6a96c4e Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Wed, 12 Aug 2015 15:44:59 +0200 Subject: [PATCH 2/3] admin panel: inspect queue --- mod/admin.php | 29 ++++++++++++++++++++++++++++- view/templates/admin_queue.tpl | 25 +++++++++++++++++++++++++ view/templates/admin_summary.tpl | 2 +- 3 files changed, 54 insertions(+), 2 deletions(-) create mode 100644 view/templates/admin_queue.tpl diff --git a/mod/admin.php b/mod/admin.php index d725c4581..9c3a4d5f0 100644 --- a/mod/admin.php +++ b/mod/admin.php @@ -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 index 000000000..aaca9b014 --- /dev/null +++ b/view/templates/admin_queue.tpl @@ -0,0 +1,25 @@ +
+

{{$title}} - {{$page}} ({{$count}})

+ +

{{$info}}

+ + + + + + + + + + {{foreach $entries as $e}} + + + + + + + + + {{/foreach}} +
{{$id_header}}{{$to_header}}{{$url_header}}{{$network_header}}{{$created_header}}{{$last_header}}
{{$e.id}}{{$e.name}}{{$e.nurl}}{{$e.network}}{{$e.created}}{{$e.last}}
+
diff --git a/view/templates/admin_summary.tpl b/view/templates/admin_summary.tpl index 8a3ac5bf0..05a4f0b31 100644 --- a/view/templates/admin_summary.tpl +++ b/view/templates/admin_summary.tpl @@ -4,7 +4,7 @@
{{$queues.label}}
-
{{$queues.deliverq}} - {{$queues.queue}}
+
{{$queues.deliverq}} - {{$queues.queue}}
{{$pending.0}}
From 5013e5daf175a3ec8587409191f7c9a54be6f1ce Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Wed, 12 Aug 2015 19:58:53 +0200 Subject: [PATCH 3/3] use to link to queue inspector --- mod/admin.php | 1 + view/templates/admin_summary.tpl | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/mod/admin.php b/mod/admin.php index 9c3a4d5f0..21a1c0030 100644 --- a/mod/admin.php +++ b/mod/admin.php @@ -253,6 +253,7 @@ function admin_page_summary(&$a) { '$accounts' => $accounts, '$pending' => Array( t('Pending registrations'), $pending), '$version' => Array( t('Version'), FRIENDICA_VERSION), + '$baseurl' => $a->get_baseurl(), '$platform' => FRIENDICA_PLATFORM, '$codename' => FRIENDICA_CODENAME, '$build' => get_config('system','build'), diff --git a/view/templates/admin_summary.tpl b/view/templates/admin_summary.tpl index 05a4f0b31..282c2b6fb 100644 --- a/view/templates/admin_summary.tpl +++ b/view/templates/admin_summary.tpl @@ -4,7 +4,7 @@
{{$queues.label}}
-
{{$queues.deliverq}} - {{$queues.queue}}
+
{{$queues.deliverq}} - {{$queues.queue}}
{{$pending.0}}