feat: "ARIA hart neu starten"-Button (docker restart aria-core)
Zweiter Eskalations-Button neben dem Reparieren-Button — fuer Faelle wo doctor --fix nicht reicht (Run alive aber haengt im Tool-Call). Mit Confirmation-Dialog damit's nicht versehentlich gedrueckt wird. Wege: - App-Settings: Reparatur-Sektion, zwei Buttons (Reparieren + Hart neu) - App-Thinking-Bubble: 🔧 + 🚨 + Abbrechen - Diagnostic-Thinking-Indicator: 🔧 + 🚨 + Abbrechen - Diagnostic-Server: POST /api/aria-restart → child_process exec `docker restart aria-core` - Bridge: rvs aria_restart → HTTP zu Diagnostic Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -290,6 +290,7 @@
|
||||
<span><span style="animation:pulse 1s infinite;">💭</span> <span id="thinking-text">ARIA denkt...</span></span>
|
||||
<div style="display:flex;gap:6px;">
|
||||
<button class="btn secondary" onclick="doctorFix()" style="padding:2px 10px;font-size:11px;color:#FF9500;border-color:#FF9500;" title="ARIA reparieren — openclaw doctor --fix">🔧 Reparieren</button>
|
||||
<button class="btn secondary" onclick="ariaRestart()" style="padding:2px 10px;font-size:11px;color:#FF3B30;border-color:#FF3B30;" title="Container hart neu starten (~15s)">🚨 Hart neu</button>
|
||||
<button class="btn secondary" onclick="cancelRequest()" style="padding:2px 10px;font-size:11px;color:#FF3B30;border-color:#FF3B30;">Abbrechen</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1875,6 +1876,21 @@
|
||||
.catch(err => addLog('error', 'server', 'Reparatur Request fehlgeschlagen: ' + err.message));
|
||||
}
|
||||
|
||||
// ── Hard-Restart — docker restart aria-core ──────
|
||||
function ariaRestart() {
|
||||
if (!confirm('ARIA wird hart neu gestartet (Container-Restart, ~15s).\n\nLaufende Anfragen gehen verloren. Sicher?')) return;
|
||||
fetch('/api/aria-restart', { method: 'POST' })
|
||||
.then(r => r.json())
|
||||
.then(data => {
|
||||
if (data.ok) {
|
||||
addLog('info', 'server', 'ARIA neu gestartet — wartet auf Reconnect');
|
||||
} else {
|
||||
addLog('error', 'server', 'Restart fehlgeschlagen: ' + (data.error || ''));
|
||||
}
|
||||
})
|
||||
.catch(err => addLog('error', 'server', 'Restart Request fehlgeschlagen: ' + err.message));
|
||||
}
|
||||
|
||||
// ── Abbrechen ──────────────────────────────
|
||||
function cancelRequest() {
|
||||
send({ action: 'cancel_request' });
|
||||
|
||||
@@ -1358,6 +1358,27 @@ const server = http.createServer((req, res) => {
|
||||
res.end(JSON.stringify({ ok: false, error: err.message }));
|
||||
});
|
||||
return;
|
||||
} else if (req.url === "/api/aria-restart" && req.method === "POST") {
|
||||
// Harter Restart — fuer Faelle wo doctor --fix nicht reicht (alive aber
|
||||
// haengender Run). docker restart killt PID 1 vom Container, alle Locks
|
||||
// weg, neuer State. Dauert ~10-20s bis ARIA wieder antwortet.
|
||||
log("warn", "server", "HTTP /api/aria-restart — harter Container-Restart");
|
||||
broadcast({ type: "watchdog", status: "fixing", message: "ARIA wird hart neu gestartet (~15s)" });
|
||||
const exec = require("child_process").exec;
|
||||
exec("docker restart aria-core", { timeout: 30000 }, (err, stdout, stderr) => {
|
||||
if (err) {
|
||||
log("error", "server", `aria-restart fehlgeschlagen: ${err.message}`);
|
||||
broadcast({ type: "watchdog", status: "error", message: `Restart fehlgeschlagen: ${err.message}` });
|
||||
res.writeHead(500, { "Content-Type": "application/json" });
|
||||
res.end(JSON.stringify({ ok: false, error: err.message }));
|
||||
return;
|
||||
}
|
||||
log("info", "server", `aria-restart OK: ${(stdout || "").trim()}`);
|
||||
broadcast({ type: "watchdog", status: "fixed", message: "ARIA wurde neu gestartet — sollte gleich antworten" });
|
||||
res.writeHead(200, { "Content-Type": "application/json" });
|
||||
res.end(JSON.stringify({ ok: true, output: stdout }));
|
||||
});
|
||||
return;
|
||||
} else if (req.url.startsWith("/shared/")) {
|
||||
// Dateien aus Shared Volume ausliefern (Bilder, Uploads)
|
||||
const filePath = decodeURIComponent(req.url);
|
||||
|
||||
Reference in New Issue
Block a user