diff options
Diffstat (limited to '')
-rw-r--r-- | html/index.html | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/html/index.html b/html/index.html index c783367..f8f599c 100644 --- a/html/index.html +++ b/html/index.html @@ -238,6 +238,10 @@ function loop_top() { $('#top_refresh_interval').text(top_refresh_interval_seconds); } +// Container's State.Status field values are described in the API reference: +// +// https://docs.docker.com/engine/api/v1.43/#tag/Container/operation/ContainerInspect +// function docker_container_is_ok(info) { if (info.status == 'restarting' || info.status == 'dead') return false; @@ -256,12 +260,10 @@ function docker_container_format_status(info) { result += ` (${info.exit_code})`; if (info.status == 'running') { - if (info.health == 'unhealthy') { - result = 'Up (unhealthy)'; - } else { - let since = new Date(info.started_at); - result = `Up ${format_duration(Date.now() - since)}`; - } + let since = new Date(info.started_at); + result = `Up ${format_duration(Date.now() - since)}`; + if (info.health == 'unhealthy') + result = `${result} (unhealthy)`; } return result; |