mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-09-22 11:13:26 +00:00
fix: improve configuration readiness detection in setup flow
- Add system info to health endpoint including configPlaceholder status - Update setup page to check correct health properties - Include hasData and clientsInitialized flags for better readiness detection This ensures the 'Continue to Pulse' button appears when the server is actually ready with data, not just when it times out.
This commit is contained in:
@@ -167,6 +167,13 @@ app.get('/healthz', (req, res) => {
|
||||
app.get('/api/health', (req, res) => {
|
||||
try {
|
||||
const healthSummary = stateManager.getHealthSummary();
|
||||
// Add system info including placeholder status
|
||||
const state = stateManager.getState();
|
||||
healthSummary.system = {
|
||||
configPlaceholder: state.isConfigPlaceholder || false,
|
||||
hasData: stateManager.hasData(),
|
||||
clientsInitialized: Object.keys(global.pulseApiClients?.apiClients || {}).length > 0
|
||||
};
|
||||
res.json(healthSummary);
|
||||
} catch (error) {
|
||||
console.error("Error in /api/health:", error);
|
||||
|
||||
@@ -540,8 +540,8 @@
|
||||
console.log('Health check response:', health);
|
||||
|
||||
// Check if the server has successfully loaded configuration
|
||||
// Look for signs that API clients are initialized and not in placeholder mode
|
||||
if (health.system && health.system.configPlaceholder === false) {
|
||||
// Look for overall health and recent activity
|
||||
if (health.overall === 'healthy' && health.lastUpdate && health.connections && health.connections.total > 0) {
|
||||
showSuccess('Configuration applied successfully!', true, false);
|
||||
|
||||
// Re-enable the save button
|
||||
|
||||
Reference in New Issue
Block a user