diff --git a/app.js b/app.js index 21c5c222e..57ce9b8f8 100644 --- a/app.js +++ b/app.js @@ -2516,24 +2516,46 @@ function populateAtlas() { const grid = document.getElementById('atlas-grid'); grid.innerHTML = ''; + // Counters by status let onlineCount = 0; let standbyCount = 0; + let rebuildingCount = 0; + let localCount = 0; + let blockedCount = 0; + + // Group portals by environment + const byEnv = { production: [], staging: [], local: [] }; portals.forEach(portal => { const config = portal.config; - if (config.status === 'online') onlineCount++; - if (config.status === 'standby') standbyCount++; + const status = config.status || 'online'; + const env = config.environment || 'production'; + // Count statuses + if (status === 'online' || status === 'active') onlineCount++; + else if (status === 'standby') standbyCount++; + else if (status === 'rebuilding') rebuildingCount++; + else if (status === 'local-only') localCount++; + else if (status === 'blocked') blockedCount++; + + // Group by environment + if (byEnv[env]) { + byEnv[env].push({ config, status }); + } else { + byEnv['production'].push({ config, status }); + } + + // Create atlas card const card = document.createElement('div'); card.className = 'atlas-card'; card.style.setProperty('--portal-color', config.color); - const statusClass = `status-${config.status || 'online'}`; + const statusClass = `status-${status}`; card.innerHTML = `
${config.name}
-
${config.status || 'ONLINE'}
+
${status.toUpperCase()}
${config.description}