Cards show the VPS's public IP (PUBLIC_IP, else the default route's source address) instead of the page's hostname; clicking the address copies it. VPS resources gets stacked download/upload graphs of the last 5 minutes, kept server side. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
306 lines
15 KiB
HTML
306 lines
15 KiB
HTML
<!doctype html>
|
||
<html lang="en">
|
||
<head>
|
||
<meta charset="utf-8">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||
<title>Game Servers</title>
|
||
<link rel="stylesheet" href="/static/style.css">
|
||
</head>
|
||
<body>
|
||
|
||
<!-- Login -->
|
||
<section id="login-view" class="hidden">
|
||
<form id="login-form" class="card login-card">
|
||
<h1>Game Servers</h1>
|
||
<input type="password" id="login-password" placeholder="Password" autocomplete="current-password" autofocus required>
|
||
<button type="submit" class="primary">Log in</button>
|
||
<p class="error" id="login-error"></p>
|
||
</form>
|
||
</section>
|
||
|
||
<!-- Dashboard -->
|
||
<section id="app-view" class="hidden">
|
||
<header>
|
||
<div class="brand">
|
||
<h1>Game Servers</h1>
|
||
<nav class="tabs">
|
||
<a href="#servers" data-view="servers">Servers</a>
|
||
<a href="#backups" data-view="backups">Backups</a>
|
||
</nav>
|
||
</div>
|
||
<div class="header-actions">
|
||
<button class="primary" id="new-server-btn">+ New game server</button>
|
||
<button class="ghost" id="logout-btn">Log out</button>
|
||
</div>
|
||
</header>
|
||
|
||
<div id="view-servers">
|
||
<div class="card" id="resources">
|
||
<h2>VPS resources</h2>
|
||
<div class="meters">
|
||
<div class="meter"><div class="meter-label"><span>CPU</span><span id="m-cpu">–</span></div><div class="bar"><div id="b-cpu"></div></div></div>
|
||
<div class="meter"><div class="meter-label"><span>Memory</span><span id="m-mem">–</span></div><div class="bar"><div id="b-mem"></div></div></div>
|
||
<div class="meter"><div class="meter-label"><span>Swap</span><span id="m-swap">–</span></div><div class="bar"><div id="b-swap"></div></div></div>
|
||
<div class="meter"><div class="meter-label"><span>Disk</span><span id="m-disk">–</span></div><div class="bar"><div id="b-disk"></div></div></div>
|
||
<div class="meter net-meter">
|
||
<div class="meter-label"><span>Download</span><span id="m-rx">–</span></div>
|
||
<svg class="graph rx" id="g-rx" viewBox="0 0 100 24" preserveAspectRatio="none"><path class="area"/><path class="line"/></svg>
|
||
<div class="meter-label graph-gap"><span>Upload</span><span id="m-tx">–</span></div>
|
||
<svg class="graph tx" id="g-tx" viewBox="0 0 100 24" preserveAspectRatio="none"><path class="area"/><path class="line"/></svg>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<h2 class="section-title">Servers</h2>
|
||
<div id="server-list"></div>
|
||
<p class="empty hidden" id="empty-msg">No servers yet. Click <b>+ New game server</b> to create one.</p>
|
||
</div>
|
||
|
||
<div id="view-backups" class="hidden">
|
||
<div class="row-between section-title">
|
||
<h2 style="margin:0">Backups</h2>
|
||
<button class="ghost" id="about-backups-btn">About Backups</button>
|
||
</div>
|
||
<div id="backup-list"></div>
|
||
</div>
|
||
</section>
|
||
|
||
<!-- About backups -->
|
||
<dialog id="about-backups">
|
||
<div class="logs-head"><h2 style="margin:0">About Backups</h2><button class="ghost" id="about-backups-close">Close</button></div>
|
||
<h3>What is backed up</h3>
|
||
<ul class="about-list">
|
||
<li><b>Valheim:</b> the world folder (<code>.db2</code>, <code>.fwl2</code>, <code>.ok</code>, <code>.chunks</code> and <code>.chunk</code> files), or the <code>.db</code> + <code>.fwl</code> pair for older worlds.</li>
|
||
<li><b>Project Zomboid:</b> the world save, the player database and the server's settings files.</li>
|
||
</ul>
|
||
<h3>Automatic backups</h3>
|
||
<ul class="about-list">
|
||
<li>A server run becomes eligible for a backup once <b>at least one player connects</b>.</li>
|
||
<li>If the server starts and nobody connects, no backup is made.</li>
|
||
<li>The backup is taken when that run ends: the server is stopped by hand or by auto stop, restarted,
|
||
or recreated after a settings change. Deleting a server also backs up an eligible run first.</li>
|
||
<li>Backups are taken after the server has stopped, so they hold the world as it was saved on shutdown.</li>
|
||
</ul>
|
||
<h3>Manual backups</h3>
|
||
<ul class="about-list">
|
||
<li>Made every time you use <b>Download</b> in a server's Manage panel: the zip you download is also saved here.</li>
|
||
<li>While the server is running this is its last autosave (Valheim saves about every 30 minutes). Stop the
|
||
server first for an up-to-the-minute copy.</li>
|
||
</ul>
|
||
<h3>Retention</h3>
|
||
<ul class="about-list">
|
||
<li>The newest <b>5 automatic</b> and newest <b>5 manual</b> backups are kept for each server. Older ones are
|
||
deleted when a new backup is made.</li>
|
||
<li>Backups are stored on the VPS in <code>/srv/gameservers/backups/<game>/<auto|manual>/</code>,
|
||
outside the server's own folder, so they are kept even if the server and its world files are deleted.</li>
|
||
</ul>
|
||
</dialog>
|
||
|
||
<!-- Wizard -->
|
||
<dialog id="wizard">
|
||
<form id="wizard-form" method="dialog">
|
||
<div class="wiz-step" data-step="1">
|
||
<h2>New game server</h2>
|
||
<p class="muted">Choose a game</p>
|
||
<div id="game-list" class="game-list"></div>
|
||
</div>
|
||
|
||
<div class="wiz-step hidden" data-step="2">
|
||
<h2 id="wiz-game-title">New server</h2>
|
||
<label>Server name <span class="muted">(shown in the server browser)</span>
|
||
<input name="server_name" required maxlength="60">
|
||
</label>
|
||
<label>Password <span class="muted" id="password-help"></span>
|
||
<input name="password">
|
||
</label>
|
||
<label>Port <span class="muted">(UDP; this port and the next one are used)</span>
|
||
<input name="port" type="number" min="1024" max="65534" required>
|
||
</label>
|
||
|
||
<div class="game-fields" data-game="valheim">
|
||
<label>World name <span class="muted">(letters, numbers, underscores)</span>
|
||
<input name="world_name" required pattern="[A-Za-z0-9_]{1,40}">
|
||
</label>
|
||
<fieldset>
|
||
<legend>World</legend>
|
||
<label class="radio"><input type="radio" name="world_source" value="new" checked> Create a new world</label>
|
||
<label class="radio"><input type="radio" name="world_source" value="upload"> Upload an existing world</label>
|
||
<div id="upload-fields" class="hidden">
|
||
<p class="muted small">Easiest: <b>zip your whole world folder</b> and upload the zip. Or select
|
||
<b>every file</b> inside the folder: the <code>_main.N.db2</code>, <code>.fwl2</code>, <code>.ok</code> and
|
||
<code>.chunks</code> files <i>and</i> all the <code>.chunk</code> files. Valheim throws away an incomplete
|
||
world and starts a new one. Older worlds saved as a <code>.db</code> + <code>.fwl</code> pair also work.
|
||
On Windows, worlds are in <code>%USERPROFILE%\AppData\LocalLow\IronGate\Valheim\worlds_local</code>.</p>
|
||
<label>World files <input type="file" name="world_files" multiple></label>
|
||
</div>
|
||
</fieldset>
|
||
</div>
|
||
|
||
<div class="game-fields" data-game="zomboid">
|
||
<label>Admin password <span class="muted">(for the in-game <code>admin</code> account; at least 5 characters)</span>
|
||
<input name="admin_password" required minlength="5">
|
||
</label>
|
||
<label>Game version
|
||
<select name="branch">
|
||
<option value="public">Build 42 (current stable)</option>
|
||
<option value="legacy41">Build 41 (legacy)</option>
|
||
</select>
|
||
</label>
|
||
<label>Memory (MB) <span class="muted">(Java heap; Build 42 with mods wants 4096 or more)</span>
|
||
<input name="memory_mb" type="number" min="1024" max="65536" step="256" value="4096" required>
|
||
<span class="field-help" id="memory-help"></span>
|
||
</label>
|
||
<label>Max players
|
||
<input name="max_players" type="number" min="1" max="100" value="8" required>
|
||
</label>
|
||
<fieldset id="preset-mods-fieldset">
|
||
<legend>Mods <span class="muted small">(Build 42)</span></legend>
|
||
<div class="row-between small"><span class="muted">Players get these from the Workshop when they join.</span>
|
||
<span><button type="button" class="ghost small" id="preset-all">All</button> <button type="button" class="ghost small" id="preset-none">None</button></span></div>
|
||
<div id="preset-mods" class="preset-mods"></div>
|
||
</fieldset>
|
||
<p class="muted small hidden" id="preset-mods-b41">The mod checklist is for Build 42. Add Build 41 mods after creating the server.</p>
|
||
<p class="muted small">Add or change mods later from <b>Manage → Mods</b>. The first start
|
||
downloads the game (about 7 GB) plus any mods and can take 10+ minutes.</p>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="wiz-step hidden" data-step="3">
|
||
<h2>Review</h2>
|
||
<dl id="review"></dl>
|
||
<p class="muted small">The first start downloads the Valheim server (about 1 GB), so it can take a few minutes to come online.</p>
|
||
</div>
|
||
|
||
<p class="error" id="wiz-error"></p>
|
||
<div class="wiz-actions">
|
||
<button type="button" class="ghost" id="wiz-cancel">Cancel</button>
|
||
<span class="spacer"></span>
|
||
<button type="button" class="ghost hidden" id="wiz-back">Back</button>
|
||
<button type="button" class="primary hidden" id="wiz-next">Next</button>
|
||
<button type="button" class="primary hidden" id="wiz-create">Create server</button>
|
||
</div>
|
||
</form>
|
||
</dialog>
|
||
|
||
<!-- Manage (contents depend on the server's game type) -->
|
||
<dialog id="manage-dialog">
|
||
<div class="logs-head">
|
||
<div><h2 id="manage-title" style="margin:0">Manage</h2><div class="muted small" id="manage-sub"></div></div>
|
||
<button class="ghost" id="manage-close">Close</button>
|
||
</div>
|
||
|
||
<div class="manage-section">
|
||
<h3>Players</h3>
|
||
<div id="players-body"></div>
|
||
</div>
|
||
|
||
<form class="manage-section" id="autostop-form">
|
||
<h3>Server Auto Stop</h3>
|
||
<label class="radio"><input type="checkbox" id="autostop-enabled"> Auto stop server when no players are connected</label>
|
||
<label>Auto stop timeout (mins)
|
||
<input type="number" id="autostop-minutes" min="5" max="1440" step="5" value="15" required>
|
||
</label>
|
||
<p class="muted small" id="autostop-status"></p>
|
||
<p class="error" id="autostop-error"></p>
|
||
<div class="row-end"><button type="submit" class="primary" id="autostop-save">Save</button></div>
|
||
</form>
|
||
|
||
<form id="settings-form" class="manage-section">
|
||
<h3>Settings</h3>
|
||
<div id="settings-fields"></div>
|
||
<p class="muted small hidden" id="settings-restart-note">Saving restarts the server, which disconnects anyone playing.</p>
|
||
<p class="error" id="settings-error"></p>
|
||
<div class="row-end"><span class="tip" id="settings-save-tip"><button type="submit" class="primary" id="settings-save">Save settings</button></span></div>
|
||
</form>
|
||
|
||
<div class="manage-section hidden" id="mods-section">
|
||
<h3>Mods</h3>
|
||
<div class="row-between"><span class="muted small" id="mods-summary"></span><button class="ghost" id="open-mods">Manage mods</button></div>
|
||
</div>
|
||
|
||
<div class="manage-section hidden" id="world-section">
|
||
<h3>World</h3>
|
||
<div class="row-between">
|
||
<span class="muted small">Download the saved world as a zip; a copy is also kept in <b>Backups</b>. While the server
|
||
is running this is the last autosave; stop the server first for an up-to-the-minute copy.</span>
|
||
<a class="button ghost" id="world-download" download>Download</a>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="manage-section">
|
||
<h3>Logs</h3>
|
||
<div class="row-between"><span class="muted small">Live, color-coded output from the game server.</span><button class="ghost" id="manage-logs">View logs</button></div>
|
||
</div>
|
||
|
||
<div class="manage-section danger-zone">
|
||
<h3>Delete server</h3>
|
||
<label class="radio"><input type="checkbox" id="delete-data"> Also delete the world files (cannot be undone)</label>
|
||
<div class="row-end"><span class="tip" id="manage-delete-tip"><button class="danger" id="manage-delete">Delete server</button></span></div>
|
||
</div>
|
||
</dialog>
|
||
|
||
<!-- Mod manager (Project Zomboid) -->
|
||
<dialog id="mods-dialog" class="wide">
|
||
<div class="logs-head">
|
||
<div><h2 id="mods-title" style="margin:0">Mods</h2><span class="muted small" id="mods-status"></span></div>
|
||
<button class="ghost" id="mods-close">Close</button>
|
||
</div>
|
||
|
||
<div class="mods-add">
|
||
<input id="mods-add-input" placeholder="Paste a Steam Workshop link or ID, or a collection link">
|
||
<button class="primary" id="mods-add-btn">Add</button>
|
||
</div>
|
||
<details class="mods-presets hidden" id="mods-presets" open>
|
||
<summary class="small"><b>Recommended mods</b> <span class="muted">(Build 42; ticking adds the Workshop items and enables their mods)</span></summary>
|
||
<div class="row-between small presets-bar"><span class="muted" id="mods-presets-count"></span>
|
||
<button type="button" class="ghost small" id="mods-presets-all">Add all</button></div>
|
||
<div id="mods-presets-list" class="preset-mods"></div>
|
||
</details>
|
||
<details class="mods-import">
|
||
<summary class="muted small">Import from another server's config</summary>
|
||
<textarea id="mods-import-text" rows="3" placeholder="WorkshopItems=2169435993;2392709985 Mods=\ModOptions;\tsarslib"></textarea>
|
||
<div class="row-end"><button class="ghost small" id="mods-import-btn">Import</button></div>
|
||
</details>
|
||
<div id="mods-messages" class="msgs"></div>
|
||
|
||
<div class="mods-grid">
|
||
<div>
|
||
<h3>Workshop items <span class="muted small" id="items-count"></span></h3>
|
||
<div id="mods-items" class="mods-list"></div>
|
||
</div>
|
||
<div>
|
||
<div class="row-between"><h3>Enabled mods & load order</h3>
|
||
<span><button class="ghost small" id="mods-enable-all" title="Enable every mod in the downloaded workshop items, then auto-sort">Enable all</button>
|
||
<button class="ghost small" id="mods-sort">Auto-sort</button></span></div>
|
||
<p class="muted small">Mods load top to bottom. Auto-sort puts each mod after the ones it requires.</p>
|
||
<ol id="mods-order" class="mods-list mods-order"></ol>
|
||
</div>
|
||
</div>
|
||
|
||
<div id="mods-issues-section" class="hidden">
|
||
<h3>Issues</h3>
|
||
<ul id="mods-issues" class="mods-issues"></ul>
|
||
</div>
|
||
|
||
<div class="mods-footer">
|
||
<label class="radio"><input type="checkbox" id="mods-auto-update"> Auto-update mods (checks every 15 min; warns players 5 min before restarting)</label>
|
||
<span class="spacer"></span>
|
||
<button class="ghost" id="mods-fetch" title="Download new items into the running server and read their mod IDs">Fetch mod info</button>
|
||
<button class="ghost" id="mods-save">Save for next restart</button>
|
||
<button class="primary" id="mods-apply">Save & restart now</button>
|
||
</div>
|
||
</dialog>
|
||
|
||
<!-- Logs -->
|
||
<dialog id="logs-dialog" class="wide">
|
||
<div class="logs-head">
|
||
<div><h2 id="logs-title" style="margin:0">Logs</h2><span class="logs-status" id="logs-status"></span></div>
|
||
<button class="ghost" id="logs-close">Close</button>
|
||
</div>
|
||
<pre id="logs-body"></pre>
|
||
</dialog>
|
||
|
||
<script src="/static/app.js"></script>
|
||
<script src="/static/mods.js"></script>
|
||
</body>
|
||
</html>
|