Admin: freier Speicher pro Docker-Host anzeigen
Die Karte Docker-Hosts zeigt den freien Speicher unter /var/lib/docker, per SSH mit df gemessen und eine Minute zwischengespeichert. Unter 20 GB wird die Zeile rot.
This commit is contained in:
1 parent
0f3a66fed5
commit
dfe6a7d218
6 files changed
+66
-4
No files matched your search
@@ -408,6 +408,11 @@ function HostUsage({ hosts }) {
|
||||
<div className="host-bar" role="progressbar" aria-valuenow={percent} aria-valuemin={0} aria-valuemax={100}>
|
||||
<span style={{ width: `${percent}%` }} />
|
||||
</div>
|
||||
{h.disk && (
|
||||
<div className={`host-disk ${h.disk.freeBytes < 20e9 ? 'is-low' : ''}`}>
|
||||
Speicher: {gb(h.disk.freeBytes)} frei von {gb(h.disk.totalBytes)}
|
||||
</div>
|
||||
)}
|
||||
{h.matches.length === 0 ? (
|
||||
<p className="muted small">Keine Gameserver</p>
|
||||
) : (
|
||||
@@ -422,3 +427,6 @@ function HostUsage({ hosts }) {
|
||||
</section>
|
||||
);
|
||||
}
|
||||
function gb(bytes) {
|
||||
return `${Math.round(bytes / 1e9)} GB`;
|
||||
}
|
||||
@@ -566,3 +566,5 @@ input:focus, select:focus { border-color: var(--link); outline: none; }
|
||||
.host-card.is-full .host-bar span { background: var(--pending); }
|
||||
.host-matches { list-style: none; margin: 0; padding: 0; font-size: .9rem; }
|
||||
.host-matches li { padding: 3px 0; border-top: 1px solid var(--line); }
|
||||
.host-disk { font-size: .85rem; color: var(--muted); margin: -2px 0 8px; font-variant-numeric: tabular-nums; }
|
||||
.host-disk.is-low { color: var(--error); font-weight: 600; }
|
||||
Reference in new issue
Block a user