ysdsad
All checks were successful
Deploy / deploy-staging (push) Successful in 25s
Deploy / deploy-production (push) Has been skipped

This commit is contained in:
2026-08-14 02:13:02 +02:00
parent 3205d9f0f6
commit 8bcd445759
2 changed files with 42 additions and 4 deletions

View File

@@ -821,7 +821,18 @@
: null,
]),
hoveredPoint
? h('div', { key: 'hover', className: 'mc-mini-card' }, [
? h('div', {
key: 'hover',
className: 'mc-mini-card',
style: {
position: 'absolute',
top: 28,
right: 0,
zIndex: 3,
pointerEvents: 'none',
maxWidth: '220px',
},
}, [
h('div', { key: 'label', className: 'mc-kicker', style: { color: hoveredPoint.color } }, hoveredPoint.label),
h('div', { key: 'value' }, `${hoveredPoint.x}: ${hoveredPoint.value}`),
])
@@ -1678,15 +1689,19 @@
async function loadSchemaStatus(key) {
try {
const schema = await request(`${apiBase}/projects/${encodeURIComponent(key)}/schema-status`, { timeoutMs: 4000 });
setSchemaStatus(normalizeSchemaStatus(schema));
const normalized = normalizeSchemaStatus(schema);
setSchemaStatus(normalized);
return normalized;
} catch (err) {
setSchemaStatus(normalizeSchemaStatus(null));
setError((previous) => previous || `Schema-Status konnte nicht geladen werden: ${err.message}`);
return null;
}
}
async function loadBootstrap(key, options) {
const suppressError = !!(options && options.suppressError);
const schemaStatusOverride = options && options.schemaStatusOverride ? options.schemaStatusOverride : null;
const cacheKey = `${key}:${activeTab || 'overview'}`;
const cachedPayload = bootstrapCacheRef.current.get(cacheKey) || null;
@@ -1708,7 +1723,8 @@
}, 30000);
try {
if (schemaStatus.missing_count > 0 || schemaStatus.pending_upgrade_count > 0) {
const effectiveSchemaStatus = schemaStatusOverride || schemaStatus;
if (effectiveSchemaStatus.missing_count > 0 || effectiveSchemaStatus.pending_upgrade_count > 0) {
setPayload(normalizeBootstrap(null, key));
setError('Mining-Checker Schema ist noch nicht initialisiert. Bitte im Tab Settings die Datenbank initialisieren.');
return false;
@@ -2646,7 +2662,8 @@
? `Angewendete Upgrades: ${result.upgraded.join(', ')}.`
: 'Keine Upgrades erforderlich.')
);
await loadBootstrap(projectKey);
const refreshedStatus = await loadSchemaStatus(projectKey);
await loadBootstrap(projectKey, { schemaStatusOverride: refreshedStatus || nextStatus });
} catch (err) {
setError(err.message);
} finally {

View File

@@ -279,6 +279,7 @@ final class SchemaManager
public function upgradeSchemaDirect(): array
{
$before = $this->schemaStatus();
$coreTables = [
$this->prefix . 'projects',
$this->prefix . 'settings',
@@ -291,8 +292,11 @@ final class SchemaManager
$presentCoreTables = $this->existingTables($coreTables);
if ($presentCoreTables === []) {
$this->importSchema();
$after = $this->schemaStatus();
return [
'upgraded' => ['schema_initialized'],
'before' => $before,
'after' => $after,
'message' => 'Mining-Checker Schema wurde neu angelegt.',
];
}
@@ -312,6 +316,19 @@ final class SchemaManager
$this->upgradeCostPlanColumns();
$applied[] = 'cost_plan_columns';
}
if (
($this->tableExists($this->prefix . 'cost_plans') && (
!$this->columnExists($this->prefix . 'cost_plans', 'daily_cost_amount') ||
!$this->columnExists($this->prefix . 'cost_plans', 'daily_cost_currency')
)) ||
($this->tableExists($this->prefix . 'purchased_miners') && (
!$this->columnExists($this->prefix . 'purchased_miners', 'daily_cost_amount') ||
!$this->columnExists($this->prefix . 'purchased_miners', 'daily_cost_currency')
))
) {
$this->upgradeServerDailyCostColumns();
$applied[] = 'server_daily_cost_columns';
}
$settingsColumns = $this->existingColumns($this->prefix . 'settings', ['preferred_currencies', 'report_currency', 'crypto_currency', 'display_timezone', 'fx_max_age_hours', 'module_theme_mode', 'module_theme_accent']);
if (!in_array('preferred_currencies', $settingsColumns, true) || !in_array('report_currency', $settingsColumns, true) || !in_array('crypto_currency', $settingsColumns, true) || !in_array('display_timezone', $settingsColumns, true) || !in_array('fx_max_age_hours', $settingsColumns, true) || !in_array('module_theme_mode', $settingsColumns, true) || !in_array('module_theme_accent', $settingsColumns, true)) {
@@ -389,8 +406,12 @@ final class SchemaManager
$applied[] = 'target_offer_foreign_key';
}
$after = $this->schemaStatus();
return [
'upgraded' => $applied,
'before' => $before,
'after' => $after,
'message' => $applied === []
? 'Schema ist bereits auf dem neuesten Stand.'
: 'Direktes Schema-Upgrade erfolgreich ausgefuehrt.',