From a8b9f7d1653616c2db34e1d8f2d1377d41cebae7 Mon Sep 17 00:00:00 2001 From: Jonathan Miller Date: Sat, 27 Jun 2026 14:50:05 -0500 Subject: [PATCH] feat: cpanel module slim bar with collapsible detail panel Replaces full-width card with a compact bar showing site name, version, status badges, PIN, and IP. Click chevron to expand the detail panel with environment, stats, disk, and plugin info. Claude-Session: https://claude.ai/code/session_01Jo2JpjCwfHAh2HHRSjczKq --- .../tmpl/default.php | 136 ++++++++++++------ 1 file changed, 92 insertions(+), 44 deletions(-) diff --git a/source/packages/mod_mokosuiteclient_cpanel/tmpl/default.php b/source/packages/mod_mokosuiteclient_cpanel/tmpl/default.php index 9a3fbc97..ffa65e9c 100644 --- a/source/packages/mod_mokosuiteclient_cpanel/tmpl/default.php +++ b/source/packages/mod_mokosuiteclient_cpanel/tmpl/default.php @@ -1,9 +1,6 @@ 0, 'users' => 0, 'extensions' => 0, 'updates' => 0]; $disk = $disk ?? (object) ['free_mb' => null, 'total_mb' => null]; $currentIp = $currentIp ?? ''; -$collapsed = true; -$showHealth = $params->get('show_health', 1); -$showStats = $params->get('show_stats', 1); -$showDisk = $params->get('show_disk', 1); -$showIp = $params->get('show_ip', 1); -$showPlugins = $params->get('show_plugins', 1); -$showActions = $params->get('show_actions', 1); -$showVersions = $params->get('show_versions', 1); -$token = Session::getFormToken(); +$token = Session::getFormToken(); +$showPlugins = $params->get('show_plugins', 1); $enabledCount = 0; $totalCount = count($plugins); - -foreach ($plugins as $p) -{ - if ($p->enabled) - { - $enabledCount++; - } +foreach ($plugins as $p) { + if ($p->enabled) $enabledCount++; } $labels = [ @@ -52,41 +35,106 @@ $labels = [ 'mokosuiteclient_offline' => 'Offline Bypass', 'mokosuiteclient_dbip' => 'GeoIP Lookup', 'mokosuiteclient_license' => 'License Manager', + 'mokosuiteclient_backup' => 'Backup Bridge', ]; -$diskPct = ($disk->total_mb && $disk->total_mb > 0) - ? round((($disk->total_mb - ($disk->free_mb ?? 0)) / $disk->total_mb) * 100) - : null; -$diskColor = ($diskPct !== null && $diskPct > 90) ? 'bg-danger' : (($diskPct !== null && $diskPct > 75) ? 'bg-warning' : 'bg-success'); +$diskPct = ($disk->total_mb && $disk->total_mb > 0) + ? round((($disk->total_mb - ($disk->free_mb ?? 0)) / $disk->total_mb) * 100) : null; +$diskColor = ($diskPct !== null && $diskPct > 90) ? 'danger' : (($diskPct !== null && $diskPct > 75) ? 'warning' : 'success'); + +$canDashboard = Factory::getApplication()->getIdentity()->authorise('core.manage', 'com_mokosuiteclient'); +$siteName = htmlspecialchars($siteInfo->sitename ?? '', ENT_QUOTES, 'UTF-8'); +$mokoVer = htmlspecialchars($siteInfo->mokosuiteclient_version ?? '', ENT_QUOTES, 'UTF-8'); +$joomlaVer = htmlspecialchars($siteInfo->joomla_version ?? '', ENT_QUOTES, 'UTF-8'); +$phpVer = htmlspecialchars($siteInfo->php_version ?? '', ENT_QUOTES, 'UTF-8'); +$dbType = htmlspecialchars($siteInfo->db_type ?? '', ENT_QUOTES, 'UTF-8'); +$ipEscaped = htmlspecialchars($currentIp, ENT_QUOTES, 'UTF-8'); + +$statusDots = []; +if (!empty($siteInfo->debug)) $statusDots[] = 'Debug'; +if (!empty($siteInfo->offline)) $statusDots[] = 'Offline'; +if (($counts->updates ?? 0) > 0) $statusDots[] = '' . (int)$counts->updates . ' updates'; ?> -
-
- getIdentity()->authorise('core.manage', 'com_mokosuiteclient'); ?> +
+
- + + + - + - sitename ?? ''); ?> - MokoSuite mokosuiteclient_version ?? ''); ?> + + + v + + + !empty($supportPinAvailable), 'pin' => $supportPin ?? ''], $token, 'cpanel' ); ?> - Joomla joomla_version ?? ''); ?> - PHP php_version ?? ''); ?> - db_type ?? ''); ?> - debug)): ?> - Debug ON - - offline)): ?> - Offline - + - - + + + + +
+ +
+
+
+
+
Environment
+
+ MokoSuite + Joomla + PHP + +
+
+
+
Stats
+
+ articles ?? 0); ?> articles + users ?? 0); ?> users + extensions ?? 0); ?> extensions +
+ +
+
+
+
+ Disk % (free_mb ?? 0) / 1024, 1); ?> GB free) +
+ +
+ 0): ?> +
+
Plugins (/)
+
+ element); + $label = $labels[$el] ?? ucfirst(str_replace('mokosuiteclient_', '', $el)); + $color = $p->enabled ? 'success' : 'secondary'; + ?> + + +
+
+ +
+
+
+ +