mirror of https://github.com/portainer/portainer
fix(docker): Show stopped container on dashboard [EE-4327] (#7833)
* EE-4327 fix(docker): Show stopped container on dashboard * Update ContainerStatus.tsx remove comment * EE-4327 fix(docker): show stopped container on dashboardpull/6986/merge
parent
f3e2ccd487
commit
0219d41ba7
|
@ -159,7 +159,7 @@ func snapshotContainers(snapshot *portainer.DockerSnapshot, cli *client.Client)
|
||||||
gpuUseSet := make(map[string]struct{})
|
gpuUseSet := make(map[string]struct{})
|
||||||
gpuUseAll := false
|
gpuUseAll := false
|
||||||
for _, container := range containers {
|
for _, container := range containers {
|
||||||
if container.State == "exited" {
|
if container.State == "exited" || container.State == "stopped" {
|
||||||
stoppedContainers++
|
stoppedContainers++
|
||||||
} else if container.State == "running" {
|
} else if container.State == "running" {
|
||||||
runningContainers++
|
runningContainers++
|
||||||
|
|
|
@ -60,7 +60,10 @@ function runningContainersFilter(containers: DockerContainer[]) {
|
||||||
.length;
|
.length;
|
||||||
}
|
}
|
||||||
function stoppedContainersFilter(containers: DockerContainer[]) {
|
function stoppedContainersFilter(containers: DockerContainer[]) {
|
||||||
return containers.filter((container) => container.Status === 'exited').length;
|
return containers.filter(
|
||||||
|
(container) =>
|
||||||
|
container.Status === 'exited' || container.Status === 'stopped'
|
||||||
|
).length;
|
||||||
}
|
}
|
||||||
function healthyContainersFilter(containers: DockerContainer[]) {
|
function healthyContainersFilter(containers: DockerContainer[]) {
|
||||||
return containers.filter((container) => container.Status === 'healthy')
|
return containers.filter((container) => container.Status === 'healthy')
|
||||||
|
|
Loading…
Reference in New Issue