diff --git a/CHANGELOG.md b/CHANGELOG.md index 1a5aa565..822edc0f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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

diff --git a/app/classes/controllers/servers_controller.py b/app/classes/controllers/servers_controller.py index b7c10ed8..ca6c8d22 100644 --- a/app/classes/controllers/servers_controller.py +++ b/app/classes/controllers/servers_controller.py @@ -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) diff --git a/app/frontend/templates/panel/parts/server_players.html b/app/frontend/templates/panel/parts/server_players.html index 3ecc5efb..fd014018 100644 --- a/app/frontend/templates/panel/parts/server_players.html +++ b/app/frontend/templates/panel/parts/server_players.html @@ -17,7 +17,7 @@ {% if player['status'] == 'online' %} {{ player['status'] }} {% elif player['status'] == 'offline' %} - Last connexion : {{ player['last_seen'] }} + Last connection : {{ player['last_seen'] }} {% end %} {% if data['server_stats']['running'] %} diff --git a/app/frontend/templates/panel/server_admin_controls.html b/app/frontend/templates/panel/server_admin_controls.html index 486139c5..b7b8d5a2 100644 --- a/app/frontend/templates/panel/server_admin_controls.html +++ b/app/frontend/templates/panel/server_admin_controls.html @@ -45,69 +45,6 @@
-
- -
- -

{{ translate('serverPlayerManagement', 'players', data['lang']) }}:

- -
-
-

{{ translate('serverPlayerManagement', 'bannedPlayers', data['lang']) }}:

- -
-
-