mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
Merge branch 'dev' into bugfix/zip-upload
This commit is contained in:
commit
b8192900c2
@ -5,7 +5,7 @@ TBD
|
||||
### Bug fixes
|
||||
TBD
|
||||
### Tweaks
|
||||
TBD
|
||||
- Send empty json for no banned/cached players ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/589))
|
||||
### Lang
|
||||
TBD
|
||||
<br><br>
|
||||
|
@ -529,8 +529,8 @@ class ServersController(metaclass=Singleton):
|
||||
content = file.read()
|
||||
file.close()
|
||||
except Exception as ex:
|
||||
print(ex)
|
||||
return None
|
||||
logger.error(ex)
|
||||
return {}
|
||||
|
||||
return json.loads(content)
|
||||
|
||||
@ -548,8 +548,8 @@ class ServersController(metaclass=Singleton):
|
||||
content = file.read()
|
||||
file.close()
|
||||
except Exception as ex:
|
||||
print(ex)
|
||||
return None
|
||||
logger.error(ex)
|
||||
return {}
|
||||
|
||||
return json.loads(content)
|
||||
|
||||
|
@ -17,7 +17,7 @@
|
||||
{% if player['status'] == 'online' %}
|
||||
<td><span class="text-success"><i class="fas fa-signal"></i> {{ player['status'] }}</span></td>
|
||||
{% elif player['status'] == 'offline' %}
|
||||
<td><span class="text-warning"><i class="fa-solid fa-signal-slash"></i> Last connexion : {{ player['last_seen'] }}</span></td>
|
||||
<td><span class="text-warning"><i class="fa-solid fa-signal-slash"></i> Last connection : {{ player['last_seen'] }}</span></td>
|
||||
{% end %}
|
||||
<td class="buttons">
|
||||
{% if data['server_stats']['running'] %}
|
||||
|
@ -45,69 +45,6 @@
|
||||
|
||||
<hr />
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-6 col-sm-12">
|
||||
<style>
|
||||
.playerItem {
|
||||
padding: 1rem;
|
||||
display: flex;
|
||||
flex-flow: row wrap;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin: 1rem 0px 1rem 0px;
|
||||
}
|
||||
|
||||
.playerItem h3 {
|
||||
vertical-align: middle;
|
||||
padding: 0px;
|
||||
margin: 0px;
|
||||
margin-right: 1.5rem;
|
||||
}
|
||||
|
||||
.playerItem button {
|
||||
vertical-align: middle;
|
||||
margin: 0.25rem;
|
||||
}
|
||||
|
||||
.playerUnban {
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.banned span {
|
||||
font-size: 1.1rem;
|
||||
}
|
||||
</style>
|
||||
<h2>{{ translate('serverPlayerManagement', 'players', data['lang']) }}:</h2>
|
||||
<ul style="list-style: none;padding: 0px;margin: 0px; margin-bottom: 1rem;gap: 1rem;">
|
||||
{% for player in data['get_players'] %}
|
||||
<li class="playerItem">
|
||||
<h3>{{ player }}</h3>
|
||||
<div class="buttons">
|
||||
<button onclick="send_command_to_server('ban {{ player }}')" type="button"
|
||||
class="btn btn-danger">Ban</button>
|
||||
<button onclick="send_command_to_server('kick {{ player }}')" type="button"
|
||||
class="btn btn-outline-danger">Kick</button>
|
||||
<button onclick="send_command_to_server('op {{ player }}')" type="button"
|
||||
class="btn btn-warning">OP</button>
|
||||
<button onclick="send_command_to_server('deop {{ player }}')" type="button"
|
||||
class="btn btn-outline-warning">De-OP</button>
|
||||
</div>
|
||||
</li>
|
||||
{% end %}
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-md-6 col-sm-12">
|
||||
<h2>{{ translate('serverPlayerManagement', 'bannedPlayers', data['lang']) }}:</h2>
|
||||
<ul id="bannedPlayers" style="list-style: none;padding: 0px;margin: 0px; margin-bottom: 1rem;gap: 1rem;">
|
||||
<li class="playerItem banned">
|
||||
<h3>{{ translate('serverPlayerManagement', 'loadingBannedPlayers', data['lang']) }}</h3>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user