Fix admin ops status refresh
All checks were successful
Build & Push Docker Image to Gitea Registry / build-and-push (push) Successful in 12s

This commit is contained in:
Kroonk
2026-05-21 17:16:58 +02:00
parent 5b252f17fd
commit d62224366b
4 changed files with 38 additions and 23 deletions

View File

@@ -205,6 +205,15 @@ function canRestartContainer(container) {
return container.state === 'running' || container.State === 'running';
}
function restartBlockReason(container) {
const name = normalizeContainerName(container.name || container.Names?.[0]);
if (!name) return 'Kein Containername.';
if (RESTART_BLOCKLIST.has(name)) return 'Geschuetzter Systemdienst.';
if (name.endsWith('_db') || name.includes('-db')) return 'Datenbank-Container.';
if (container.state !== 'running' && container.State !== 'running') return 'Container laeuft nicht.';
return null;
}
function dockerLogs(container, tail = 160) {
return new Promise((resolve, reject) => {
const endpoint = `/containers/${encodeURIComponent(container)}/logs?stdout=1&stderr=1&tail=${tail}`;
@@ -252,6 +261,7 @@ async function getContainers() {
status: container.Status,
state: container.State,
restartable: canRestartContainer(container),
restartBlockReason: restartBlockReason(container),
ports: (container.Ports || []).map((port) => ({
privatePort: port.PrivatePort,
publicPort: port.PublicPort,
@@ -400,6 +410,8 @@ async function readWatchtowerRunContainer(runId) {
session: parsed,
tail: Array.isArray(logs) ? logs.slice(-20) : logs
};
return payload;
}
async function monitorWatchtowerRun(runId) {