feat: Enhance RelayHub component with subscription count details (still not working)

- Update RelayHubStatus.vue to display both local and global subscription counts, improving user visibility into active subscriptions.
- Add totalSubscriptionCount computed property in useRelayHub.ts to track the total number of subscriptions.
- Implement totalSubscriptionCount getter in relayHub.ts to return the size of the subscriptions map.
- Include debug logging in relayHub.ts for connected relay counts and statuses to aid in troubleshooting.
This commit is contained in:
padreug 2025-08-10 18:19:18 +02:00
parent 356f42d209
commit 36e9694c1b
5 changed files with 26 additions and 3 deletions

View file

@ -85,19 +85,34 @@ export class RelayHub extends EventEmitter {
}
get connectedRelayCount(): number {
return this.connectedRelays.size
// Return the actual size of connectedRelays map
const count = this.connectedRelays.size
console.log('🔍 connectedRelayCount getter called, returning:', count)
return count
}
get totalRelayCount(): number {
return this.relayConfigs.size
}
get totalSubscriptionCount(): number {
return this.subscriptions.size
}
get relayStatuses(): RelayStatus[] {
console.log('🔍 relayStatuses getter called')
console.log('🔍 relayConfigs size:', this.relayConfigs.size)
console.log('🔍 connectedRelays size:', this.connectedRelays.size)
console.log('🔍 connectedRelays keys:', Array.from(this.connectedRelays.keys()))
return Array.from(this.relayConfigs.values()).map(config => {
const relay = this.connectedRelays.get(config.url)
const isConnected = !!relay
console.log(`🔍 Relay ${config.url}: connected=${isConnected}, relay=${relay ? 'exists' : 'null'}`)
return {
url: config.url,
connected: !!relay,
connected: isConnected,
lastSeen: relay ? Date.now() : 0,
error: relay ? undefined : 'Not connected',
latency: relay ? 0 : undefined // TODO: Implement actual latency measurement