xycyxc
This commit is contained in:
@@ -344,24 +344,6 @@
|
||||
background: rgba(255, 255, 255, 0.05);
|
||||
}
|
||||
|
||||
#mining-checker-app .mc-token-list,
|
||||
#mining-checker-app .mc-suggestion-list {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
#mining-checker-app .mc-token-list--inline {
|
||||
flex: 1 1 auto;
|
||||
}
|
||||
|
||||
#mining-checker-app .mc-currency-selection-row {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 16px;
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
#mining-checker-app .mc-inline-fields {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
@@ -373,59 +355,6 @@
|
||||
flex: 1 1 280px;
|
||||
}
|
||||
|
||||
#mining-checker-app .mc-currency-search {
|
||||
flex: 0 1 360px;
|
||||
min-width: 260px;
|
||||
}
|
||||
|
||||
#mining-checker-app .mc-token,
|
||||
#mining-checker-app .mc-suggestion {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
border: 1px solid var(--mc-line);
|
||||
border-radius: 999px;
|
||||
padding: 10px 14px;
|
||||
background: rgba(255, 255, 255, 0.06);
|
||||
color: var(--mc-text);
|
||||
}
|
||||
|
||||
#mining-checker-app .mc-token {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#mining-checker-app .mc-token:hover,
|
||||
#mining-checker-app .mc-suggestion:hover {
|
||||
border-color: rgba(125, 211, 252, 0.4);
|
||||
background: rgba(61, 217, 196, 0.12);
|
||||
}
|
||||
|
||||
#mining-checker-app .mc-token-close {
|
||||
color: var(--mc-accent-strong);
|
||||
font-weight: 700;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
#mining-checker-app .mc-suggestion {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
@media (max-width: 860px) {
|
||||
#mining-checker-app .mc-currency-selection-row {
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
#mining-checker-app .mc-currency-search {
|
||||
flex: 1 1 auto;
|
||||
width: 100%;
|
||||
min-width: 0;
|
||||
}
|
||||
}
|
||||
|
||||
#mining-checker-app .mc-suggestion strong {
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
#mining-checker-app .mc-alert--error {
|
||||
border-color: rgba(251, 113, 133, 0.28);
|
||||
background: rgba(127, 29, 29, 0.35);
|
||||
@@ -760,7 +689,6 @@
|
||||
}
|
||||
|
||||
#mining-checker-app .mc-inline-fields,
|
||||
#mining-checker-app .mc-currency-selection-row,
|
||||
#mining-checker-app .mc-debug-tools,
|
||||
#mining-checker-app .mc-debug-view-switch {
|
||||
gap: 8px;
|
||||
@@ -771,8 +699,6 @@
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
#mining-checker-app .mc-token,
|
||||
#mining-checker-app .mc-suggestion,
|
||||
#mining-checker-app .mc-badge {
|
||||
padding: 7px 10px;
|
||||
font-size: 0.78rem;
|
||||
|
||||
@@ -8,10 +8,6 @@
|
||||
const { useEffect, useMemo, useState } = React;
|
||||
const apiBase = root.dataset.apiBase || '/api/mining-checker/v1';
|
||||
const initialProjectKey = root.dataset.defaultProjectKey || 'doge-main';
|
||||
const fxProvider = root.dataset.fxProvider || 'currencyapi';
|
||||
const fxBaseUrl = root.dataset.fxUrl || 'https://currencyapi.net';
|
||||
const fxCurrenciesUrl = root.dataset.fxCurrenciesUrl || fxBaseUrl;
|
||||
const fxApiKeyMask = root.dataset.fxApiKeyMask || '';
|
||||
const initialActiveTab = String(root.dataset.activeView || 'overview').trim() || 'overview';
|
||||
const configuredSections = (() => {
|
||||
try {
|
||||
@@ -109,21 +105,6 @@
|
||||
});
|
||||
}
|
||||
|
||||
function buildExternalFxUrl(base) {
|
||||
if (fxProvider === 'currencyapi') {
|
||||
const params = new URLSearchParams({
|
||||
base: String(base || 'USD').toUpperCase(),
|
||||
output: 'json',
|
||||
});
|
||||
if (fxApiKeyMask) {
|
||||
params.set('key', fxApiKeyMask);
|
||||
}
|
||||
return `${fxBaseUrl}/api/v2/rates?${params.toString()}`;
|
||||
}
|
||||
|
||||
return `${fxBaseUrl}/latest?base=${encodeURIComponent(String(base || 'USD').toUpperCase())}`;
|
||||
}
|
||||
|
||||
async function loadLatestDebugTrace() {
|
||||
try {
|
||||
const response = await fetch(`${apiBase}/debug/latest`, {
|
||||
@@ -297,7 +278,6 @@
|
||||
daily_cost_currency: 'EUR',
|
||||
report_currency: 'EUR',
|
||||
crypto_currency: 'DOGE',
|
||||
fx_max_age_hours: 3,
|
||||
preferred_currencies: ['DOGE', 'USD', 'EUR'],
|
||||
cost_plans: [],
|
||||
currencies: [],
|
||||
@@ -646,7 +626,6 @@
|
||||
baseline_coins_total: '',
|
||||
report_currency: 'EUR',
|
||||
crypto_currency: 'DOGE',
|
||||
fx_max_age_hours: 3,
|
||||
});
|
||||
const [moduleAuthForm, setModuleAuthForm] = useState({
|
||||
required: true,
|
||||
@@ -1097,7 +1076,6 @@
|
||||
baseline_coins_total: normalized.settings.baseline_coins_total || '',
|
||||
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,
|
||||
});
|
||||
setFxSelection(Array.isArray(normalized.settings.preferred_currencies) && normalized.settings.preferred_currencies.length
|
||||
? normalized.settings.preferred_currencies
|
||||
@@ -1372,7 +1350,6 @@
|
||||
daily_cost_currency: currentSettings.daily_cost_currency,
|
||||
report_currency: settingsForm.report_currency || 'EUR',
|
||||
crypto_currency: settingsForm.crypto_currency || 'DOGE',
|
||||
fx_max_age_hours: settingsForm.fx_max_age_hours || 3,
|
||||
preferred_currencies: Array.isArray(currentSettings.preferred_currencies)
|
||||
? currentSettings.preferred_currencies
|
||||
: fxSelection,
|
||||
@@ -1788,52 +1765,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
async function refreshSelectedFxRates() {
|
||||
setSaving(true);
|
||||
setError('');
|
||||
setMessage('');
|
||||
try {
|
||||
emitDebug({
|
||||
type: 'external:request-plan',
|
||||
label: 'Ich rufe jetzt extern FX-Rates auf',
|
||||
provider: fxProvider,
|
||||
url: buildExternalFxUrl('USD'),
|
||||
method: 'GET',
|
||||
headers: { Accept: 'application/json' },
|
||||
});
|
||||
const probe = await request(`${apiBase}/projects/${encodeURIComponent(projectKey)}/fx-probe`, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ base: 'USD' }),
|
||||
timeoutMs: 20000,
|
||||
});
|
||||
emitDebug({
|
||||
type: 'external:response',
|
||||
label: 'Hey, hier ist der Response vor dem DB-Schritt',
|
||||
url: probe.url,
|
||||
http_status: probe.http_status,
|
||||
curl_error: probe.curl_error,
|
||||
response_headers: probe.response_headers,
|
||||
response_body: probe.response_body,
|
||||
});
|
||||
const result = await request(`${apiBase}/projects/${encodeURIComponent(projectKey)}/fx-refresh`, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({
|
||||
base: 'USD',
|
||||
}),
|
||||
timeoutMs: 15000,
|
||||
});
|
||||
await loadFxHistory(projectKey);
|
||||
await loadBootstrap(projectKey);
|
||||
setMessage(`Wechselkurse aktualisiert. ${result.updated_count || 0} Datensaetze gespeichert.`);
|
||||
} catch (err) {
|
||||
setError(err.message);
|
||||
} finally {
|
||||
setSaving(false);
|
||||
}
|
||||
}
|
||||
|
||||
async function copyDebugConsole() {
|
||||
const content = debugEntries
|
||||
.slice()
|
||||
@@ -2794,7 +2725,6 @@
|
||||
inputField('Baseline Coins', 'number', settingsForm.baseline_coins_total, (value) => setSettingsForm({ ...settingsForm, baseline_coins_total: value }), '0.000001'),
|
||||
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'),
|
||||
h('button', {
|
||||
type: 'submit',
|
||||
className: 'mc-button mc-button--primary',
|
||||
|
||||
Reference in New Issue
Block a user