From 12f32bfb754cf3ae93fa8245b5dd46065135ff83 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Sun, 10 Dec 2023 09:42:56 +0100 Subject: html: display container running time, even if unhealthy --- html/index.html | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'html') diff --git a/html/index.html b/html/index.html index c783367..3672cad 100644 --- a/html/index.html +++ b/html/index.html @@ -256,12 +256,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; -- cgit v1.2.3 From 33e0201c3f1831dc6384a88777b37d625fb0630b Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Sun, 10 Dec 2023 09:45:17 +0100 Subject: html: add a comment with a reference link --- html/index.html | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'html') diff --git a/html/index.html b/html/index.html index 3672cad..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; -- cgit v1.2.3