diff options
Diffstat (limited to 'mod')
-rw-r--r-- | mod/admin.php | 39 |
1 files changed, 31 insertions, 8 deletions
diff --git a/mod/admin.php b/mod/admin.php index 98b2f4266..f97c15786 100644 --- a/mod/admin.php +++ b/mod/admin.php @@ -590,19 +590,42 @@ function admin_page_dbsync(&$a) { function admin_page_queue($a) { $o = ''; - $r = q("select count(outq_posturl) as total, outq_posturl from outq + $r = q("select count(outq_posturl) as total, outq_posturl, max(hubloc_connected) as connected from outq where outq_delivered = 0 group by outq_posturl order by total desc"); - $o .= '<h3>' . t('Queue Statistics') . '</h3>'; + if($_REQUEST['drophub']) { + require_once('hubloc.php'); + hubloc_mark_as_down($_REQUEST['drophub']); + } - if($r) { - $o .= '<table><tr><td>' . t('Total Entries') . ' </td><td>' . t('Destination URL') . '</td></tr>'; - foreach($r as $rr) { - $o .= '<tr><td>' . $rr['total'] . '</td><td>' . $rr['outq_posturl'] . '</td></tr>'; - } - $o .= '</table>'; + if($_REQUEST['emptyhub']) { + $r = q("delete from outq where outq_posturl = '%s' ", + dbesc($_REQUEST['emptyhub']) + ); } + + + $r = q("select count(outq_posturl) as total, outq_posturl from outq + where outq_delivered = 0 group by outq_posturl order by total desc"); + + for($x = 0; $x < count($r); $x ++) { + $r[$x]['eurl'] = urlencode($r[$x]['outq_posturl']); + $r[$x]['connected'] = datetime_convert('UTC',date_default_timezone_get(),$r[$x]['connected'],'Y-m-d'); + } + + + $o = replace_macros(get_markup_template('admin_queue.tpl'), array( + '$banner' => t('Queue Statistics'), + '$numentries' => t('Total Entries'), + '$desturl' => t('Destination URL'), + '$nukehub' => t('Mark hub permanently offline'), + '$empty' => t('Empty queue for this hub'), + '$lastconn' => t('Last known contact'), + '$hasentries' => ((count($r)) ? true : false), + '$entries' => $r + )); + return $o; } |