From 3a617f929116ff1f16f229c9f3f913237eb7124c Mon Sep 17 00:00:00 2001 From: Neshura Date: Sun, 11 Dec 2022 17:00:34 +0100 Subject: [PATCH] More logging --- pages/services.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pages/services.tsx b/pages/services.tsx index 7b62cb1..3111d67 100644 --- a/pages/services.tsx +++ b/pages/services.tsx @@ -109,7 +109,7 @@ async function getStatus(entry: Service, containers: Dockerode.ContainerInfo[]) else if (entry.type === ServiceType.docker) { containers.forEach((container) => { // Docker API returns container names with / prepended - if (container.Names.includes( "/" + entry.docker_container_name)) { + if (container.Names.includes("/" + entry.docker_container_name)) { // so far only "running" is properly implemented, mroe cases to follow as needed switch (container.State) { case "running": @@ -123,8 +123,9 @@ async function getStatus(entry: Service, containers: Dockerode.ContainerInfo[]) // If container name is not missing the container is set to offline else if (entry.docker_container_name !== null) { // DEBUG - console.log(entry.docker_container_name); - console.log(container.Names); + console.log(container.Names.includes("/" + entry.docker_container_name)) + console.log("/" + entry.docker_container_name); + console.log(container.Names[0]); // DEBUG console.warn("Container for " + entry.name + " could not be found"); entry.status = ServiceStatus.offline;