From a2ee5705f47d3c4794180b0af4e433bee8a31ce5 Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Wed, 18 Feb 2026 21:32:47 +0100 Subject: [PATCH] Add System Status panel to HQ for admins Project......: Performance Profiling Sponsored-by.: NLnet NGI0 Commons Fund --- Zotlabs/Widget/Channel_activities.php | 28 +++++++++++++++++++++++++++ view/tpl/system_status_widget.tpl | 15 ++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 view/tpl/system_status_widget.tpl diff --git a/Zotlabs/Widget/Channel_activities.php b/Zotlabs/Widget/Channel_activities.php index c2184301e..35a28b627 100644 --- a/Zotlabs/Widget/Channel_activities.php +++ b/Zotlabs/Widget/Channel_activities.php @@ -9,6 +9,8 @@ namespace Zotlabs\Widget; use App; use Zotlabs\Lib\Apps; +use Zotlabs\Lib\Queue; +use Zotlabs\Lib\QueueWorkerStats; class Channel_activities { @@ -25,6 +27,9 @@ class Channel_activities { self::$uid = local_channel(); self::$channel = App::get_channel(); + if (is_site_admin()) { + self::get_system_status(); + } self::get_photos_activity(); self::get_files_activity(); self::get_webpages_activity(); @@ -247,5 +252,28 @@ class Channel_activities { } + private static function get_system_status(): void { + $items = []; + + if (function_exists('sys_getloadavg')) { + $items['System load'] = implode(' / ', sys_getloadavg()); + } + + $items['Output queue'] = Queue::get_undelivered(); + + $qwstats = new QueueWorkerStats(); + $items['Queue workers'] = $qwstats->active; + $items['Worker queue size'] = $qwstats->size; + + self::$activities['status'] = [ + 'label' => t('System status'), + 'icon' => 'gpu-card', + 'url' => z_root() . '/perf', + 'date' => datetime_convert(), + 'items' => $items, + 'tpl' => 'system_status_widget.tpl' + ]; + } + } diff --git a/view/tpl/system_status_widget.tpl b/view/tpl/system_status_widget.tpl new file mode 100644 index 000000000..057ec3866 --- /dev/null +++ b/view/tpl/system_status_widget.tpl @@ -0,0 +1,15 @@ +
+ {{$label}} +
+
+
+ + {{foreach $items as $title => $item}} + + + + + {{/foreach}} +
{{$title}}:{{$item}}
+
+