Merge branch 'dev' into critical/CVE-2023-28370

This commit is contained in:
Zedifus 2023-05-29 21:36:17 +01:00
commit 2ea4012438
5 changed files with 9 additions and 70 deletions

View File

@ -3,7 +3,8 @@
### New features
TBD
### 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
TBD
### Lang

View File

@ -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)

View File

@ -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'] %}

View File

@ -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>

View File

@ -553,6 +553,7 @@
<div class="form-group">
<input type="text" class="form-control" id="zip_root_path" name="zip_root_path">
</div>
</div>
<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-content">
@ -596,7 +597,6 @@
</div>
</div>
</div>
</div>
<style>
button>i.refresh-class {
margin: 0px;
@ -949,6 +949,7 @@
function show_file_tree() {
if (upload) {
console.log("upload true")
$("#dir_upload_select").modal();
} else {
$("#dir_select").modal();