From 5c429f957160b4994b57cb5ada4ee30aed06566a Mon Sep 17 00:00:00 2001 From: Dorian Date: Wed, 1 Apr 2026 23:35:27 +0100 Subject: [PATCH] fix: show Bitcoin as Loading when container running but RPC unavailable Co-Authored-By: Claude Opus 4.6 (1M context) --- neode-ui/src/views/Home.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/neode-ui/src/views/Home.vue b/neode-ui/src/views/Home.vue index 87cf23c9..281ee271 100644 --- a/neode-ui/src/views/Home.vue +++ b/neode-ui/src/views/Home.vue @@ -318,6 +318,7 @@ const vpnConnected = computed(() => { const bitcoinSyncDisplay = computed(() => { if (!systemStats.bitcoinAvailable) return 'Not running' if (systemStats.bitcoinSyncPercent >= 99.9) return 'Synced' + if (systemStats.bitcoinSyncPercent < 0.01 && systemStats.bitcoinBlockHeight === 0) return 'Loading...' return `${systemStats.bitcoinSyncPercent.toFixed(1)}%` }) @@ -376,7 +377,7 @@ let systemStatsInterval: ReturnType | null = null async function loadSystemStats() { try { const res = await rpcClient.call<{ cpu_usage_percent: number; mem_used_bytes: number; mem_total_bytes: number; disk_used_bytes: number; disk_total_bytes: number; uptime_secs: number }>({ method: 'system.stats' }); systemStats.cpuPercent = res.cpu_usage_percent; systemStats.memUsed = res.mem_used_bytes; systemStats.memTotal = res.mem_total_bytes; systemStats.memPercent = res.mem_total_bytes > 0 ? (res.mem_used_bytes / res.mem_total_bytes) * 100 : 0; systemStats.diskUsed = res.disk_used_bytes; systemStats.diskTotal = res.disk_total_bytes; systemStats.diskPercent = res.disk_total_bytes > 0 ? (res.disk_used_bytes / res.disk_total_bytes) * 100 : 0; systemStats.uptimeSecs = res.uptime_secs; systemStatsLoaded.value = true } catch { systemStatsLoaded.value = true } - try { const btc = await rpcClient.call<{ block_height: number; sync_progress: number }>({ method: 'bitcoin.getinfo', timeout: 5000 }); systemStats.bitcoinSyncPercent = (btc.sync_progress ?? 0) * 100; systemStats.bitcoinBlockHeight = btc.block_height ?? 0; systemStats.bitcoinAvailable = true } catch { systemStats.bitcoinAvailable = false } + try { const btc = await rpcClient.call<{ block_height: number; sync_progress: number }>({ method: 'bitcoin.getinfo', timeout: 5000 }); systemStats.bitcoinSyncPercent = (btc.sync_progress ?? 0) * 100; systemStats.bitcoinBlockHeight = btc.block_height ?? 0; systemStats.bitcoinAvailable = true } catch { /* RPC failed — check if container is at least running (loading/syncing) */ const btcPkg = packages.value['bitcoin-knots']; systemStats.bitcoinAvailable = btcPkg?.state === PackageState.Running } } function uploadFiles() { const pkg = packages.value['filebrowser']; if (pkg && pkg.state === PackageState.Running) { const host = window.location.hostname; useAppLauncherStore().open({ url: `http://${host}:8083`, title: 'File Browser' }) } else { router.push('/dashboard/cloud') } }