1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-08-04 13:25:26 +02:00

feat(containers): show health status of containers (#622)

This commit is contained in:
Thomas Krzero 2017-04-25 11:09:06 +02:00 committed by Anthony Lapenna
parent ca5c606dfc
commit e70817f776
4 changed files with 45 additions and 3 deletions

View file

@ -40,11 +40,11 @@ angular.module('portainer.filters', [])
'use strict';
return function (text) {
var status = _.toLower(text);
if (status.indexOf('paused') !== -1) {
if (status.indexOf('paused') !== -1 || status.indexOf('starting') !== -1) {
return 'warning';
} else if (status.indexOf('created') !== -1) {
return 'info';
} else if (status.indexOf('stopped') !== -1) {
} else if (status.indexOf('stopped') !== -1 || status.indexOf('unhealthy') !== -1) {
return 'danger';
}
return 'success';
@ -60,6 +60,12 @@ angular.module('portainer.filters', [])
return 'created';
} else if (status.indexOf('exited') !== -1) {
return 'stopped';
} else if (status.indexOf('(healthy)') !== -1) {
return 'healthy';
} else if (status.indexOf('(unhealthy)') !== -1) {
return 'unhealthy';
} else if (status.indexOf('(health: starting)') !== -1) {
return 'starting';
}
return 'running';
};