From aa61834e61cb82a47b57fa28d68a48410ed5b012 Mon Sep 17 00:00:00 2001 From: Jonathan Miller Date: Sat, 20 Jun 2026 22:10:56 -0500 Subject: [PATCH] feat(support): show domain as support key in status bar with click-to-copy Domain is displayed in the status bar next to cache buttons. Click to copy to clipboard for easy sharing with support agents. HQ looks up the site by domain. --- .../src/Dispatcher/Dispatcher.php | 6 +++++- .../tmpl/default.php | 19 +++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/source/packages/mod_mokosuiteclient_cache/src/Dispatcher/Dispatcher.php b/source/packages/mod_mokosuiteclient_cache/src/Dispatcher/Dispatcher.php index 7020eccf..75e2f7bb 100644 --- a/source/packages/mod_mokosuiteclient_cache/src/Dispatcher/Dispatcher.php +++ b/source/packages/mod_mokosuiteclient_cache/src/Dispatcher/Dispatcher.php @@ -4,11 +4,15 @@ namespace Moko\Module\MokoSuiteClientCache\Administrator\Dispatcher; defined('_JEXEC') or die; use Joomla\CMS\Dispatcher\AbstractModuleDispatcher; +use Joomla\CMS\Uri\Uri; class Dispatcher extends AbstractModuleDispatcher { protected function getLayoutData() { - return parent::getLayoutData(); + $data = parent::getLayoutData(); + $data['domain'] = parse_url(Uri::root(), PHP_URL_HOST) ?: ''; + + return $data; } } diff --git a/source/packages/mod_mokosuiteclient_cache/tmpl/default.php b/source/packages/mod_mokosuiteclient_cache/tmpl/default.php index 5bbb3c43..4ea7e30d 100644 --- a/source/packages/mod_mokosuiteclient_cache/tmpl/default.php +++ b/source/packages/mod_mokosuiteclient_cache/tmpl/default.php @@ -13,6 +13,7 @@ use Joomla\CMS\Session\Session; $token = Session::getFormToken(); $cacheUrl = 'index.php?option=com_mokosuiteclient&task=clearCache&format=json'; $tempUrl = 'index.php?option=com_mokosuiteclient&task=clearTemp&format=json'; +$domain = $domain ?? ''; ?>
+ + + | + Clear: Cache @@ -85,5 +92,17 @@ document.addEventListener('DOMContentLoaded', function() { setupCleaner('mokosuiteclient-clear-cache', 'mokosuiteclient-cache-icon', '', ''); setupCleaner('mokosuiteclient-clear-temp', 'mokosuiteclient-temp-icon', '', ''); + + // Click-to-copy domain + var domainEl = document.getElementById('mokosuiteclient-domain'); + if (domainEl) { + domainEl.addEventListener('click', function() { + navigator.clipboard.writeText(domainEl.textContent.trim()).then(function() { + var orig = domainEl.textContent; + domainEl.textContent = 'Copied!'; + setTimeout(function() { domainEl.textContent = orig; }, 1500); + }); + }); + } });