fix: Disk-Banner — Safe-Cleanup als Default + Aggressiv hinter Expander

Safe-Variante (Default):
  docker builder prune -a -f && docker image prune -a -f
  → Build-Cache + ungenutzte Images, KEINE Volumes angefasst.
  → 90% des Platzproblems geloest, Null Datenverlust-Risiko.

Aggressive Variante (nur auf Wunsch, hinter 'Mehr'-Button):
  docker system prune -a --volumes -f
  → Zusaetzlich ungenutzte Volumes.
  → Nur sicher wenn alle ARIA-Container LAUFEN (sonst werden
     openclaw-config/claude-config/aria-shared als "ungenutzt"
     behandelt und zerstoert — Sessions weg).
  → Hinweistext orange hervorgehoben mit Warnung.

Banner-Button 'Sicher aufraeumen' kopiert die sichere Variante.
'Mehr' klappt die Erklaerung der aggressiven Variante aus.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
duffyduck 2026-04-19 23:39:22 +02:00
parent f15b3f583f
commit ba62cec78c
1 changed files with 24 additions and 11 deletions

View File

@ -132,12 +132,27 @@
<div style="display:flex;align-items:center;gap:10px;flex-wrap:wrap;">
<span id="disk-banner-icon" style="font-size:18px;">&#x26A0;&#xFE0F;</span>
<span id="disk-banner-text" style="flex:1;min-width:200px;font-weight:600;"></span>
<code id="disk-banner-cmd" onclick="copyDiskCmd()" style="font-family:monospace;font-size:12px;padding:4px 8px;background:rgba(0,0,0,0.3);border-radius:4px;cursor:pointer;white-space:nowrap;">
docker system prune -a --volumes -f
</code>
<button onclick="copyDiskCmd()" class="btn secondary" style="padding:4px 10px;font-size:11px;">Kopieren</button>
<button onclick="copyDiskCmd('safe')" class="btn secondary" style="padding:4px 10px;font-size:11px;" title="docker builder prune -a -f && docker image prune -a -f">
Sicher aufraeumen
</button>
<button onclick="document.getElementById('disk-banner-aggressive').style.display=(document.getElementById('disk-banner-aggressive').style.display==='none'?'flex':'none')"
class="btn secondary" style="padding:4px 10px;font-size:11px;">
Mehr &#x25BE;
</button>
<button onclick="document.getElementById('disk-banner').style.display='none'" class="btn secondary" style="padding:4px 10px;font-size:11px;">Schliessen</button>
</div>
<!-- Aggressive Variante (erst nach Klick sichtbar) -->
<div id="disk-banner-aggressive" style="display:none;margin-top:10px;padding:8px;background:rgba(0,0,0,0.25);border-radius:4px;flex-direction:column;gap:6px;font-size:12px;">
<div>
<b>Sicher</b> (empfohlen) — Build-Cache + ungenutzte Images, keine Volumes:<br>
<code style="font-family:monospace;">docker builder prune -a -f && docker image prune -a -f</code>
</div>
<div style="color:#FFAA55;">
<b>Aggressiv</b> — zusaetzlich ungenutzte Volumes. <b>Nur wenn alle ARIA-Container laufen</b>, sonst riskierst du Daten-Verlust (Sessions, SSH-Keys, Shared):<br>
<code style="font-family:monospace;">docker system prune -a --volumes -f</code>
<button onclick="copyDiskCmd('aggressive')" class="btn secondary" style="padding:2px 8px;font-size:10px;margin-left:6px;">Kopieren</button>
</div>
</div>
</div>
<h1>ARIA Diagnostic</h1>
@ -2205,19 +2220,17 @@
banner.style.display = 'block';
}
function copyDiskCmd() {
const cmd = document.getElementById('disk-banner-cmd').textContent.trim();
function copyDiskCmd(variant) {
const cmd = variant === 'aggressive'
? 'docker system prune -a --volumes -f'
: 'docker builder prune -a -f && docker image prune -a -f';
navigator.clipboard.writeText(cmd).then(() => {
const btn = event.target;
const old = btn.textContent;
btn.textContent = 'Kopiert!';
setTimeout(() => { btn.textContent = old; }, 1500);
}).catch(() => {
// Fallback: selektieren
const range = document.createRange();
range.selectNode(document.getElementById('disk-banner-cmd'));
window.getSelection().removeAllRanges();
window.getSelection().addRange(range);
alert('Kopieren fehlgeschlagen — Befehl: ' + cmd);
});
}