mirror of
https://github.com/portainer/portainer.git
synced 2025-07-25 08:19:40 +02:00
feat(dashboard): add health status to home page and dashboard (#3489)
* feat(dashboard): add health status to home page and dashboard * fix(dashboard): code review updates, using builtin for substring search
This commit is contained in:
parent
cc8d3c8639
commit
6f59f130a1
5 changed files with 53 additions and 17 deletions
|
@ -248,6 +248,22 @@ angular.module('portainer.docker')
|
|||
}).length;
|
||||
};
|
||||
})
|
||||
.filter('healthycontainers', function () {
|
||||
'use strict';
|
||||
return function healthyContainersFilter(containers) {
|
||||
return containers.filter(function (container) {
|
||||
return container.Status === 'healthy';
|
||||
}).length;
|
||||
}
|
||||
})
|
||||
.filter('unhealthycontainers', function () {
|
||||
'use strict';
|
||||
return function unhealthyContainersFilter(containers) {
|
||||
return containers.filter(function (container) {
|
||||
return container.Status === 'unhealthy';
|
||||
}).length;
|
||||
}
|
||||
})
|
||||
.filter('imagestotalsize', function () {
|
||||
'use strict';
|
||||
return function (images) {
|
||||
|
|
|
@ -109,9 +109,13 @@
|
|||
<div class="widget-icon blue pull-left">
|
||||
<i class="fa fa-server"></i>
|
||||
</div>
|
||||
<div class="pull-right">
|
||||
<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 | stoppedcontainers }} stopped</div>
|
||||
<div class="pull-right"style="padding-left: 5px;">
|
||||
<div><i class="fa fa-power-off space-right green-icon"></i>{{ containers | runningcontainers }} running</div>
|
||||
<div><i class="fa fa-power-off space-right red-icon"></i>{{ containers | stoppedcontainers }} stopped</div>
|
||||
</div>
|
||||
<div class="pull-right" style="padding-right: 5px;">
|
||||
<div><i class="fa fa-heartbeat space-right green-icon"></i>{{ containers | healthycontainers }} healthy</div>
|
||||
<div><i class="fa fa-heartbeat space-right orange-icon"></i>{{ containers | unhealthycontainers }} unhealthy</div>
|
||||
</div>
|
||||
<div class="title">{{ containers.length }}</div>
|
||||
<div class="comment">{{ containers.length === 1 ? 'Container' : 'Containers' }}</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue