feat: Implement network status banner

This commit is contained in:
gpt-engineer-app[bot]
2025-11-05 14:12:23 +00:00
parent 783284a47a
commit e773ca58d1
4 changed files with 156 additions and 0 deletions

View File

@@ -98,6 +98,13 @@ export class CircuitBreaker {
logger.info('Circuit breaker CLOSED - service recovered', {
successCount: this.successCount
});
// Emit event for UI components
if (typeof window !== 'undefined') {
window.dispatchEvent(new CustomEvent('circuit-breaker-closed', {
detail: { successCount: this.successCount }
}));
}
}
}
}
@@ -122,6 +129,16 @@ export class CircuitBreaker {
monitoringWindow: this.config.monitoringWindow,
resetTimeout: this.config.resetTimeout
});
// Emit event for UI components
if (typeof window !== 'undefined') {
window.dispatchEvent(new CustomEvent('circuit-breaker-opened', {
detail: {
failures: this.failures.length,
threshold: this.config.failureThreshold
}
}));
}
}
}