1
0
mirror of https://github.com/mailcow/mailcow-dockerized.git synced 2026-04-28 20:09:08 +00:00

Merge pull request #7082 from JeremieCrinon/fix/show-stopped-containers-api-and-dashboard

fix: show stopped and failed containers in dashboard and API
This commit is contained in:
FreddleSpl0it
2026-03-03 14:01:03 +01:00
committed by GitHub
3 changed files with 4 additions and 4 deletions

View File

@@ -110,12 +110,12 @@ async def get_container(container_id : str):
return Response(content=json.dumps(res, indent=4), media_type="application/json")
@app.get("/containers/json")
async def get_containers():
async def get_containers(all: bool = False):
global dockerapi
containers = {}
try:
for container in (await dockerapi.async_docker_client.containers.list()):
for container in (await dockerapi.async_docker_client.containers.list(all=all)):
container_info = await container.show()
containers.update({container_info['Id']: container_info})
return Response(content=json.dumps(containers, indent=4), media_type="application/json")