Merge feature/admin-server-adresse in main
This commit is contained in:
commit
69d620bb19
4 files changed
+15
-2
No files matched your search
@@ -296,6 +296,14 @@ function MatchAdminCard({ m, run, busy, token, reload, setNotice }) {
|
||||
{current.live?.roundsPlayed != null && <span className="muted">Runde {current.live.roundsPlayed + 1}</span>}
|
||||
</div>
|
||||
)}
|
||||
{m.server?.address && m.server.status !== 'stopped' && (
|
||||
<div className="admin-address">
|
||||
<span><span className="muted">Server</span> <code>{m.server.address.host}:{m.server.address.port}</code></span>
|
||||
{m.server.address.tvPort && (
|
||||
<span><span className="muted">CSTV</span> <code>{m.server.address.host}:{m.server.address.tvPort}</code></span>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
{paused && <span className="admin-badge is-paused">Pausiert</span>}
|
||||
</div>
|
||||
<button className="link-btn" onClick={() => setOpen(!open)}>{open ? 'Weniger' : 'Details'}</button>
|
||||
|
||||
@@ -568,3 +568,5 @@ input:focus, select:focus { border-color: var(--link); outline: none; }
|
||||
.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; }
|
||||
.admin-address { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; font-size: .85rem; }
|
||||
.admin-address code { font: 500 .85rem ui-monospace, SFMono-Regular, Consolas, monospace; padding: 1px 6px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); }
|
||||
@@ -956,6 +956,9 @@ export class MatchService extends EventEmitter {
|
||||
updatedAt: row.updated_at,
|
||||
idleTimeoutMinutes: this.config.idleTimeoutMinutes,
|
||||
};
|
||||
if (viewer.isOrganizer && row.host) {
|
||||
view.address = { host: row.host, port: row.port, tvPort: row.tv_port };
|
||||
}
|
||||
const configured = row.status === 'configured';
|
||||
if (!configured || viewer.role === 'public') return view;
|
||||
|
||||
|
||||
@@ -251,7 +251,7 @@ export class DockerHostPool {
|
||||
}
|
||||
|
||||
/**
|
||||
* Freier Speicher unter /var/lib/docker auf einem Host, per SSH. Ergebnis wird eine Minute lang
|
||||
* Freier Speicher auf einem Host, per SSH: dort, wo das Gameserver-Volume liegt. Ergebnis wird eine Minute lang
|
||||
* zwischengespeichert, weil die Admin-Seite alle paar Sekunden abfragt. Ohne ssh:// gibt es null.
|
||||
*/
|
||||
async diskUsage(name) {
|
||||
@@ -265,7 +265,7 @@ export class DockerHostPool {
|
||||
try {
|
||||
const { stdout } = await exec('ssh', [
|
||||
'-o', 'BatchMode=yes', '-o', 'ConnectTimeout=5', host.dockerHost.slice('ssh://'.length),
|
||||
'df -B1 /var/lib/docker 2>/dev/null || df -B1 /',
|
||||
`df -B1 "$(docker volume inspect ${host.volume} --format '{{with .Options}}{{.device}}{{end}}' 2>/dev/null | grep . || docker volume inspect ${host.volume} --format '{{.Mountpoint}}' 2>/dev/null || echo /var/lib/docker)" 2>/dev/null || df -B1 /var/lib/docker 2>/dev/null || df -B1 /`,
|
||||
], { timeout: 10_000 });
|
||||
value = parseDf(stdout.trim().split('\n').pop());
|
||||
} catch {
|
||||
|
||||
Reference in new issue
Block a user