@@ -2029,6 +2029,7 @@ function refreshStackRow(stackId, project) {
20292029 }
20302030 // Update cache with fresh data
20312031 stackContainersCache[stackId] = containers;
2032+ stackDefinedServicesCache[stackId] = response.definedServices || containers.length;
20322033 // Now update the row using the fresh cache
20332034 updateParentStackFromContainers(stackId, project);
20342035 // If details are expanded, refresh them too
@@ -2530,6 +2531,7 @@ function ComposeLogs(pathOrProject, profile = "") {
25302531 var currentStackId = null;
25312532 var expandedStacks = {};
25322533 var stackContainersCache = {};
2534+ var stackDefinedServicesCache = {}; // Cache for defined service counts
25332535 // Track stacks currently loading details to prevent concurrent reloads
25342536 var stackDetailsLoading = {};
25352537 // Suppress immediate refresh after a render to avoid loops
@@ -3636,6 +3638,7 @@ function loadStackContainerDetails(stackId, project) {
36363638 }
36373639
36383640 stackContainersCache[stackId] = containers;
3641+ stackDefinedServicesCache[stackId] = response.definedServices || containers.length;
36393642 composeClientDebug('[loadStackContainerDetails] success', {
36403643 stackId: stackId,
36413644 project: project,
@@ -3925,11 +3928,13 @@ function renderContainerDetails(stackId, containers, project) {
39253928 // Build a condensed stackInfo object from the stackContainersCache for a stack
39263929 function buildStackInfoFromCache(stackId, project) {
39273930 var containers = stackContainersCache[stackId] || [];
3931+ var definedServices = stackDefinedServicesCache[stackId] || containers.length;
39283932 var stackInfo = {
39293933 projectName: project,
39303934 containers: [],
39313935 isRunning: false,
3932- hasUpdate: false
3936+ hasUpdate: false,
3937+ totalServices: definedServices // Track total defined services for accurate status
39333938 };
39343939 containers.forEach(function(c) {
39353940 var name = c.Name || c.Service || '';
@@ -4006,7 +4011,8 @@ function updateParentStackFromContainers(stackId, project) {
40064011 var runningCount = stackInfo.containers.filter(function(c) {
40074012 return c.isRunning;
40084013 }).length;
4009- var totalCount = stackInfo.containers.length;
4014+ // Use totalServices (defined services) if available, otherwise fall back to actual container count
4015+ var totalCount = stackInfo.totalServices || stackInfo.containers.length;
40104016 var anyRunning = runningCount > 0;
40114017 var anyPaused = stackInfo.containers.some(function(c) {
40124018 return !c.isRunning && (c.updateStatus === 'paused' || c.updateStatus === 'paused');
0 commit comments