mcst/views/index.twig

48 lines
1.3 KiB
Twig
Raw Normal View History

{% extends 'layout.twig' %}
{% block content %}
<!-- page header -->
<header class="row">
<div class="columns twelve">
<h1>Welcome to MCST!</h1>
<p>Using MCST you can easily manage your Minecraft: Java Edition servers.</p>
</div>
</header>
<!-- list of servers -->
<section class="row">
<div class="columns twelve">
<h3>List of servers:</h3>
{% if servers|length < 1 %}
<p>There are currently no servers registered.</p>
{% else %}
<table class="u-full-width">
<thead>
<tr>
<th>Server name</th>
<th>Minecraft version</th>
<th>State</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
{% for m in servers %}
<tr class="serverItem" data-server-name="{{ m.getName() }}">
<td class="serverName">{{ m.getName() }}</td>
<td class="serverVersion">{{ m.getVersion() }}</td>
<td class="serverState">{{ m.getState() ? 'Running' : 'Stopped' }}</td>
<td>
<a href="/server/{{ m.getName() }}/start"><i class="fa-solid fa-play"></i></a>
<a href="/server/{{ m.getName() }}/stop"><i class="fa-solid fa-stop"></i></a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endif %}
</div>
</section>
{% endblock %}