Files
nexus/modules/mining-checker/pages/index.php
Lars Gebhardt-Kusche d6f09326f4
All checks were successful
Deploy / deploy-staging (push) Successful in 6s
Deploy / deploy-production (push) Has been skipped
dsfdsf
2026-04-24 23:54:04 +02:00

42 lines
2.0 KiB
PHP

<?php
declare(strict_types=1);
require_once dirname(__DIR__) . '/bootstrap.php';
$moduleConfig = require dirname(__DIR__) . '/config/module.php';
$design = module_design('mining-checker');
$defaultProjectKey = (string) ($moduleConfig['default_project_key'] ?? 'doge-main');
$fxConfig = (array) ($moduleConfig['fx'] ?? []);
$fxProvider = (string) ($fxConfig['provider'] ?? 'currencyapi');
$fxBaseUrl = rtrim((string) ($fxConfig['url'] ?? 'https://currencyapi.net'), '/');
$fxCurrenciesUrl = rtrim((string) ($fxConfig['currencies_url'] ?? $fxBaseUrl), '/');
$fxApiKey = (string) ($fxConfig['api_key'] ?? '');
$fxApiKeyMasked = $fxApiKey === ''
? ''
: (strlen($fxApiKey) <= 10 ? $fxApiKey : substr($fxApiKey, 0, 6) . '...' . substr($fxApiKey, -4));
$sectionsJson = json_encode(is_array($design['sections'] ?? null) ? $design['sections'] : [], JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
$moduleCss = file_get_contents(dirname(__DIR__) . '/assets/css/app.css') ?: '';
$moduleJs = file_get_contents(dirname(__DIR__) . '/assets/js/app.js') ?: '';
$moduleJs = str_replace('</script>', '<\/script>', $moduleJs);
?>
<?= module_shell_header('mining-checker', [
'title' => 'DOGE Mining-Checker',
]) ?>
<div class="module-flow">
<div class="module-box mining-checker-host">
<div id="mining-checker-app"
data-default-project-key="<?= e($defaultProjectKey) ?>"
data-api-base="/api/mining-checker/v1"
data-fx-provider="<?= e($fxProvider) ?>"
data-fx-url="<?= e($fxBaseUrl) ?>"
data-fx-currencies-url="<?= e($fxCurrenciesUrl) ?>"
data-fx-api-key-mask="<?= e($fxApiKeyMasked) ?>"
data-sections-json="<?= e(is_string($sectionsJson) ? $sectionsJson : '[]') ?>"></div>
</div>
</div>
<style><?= $moduleCss ?></style>
<script crossorigin src="https://unpkg.com/react@18/umd/react.production.min.js"></script>
<script crossorigin src="https://unpkg.com/react-dom@18/umd/react-dom.production.min.js"></script>
<script><?= $moduleJs ?></script>
<?= module_shell_footer() ?>