π Source: index.php
<?php
require_once __DIR__ . '/auth.php';
?>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Minecraft Server Dashboard</title>
<link rel="stylesheet" href="assets/style.css">
<link rel="stylesheet" href="assets/players.css">
</head>
<body>
<div id="loginScreen" class="login-wrap" style="display:none">
<form class="login-card" onsubmit="doLogin(event)">
<h1>Minecraft Dashboard</h1>
<p class="muted">Log in to manage your servers.</p>
<label for="loginUser">Username</label>
<input type="text" id="loginUser" autocomplete="username" required>
<label for="loginPass">Password</label>
<input type="password" id="loginPass" autocomplete="current-password" required>
<button class="primary" type="submit">Log in</button>
<div id="loginError" class="error" style="margin-top:10px"></div>
</form>
</div>
<div id="dashboard" style="display:none">
<div class="topbar">
<h1>Minecraft Server Dashboard</h1>
<div>
<span class="who" id="who"></span>
<button id="usersBtn" style="display:none; margin-left:12px" onclick="openUsers()">Users</button>
<button style="margin-left:6px" onclick="doLogout()">Log out</button>
</div>
</div>
<div class="layout">
<div class="card">
<h2>Servers</h2>
<ul class="server-list" id="serverList"></ul>
<p class="muted" style="margin-top:14px">
Servers are auto-discovered from your configured root folder.
</p>
</div>
<div>
<div class="card" style="margin-bottom:18px">
<h2>Selected server</h2>
<div style="display:flex; align-items:center; gap:10px; margin-bottom:12px">
<span id="srvState" class="dot"></span>
<strong id="srvName">β</strong>
</div>
<div class="controls">
<button id="btnStart" class="primary" onclick="control('start')">Start</button>
<button id="btnStop" class="danger" onclick="control('stop')">Stop</button>
<button id="btnRestart" onclick="control('restart')">Restart</button>
<button id="btnEnable" onclick="control('enable')">Enable auto-start</button>
<button id="btnDisable" onclick="control('disable')">Disable auto-start</button>
</div>
</div>
<div class="card" style="margin-bottom:18px">
<h2>Console</h2>
<div class="console" id="console">Select a server to view its consoleβ¦</div>
<div class="cmd-row">
<input type="text" id="cmdInput" placeholder="Type a command (e.g. say hello, list)"
onkeydown="if(event.key==='Enter'){event.preventDefault();sendCommand();}">
<button class="primary" onclick="sendCommand()">Send</button>
</div>
</div>
<div class="card">
<h2>Players online</h2>
<div id="playersList">
<div class="muted" style="padding:10px">Select a serverβ¦</div>
</div>
<p class="muted" style="margin-top:10px">
Requires RCON enabled in <code>server.properties</code>.
</p>
</div>
</div>
</div>
</div>
<div class="modal-backdrop" id="usersModal">
<div class="modal">
<h3>Manage accounts</h3>
<table>
<thead><tr><th>User</th><th>Role</th><th>Device</th><th></th></tr></thead>
<tbody id="usersBody"></tbody>
</table>
<h3 style="margin-top:20px">Add a user</h3>
<label class="muted">Username</label>
<input type="text" id="newUser" style="width:100%; padding:8px; background:var(--panel-2); border:1px solid var(--border); color:var(--text); border-radius:6px">
<label class="muted" style="display:block; margin-top:8px">Password</label>
<input type="password" id="newPass" style="width:100%; padding:8px; background:var(--panel-2); border:1px solid var(--border); color:var(--text); border-radius:6px">
<label style="display:block; margin-top:10px"><input type="checkbox" id="newBound"> Bind to first device</label>
<div class="row">
<button onclick="closeUsers()">Close</button>
<button class="primary" onclick="createUser()">Create user</button>
</div>
</div>
</div>
<div class="modal-backdrop" id="infoModal">
<div class="modal" style="max-width:640px">
<h3 id="infoModalTitle">Info</h3>
<div id="infoModalBody"></div>
<div class="row">
<button onclick="closeInfoModal()">Close</button>
</div>
</div>
</div>
<script src="assets/dashboard.js"></script>
<script src="assets/players.js"></script>
</body>
</html>
β Back