'tos' => ["admin/tos/" , L10n::t("Terms of Service") , "tos"] ]],
'database' => [ L10n::t('Database'), [
'dbsync' => ["admin/dbsync/" , L10n::t('DB updates') , "dbsync"],
- 'queue' => ["admin/queue/" , L10n::t('Inspect Queue') , "queue"], ]],
+ 'queue' => ["admin/queue/" , L10n::t('Inspect Queue') , "queue"],
+ 'workerqueue' => ["admin/workerqueue/" , L10n::t('Inspect worker Queue') , "workerqueue"] ]],
'tools' => [ L10n::t('Tools'), [
'contactblock' => ["admin/contactblock/", L10n::t('Contact Blocklist') , "contactblock"],
'blocklist' => ["admin/blocklist/" , L10n::t('Server Blocklist') , "blocklist"],
case 'queue':
$o = admin_page_queue($a);
break;
+ case 'workerqueue':
+ $o = admin_page_workerqueue($a);
+ break;
case 'federation':
$o = admin_page_federation($a);
break;
* @brief Admin Inspect Queue Page
*
* Generates a page for the admin to have a look into the current queue of
- * postings that are not deliverabke. Shown are the name and url of the
+ * postings that are not deliverable. Shown are the name and url of the
* recipient, the delivery network and the dates when the posting was generated
* and the last time tried to deliver the posting.
*
]);
}
+/**
+ * @brief Admin Inspect Worker Queue Page
+ *
+ * Generates a page for the admin to have a look into the current queue of
+ * worker jobs. Shown are the parameters for the job and its priority.
+ *
+ * The returned string holds the content of the page.
+ *
+ * @param App $a
+ * @return string
+ */
+function admin_page_workerqueue(App $a)
+{
+ // get jobs from the workerqueue table
+ $statement = dba::select('workerqueue', ['id', 'parameter', 'created', 'priority'], ['done' => 0], ['order'=> ['priority']]);
+ $r = dba::inArray($statement);
+
+ $t = get_markup_template('admin/workerqueue.tpl');
+ return replace_macros($t, [
+ '$title' => L10n::t('Administration'),
+ '$page' => L10n::t('Inspect Worker Queue'),
+ '$count' => count($r),
+ '$id_header' => L10n::t('ID'),
+ '$param_header' => L10n::t('Job Parameters'),
+ '$created_header' => L10n::t('Created'),
+ '$prio_header' => L10n::t('Priority'),
+ '$info' => L10n::t('This page lists the currently queued worker jobs. These jobs are handled by the worker cronjob you\'ve set up during install.'),
+ '$entries' => $r,
+ ]);
+}
+
/**
* @brief Admin Summary Page
*