Merge pull request 'Release 02.01.43: Site aliases tab, API endpoints, heartbeat fix' (#27) from dev into main
Universal: Cascade Main → Dev / Cascade main → branches (push) Successful in 3s
Universal: Cascade Main → Dev / Cascade main → branches (push) Successful in 3s
This commit was merged in pull request #27.
This commit is contained in:
@@ -31,6 +31,30 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
- License/subscription check
|
||||
- System email template branding (DB approach)
|
||||
|
||||
## [02.01.43] - 2026-05-23
|
||||
|
||||
### Added
|
||||
- Site Aliases tab with Joomla subform repeatable-table UI
|
||||
- Per-alias offline toggle with custom maintenance message (503 response)
|
||||
- Per-alias robots meta directive (index/noindex/follow/nofollow/none)
|
||||
- Per-alias backend redirect (admin panel redirects to primary domain)
|
||||
- 6 MokoWaaS API endpoints: health, install, update, cache, backup, info
|
||||
- Remote plugin install via `/?mokowaas=install` endpoint
|
||||
- Remote update trigger via `/?mokowaas=update` endpoint
|
||||
- Remote cache clear via `/?mokowaas=cache` endpoint (site + admin + opcache)
|
||||
- Remote Akeeba Backup trigger via `/?mokowaas=backup` endpoint
|
||||
- Compact site info via `/?mokowaas=info` endpoint
|
||||
|
||||
### Changed
|
||||
- Site aliases moved from comma-separated text field to structured subform
|
||||
- Each alias now stores domain, offline, offline_message, robots, redirect_backend
|
||||
- Heartbeat provisioning updated for subform alias format
|
||||
- Grafana datasource names use domain-only (removed "MokoWaaS - " prefix)
|
||||
|
||||
### Fixed
|
||||
- Heartbeat receiver accepts any 200 status (registered/updated/ok)
|
||||
- script.php uses heartbeat receiver instead of Grafana API (fixes 403 RBAC)
|
||||
|
||||
## [02.01.37] - 2026-05-23
|
||||
|
||||
### Added
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
DEFGROUP: Joomla.Plugin
|
||||
INGROUP: MokoWaaS
|
||||
REPO: https://github.com/mokoconsulting-tech/mokowaas
|
||||
VERSION: 02.01.42
|
||||
VERSION: 02.01.43
|
||||
PATH: /README.md
|
||||
BRIEF: Rebranding plugin for MokoWaaS platform
|
||||
NOTE: Internal WaaS identity abstraction layer
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
# MokoWaaS Plugin
|
||||
|
||||
[](https://github.com/mokoconsulting-tech/MokoWaaS/releases/tag/v02)
|
||||
[](https://github.com/mokoconsulting-tech/MokoWaaS/releases/tag/v02)
|
||||
[](LICENSE)
|
||||
[](https://www.joomla.org)
|
||||
[](https://www.php.net)
|
||||
|
||||
+156
-21
@@ -96,6 +96,9 @@ class MokoWaaS extends CMSPlugin
|
||||
// Security: HTTPS redirect (runs for all clients)
|
||||
$this->enforceHttps();
|
||||
|
||||
// Site alias handling: offline page and backend redirect
|
||||
$this->handleSiteAlias();
|
||||
|
||||
// MokoWaaS API endpoints (run before routing)
|
||||
$mokoAction = $this->app->input->get('mokowaas', '');
|
||||
|
||||
@@ -880,14 +883,20 @@ class MokoWaaS extends CMSPlugin
|
||||
*/
|
||||
public function onBeforeCompileHead()
|
||||
{
|
||||
if (!$this->app->isClient('administrator'))
|
||||
$doc = $this->app->getDocument();
|
||||
|
||||
if ($doc->getType() !== 'html')
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
$doc = $this->app->getDocument();
|
||||
// Inject robots meta tag for alias domains (frontend only)
|
||||
if ($this->app->isClient('site'))
|
||||
{
|
||||
$this->injectAliasRobots($doc);
|
||||
}
|
||||
|
||||
if ($doc->getType() !== 'html')
|
||||
if (!$this->app->isClient('administrator'))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -2559,6 +2568,142 @@ class MokoWaaS extends CMSPlugin
|
||||
}
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
// Site Alias handling
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Get the alias configuration for the current request domain, if any.
|
||||
*
|
||||
* @return object|null Alias entry object or null if not an alias domain
|
||||
*
|
||||
* @since 02.01.43
|
||||
*/
|
||||
protected function getCurrentAlias()
|
||||
{
|
||||
$currentHost = $_SERVER['HTTP_HOST'] ?? '';
|
||||
$primaryHost = parse_url(Uri::root(), PHP_URL_HOST);
|
||||
|
||||
if (empty($currentHost) || strcasecmp($currentHost, $primaryHost) === 0)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
$aliases = $this->params->get('site_aliases', '');
|
||||
|
||||
if (empty($aliases))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
// Subform returns JSON string or array
|
||||
if (is_string($aliases))
|
||||
{
|
||||
$aliases = json_decode($aliases, false);
|
||||
}
|
||||
|
||||
if (!is_array($aliases))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
foreach ($aliases as $alias)
|
||||
{
|
||||
$alias = (object) $alias;
|
||||
|
||||
if (isset($alias->domain) && strcasecmp(trim($alias->domain), $currentHost) === 0)
|
||||
{
|
||||
return $alias;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle site alias logic: offline page and backend redirect.
|
||||
*
|
||||
* Runs early in onAfterInitialise before routing occurs.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 02.01.43
|
||||
*/
|
||||
protected function handleSiteAlias()
|
||||
{
|
||||
$alias = $this->getCurrentAlias();
|
||||
|
||||
if ($alias === null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Backend redirect: send admin requests to the primary domain
|
||||
if (!empty($alias->redirect_backend) && $alias->redirect_backend === '1'
|
||||
&& $this->app->isClient('administrator'))
|
||||
{
|
||||
$primaryUrl = rtrim(Uri::root(), '/') . '/administrator' . Uri::getInstance()->toString(['path', 'query']);
|
||||
$adminPath = str_replace(Uri::root() . 'administrator', '', Uri::getInstance()->toString(['path', 'query']));
|
||||
$primaryUrl = rtrim(Uri::root(), '/') . '/administrator' . $adminPath;
|
||||
|
||||
$this->app->redirect($primaryUrl, 301);
|
||||
}
|
||||
|
||||
// Offline: show maintenance page for frontend requests
|
||||
if (!empty($alias->offline) && $alias->offline === '1'
|
||||
&& $this->app->isClient('site'))
|
||||
{
|
||||
// Allow health API to still respond
|
||||
if ($this->app->input->get('mokowaas', '') !== '')
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
$message = $alias->offline_message ?? 'This site is currently offline for maintenance.';
|
||||
$brandName = $this->params->get('brand_name', 'MokoWaaS');
|
||||
|
||||
header('HTTP/1.1 503 Service Unavailable');
|
||||
header('Retry-After: 3600');
|
||||
header('Content-Type: text/html; charset=utf-8');
|
||||
echo '<!DOCTYPE html><html><head><meta charset="utf-8">';
|
||||
echo '<meta name="robots" content="noindex, nofollow">';
|
||||
echo '<title>' . htmlspecialchars($brandName) . ' - Maintenance</title>';
|
||||
echo '<style>body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;display:flex;justify-content:center;align-items:center;min-height:100vh;margin:0;background:#f5f5f5;color:#333}';
|
||||
echo '.container{text-align:center;padding:2rem;max-width:600px}h1{color:#1a2744;margin-bottom:1rem}p{font-size:1.1rem;line-height:1.6}</style>';
|
||||
echo '</head><body><div class="container">';
|
||||
echo '<h1>' . htmlspecialchars($brandName) . '</h1>';
|
||||
echo '<p>' . htmlspecialchars($message) . '</p>';
|
||||
echo '</div></body></html>';
|
||||
$this->app->close();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Inject robots meta tag for alias domains.
|
||||
*
|
||||
* @param \Joomla\CMS\Document\HtmlDocument $doc Document object
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 02.01.43
|
||||
*/
|
||||
protected function injectAliasRobots($doc)
|
||||
{
|
||||
$alias = $this->getCurrentAlias();
|
||||
|
||||
if ($alias === null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
$robots = $alias->robots ?? 'index, follow';
|
||||
|
||||
if ($robots !== 'index, follow')
|
||||
{
|
||||
$doc->setMetaData('robots', $robots);
|
||||
}
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
// Heartbeat (called from onExtensionAfterSave)
|
||||
// ------------------------------------------------------------------
|
||||
@@ -2566,8 +2711,9 @@ class MokoWaaS extends CMSPlugin
|
||||
/**
|
||||
* Send heartbeat to the MokoWaaS monitoring receiver.
|
||||
*
|
||||
* Registers this site (and any aliases) with the Grafana provisioning system.
|
||||
* Registers this site's primary domain with the Grafana provisioning system.
|
||||
* The receiver writes a datasource YAML file and restarts Grafana.
|
||||
* Alias domains are not registered to avoid duplicate datasource UIDs.
|
||||
*
|
||||
* @param \Joomla\Registry\Registry $params Plugin params
|
||||
* @param \Joomla\CMS\Application\CMSApplication $app Application
|
||||
@@ -2588,21 +2734,8 @@ class MokoWaaS extends CMSPlugin
|
||||
$siteUrl = rtrim(Uri::root(), '/');
|
||||
$siteName = Factory::getConfig()->get('sitename', 'Joomla');
|
||||
|
||||
// Register primary domain
|
||||
// Register primary domain only — aliases should not get separate datasources
|
||||
$this->sendHeartbeat($siteUrl, $siteName, $healthToken, $app);
|
||||
|
||||
// Register any alias domains
|
||||
$aliases = $params->get('site_aliases', '');
|
||||
|
||||
if (!empty($aliases))
|
||||
{
|
||||
foreach (array_filter(array_map('trim', explode(',', $aliases))) as $alias)
|
||||
{
|
||||
$aliasUrl = 'https://' . ltrim($alias, 'https://');
|
||||
$aliasUrl = rtrim($aliasUrl, '/');
|
||||
$this->sendHeartbeat($aliasUrl, $siteName . ' (' . $alias . ')', $healthToken, $app);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2650,16 +2783,18 @@ class MokoWaaS extends CMSPlugin
|
||||
$app->enqueueMessage('Grafana heartbeat failed (' . $siteUrl . '): ' . $error, 'warning');
|
||||
Log::add('Heartbeat failed: ' . $error, Log::WARNING, 'mokowaas');
|
||||
}
|
||||
elseif ($code === 200 && ($body['status'] ?? '') === 'registered')
|
||||
elseif ($code === 200)
|
||||
{
|
||||
$status = $body['status'] ?? 'ok';
|
||||
$app->enqueueMessage(
|
||||
'Grafana heartbeat: ' . $siteUrl . ' registered (' . ($body['ds_uid'] ?? '') . ')',
|
||||
'Grafana heartbeat: ' . $siteUrl . ' ' . $status . ' (' . ($body['ds_uid'] ?? '') . ')',
|
||||
'message'
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
$msg = sprintf('Grafana heartbeat failed (%s): HTTP %d', $siteUrl, $code);
|
||||
$msg = sprintf('Grafana heartbeat failed (%s): HTTP %d — %s',
|
||||
$siteUrl, $code, $body['error'] ?? $body['message'] ?? 'Unknown');
|
||||
$app->enqueueMessage($msg, 'warning');
|
||||
Log::add($msg, Log::WARNING, 'mokowaas');
|
||||
}
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<form>
|
||||
<field
|
||||
name="domain"
|
||||
type="text"
|
||||
label="PLG_SYSTEM_MOKOWAAS_ALIAS_DOMAIN_LABEL"
|
||||
description="PLG_SYSTEM_MOKOWAAS_ALIAS_DOMAIN_DESC"
|
||||
required="true"
|
||||
hint="e.g. www.example.com"
|
||||
/>
|
||||
<field
|
||||
name="offline"
|
||||
type="radio"
|
||||
label="PLG_SYSTEM_MOKOWAAS_ALIAS_OFFLINE_LABEL"
|
||||
description="PLG_SYSTEM_MOKOWAAS_ALIAS_OFFLINE_DESC"
|
||||
default="0"
|
||||
class="btn-group btn-group-yesno"
|
||||
>
|
||||
<option value="1">JYES</option>
|
||||
<option value="0">JNO</option>
|
||||
</field>
|
||||
<field
|
||||
name="offline_message"
|
||||
type="textarea"
|
||||
label="PLG_SYSTEM_MOKOWAAS_ALIAS_OFFLINE_MSG_LABEL"
|
||||
description="PLG_SYSTEM_MOKOWAAS_ALIAS_OFFLINE_MSG_DESC"
|
||||
default=""
|
||||
rows="3"
|
||||
showon="offline:1"
|
||||
/>
|
||||
<field
|
||||
name="robots"
|
||||
type="list"
|
||||
label="PLG_SYSTEM_MOKOWAAS_ALIAS_ROBOTS_LABEL"
|
||||
description="PLG_SYSTEM_MOKOWAAS_ALIAS_ROBOTS_DESC"
|
||||
default="index, follow"
|
||||
>
|
||||
<option value="index, follow">index, follow</option>
|
||||
<option value="noindex, follow">noindex, follow</option>
|
||||
<option value="index, nofollow">index, nofollow</option>
|
||||
<option value="noindex, nofollow">noindex, nofollow</option>
|
||||
<option value="none">none</option>
|
||||
</field>
|
||||
<field
|
||||
name="redirect_backend"
|
||||
type="radio"
|
||||
label="PLG_SYSTEM_MOKOWAAS_ALIAS_REDIRECT_BACKEND_LABEL"
|
||||
description="PLG_SYSTEM_MOKOWAAS_ALIAS_REDIRECT_BACKEND_DESC"
|
||||
default="1"
|
||||
class="btn-group btn-group-yesno"
|
||||
>
|
||||
<option value="1">JYES</option>
|
||||
<option value="0">JNO</option>
|
||||
</field>
|
||||
</form>
|
||||
@@ -130,5 +130,18 @@ PLG_SYSTEM_MOKOWAAS_UPLOAD_TYPES_DESC="Comma-separated list of allowed file exte
|
||||
PLG_SYSTEM_MOKOWAAS_UPLOAD_SIZE_LABEL="Max Upload Size (MB)"
|
||||
PLG_SYSTEM_MOKOWAAS_UPLOAD_SIZE_DESC="Maximum file upload size in megabytes."
|
||||
|
||||
PLG_SYSTEM_MOKOWAAS_SITE_ALIASES_LABEL="Site Aliases"
|
||||
PLG_SYSTEM_MOKOWAAS_SITE_ALIASES_DESC="Comma-separated list of additional domains this site is accessible on (e.g. www.example.com,alias.example.com). Each alias gets its own Grafana datasource for health monitoring."
|
||||
; ===== Site Aliases fieldset =====
|
||||
PLG_SYSTEM_MOKOWAAS_FIELDSET_ALIASES_LABEL="Site Aliases"
|
||||
PLG_SYSTEM_MOKOWAAS_FIELDSET_ALIASES_DESC="Configure additional domains that mirror this site. Each alias can have its own offline status, robots directive, and backend redirect behavior."
|
||||
PLG_SYSTEM_MOKOWAAS_SITE_ALIASES_LABEL="Domain Aliases"
|
||||
PLG_SYSTEM_MOKOWAAS_SITE_ALIASES_DESC="Add domain aliases that serve as mirrors of this site. Each alias gets its own Grafana monitoring datasource."
|
||||
PLG_SYSTEM_MOKOWAAS_ALIAS_DOMAIN_LABEL="Domain"
|
||||
PLG_SYSTEM_MOKOWAAS_ALIAS_DOMAIN_DESC="The alias domain name (e.g. www.example.com). Do not include https:// prefix."
|
||||
PLG_SYSTEM_MOKOWAAS_ALIAS_OFFLINE_LABEL="Offline"
|
||||
PLG_SYSTEM_MOKOWAAS_ALIAS_OFFLINE_DESC="Show an offline maintenance page when visitors access the site through this alias domain."
|
||||
PLG_SYSTEM_MOKOWAAS_ALIAS_OFFLINE_MSG_LABEL="Offline Message"
|
||||
PLG_SYSTEM_MOKOWAAS_ALIAS_OFFLINE_MSG_DESC="Custom message to display when this alias is set to offline."
|
||||
PLG_SYSTEM_MOKOWAAS_ALIAS_ROBOTS_LABEL="Robots"
|
||||
PLG_SYSTEM_MOKOWAAS_ALIAS_ROBOTS_DESC="Meta robots directive for this alias domain. Use 'noindex, nofollow' to prevent search engines from indexing the alias."
|
||||
PLG_SYSTEM_MOKOWAAS_ALIAS_REDIRECT_BACKEND_LABEL="Redirect Backend"
|
||||
PLG_SYSTEM_MOKOWAAS_ALIAS_REDIRECT_BACKEND_DESC="Redirect admin panel requests on this alias to the primary domain. Frontend stays on the alias domain."
|
||||
|
||||
@@ -130,5 +130,18 @@ PLG_SYSTEM_MOKOWAAS_UPLOAD_TYPES_DESC="Comma-separated list of allowed file exte
|
||||
PLG_SYSTEM_MOKOWAAS_UPLOAD_SIZE_LABEL="Max Upload Size (MB)"
|
||||
PLG_SYSTEM_MOKOWAAS_UPLOAD_SIZE_DESC="Maximum file upload size in megabytes."
|
||||
|
||||
PLG_SYSTEM_MOKOWAAS_SITE_ALIASES_LABEL="Site Aliases"
|
||||
PLG_SYSTEM_MOKOWAAS_SITE_ALIASES_DESC="Comma-separated list of additional domains this site is accessible on (e.g. www.example.com,alias.example.com). Each alias gets its own Grafana datasource for health monitoring."
|
||||
; ===== Site Aliases fieldset =====
|
||||
PLG_SYSTEM_MOKOWAAS_FIELDSET_ALIASES_LABEL="Site Aliases"
|
||||
PLG_SYSTEM_MOKOWAAS_FIELDSET_ALIASES_DESC="Configure additional domains that mirror this site. Each alias can have its own offline status, robots directive, and backend redirect behavior."
|
||||
PLG_SYSTEM_MOKOWAAS_SITE_ALIASES_LABEL="Domain Aliases"
|
||||
PLG_SYSTEM_MOKOWAAS_SITE_ALIASES_DESC="Add domain aliases that serve as mirrors of this site. Each alias gets its own Grafana monitoring datasource."
|
||||
PLG_SYSTEM_MOKOWAAS_ALIAS_DOMAIN_LABEL="Domain"
|
||||
PLG_SYSTEM_MOKOWAAS_ALIAS_DOMAIN_DESC="The alias domain name (e.g. www.example.com). Do not include https:// prefix."
|
||||
PLG_SYSTEM_MOKOWAAS_ALIAS_OFFLINE_LABEL="Offline"
|
||||
PLG_SYSTEM_MOKOWAAS_ALIAS_OFFLINE_DESC="Show an offline maintenance page when visitors access the site through this alias domain."
|
||||
PLG_SYSTEM_MOKOWAAS_ALIAS_OFFLINE_MSG_LABEL="Offline Message"
|
||||
PLG_SYSTEM_MOKOWAAS_ALIAS_OFFLINE_MSG_DESC="Custom message to display when this alias is set to offline."
|
||||
PLG_SYSTEM_MOKOWAAS_ALIAS_ROBOTS_LABEL="Robots"
|
||||
PLG_SYSTEM_MOKOWAAS_ALIAS_ROBOTS_DESC="Meta robots directive for this alias domain. Use 'noindex, nofollow' to prevent search engines from indexing the alias."
|
||||
PLG_SYSTEM_MOKOWAAS_ALIAS_REDIRECT_BACKEND_LABEL="Redirect Backend"
|
||||
PLG_SYSTEM_MOKOWAAS_ALIAS_REDIRECT_BACKEND_DESC="Redirect admin panel requests on this alias to the primary domain. Frontend stays on the alias domain."
|
||||
|
||||
+18
-8
@@ -30,7 +30,7 @@
|
||||
<license>GNU General Public License version 3 or later; see LICENSE.md</license>
|
||||
<authorEmail>hello@mokoconsulting.tech</authorEmail>
|
||||
<authorUrl>https://mokoconsulting.tech</authorUrl>
|
||||
<version>02.01.42</version>
|
||||
<version>02.01.43</version>
|
||||
<description>This plugin rebrands the Joomla system interface with MokoWaaS identity. It applies language overrides and ensures consistent branding across the platform.</description>
|
||||
<namespace path=".">Moko\Plugin\System\MokoWaaS</namespace>
|
||||
<scriptfile>script.php</scriptfile>
|
||||
@@ -44,6 +44,7 @@
|
||||
<filename plugin="mokowaas">script.php</filename>
|
||||
<folder>Extension</folder>
|
||||
<folder>Field</folder>
|
||||
<folder>forms</folder>
|
||||
<folder>payload</folder>
|
||||
<folder>services</folder>
|
||||
<folder>language</folder>
|
||||
@@ -268,6 +269,22 @@
|
||||
description="PLG_SYSTEM_MOKOWAAS_HIDDEN_MENUS_DESC"
|
||||
rows="5" filter="raw" />
|
||||
</fieldset>
|
||||
<fieldset name="site_aliases"
|
||||
label="PLG_SYSTEM_MOKOWAAS_FIELDSET_ALIASES_LABEL"
|
||||
description="PLG_SYSTEM_MOKOWAAS_FIELDSET_ALIASES_DESC"
|
||||
>
|
||||
<field
|
||||
name="site_aliases"
|
||||
type="subform"
|
||||
label="PLG_SYSTEM_MOKOWAAS_SITE_ALIASES_LABEL"
|
||||
description="PLG_SYSTEM_MOKOWAAS_SITE_ALIASES_DESC"
|
||||
formsource="plugins/system/mokowaas/forms/alias_entry.xml"
|
||||
multiple="true"
|
||||
layout="joomla.form.field.subform.repeatable-table"
|
||||
groupByFieldset="false"
|
||||
buttons="add,remove,move"
|
||||
/>
|
||||
</fieldset>
|
||||
<fieldset name="diagnostics"
|
||||
label="PLG_SYSTEM_MOKOWAAS_FIELDSET_DIAGNOSTICS_LABEL"
|
||||
description="PLG_SYSTEM_MOKOWAAS_FIELDSET_DIAGNOSTICS_DESC"
|
||||
@@ -281,13 +298,6 @@
|
||||
filter="raw"
|
||||
readonly="true"
|
||||
/>
|
||||
<field
|
||||
name="site_aliases"
|
||||
type="text"
|
||||
label="PLG_SYSTEM_MOKOWAAS_SITE_ALIASES_LABEL"
|
||||
description="PLG_SYSTEM_MOKOWAAS_SITE_ALIASES_DESC"
|
||||
default=""
|
||||
/>
|
||||
</fieldset>
|
||||
<fieldset name="security"
|
||||
label="PLG_SYSTEM_MOKOWAAS_FIELDSET_SECURITY_LABEL"
|
||||
|
||||
+4
-3
@@ -829,17 +829,18 @@ class plgSystemMokoWaaSInstallerScript implements InstallerScriptInterface
|
||||
$app->enqueueMessage('Grafana heartbeat failed: ' . $error, 'warning');
|
||||
Log::add('Heartbeat failed: ' . $error, Log::WARNING, 'mokowaas');
|
||||
}
|
||||
elseif ($code === 200 && ($body['status'] ?? '') === 'registered')
|
||||
elseif ($code === 200)
|
||||
{
|
||||
$status = $body['status'] ?? 'ok';
|
||||
$app->enqueueMessage(
|
||||
'Grafana heartbeat: site registered (' . ($body['ds_uid'] ?? '') . ')',
|
||||
'Grafana heartbeat: ' . $status . ' (' . ($body['ds_uid'] ?? '') . ')',
|
||||
'message'
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
$msg = sprintf('Grafana heartbeat failed: HTTP %d — %s',
|
||||
$code, $body['error'] ?? 'Unknown');
|
||||
$code, $body['error'] ?? $body['message'] ?? 'Unknown');
|
||||
$app->enqueueMessage($msg, 'warning');
|
||||
Log::add($msg, Log::WARNING, 'mokowaas');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user