Major server management fixes: - Replace Flatpak-specific pkill with universal process tree termination using pstree + process.kill() - Fix signal format errors (SIGTERM/SIGKILL instead of TERM/KILL strings) - Add 5-second cooldown after server stop to prevent race conditions with external detection - Enable Stop Server button for external servers in UI - Implement proper timeout handling with process tree killing ContentDB improvements: - Fix download retry logic and "closed" error by preventing concurrent zip extraction - Implement smart root directory detection and stripping during package extraction - Add game-specific timeout handling (8s for VoxeLibre vs 3s for simple games) World creation fixes: - Make world creation asynchronous to prevent browser hangs - Add WebSocket notifications for world creation completion status Other improvements: - Remove excessive debug logging - Improve error handling and user feedback throughout the application - Clean up temporary files and unnecessary logging 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
143 lines
4.6 KiB
Plaintext
143 lines
4.6 KiB
Plaintext
<%
|
|
const body = `
|
|
<!-- Dashboard Statistics -->
|
|
<div class="stats-grid">
|
|
<div class="stat-card">
|
|
<div class="stat-value">${stats.worlds}</div>
|
|
<div class="stat-label">Worlds</div>
|
|
</div>
|
|
<div class="stat-card">
|
|
<div class="stat-value">${stats.mods}</div>
|
|
<div class="stat-label">Mods</div>
|
|
</div>
|
|
<div class="stat-card">
|
|
<div class="stat-value">
|
|
<span id="server-status" class="status status-stopped">
|
|
Loading...
|
|
</span>
|
|
</div>
|
|
<div class="stat-label">Server Status</div>
|
|
</div>
|
|
<div class="stat-card">
|
|
<div class="stat-value" style="font-size: 1rem; word-break: break-all;">
|
|
${stats.minetestDir}
|
|
</div>
|
|
<div class="stat-label">Data Directory</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Quick Actions -->
|
|
<div class="card">
|
|
<div class="card-header">
|
|
<h2>Quick Actions</h2>
|
|
</div>
|
|
|
|
<div class="grid grid-2">
|
|
<div class="card" style="margin: 0;">
|
|
<h3>World Management</h3>
|
|
<p style="color: var(--text-secondary); margin-bottom: 1rem;">
|
|
Create and manage your game worlds
|
|
</p>
|
|
<div class="btn-group">
|
|
<a href="/worlds" class="btn btn-primary">Manage Worlds</a>
|
|
<a href="/worlds/new" class="btn btn-outline">Create World</a>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="card" style="margin: 0;">
|
|
<h3>Extensions</h3>
|
|
<p style="color: var(--text-secondary); margin-bottom: 1rem;">
|
|
Manage games, mods, and texture packs
|
|
</p>
|
|
<div class="btn-group">
|
|
<a href="/extensions" class="btn btn-primary">Manage Extensions</a>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="card" style="margin: 0;">
|
|
<h3>Server Control</h3>
|
|
<p style="color: var(--text-secondary); margin-bottom: 1rem;">
|
|
Start, stop, and monitor your server
|
|
</p>
|
|
<div class="btn-group">
|
|
<a href="/server" class="btn btn-primary">Server Console</a>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="card" style="margin: 0;">
|
|
<h3>ContentDB Browser</h3>
|
|
<p style="color: var(--text-secondary); margin-bottom: 1rem;">
|
|
Discover new content on ContentDB
|
|
</p>
|
|
<div class="btn-group">
|
|
<a href="/contentdb" class="btn btn-primary">Browse ContentDB</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- System Information -->
|
|
<div class="card">
|
|
<h3>System Information</h3>
|
|
<div class="table-container">
|
|
<table class="table">
|
|
<tbody>
|
|
<tr>
|
|
<td><strong>Platform</strong></td>
|
|
<td>${systemInfo.platform}</td>
|
|
</tr>
|
|
<tr>
|
|
<td><strong>Architecture</strong></td>
|
|
<td>${systemInfo.arch}</td>
|
|
</tr>
|
|
<tr>
|
|
<td><strong>Node.js Version</strong></td>
|
|
<td>${systemInfo.nodeVersion}</td>
|
|
</tr>
|
|
<tr>
|
|
<td><strong>Data Directory</strong></td>
|
|
<td style="word-break: break-all;">${stats.minetestDir}</td>
|
|
</tr>
|
|
<tr>
|
|
<td><strong>Server Uptime</strong></td>
|
|
<td id="server-uptime">N/A</td>
|
|
</tr>
|
|
<tr>
|
|
<td><strong>Process ID</strong></td>
|
|
<td id="server-pid">N/A</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Recent Activity (placeholder for future implementation) -->
|
|
<div class="card">
|
|
<h3>Recent Activity</h3>
|
|
<div class="empty-state">
|
|
<p>Activity logging will be implemented in a future update.</p>
|
|
<small>This will show recent world changes, mod installations, and server events.</small>
|
|
</div>
|
|
</div>
|
|
|
|
<script src="/static/js/shared-status.js"></script>
|
|
<script>
|
|
// Set current page for navigation
|
|
window.addEventListener('DOMContentLoaded', function() {
|
|
// Add any dashboard-specific JavaScript here
|
|
console.log('Dashboard loaded');
|
|
|
|
// Update page context for navigation
|
|
if (window.luantiWebServer) {
|
|
window.luantiWebServer.currentPage = 'dashboard';
|
|
}
|
|
|
|
// Load server status using shared function
|
|
updateServerStatus('server-status');
|
|
});
|
|
</script>
|
|
`;
|
|
%>
|
|
|
|
<%- include('layout', { body: body, currentPage: 'dashboard', title: title }) %>
|