fix: node names everywhere, cloud peer names, sync timeout 180s
- Federation: nodeName() with Node-XXXX fallback for all views + map + sync results - Cloud: peerDisplayName() replaces raw DIDs, hides onion addresses - Sync timeout increased to 180s for Tor-connected nodes - Better error message when sync fails Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
96e8afb526
commit
ffc8e25c17
@ -64,8 +64,8 @@
|
|||||||
</svg>
|
</svg>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex-1 min-w-0">
|
<div class="flex-1 min-w-0">
|
||||||
<h3 class="text-lg font-semibold text-white mb-0.5 truncate" :title="peer.did">{{ peer.name || truncateDid(peer.did) }}</h3>
|
<h3 class="text-lg font-semibold text-white mb-0.5 truncate" :title="peer.did">{{ peer.name || peerDisplayName(peer.did) }}</h3>
|
||||||
<p class="text-xs text-white/50 truncate">{{ peer.onion }}</p>
|
<p class="text-xs text-white/40 truncate">{{ peer.name ? peer.did.slice(0, 20) + '...' : 'Peer node' }}</p>
|
||||||
</div>
|
</div>
|
||||||
<svg class="w-5 h-5 text-white/30" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
<svg class="w-5 h-5 text-white/30" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7" />
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7" />
|
||||||
@ -275,9 +275,9 @@ async function loadPeers() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function truncateDid(did: string): string {
|
function peerDisplayName(did: string): string {
|
||||||
if (did.length <= 24) return did
|
const suffix = did.replace(/^did:key:z6Mk/, '').slice(-6).toUpperCase()
|
||||||
return did.slice(0, 16) + '...' + did.slice(-8)
|
return `Node-${suffix}`
|
||||||
}
|
}
|
||||||
|
|
||||||
function openSection(section: ContentSection) {
|
function openSection(section: ContentSection) {
|
||||||
|
|||||||
@ -689,11 +689,15 @@ async function syncAll() {
|
|||||||
try {
|
try {
|
||||||
syncing.value = true
|
syncing.value = true
|
||||||
error.value = ''
|
error.value = ''
|
||||||
const result = await rpcClient.federationSyncState()
|
syncResults.value = []
|
||||||
|
const result = await rpcClient.call<{
|
||||||
|
synced: number; failed: number;
|
||||||
|
results: Array<{ did: string; status: string; apps?: number; error?: string }>
|
||||||
|
}>({ method: 'federation.sync-state', timeout: 180000 })
|
||||||
syncResults.value = result.results
|
syncResults.value = result.results
|
||||||
await loadNodes()
|
await loadNodes()
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
error.value = e instanceof Error ? e.message : 'Sync failed'
|
error.value = e instanceof Error ? e.message : 'Sync failed — some peers may be unreachable over Tor'
|
||||||
} finally {
|
} finally {
|
||||||
syncing.value = false
|
syncing.value = false
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user