ycyxcxc
This commit is contained in:
@@ -980,7 +980,7 @@
|
|||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const measurements = Array.isArray(payload?.measurements) ? payload.measurements : [];
|
const measurements = Array.isArray(payload?.measurements) ? payload.measurements : [];
|
||||||
const latest = payload?.summary?.latest_measurement || null;
|
const latest = payload?.summary?.latest_measurement || (measurements.length ? measurements[measurements.length - 1] : null);
|
||||||
const currentSettings = payload?.settings || {
|
const currentSettings = payload?.settings || {
|
||||||
cost_plans: [],
|
cost_plans: [],
|
||||||
currencies: [],
|
currencies: [],
|
||||||
@@ -1009,7 +1009,7 @@
|
|||||||
const currentMiningCurrency = String((latest && latest.coin_currency) || currentSettings.crypto_currency || 'DOGE').toUpperCase();
|
const currentMiningCurrency = String((latest && latest.coin_currency) || currentSettings.crypto_currency || 'DOGE').toUpperCase();
|
||||||
const latestMeasurementDate = latest && latest.measured_at ? parseStoredUtcDate(latest.measured_at) : null;
|
const latestMeasurementDate = latest && latest.measured_at ? parseStoredUtcDate(latest.measured_at) : null;
|
||||||
const latestMeasurementAgeMs = latestMeasurementDate ? (Date.now() - latestMeasurementDate.getTime()) : null;
|
const latestMeasurementAgeMs = latestMeasurementDate ? (Date.now() - latestMeasurementDate.getTime()) : null;
|
||||||
const canTransferAll = !!latestMeasurementDate
|
const canTransferAll = !!latest
|
||||||
&& Number(latest?.coins_total_visible ?? latest?.coins_total ?? 0) > 0;
|
&& Number(latest?.coins_total_visible ?? latest?.coins_total ?? 0) > 0;
|
||||||
const fullTransferCoins = Number(latest?.coins_total_visible ?? latest?.coins_total ?? 0);
|
const fullTransferCoins = Number(latest?.coins_total_visible ?? latest?.coins_total ?? 0);
|
||||||
const transferAllHint = !latestMeasurementDate
|
const transferAllHint = !latestMeasurementDate
|
||||||
@@ -2825,6 +2825,9 @@
|
|||||||
},
|
},
|
||||||
}, 'Teiluebertragung'),
|
}, 'Teiluebertragung'),
|
||||||
]),
|
]),
|
||||||
|
h('div', { key: 'transfer-last-import', className: 'mc-text' }, latest
|
||||||
|
? `Letzter Mining-Import: ${fmtDate(latest.measured_at)}`
|
||||||
|
: 'Kein Mining-Upload vorhanden.'),
|
||||||
h('div', { key: 'transfer-help', className: 'mc-text' }, transferAllHint),
|
h('div', { key: 'transfer-help', className: 'mc-text' }, transferAllHint),
|
||||||
h('div', { key: 'transfer-list', className: 'mc-table-shell' }, [
|
h('div', { key: 'transfer-list', className: 'mc-table-shell' }, [
|
||||||
h('table', { key: 'transfer-table', className: 'mc-table' }, [
|
h('table', { key: 'transfer-table', className: 'mc-table' }, [
|
||||||
|
|||||||
@@ -1268,6 +1268,8 @@ final class Router
|
|||||||
|
|
||||||
if (in_array($view, ['overview', 'mining'], true)) {
|
if (in_array($view, ['overview', 'mining'], true)) {
|
||||||
$rows = $this->repository()->listRecentMeasurements($projectKey, self::BOOTSTRAP_MEASUREMENT_LIMIT);
|
$rows = $this->repository()->listRecentMeasurements($projectKey, self::BOOTSTRAP_MEASUREMENT_LIMIT);
|
||||||
|
} elseif ($view === 'wallet') {
|
||||||
|
$rows = $this->repository()->listRecentMeasurements($projectKey, 1);
|
||||||
} elseif ($view === 'measurements') {
|
} elseif ($view === 'measurements') {
|
||||||
$rows = $this->repository()->listRecentMeasurements($projectKey, 10);
|
$rows = $this->repository()->listRecentMeasurements($projectKey, 10);
|
||||||
} else {
|
} else {
|
||||||
@@ -1331,6 +1333,14 @@ final class Router
|
|||||||
|
|
||||||
private function bootstrapSummary(array $measurements, array $settings, array $targets, array $walletSnapshots, string $view): array
|
private function bootstrapSummary(array $measurements, array $settings, array $targets, array $walletSnapshots, string $view): array
|
||||||
{
|
{
|
||||||
|
if ($view === 'wallet') {
|
||||||
|
return $this->analytics()->buildSummary($measurements, $settings, [], [
|
||||||
|
'include_offer_scenarios' => false,
|
||||||
|
'include_long_term_projection' => false,
|
||||||
|
'wallet_snapshots' => $walletSnapshots,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
if (!in_array($view, ['overview', 'mining'], true)) {
|
if (!in_array($view, ['overview', 'mining'], true)) {
|
||||||
return [
|
return [
|
||||||
'latest_measurement' => $measurements !== [] ? $measurements[array_key_last($measurements)] : null,
|
'latest_measurement' => $measurements !== [] ? $measurements[array_key_last($measurements)] : null,
|
||||||
|
|||||||
Reference in New Issue
Block a user