@@ -109,7 +109,7 @@ export const getContainersByAppNameMatch = async (
109109 try {
110110 let result : string [ ] = [ ] ;
111111 const cmd =
112- "docker ps -a --format 'CONTAINER ID : {{.ID}} | Name: {{.Names}} | State: {{.State}}'" ;
112+ "docker ps -a --format 'CONTAINER ID : {{.ID}} | Name: {{.Names}} | State: {{.State}} | Status: {{.Status}} '" ;
113113
114114 const command =
115115 appType === "docker-compose"
@@ -148,10 +148,14 @@ export const getContainersByAppNameMatch = async (
148148 const state = parts [ 2 ]
149149 ? parts [ 2 ] . replace ( "State: " , "" ) . trim ( )
150150 : "No state" ;
151+
152+ const status = parts [ 3 ] ? parts [ 3 ] . replace ( "Status: " , "" ) . trim ( ) : "" ;
153+
151154 return {
152155 containerId,
153156 name,
154157 state,
158+ status,
155159 } ;
156160 } ) ;
157161
@@ -168,7 +172,7 @@ export const getStackContainersByAppName = async (
168172 try {
169173 let result : string [ ] = [ ] ;
170174
171- const command = `docker stack ps ${ appName } --format 'CONTAINER ID : {{.ID}} | Name: {{.Name}} | State: {{.DesiredState}} | Node: {{.Node}}'` ;
175+ const command = `docker stack ps ${ appName } --format 'CONTAINER ID : {{.ID}} | Name: {{.Name}} | State: {{.DesiredState}} | Node: {{.Node}} | CurrentState: {{.CurrentState}} '` ;
172176 if ( serverId ) {
173177 const { stdout, stderr } = await execAsyncRemote ( serverId , command ) ;
174178
@@ -205,11 +209,15 @@ export const getStackContainersByAppName = async (
205209 const node = parts [ 3 ]
206210 ? parts [ 3 ] . replace ( "Node: " , "" ) . trim ( )
207211 : "No specific node" ;
212+ const currentState = parts [ 4 ]
213+ ? parts [ 4 ] . replace ( "CurrentState: " , "" ) . trim ( )
214+ : "" ;
208215 return {
209216 containerId,
210217 name,
211218 state,
212219 node,
220+ currentState,
213221 } ;
214222 } ) ;
215223
@@ -226,8 +234,7 @@ export const getServiceContainersByAppName = async (
226234 try {
227235 let result : string [ ] = [ ] ;
228236
229- const command = `docker service ps ${ appName } --format 'CONTAINER ID : {{.ID}} | Name: {{.Name}} | State: {{.DesiredState}} | Node: {{.Node}}'` ;
230-
237+ const command = `docker service ps ${ appName } --format 'CONTAINER ID : {{.ID}} | Name: {{.Name}} | State: {{.DesiredState}} | Node: {{.Node}} | CurrentState: {{.CurrentState}}'` ;
231238 if ( serverId ) {
232239 const { stdout, stderr } = await execAsyncRemote ( serverId , command ) ;
233240
@@ -265,10 +272,15 @@ export const getServiceContainersByAppName = async (
265272 const node = parts [ 3 ]
266273 ? parts [ 3 ] . replace ( "Node: " , "" ) . trim ( )
267274 : "No specific node" ;
275+
276+ const currentState = parts [ 4 ]
277+ ? parts [ 4 ] . replace ( "CurrentState: " , "" ) . trim ( )
278+ : "" ;
268279 return {
269280 containerId,
270281 name,
271282 state,
283+ currentState,
272284 node,
273285 } ;
274286 } ) ;
0 commit comments