crafty-4/app/frontend/templates/panel/parts/server_players.html

87 lines
4.4 KiB
HTML
Raw Normal View History

<div class="col-xl-6 col-lg-12 col-md-12 col-sm-12">
2023-04-15 20:47:35 +02:00
<h2>{{ translate('serverPlayerManagement', 'players', data['lang']) }}:</h2>
2024-08-03 21:39:17 +02:00
<div class="table-responsive ">
<table class="table no-scroll">
<thead class="thead">
<tr>
<th scope="col-5">Player</th>
<th scope="col-4">Status</th>
<th scope="col-3">Actions</th>
</tr>
</thead>
<tbody id="player-body">
{% for player in data['cached_players'] %}
<tr id="playerItem-{{ player['name'] }}" class="playerItem-- text-center">
<td class=" no-scroll">
<strong> {{ player['name'] }}</strong>
</td>
{% if player['status'] == 'Online' %}
<td class="no-scroll col-5"><span class="text-success"><i class="fas fa-signal"></i> {{ player['status'] }}</span></td>
{% elif player['status'] == 'Offline' %}
<td class="no-scroll col-4"><span class="text-warning"><i class="fa-regular fa-circle-xmark"></i><span class="d-md-none ">&nbsp;{{ player['status'] }}</span><span class="d-none d-md-inline"> Last connection :<br> {{ player['last_seen'] }}</span></span></td>
2023-04-15 20:47:35 +02:00
{% end %}
2024-08-03 21:39:17 +02:00
<td class="no-scroll col-3">
{% if data['server_stats']['running'] %}
<div class="row">
<div class="col"><button onclick="send_command_to_server(`ban {{ player['name'] }}`)" type="button" class="btn btn-danger">Ban</button></div>
<div class="col"><button onclick="send_command_to_server(`kick {{ player['name'] }}`)" type="button" class="btn btn-outline-danger">Kick</button></div>
<div class="col"><button onclick="send_command_to_server(`op {{ player['name'] }}`)" type="button" class="btn btn-warning">OP</button></div>
<div class="col"><button onclick="send_command_to_server(`deop {{ player['name'] }}`)" type="button" class="btn btn-outline-warning">De-OP</button></div>
</div>
{% else %}
<span> Unavailable <br>(Server Offline)</span>
{% end %}
</td>
</tr>
{% end %}
</tbody>
</table>
</div>
2023-04-15 20:47:35 +02:00
</div>
2024-08-03 21:39:17 +02:00
<div class="col-xl-6 col-lg-12 no-scroll">
2023-04-15 20:47:35 +02:00
<h2>{{ translate('serverPlayerManagement', 'bannedPlayers', data['lang']) }}:</h2>
2024-08-03 21:39:17 +02:00
<div class="d-none d-lg-block table-responsive">
2024-08-06 23:38:02 +02:00
<table class="table no-scroll w-100">
2024-08-03 21:39:17 +02:00
<thead class="thead">
<tr>
<th scope="col">Player</th>
<th scope="col">Status</th>
<th scope="col">Reason</th>
<th scope="col">Actions</th>
</tr>
</thead>
<tbody>
{% for player in data['banned_players'] %}
<tr id="playerItem-{{ player }}" class="playerItem--">
<td><strong> {{ player['name'] }}</strong></td>
<td>Banned on {{ player['banned_on'] }}</td>
<td>Banned by : {{ player['source'] }} <br />Reason : {{ player['reason'] }}</td>
<td class="buttons">
<button onclick="send_command_to_server(`pardon {{ player['name'] }}`)" type="button" class="btn btn-danger">Unban</button>
</td>
</tr>
{% end %}
</tbody>
</table>
</div>
<div class="d-block d-lg-none table-responsive">
<table class="table no-scroll">
<thead class="thead ">
<tr>
<th scope="col">Player</th>
<th scope="col">Actions</th>
</tr>
</thead>
<tbody>
{% for player in data['banned_players'] %}
<tr id="playerItem-{{ player }}" class="playerItem--">
<td><strong> {{ player['name'] }}</strong></td>
<td class="buttons">
<button onclick="send_command_to_server(`pardon {{ player['name'] }} `)" type="button" class="btn btn-danger">Unban</button>
</td>
</tr>
{% end %}
</tbody>
</table>
</div>
2023-04-15 20:47:35 +02:00
</div>