64a8504794
Platform: moko-platform CI / Gate 2: Unit Tests (8.1) (push) Blocked by required conditions
Platform: moko-platform CI / Gate 2: Unit Tests (8.2) (push) Blocked by required conditions
Platform: moko-platform CI / Gate 2: Unit Tests (8.3) (push) Blocked by required conditions
Platform: moko-platform CI / Gate 3: Self-Health Check (push) Blocked by required conditions
Platform: moko-platform CI / Gate 4: Governance (push) Blocked by required conditions
Platform: moko-platform CI / Gate 5: Template Integrity (push) Blocked by required conditions
Platform: moko-platform CI / CI Summary (push) Blocked by required conditions
Joomla: Extension CI / Tests (PHP 8.2) (pull_request) Blocked by required conditions
Joomla: Extension CI / Tests (PHP 8.3) (pull_request) Blocked by required conditions
Joomla: Extension CI / PHPStan Analysis (pull_request) Blocked by required conditions
Joomla: Extension CI / Build RC Pre-Release (pull_request) Blocked by required conditions
Platform: moko-platform CI / Gate 2: Unit Tests (8.1) (pull_request) Blocked by required conditions
Platform: moko-platform CI / Gate 2: Unit Tests (8.2) (pull_request) Blocked by required conditions
Platform: moko-platform CI / Gate 2: Unit Tests (8.3) (pull_request) Blocked by required conditions
Platform: moko-platform CI / Gate 3: Self-Health Check (pull_request) Blocked by required conditions
Platform: moko-platform CI / Gate 4: Governance (pull_request) Blocked by required conditions
Platform: moko-platform CI / Gate 5: Template Integrity (pull_request) Blocked by required conditions
Platform: moko-platform CI / CI Summary (pull_request) Blocked by required conditions
Universal: PR Check / Build RC Package (pull_request) Blocked by required conditions
Universal: PR Check / Report Issues (pull_request) Blocked by required conditions
Joomla: Extension CI / Release Readiness Check (pull_request) Failing after 6s
Universal: PR Check / Branch Policy (pull_request) Successful in 3s
Universal: Secret Scanning / Gitleaks Secret Scan (pull_request) Successful in 11s
Universal: Auto Version Bump / Version Bump (push) Successful in 12s
Generic: Project CI / Lint & Validate (pull_request) Successful in 14s
Generic: Repo Health / Access control (pull_request) Successful in 2s
Universal: PR Check / Validate PR (pull_request) Failing after 6s
Generic: Repo Health / Site Health (pull_request) Has been skipped
Universal: Pre-Release / Build Pre-Release (${{ inputs.stability || github.ref_name }}) (push) Successful in 22s
Joomla: Extension CI / Lint & Validate (pull_request) Failing after 36s
Platform: moko-platform CI / Gate 1: Code Quality (push) Failing after 36s
Platform: moko-platform CI / Gate 1: Code Quality (pull_request) Failing after 39s
Joomla: Metadata Validation / Validate Joomla Metadata (pull_request) Successful in 35s
Generic: Project CI / Tests (pull_request) Has been cancelled
Generic: Repo Health / Scripts governance (pull_request) Has been cancelled
Generic: Repo Health / Repository health (pull_request) Has been cancelled
Generic: Repo Health / Report Issues (pull_request) Has been cancelled
PIN is derived from HMAC-SHA256(health_api_token, YYYY-MM-DD) so both client and HQ compute the same value independently. Rotates at UTC midnight. Shown on cpanel module header and component dashboard.
101 lines
3.1 KiB
PHP
101 lines
3.1 KiB
PHP
<?php
|
|
/**
|
|
* @package MokoSuiteClient
|
|
* @subpackage com_mokosuiteclient
|
|
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
|
|
* @license GNU General Public License version 3 or later; see LICENSE
|
|
*/
|
|
|
|
namespace Moko\Component\MokoSuiteClient\Administrator\View\Dashboard;
|
|
|
|
defined('_JEXEC') or die;
|
|
|
|
use Joomla\CMS\Factory;
|
|
use Joomla\CMS\Language\Text;
|
|
use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;
|
|
use Joomla\CMS\Toolbar\ToolbarHelper;
|
|
|
|
class HtmlView extends BaseHtmlView
|
|
{
|
|
protected $plugins = [];
|
|
protected $siteInfo;
|
|
protected $recentLogins = [];
|
|
protected $pendingUpdates = [];
|
|
protected $checkedOutItems = [];
|
|
protected $wafBlocks = [];
|
|
protected $wafChartData = [];
|
|
protected $loginChartData = [];
|
|
protected $mokoExtensions = [];
|
|
public $supportPin = '';
|
|
|
|
public function display($tpl = null)
|
|
{
|
|
$model = $this->getModel();
|
|
|
|
$this->plugins = $model->getFeaturePlugins();
|
|
$this->siteInfo = $model->getSiteInfo();
|
|
|
|
// Daily support PIN from health token
|
|
try
|
|
{
|
|
$db = \Joomla\CMS\Factory::getDbo();
|
|
$db->setQuery(
|
|
$db->getQuery(true)
|
|
->select($db->quoteName('params'))
|
|
->from($db->quoteName('#__extensions'))
|
|
->where($db->quoteName('element') . ' = ' . $db->quote('mokosuiteclient'))
|
|
->where($db->quoteName('type') . ' = ' . $db->quote('plugin'))
|
|
->where($db->quoteName('folder') . ' = ' . $db->quote('system'))
|
|
);
|
|
$token = (json_decode((string) $db->loadResult()))->health_api_token ?? '';
|
|
|
|
if (!empty($token))
|
|
{
|
|
$hash = hash_hmac('sha256', gmdate('Y-m-d'), $token);
|
|
$this->supportPin = 'MOKO-' . strtoupper(substr($hash, 0, 4)) . '-' . strtoupper(substr($hash, 4, 4));
|
|
}
|
|
}
|
|
catch (\Throwable $e) {}
|
|
$this->recentLogins = $model->getRecentLogins(5);
|
|
$this->pendingUpdates = $model->getPendingUpdates();
|
|
$this->checkedOutItems = $model->getCheckedOutItems();
|
|
$this->wafBlocks = $model->getRecentWafBlocks(5);
|
|
$this->wafChartData = $model->getWafBlocksByDay(14);
|
|
$this->loginChartData = $model->getLoginsByDay(14);
|
|
$this->mokoExtensions = $model->getMokoExtensions();
|
|
|
|
// Check for importable Akeeba data
|
|
try
|
|
{
|
|
$importModel = new \Moko\Component\MokoSuiteClient\Administrator\Model\ImportModel();
|
|
$this->adminToolsAvailable = $importModel->checkAdminToolsAvailable();
|
|
$this->atsAvailable = $importModel->checkAtsAvailable();
|
|
}
|
|
catch (\Throwable $e)
|
|
{
|
|
$this->adminToolsAvailable = null;
|
|
$this->atsAvailable = null;
|
|
}
|
|
|
|
$this->addToolbar();
|
|
|
|
$wa = Factory::getApplication()->getDocument()->getWebAssetManager();
|
|
$wa->registerAndUseStyle('com_mokosuiteclient.dashboard', 'com_mokosuiteclient/dashboard.css');
|
|
$wa->registerAndUseScript('com_mokosuiteclient.dashboard', 'com_mokosuiteclient/dashboard.js', [], ['defer' => true]);
|
|
|
|
parent::display($tpl);
|
|
}
|
|
|
|
protected function addToolbar(): void
|
|
{
|
|
ToolbarHelper::title(Text::_('COM_MOKOSUITECLIENT_DASHBOARD_TITLE'), 'cogs');
|
|
|
|
$user = Factory::getApplication()->getIdentity();
|
|
|
|
if ($user->authorise('core.admin', 'com_mokosuiteclient'))
|
|
{
|
|
ToolbarHelper::preferences('com_mokosuiteclient');
|
|
}
|
|
}
|
|
}
|