mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
Merge branch 'dev' into critical/CVE-2023-28370
This commit is contained in:
commit
2ea4012438
@ -3,7 +3,8 @@
|
|||||||
### New features
|
### New features
|
||||||
TBD
|
TBD
|
||||||
### Bug fixes
|
### Bug fixes
|
||||||
TBD
|
- Fix upload root files being hidden ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/590))
|
||||||
|
- Send empty json for no banned/cached players ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/589))
|
||||||
### Tweaks
|
### Tweaks
|
||||||
TBD
|
TBD
|
||||||
### Lang
|
### Lang
|
||||||
|
@ -529,8 +529,8 @@ class ServersController(metaclass=Singleton):
|
|||||||
content = file.read()
|
content = file.read()
|
||||||
file.close()
|
file.close()
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
print(ex)
|
logger.error(ex)
|
||||||
return None
|
return {}
|
||||||
|
|
||||||
return json.loads(content)
|
return json.loads(content)
|
||||||
|
|
||||||
@ -548,8 +548,8 @@ class ServersController(metaclass=Singleton):
|
|||||||
content = file.read()
|
content = file.read()
|
||||||
file.close()
|
file.close()
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
print(ex)
|
logger.error(ex)
|
||||||
return None
|
return {}
|
||||||
|
|
||||||
return json.loads(content)
|
return json.loads(content)
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
{% if player['status'] == 'online' %}
|
{% if player['status'] == 'online' %}
|
||||||
<td><span class="text-success"><i class="fas fa-signal"></i> {{ player['status'] }}</span></td>
|
<td><span class="text-success"><i class="fas fa-signal"></i> {{ player['status'] }}</span></td>
|
||||||
{% elif player['status'] == 'offline' %}
|
{% 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 %}
|
{% end %}
|
||||||
<td class="buttons">
|
<td class="buttons">
|
||||||
{% if data['server_stats']['running'] %}
|
{% if data['server_stats']['running'] %}
|
||||||
|
@ -45,69 +45,6 @@
|
|||||||
|
|
||||||
<hr />
|
<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>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -553,6 +553,7 @@
|
|||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<input type="text" class="form-control" id="zip_root_path" name="zip_root_path">
|
<input type="text" class="form-control" id="zip_root_path" name="zip_root_path">
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
<div class="modal fade" id="dir_upload_select" tabindex="-1" role="dialog" aria-labelledby="dir_select" aria-hidden="true">
|
<div class="modal fade" id="dir_upload_select" tabindex="-1" role="dialog" aria-labelledby="dir_select" aria-hidden="true">
|
||||||
<div class="modal-dialog" role="document">
|
<div class="modal-dialog" role="document">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
@ -596,7 +597,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
<style>
|
<style>
|
||||||
button>i.refresh-class {
|
button>i.refresh-class {
|
||||||
margin: 0px;
|
margin: 0px;
|
||||||
@ -949,6 +949,7 @@
|
|||||||
|
|
||||||
function show_file_tree() {
|
function show_file_tree() {
|
||||||
if (upload) {
|
if (upload) {
|
||||||
|
console.log("upload true")
|
||||||
$("#dir_upload_select").modal();
|
$("#dir_upload_select").modal();
|
||||||
} else {
|
} else {
|
||||||
$("#dir_select").modal();
|
$("#dir_select").modal();
|
||||||
|
Loading…
Reference in New Issue
Block a user