mirror of
https://github.com/portainer/portainer.git
synced 2025-07-27 17:29:39 +02:00
fix(dashboard): update stopped/running container filters
This commit is contained in:
parent
0ae10c6f82
commit
8dfa129129
2 changed files with 15 additions and 12 deletions
|
@ -218,17 +218,20 @@ angular.module('portainer.docker')
|
||||||
return runningTasks;
|
return runningTasks;
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
.filter('containerswithstatus', function () {
|
.filter('runningcontainers', function () {
|
||||||
'use strict';
|
'use strict';
|
||||||
return function (containers, status) {
|
return function runningContainersFilter(containers) {
|
||||||
var containersWithStatus = 0;
|
return containers.filter(function (container) {
|
||||||
for (var i = 0; i < containers.length; i++) {
|
return container.State === 'running';
|
||||||
var container = containers[i];
|
}).length;
|
||||||
if (container.Status === status) {
|
};
|
||||||
containersWithStatus++;
|
})
|
||||||
}
|
.filter('stoppedcontainers', function () {
|
||||||
}
|
'use strict';
|
||||||
return containersWithStatus;
|
return function stoppedContainersFilter(containers) {
|
||||||
|
return containers.filter(function (container) {
|
||||||
|
return container.State === 'exited';
|
||||||
|
}).length;
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
.filter('imagestotalsize', function () {
|
.filter('imagestotalsize', function () {
|
||||||
|
|
|
@ -115,8 +115,8 @@
|
||||||
<i class="fa fa-server"></i>
|
<i class="fa fa-server"></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="pull-right">
|
<div class="pull-right">
|
||||||
<div><i class="fa fa-heartbeat space-right green-icon"></i>{{ containers | containerswithstatus:'running' }} running</div>
|
<div><i class="fa fa-heartbeat space-right green-icon"></i>{{ containers | runningcontainers }} running</div>
|
||||||
<div><i class="fa fa-heartbeat space-right red-icon"></i>{{ containers | containerswithstatus:'stopped' }} stopped</div>
|
<div><i class="fa fa-heartbeat space-right red-icon"></i>{{ containers | stoppedcontainers }} stopped</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="title">{{ containers.length }}</div>
|
<div class="title">{{ containers.length }}</div>
|
||||||
<div class="comment">Containers</div>
|
<div class="comment">Containers</div>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue