|
|
@ -7,14 +7,15 @@ export default function Status({ service }) {
|
|
|
|
const { data, error } = useSWR(`/api/docker/status/${service.container}/${service.server || ""}`);
|
|
|
|
const { data, error } = useSWR(`/api/docker/status/${service.container}/${service.server || ""}`);
|
|
|
|
|
|
|
|
|
|
|
|
if (error) {
|
|
|
|
if (error) {
|
|
|
|
<div className="w-auto px-1.5 py-0.5 text-center bg-theme-500/10 dark:bg-theme-900/50 rounded-b-[3px] overflow-hidden" title={data.status}>
|
|
|
|
<div className="w-auto px-1.5 py-0.5 text-center bg-theme-500/10 dark:bg-theme-900/50 rounded-b-[3px] overflow-hidden" title={t("docker.error")}>
|
|
|
|
<div className="text-[8px] font-bold text-rose-500/80 uppercase">{t("docker.error")}</div>
|
|
|
|
<div className="text-[8px] font-bold text-rose-500/80 uppercase">{t("docker.error")}</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (data) {
|
|
|
|
let statusLabel = "";
|
|
|
|
let statusLabel = "";
|
|
|
|
|
|
|
|
|
|
|
|
if (data && data.status?.includes("running")) {
|
|
|
|
if (data.status?.includes("running")) {
|
|
|
|
if (data.health === "starting") {
|
|
|
|
if (data.health === "starting") {
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<div className="w-auto px-1.5 py-0.5 text-center bg-theme-500/10 dark:bg-theme-900/50 rounded-b-[3px] overflow-hidden" title={t("docker.starting")}>
|
|
|
|
<div className="w-auto px-1.5 py-0.5 text-center bg-theme-500/10 dark:bg-theme-900/50 rounded-b-[3px] overflow-hidden" title={t("docker.starting")}>
|
|
|
@ -44,7 +45,7 @@ export default function Status({ service }) {
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (data && (data.status === "not found" || data.status === "exited" || data.status?.startsWith("partial"))) {
|
|
|
|
if (data.status === "not found" || data.status === "exited" || data.status?.startsWith("partial")) {
|
|
|
|
if (data.status === "not found") statusLabel = t("docker.not_found")
|
|
|
|
if (data.status === "not found") statusLabel = t("docker.not_found")
|
|
|
|
else if (data.status === "exited") statusLabel = t("docker.exited")
|
|
|
|
else if (data.status === "exited") statusLabel = t("docker.exited")
|
|
|
|
else statusLabel = data.status.replace("partial", t("docker.partial"))
|
|
|
|
else statusLabel = data.status.replace("partial", t("docker.partial"))
|
|
|
@ -54,6 +55,7 @@ export default function Status({ service }) {
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<div className="w-auto px-1.5 py-0.5 text-center bg-theme-500/10 dark:bg-theme-900/50 rounded-b-[3px] overflow-hidden">
|
|
|
|
<div className="w-auto px-1.5 py-0.5 text-center bg-theme-500/10 dark:bg-theme-900/50 rounded-b-[3px] overflow-hidden">
|
|
|
|