- Add TunnelRegistry (var/magesail_tunnels.json) and TunnelProcessPaths; migrate legacy magesail_tunnel_store.json and PID/key files - Provision unique store codes per tunnel; website/group selection; stop vs remove; per-tunnel NGINX map, cron, status/logtail - Fix log path: use DirectoryList::LOG (not LOG_DIR) - Ignore missing store codes for MAGE_RUN_* (stale nginx / magesail_tunnel) - Allow duplicate local ports; Admin port presets 443/80/8080 + custom; update docs and system.xml comments
39 lines
1.0 KiB
PHP
39 lines
1.0 KiB
PHP
<?php
|
|
declare(strict_types=1);
|
|
|
|
namespace MageSail\Magesail\Controller\Adminhtml\Tunnel;
|
|
|
|
use Magento\Backend\App\Action;
|
|
use Magento\Backend\App\Action\Context;
|
|
use Magento\Framework\Controller\ResultFactory;
|
|
use MageSail\Magesail\Model\TunnelStatus;
|
|
|
|
class Status extends Action
|
|
{
|
|
public function __construct(
|
|
Context $context,
|
|
private readonly TunnelStatus $tunnelStatus
|
|
) {
|
|
parent::__construct($context);
|
|
}
|
|
|
|
public function execute()
|
|
{
|
|
$tunnelId = trim((string) $this->getRequest()->getParam('tunnel_id', ''));
|
|
$resultJson = $this->resultFactory->create(ResultFactory::TYPE_JSON);
|
|
if ($tunnelId !== '') {
|
|
$resultJson->setData($this->tunnelStatus->getStatus($tunnelId));
|
|
return $resultJson;
|
|
}
|
|
$resultJson->setData([
|
|
'tunnels' => $this->tunnelStatus->getAllTunnelStatuses(),
|
|
]);
|
|
return $resultJson;
|
|
}
|
|
|
|
protected function _isAllowed()
|
|
{
|
|
return $this->_authorization->isAllowed('MageSail_Magesail::tunnel');
|
|
}
|
|
}
|