From 0aeaea208fb4a18ac6ad4559eab1e0e960365c2d Mon Sep 17 00:00:00 2001 From: Jonathan Miller Date: Tue, 23 Jun 2026 07:44:50 -0500 Subject: [PATCH] feat(dashboard): show frontend/backend app badges on recent logins, full-width ext bar - Recent logins table now parses action log message JSON to display Admin/Site badge indicating where each login occurred - Login query uses exact match on LOGGED_IN key (excludes logout events) - Login limit increased from 5 to 10 - Info bar reverted from stacked column to horizontal row layout - Extension version bar uses flex: 1 1 0 for full-width auto-sized cells - Updated CHANGELOG --- CHANGELOG.md | 4 +++ .../admin/src/Model/DashboardModel.php | 2 +- .../admin/src/View/Dashboard/HtmlView.php | 2 +- .../admin/tmpl/dashboard/default.php | 22 +++++++++++--- .../media/css/dashboard.css | 30 +++++++++++++++++-- 5 files changed, 51 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 75b8a552..9faaefe2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,7 @@ - **Backup bridge plugin** — discovers MokoSuiteBackup's BackupStatusHelper and sends status in heartbeat payloads - **Activity log** — blockchain-style hash chain for tamper detection in MokoSuiteHQ - **Dev domain in heartbeat** — client sends dev alias to HQ for display on dashboard +- **Login app badges** — recent logins table shows Admin/Site badge parsed from Joomla action log message JSON ### Changed - **Plugin install** — self-healing: extracts plugin zips from package on every update, creates missing extension records with namespace @@ -41,6 +42,9 @@ - **Heartbeat** — correct URL (suite.dev), correct API route (mokosuitehq), correct headers (X-MokoSuite-*), fresh RSA key pair - **Date formats** — all templates use Joomla locale-aware DATE_FORMAT_LC2/LC4 - **Domains** — updated from waas.dev to suite.dev.mokoconsulting.tech throughout +- **Dashboard info bar** — reverted stacked layout; info items back to horizontal row +- **Extension version bar** — full-width auto-sized strip with equal-width cells and border separators +- **Recent logins** — exact match on LOGGED_IN key (excludes logout noise), limit increased to 10 ### Removed - **Helpdesk/tickets** — migrated to MokoSuiteCRM (issue #67) diff --git a/source/packages/com_mokosuiteclient/admin/src/Model/DashboardModel.php b/source/packages/com_mokosuiteclient/admin/src/Model/DashboardModel.php index b56e0034..59647ecc 100644 --- a/source/packages/com_mokosuiteclient/admin/src/Model/DashboardModel.php +++ b/source/packages/com_mokosuiteclient/admin/src/Model/DashboardModel.php @@ -454,7 +454,7 @@ class DashboardModel extends BaseDatabaseModel ]) ->from($db->quoteName('#__action_logs', 'a')) ->leftJoin($db->quoteName('#__users', 'u') . ' ON ' . $db->quoteName('u.id') . ' = ' . $db->quoteName('a.user_id')) - ->where($db->quoteName('a.message_language_key') . ' LIKE ' . $db->quote('%LOGIN%')) + ->where($db->quoteName('a.message_language_key') . ' = ' . $db->quote('PLG_ACTIONLOG_JOOMLA_USER_LOGGED_IN')) ->order($db->quoteName('a.log_date') . ' DESC') ->setLimit($limit); $db->setQuery($query); diff --git a/source/packages/com_mokosuiteclient/admin/src/View/Dashboard/HtmlView.php b/source/packages/com_mokosuiteclient/admin/src/View/Dashboard/HtmlView.php index 1e85f947..322ba7b1 100644 --- a/source/packages/com_mokosuiteclient/admin/src/View/Dashboard/HtmlView.php +++ b/source/packages/com_mokosuiteclient/admin/src/View/Dashboard/HtmlView.php @@ -56,7 +56,7 @@ class HtmlView extends BaseHtmlView } } catch (\Throwable $e) {} - $this->recentLogins = $model->getRecentLogins(5); + $this->recentLogins = $model->getRecentLogins(10); $this->pendingUpdates = $model->getPendingUpdates(); $this->checkedOutItems = $model->getCheckedOutItems(); $this->wafBlocks = $model->getRecentWafBlocks(5); diff --git a/source/packages/com_mokosuiteclient/admin/tmpl/dashboard/default.php b/source/packages/com_mokosuiteclient/admin/tmpl/dashboard/default.php index e736fe18..52b41aae 100644 --- a/source/packages/com_mokosuiteclient/admin/tmpl/dashboard/default.php +++ b/source/packages/com_mokosuiteclient/admin/tmpl/dashboard/default.php @@ -85,7 +85,7 @@ $categoryOrder = ['core', 'security', 'monitoring', 'content', 'tools', 'api']; -
+
'icon-cogs', @@ -99,7 +99,7 @@ $categoryOrder = ['core', 'security', 'monitoring', 'content', 'tools', 'api']; $label = str_replace(['mod_mokosuiteclient_', 'com_mokosuiteclient'], ['', 'Component'], $ext->element); $label = ucfirst($label ?: 'Component'); ?> -
+
escape($label); ?> escape($ext->version); ?> @@ -373,11 +373,25 @@ $categoryOrder = ['core', 'security', 'monitoring', 'content', 'tools', 'api'];
- + - + message ?? '{}'); + $appKey = $msgData->app ?? ''; + if (stripos($appKey, 'ADMINISTRATOR') !== false) { + $appLabel = 'Admin'; + $appBadge = 'bg-dark'; + } elseif (stripos($appKey, 'SITE') !== false) { + $appLabel = 'Site'; + $appBadge = 'bg-info text-dark'; + } else { + $appLabel = 'Unknown'; + $appBadge = 'bg-secondary'; + } + ?> + diff --git a/source/packages/com_mokosuiteclient/media/css/dashboard.css b/source/packages/com_mokosuiteclient/media/css/dashboard.css index 64b20df7..ad12a5bd 100644 --- a/source/packages/com_mokosuiteclient/media/css/dashboard.css +++ b/source/packages/com_mokosuiteclient/media/css/dashboard.css @@ -15,15 +15,14 @@ .mokosuiteclient-info-item { display: flex; - flex-direction: column; align-items: center; - gap: 0.15rem; + gap: 0.35rem; flex: 0 1 auto; min-width: 0; } .mokosuiteclient-info-label { - font-size: 0.7rem; + font-size: 0.75rem; color: #6c757d; text-transform: uppercase; letter-spacing: 0.04em; @@ -40,6 +39,31 @@ padding: 0.3em 0.6em; } +/* Moko extensions version bar — full-width auto-sized */ +.mokosuiteclient-ext-bar { + display: flex; + flex-wrap: wrap; + gap: 0; + width: 100%; +} + +.mokosuiteclient-ext-bar .mokosuiteclient-ext-item { + flex: 1 1 0; + min-width: 0; + display: flex; + align-items: center; + justify-content: center; + gap: 0.4rem; + padding: 0.5rem 0.75rem; + font-size: 0.82rem; + border-right: 1px solid #dee2e6; + white-space: nowrap; +} + +.mokosuiteclient-ext-bar .mokosuiteclient-ext-item:last-child { + border-right: none; +} + /* Plugin cards */ .mokosuiteclient-plugin-card { transition: box-shadow 0.15s ease, opacity 0.15s ease;
UserIPTime
UserAppIPTime
escape($login->username ?? ''); ?> escape($login->ip_address ?? ''); ?> log_date, Text::_('DATE_FORMAT_LC4')); ?>