}
diff --git a/src/components/services/status.jsx b/src/components/services/status.jsx
index 70cad6b2..7ef6a079 100644
--- a/src/components/services/status.jsx
+++ b/src/components/services/status.jsx
@@ -7,52 +7,54 @@ export default function Status({ service }) {
const { data, error } = useSWR(`/api/docker/status/${service.container}/${service.server || ""}`);
if (error) {
-
+
}
- let statusLabel = "";
+ if (data) {
+ let statusLabel = "";
+
+ if (data.status?.includes("running")) {
+ if (data.health === "starting") {
+ return (
+
+
{t("docker.starting")}
+
+ );
+ }
+
+ if (data.health === "unhealthy") {
+ return (
+
+
{t("docker.unhealthy")}
+
+ );
+ }
+
+ if (!data.health) {
+ statusLabel = data.status.replace("running", t("docker.running"))
+ } else {
+ statusLabel = data.health === "healthy" ? t("docker.healthy") : data.health
+ }
- if (data && data.status?.includes("running")) {
- if (data.health === "starting") {
return (
-
-
{t("docker.starting")}
+
);
}
-
- if (data.health === "unhealthy") {
+
+ if (data.status === "not found" || data.status === "exited" || data.status?.startsWith("partial")) {
+ if (data.status === "not found") statusLabel = t("docker.not_found")
+ else if (data.status === "exited") statusLabel = t("docker.exited")
+ else statusLabel = data.status.replace("partial", t("docker.partial"))
return (
-
-
{t("docker.unhealthy")}
+
);
}
-
- if (!data.health) {
- statusLabel = data.status.replace("running", t("docker.running"))
- } else {
- statusLabel = data.health === "healthy" ? t("docker.healthy") : data.health
- }
-
- return (
-
- );
- }
-
- if (data && (data.status === "not found" || data.status === "exited" || data.status?.startsWith("partial"))) {
- if (data.status === "not found") statusLabel = t("docker.not_found")
- else if (data.status === "exited") statusLabel = t("docker.exited")
- else statusLabel = data.status.replace("partial", t("docker.partial"))
- return (
-
- );
}
return (