dsfdsf
This commit is contained in:
@@ -99,51 +99,6 @@
|
||||
overflow-x: clip;
|
||||
}
|
||||
|
||||
#mining-checker-app .mc-grid-bg[data-module-theme="custom"] {
|
||||
--mc-bg: #09111f;
|
||||
--mc-surface: rgba(8, 15, 29, 0.76);
|
||||
--mc-surface-strong: rgba(15, 23, 42, 0.94);
|
||||
--mc-line: rgba(148, 163, 184, 0.18);
|
||||
--mc-line-strong: rgba(255, 255, 255, 0.12);
|
||||
--mc-text: #e5eef8;
|
||||
--mc-text-muted: #a7b5c8;
|
||||
--mc-accent: #3dd9c4;
|
||||
--mc-accent-strong: #7dd3fc;
|
||||
color: var(--mc-text);
|
||||
background:
|
||||
linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
|
||||
linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
|
||||
radial-gradient(circle at top left, rgba(13, 148, 136, 0.16), transparent 26%),
|
||||
radial-gradient(circle at top right, rgba(59, 130, 246, 0.18), transparent 22%),
|
||||
linear-gradient(180deg, #04111d 0%, #0f172a 42%, #111827 100%);
|
||||
background-size: 24px 24px, 24px 24px, auto, auto, auto;
|
||||
}
|
||||
|
||||
#mining-checker-app .mc-grid-bg[data-module-theme="custom"][data-module-accent="logo"] {
|
||||
--mc-accent: #ed1671;
|
||||
--mc-accent-strong: #06a9c8;
|
||||
}
|
||||
|
||||
#mining-checker-app .mc-grid-bg[data-module-theme="custom"][data-module-accent="pink"] {
|
||||
--mc-accent: #ed1671;
|
||||
--mc-accent-strong: #f6aa21;
|
||||
}
|
||||
|
||||
#mining-checker-app .mc-grid-bg[data-module-theme="custom"][data-module-accent="cyan"] {
|
||||
--mc-accent: #06a9c8;
|
||||
--mc-accent-strong: #8bc53f;
|
||||
}
|
||||
|
||||
#mining-checker-app .mc-grid-bg[data-module-theme="custom"][data-module-accent="orange"] {
|
||||
--mc-accent: #f6aa21;
|
||||
--mc-accent-strong: #ed1671;
|
||||
}
|
||||
|
||||
#mining-checker-app .mc-grid-bg[data-module-theme="custom"][data-module-accent="green"] {
|
||||
--mc-accent: #8bc53f;
|
||||
--mc-accent-strong: #06a9c8;
|
||||
}
|
||||
|
||||
#mining-checker-app .mc-shell {
|
||||
width: min(1360px, calc(100% - 24px));
|
||||
max-width: 100%;
|
||||
|
||||
@@ -12,6 +12,23 @@
|
||||
const fxBaseUrl = root.dataset.fxUrl || 'https://currencyapi.net';
|
||||
const fxCurrenciesUrl = root.dataset.fxCurrenciesUrl || fxBaseUrl;
|
||||
const fxApiKeyMask = root.dataset.fxApiKeyMask || '';
|
||||
const configuredSections = (() => {
|
||||
try {
|
||||
const parsed = JSON.parse(root.dataset.sectionsJson || '[]');
|
||||
if (!Array.isArray(parsed)) {
|
||||
return [];
|
||||
}
|
||||
return parsed
|
||||
.map((section) => {
|
||||
const key = section && typeof section.key === 'string' ? section.key.trim() : '';
|
||||
const label = section && typeof section.label === 'string' ? section.label.trim() : '';
|
||||
return key && label ? [key, label] : null;
|
||||
})
|
||||
.filter(Boolean);
|
||||
} catch (error) {
|
||||
return [];
|
||||
}
|
||||
})();
|
||||
const initialDebugMode = (() => {
|
||||
try {
|
||||
return window.localStorage.getItem('mining-checker-debug-enabled') === '1';
|
||||
@@ -289,12 +306,10 @@
|
||||
baseline_coins_total: '',
|
||||
daily_cost_amount: '',
|
||||
daily_cost_currency: 'EUR',
|
||||
report_currency: 'EUR',
|
||||
crypto_currency: 'DOGE',
|
||||
fx_max_age_hours: 3,
|
||||
module_theme_mode: 'inherit',
|
||||
module_theme_accent: 'teal',
|
||||
preferred_currencies: ['DOGE', 'USD', 'EUR'],
|
||||
report_currency: 'EUR',
|
||||
crypto_currency: 'DOGE',
|
||||
fx_max_age_hours: 3,
|
||||
preferred_currencies: ['DOGE', 'USD', 'EUR'],
|
||||
cost_plans: [],
|
||||
currencies: [],
|
||||
payouts: [],
|
||||
@@ -585,8 +600,6 @@
|
||||
report_currency: 'EUR',
|
||||
crypto_currency: 'DOGE',
|
||||
fx_max_age_hours: 3,
|
||||
module_theme_mode: 'inherit',
|
||||
module_theme_accent: 'teal',
|
||||
});
|
||||
const [moduleAuthForm, setModuleAuthForm] = useState({
|
||||
required: true,
|
||||
@@ -1017,8 +1030,6 @@
|
||||
report_currency: normalized.settings.report_currency || 'EUR',
|
||||
crypto_currency: normalized.settings.crypto_currency || 'DOGE',
|
||||
fx_max_age_hours: normalized.settings.fx_max_age_hours || 3,
|
||||
module_theme_mode: normalized.settings.module_theme_mode || 'inherit',
|
||||
module_theme_accent: normalized.settings.module_theme_accent || 'teal',
|
||||
});
|
||||
setFxSelection(Array.isArray(normalized.settings.preferred_currencies) && normalized.settings.preferred_currencies.length
|
||||
? normalized.settings.preferred_currencies
|
||||
@@ -1243,8 +1254,6 @@
|
||||
report_currency: settingsForm.report_currency || 'EUR',
|
||||
crypto_currency: settingsForm.crypto_currency || 'DOGE',
|
||||
fx_max_age_hours: settingsForm.fx_max_age_hours || 3,
|
||||
module_theme_mode: settingsForm.module_theme_mode || 'inherit',
|
||||
module_theme_accent: settingsForm.module_theme_accent || 'teal',
|
||||
preferred_currencies: Array.isArray(currentSettings.preferred_currencies)
|
||||
? currentSettings.preferred_currencies
|
||||
: fxSelection,
|
||||
@@ -1806,7 +1815,7 @@
|
||||
setCookie('mining_checker_report_currency', '', 0);
|
||||
}
|
||||
|
||||
const tabs = [
|
||||
const tabs = configuredSections.length ? configuredSections : [
|
||||
['overview', 'Ueberblick'],
|
||||
['measurements', 'Messpunkte'],
|
||||
['currencies', 'Waehrungen'],
|
||||
@@ -1871,17 +1880,8 @@
|
||||
const debugConsoleText = debugEntries
|
||||
.map((entry) => `${entry.time} · ${entry.type}\n${JSON.stringify(entry, null, 2)}`)
|
||||
.join('\n\n');
|
||||
const moduleThemeMode = ['inherit', 'custom'].includes(String(currentSettings.module_theme_mode || ''))
|
||||
? String(currentSettings.module_theme_mode)
|
||||
: 'inherit';
|
||||
const moduleThemeAccent = ['teal', 'logo', 'pink', 'cyan', 'orange', 'green'].includes(String(currentSettings.module_theme_accent || ''))
|
||||
? String(currentSettings.module_theme_accent)
|
||||
: 'teal';
|
||||
|
||||
return h('div', {
|
||||
className: 'mc-grid-bg',
|
||||
'data-module-theme': moduleThemeMode,
|
||||
'data-module-accent': moduleThemeAccent,
|
||||
}, [
|
||||
h('div', { key: 'shell', className: 'mc-shell mc-stack' }, [
|
||||
h('header', { key: 'header', className: 'mc-hero' }, [
|
||||
@@ -2949,20 +2949,6 @@
|
||||
selectField('Standard-FIAT-Währung', settingsForm.report_currency || 'EUR', selectableFiatCurrencies.map((currency) => currency.code), (value) => setSettingsForm({ ...settingsForm, report_currency: value })),
|
||||
selectField('Standard-Krypto-Währung', settingsForm.crypto_currency || 'DOGE', selectableCryptoCurrencies.map((currency) => currency.code), (value) => setSettingsForm({ ...settingsForm, crypto_currency: value })),
|
||||
inputField('FX maximal in Stunden wiederverwenden', 'number', String(settingsForm.fx_max_age_hours || 3), (value) => setSettingsForm({ ...settingsForm, fx_max_age_hours: value }), '0.25'),
|
||||
selectField('Modul-Layout', settingsForm.module_theme_mode || 'inherit', [
|
||||
{ value: 'inherit', label: 'Wie Main-Site' },
|
||||
{ value: 'custom', label: 'Custom' },
|
||||
], (value) => setSettingsForm({ ...settingsForm, module_theme_mode: value })),
|
||||
settingsForm.module_theme_mode === 'custom'
|
||||
? selectField('Custom-Farbschema', settingsForm.module_theme_accent || 'teal', [
|
||||
{ value: 'teal', label: 'Mining Teal' },
|
||||
{ value: 'logo', label: 'Logo Mix' },
|
||||
{ value: 'pink', label: 'Pink' },
|
||||
{ value: 'cyan', label: 'Cyan' },
|
||||
{ value: 'orange', label: 'Orange' },
|
||||
{ value: 'green', label: 'Gruen' },
|
||||
], (value) => setSettingsForm({ ...settingsForm, module_theme_accent: value }))
|
||||
: null,
|
||||
h('button', {
|
||||
type: 'submit',
|
||||
className: 'mc-button mc-button--primary',
|
||||
|
||||
16
modules/mining-checker/design.json
Normal file
16
modules/mining-checker/design.json
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"eyebrow": "Modul",
|
||||
"title": "Mining-Checker",
|
||||
"description": "Erfassung, OCR-Auswertung und Analyse von DOGE-Mining-Messwerten als eingebettetes Modul.",
|
||||
"actions": [
|
||||
{ "label": "Setup", "href": "/modules/setup/mining-checker", "variant": "secondary" }
|
||||
],
|
||||
"sections": [
|
||||
{ "key": "overview", "label": "Ueberblick" },
|
||||
{ "key": "measurements", "label": "Messpunkte" },
|
||||
{ "key": "currencies", "label": "Waehrungen" },
|
||||
{ "key": "mining", "label": "Mining" },
|
||||
{ "key": "dashboards", "label": "Dashboards" },
|
||||
{ "key": "settings", "label": "Settings" }
|
||||
]
|
||||
}
|
||||
@@ -4,6 +4,7 @@ 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');
|
||||
@@ -13,20 +14,28 @@ $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);
|
||||
?>
|
||||
<div class="module-host-card 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) ?>"></div>
|
||||
<?= 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() ?>
|
||||
|
||||
Reference in New Issue
Block a user