Merge branch 'dev' into bugfix/handle-none-java-return

This commit is contained in:
Zedifus 2022-06-24 03:45:36 +01:00
commit 9a6625ccaa
8 changed files with 308 additions and 177 deletions

View File

@ -1,5 +1,19 @@
# Changelog
## --- [4.0.5] - 2022/06/22
### New features
None
### Bug fixes
- Fix cannot delete backup on page 2 ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/382))
- Fix server starting up without stats monitoring after backup shutdown. ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/386))
- Fix pathing issue when launching with just "java" ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/386))
### Tweaks
- Rework server list on status page display for use on small screens ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/383))
- Add clone server confirmation ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/384))
### Lang
- German translation review, fixed some spelling issues and added some missing strings ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/385))
<br><br>
## --- [4.0.4-hotfix2] - 2022/06/21
### Bug fixes
- Fix Traceback on schedule config page ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/381))

View File

@ -242,7 +242,7 @@ class ServerInstance:
"Replacing with full java path."
)
# Checks for Oracle Java. Only Oracle Java's helper will cause a re-exec.
if "/Oracle/Java/" in str(shutil.which("java")):
if "/Oracle/Java/" in str(self.helper.wtol_path(shutil.which("java"))):
logger.info(
"Oracle Java detected. Changing start command to avoid re-exec."
)
@ -938,7 +938,7 @@ class ServerInstance:
logger.info(
"Backup complete. User had shutdown preference. Starting server."
)
self.start_server(HelperUsers.get_user_id_by_name("system"))
self.run_threaded_server(HelperUsers.get_user_id_by_name("system"))
time.sleep(3)
self.last_backup_failed = False
except:
@ -958,7 +958,7 @@ class ServerInstance:
logger.info(
"Backup complete. User had shutdown preference. Starting server."
)
self.start_server(HelperUsers.get_user_id_by_name("system"))
self.run_threaded_server(HelperUsers.get_user_id_by_name("system"))
self.last_backup_failed = True
def backup_status(self, source_path, dest_path):

View File

@ -60,12 +60,12 @@
</div>
<div class="wrapper my-auto ml-auto ml-lg-4">
<p id="cpu_data" class="mb-0 text-success" data-toggle="tooltip" data-placement="top" data-html="true"
title="{% raw translate('dashboard', 'cpuCores', data['lang']) %}: {{ data.get('hosts_data').get('cpu_cores') }} <br /> {% raw translate('dashboard', 'cpuCurFreq', data['lang']) %}: {{ data.get('hosts_data').get('cpu_cur_freq') }} <br /> {% raw translate('dashboard', 'cpuMaxFreq', data['lang']) %}: {{ data.get('hosts_data').get('cpu_max_freq') }}">
title="{% raw translate('dashboard', 'cpuCores', data['lang']) %}: {{ data.get('hosts_data').get('cpu_cores') }} <br /> {% raw translate('dashboard', 'cpuCurFreq', data['lang']) %}: {{ data.get('hosts_data').get('cpu_cur_freq') }} <br /> {% raw translate('dashboard', 'cpuMaxFreq', data['lang']) %}: {{ data.get('hosts_data').get('cpu_max_freq') }}">
{{ translate('dashboard', 'cpuUsage', data['lang']) }}: <span id="cpu_usage">{{
data.get('hosts_data').get('cpu_usage') }}</span>
</p>
<p id="mem_usage" class="mb-0 text-danger" data-toggle="tooltip" data-placement="top"
title="{{ translate('dashboard', 'memUsage', data['lang']) }}: {{ data.get('hosts_data').get('mem_usage') }}">
title="{{ translate('dashboard', 'memUsage', data['lang']) }}: {{ data.get('hosts_data').get('mem_usage') }}">
{{ translate('dashboard', 'memUsage', data['lang']) }}: <span id="mem_percent">{{
data.get('hosts_data').get('mem_percent') }}%</span>
</p>
@ -116,8 +116,8 @@
{% if len(data['servers']) > 0 %}
{% if data['user_data']['hints'] %}
<span class="too_small" title="{{ translate('dashboard', 'cannotSeeOnMobile', data['lang']) }}" ,
data-content="{{ translate('dashboard', 'cannotSeeOnMobile2', data['lang']) }}" ,
data-placement="top"></span>
data-content="{{ translate('dashboard', 'cannotSeeOnMobile2', data['lang']) }}" ,
data-placement="top"></span>
{% end %}
{% end %}
<div><a class="nav-link" href="/server/step1"><i class="fas fa-plus-circle"></i> &nbsp; {{
@ -156,7 +156,7 @@
<i class="fas fa-server"></i>
{% if server['alert'] %}
<a style="color: red !important;" draggable="false"
href="/panel/server_detail?id={{server['server_data']['server_id']}}">
href="/panel/server_detail?id={{server['server_data']['server_id']}}">
{{ server['server_data']['server_name'] }}&nbsp; <i class="fas fa-exclamation-triangle"></i>
</a>
{% else %}
@ -170,17 +170,17 @@
{% if server['user_command_permission'] %}
{% if server['stats']['running'] %}
<a data-id="{{server['server_data']['server_id']}}" class="stop_button" data-toggle="tooltip"
title="{{ translate('dashboard', 'stop' , data['lang']) }}">
title="{{ translate('dashboard', 'stop' , data['lang']) }}">
<i class="fas fa-stop"></i>
</a> &nbsp;
<a data-id="{{server['server_data']['server_id']}}" class="restart_button" data-toggle="tooltip"
title="{{ translate('dashboard', 'restart' , data['lang']) }}">
title="{{ translate('dashboard', 'restart' , data['lang']) }}">
<i class="fas fa-sync"></i>
</a> &nbsp;
<a data-id="{{server['server_data']['server_id']}}" class="kill_button" data-toggle="tooltip"
title="{{ translate('dashboard', 'kill' , data['lang']) }}">
title="{{ translate('dashboard', 'kill' , data['lang']) }}">
<i class="fas fa-skull"></i>
</a> &nbsp;
@ -199,15 +199,15 @@
data['lang']) }}</a>
{% else %}
<a data-id="{{server['server_data']['server_id']}}" class="play_button" data-toggle="tooltip"
title="{{ translate('dashboard', 'start' , data['lang']) }}">
title="{{ translate('dashboard', 'start' , data['lang']) }}">
<i class="fas fa-play"></i>
</a> &nbsp;
<a data-id="{{server['server_data']['server_id']}}" class="clone_button" data-toggle="tooltip"
title="{{ translate('dashboard', 'clone' , data['lang']) }}">
title="{{ translate('dashboard', 'clone' , data['lang']) }}">
<i class="fas fa-clone"></i>
</a> &nbsp;
<a data-id="{{server['server_data']['server_id']}}" class="kill_button" data-toggle="tooltip"
title="{{ translate('dashboard', 'kill' , data['lang']) }}">
title="{{ translate('dashboard', 'kill' , data['lang']) }}">
<i class="fas fa-skull"></i>
</a> &nbsp;
{% end %}
@ -216,7 +216,7 @@
<td draggable="false" id="server_cpu_{{server['server_data']['server_id']}}">
<div class="progress mb-1" data-toggle="tooltip" data-placement="top"
title="{{server['stats']['cpu']}}">
title="{{server['stats']['cpu']}}">
<div class="progress-bar
{% if server['stats']['cpu'] <= 33 %}
bg-success
@ -226,14 +226,14 @@
bg-danger
{% end %}
" role="progressbar" style="width: {{server['stats']['cpu']}}%" aria-valuenow="0"
aria-valuemin="0" aria-valuemax="100"></div>
aria-valuemin="0" aria-valuemax="100"></div>
</div>
{{server['stats']['cpu']}}%
</td>
<td draggable="false" id="server_mem_{{server['server_data']['server_id']}}">
<div class="progress mb-1" data-toggle="tooltip" data-placement="top"
title="{{server['stats']['mem']}}">
title="{{server['stats']['mem']}}">
<div class="progress-bar
{% if server['stats']['mem_percent'] <= 33 %}
bg-success
@ -243,7 +243,7 @@
bg-danger
{% end %}
" role="progressbar" style="width: {{server['stats']['mem_percent']}}%" aria-valuenow="0"
aria-valuemin="0" aria-valuemax="100"></div>
aria-valuemin="0" aria-valuemax="100"></div>
</div>
{{server['stats']['mem_percent']}}% -
@ -263,7 +263,7 @@
{% if server['stats']['desc'] != 'False' %}
<div id="desc_id"
style="overflow-wrap: break-word !important; max-width: 85px !important; overflow: scroll;">{{
style="overflow-wrap: break-word !important; max-width: 85px !important; overflow: scroll;">{{
server['stats']['desc'] }}</div> <br />
{% end %}
@ -287,7 +287,7 @@
{% end %}
</td>
<span class="server-player-totals" id="server_players_{{server['server_data']['server_id']}}"
data-players="{{ server['stats']['online']}}" data-max="{{ server['stats']['max'] }}"></span>
data-players="{{ server['stats']['online']}}" data-max="{{ server['stats']['max'] }}"></span>
</tr>
{% end %}
</tbody>
@ -295,7 +295,7 @@
</div>
{% end %}
{% if len(data['servers']) > 0 %}
<!-- Try with Accordion -->
<!-- View for Small screen -->
<div class="d-sm-none d-block">
<div class="accordion" id="accordionServers">
{% for server in data['servers'] %}
@ -306,27 +306,27 @@
<div class="col-10 col-lg-3 mx-0 px-0">
{% if server['alert'] %}
<a style="color: red !important" class="btn btn-link d-flex justify-content-start" type="button"
href="/panel/server_detail?id={{server['server_data']['server_id']}}">
href="/panel/server_detail?id={{server['server_data']['server_id']}}">
<i class="fas fa-server"></i> {{ server['server_data']['server_name'] }}&nbsp; <i
class="fas fa-exclamation-triangle"></i>
class="fas fa-exclamation-triangle"></i>
</a>
{% else %}
<a class="btn btn-link d-flex justify-content-start" type="button"
href="/panel/server_detail?id={{server['server_data']['server_id']}}">
href="/panel/server_detail?id={{server['server_data']['server_id']}}">
<i class="fas fa-server"></i> {{ server['server_data']['server_name'] }}
</a>
{% end %}
</div>
<div class="col-2 col-lg-3 mx-0 px-0">
<a class="btn btn-link d-flex justify-content-center" type="button" data-toggle="collapse"
data-target="#collapse-{{server['server_data']['server_id']}}" aria-expanded="false"
aria-controls="collapse-{{server['server_data']['server_id']}}">
data-target="#collapse-{{server['server_data']['server_id']}}" aria-expanded="false"
aria-controls="collapse-{{server['server_data']['server_id']}}">
<i class="fas fa-chart-bar"></i>
</a>
</div>
<div class="col-4 col-lg-3 mx-0 px-0">
<a id="m_server_running_status_{{server['server_data']['server_id']}}"
class="btn btn-link d-flex justify-content-start" type="button">
class="btn btn-link d-flex justify-content-start" type="button">
{% if server['stats']['running'] %}
<span class="text-success"><i class="fas fa-signal"></i> {{ translate('dashboard', 'online',
data['lang']) }}</span>
@ -348,22 +348,22 @@
<div class="row">
<div class="col-4 px-0">
<a data-id="{{server['server_data']['server_id']}}"
class="btn btn-link stop_button actions_serveritem" data-toggle="tooltip"
title="{{ translate('dashboard', 'stop' , data['lang']) }}">
class="btn btn-link stop_button actions_serveritem" data-toggle="tooltip"
title="{{ translate('dashboard', 'stop' , data['lang']) }}">
<i class="fas fa-stop"></i>
</a>
</div>
<div class="col-4 px-0">
<a data-id="{{server['server_data']['server_id']}}"
class="btn btn-link restart_button actions_serveritem" data-toggle="tooltip"
title="{{ translate('dashboard', 'restart' , data['lang']) }}">
class="btn btn-link restart_button actions_serveritem" data-toggle="tooltip"
title="{{ translate('dashboard', 'restart' , data['lang']) }}">
<i class="fas fa-sync"></i>
</a>
</div>
<div class="col-4 px-0">
<a data-id="{{server['server_data']['server_id']}}"
class="btn btn-link kill_button actions_serveritem" data-toggle="tooltip"
title="{{ translate('dashboard', 'kill' , data['lang']) }}">
class="btn btn-link kill_button actions_serveritem" data-toggle="tooltip"
title="{{ translate('dashboard', 'kill' , data['lang']) }}">
<i class="fas fa-skull"></i>
</a>
</div>
@ -390,7 +390,7 @@
<div class="row">
<div class="col-12 px-0">
<a data-id="{{server['server_data']['server_id']}}" class="btn btn-link"><i
class="fa fa-spinner fa-spin"></i>
class="fa fa-spinner fa-spin"></i>
{{ translate('serverTerm', 'downloading', data['lang']) }}</a>
</div>
</div>
@ -398,22 +398,22 @@
<div class="row">
<div class="col-4 px-0">
<a data-id="{{server['server_data']['server_id']}}"
class="btn play_button actions_serveritem" data-toggle="tooltip"
title="{{ translate('dashboard', 'start' , data['lang']) }}">
class="btn play_button actions_serveritem" data-toggle="tooltip"
title="{{ translate('dashboard', 'start' , data['lang']) }}">
<i class="fas fa-play"></i>
</a>
</div>
<div class="col-4 px-0">
<a data-id="{{server['server_data']['server_id']}}"
class="btn clone_button actions_serveritem" data-toggle="tooltip"
title="{{ translate('dashboard', 'clone' , data['lang']) }}">
class="btn clone_button actions_serveritem" data-toggle="tooltip"
title="{{ translate('dashboard', 'clone' , data['lang']) }}">
<i class="fas fa-clone"></i>
</a>
</div>
<div class="col-4 px-0">
<a data-id="{{server['server_data']['server_id']}}"
class="btn kill_button actions_serveritem" data-toggle="tooltip"
title="{{ translate('dashboard', 'kill' , data['lang']) }}">
class="btn kill_button actions_serveritem" data-toggle="tooltip"
title="{{ translate('dashboard', 'kill' , data['lang']) }}">
<i class="fas fa-skull"></i></a>
</div>
</div>
@ -426,14 +426,14 @@
</div>
<div id="collapse-{{server['server_data']['server_id']}}" class="collapse"
aria-labelledby="heading-{{server['server_data']['server_id']}}" data-parent="#accordionServers">
aria-labelledby="heading-{{server['server_data']['server_id']}}" data-parent="#accordionServers">
<div class="card-body">
<div class="row">
<div class="col-6">
<h6>{{ translate('dashboard', 'cpuUsage', data['lang']) }}</h6>
<div id="m_server_cpu_{{server['server_data']['server_id']}}">
<div class="progress mb-1" data-toggle="tooltip" data-placement="top"
title="{{server['stats']['cpu']}}">
title="{{server['stats']['cpu']}}">
<div class="progress-bar
{% if server['stats']['cpu'] <= 33 %}
bg-success
@ -443,7 +443,7 @@
bg-danger
{% end %}
" role="progressbar" style="width: {{server['stats']['cpu']}}%" aria-valuenow="0" aria-valuemin="0"
aria-valuemax="100"></div>
aria-valuemax="100"></div>
</div>
{{server['stats']['cpu']}}%
</div>
@ -452,7 +452,7 @@
<h6>{{ translate('dashboard', 'memUsage', data['lang']) }}</h6>
<div draggable="false" id="m_server_mem_{{server['server_data']['server_id']}}">
<div class="progress mb-1" data-toggle="tooltip" data-placement="top"
title="{{server['stats']['mem']}}">
title="{{server['stats']['mem']}}">
<div class="progress-bar
{% if server['stats']['mem_percent'] <= 33 %}
bg-success
@ -462,7 +462,7 @@
bg-danger
{% end %}
" role="progressbar" style="width: {{server['stats']['mem_percent']}}%" aria-valuenow="0"
aria-valuemin="0" aria-valuemax="100"></div>
aria-valuemin="0" aria-valuemax="100"></div>
</div>
{{server['stats']['mem_percent']}}% -
@ -492,7 +492,7 @@
{% if server['stats']['desc'] != 'False' %}
<div id="desc_id"
style="overflow-wrap: break-word !important; max-width: 85px !important; overflow: scroll;">
style="overflow-wrap: break-word !important; max-width: 85px !important; overflow: scroll;">
{{ server['stats']['desc'] }}</div> <br />
{% end %}
@ -849,19 +849,41 @@
$(".clone_button").click(function () {
server_id = $(this).attr("data-id");
send_command(server_id, 'clone_server');
bootbox.dialog({
backdrop: true,
title: '{% raw translate("dashboard", "sendingCommand", data["lang"]) %}',
message: '<div align="center"><i class="fas fa-spin fa-spinner"></i> &nbsp; {% raw translate("dashboard", "bePatientClone", data["lang"]) %} </div>',
closeButton: false,
bootbox.confirm({
message: "{{ translate('dashboard', 'cloneConfirm' , data['lang']) }}",
buttons: {
confirm: {
label: "{{ translate('dashboard', 'clone' , data['lang']) }}",
className: 'btn-outline-warning'
},
cancel: {
label: '{% raw translate("panelConfig", "cancel", data["lang"]) %}',
className: 'btn-secondary'
}
},
callback: function (result) {
if (result) {
cloneServer(server_id);
}
}
});
setTimeout(function () {
location.reload();
}, 5000)
});
});
function cloneServer(server_id) {
send_command(server_id, 'clone_server');
bootbox.dialog({
backdrop: true,
title: '{% raw translate("dashboard", "sendingCommand", data["lang"]) %}',
message: '<div align="center"><i class="fas fa-spin fa-spinner"></i> &nbsp; {% raw translate("dashboard", "bePatientClone", data["lang"]) %} </div>',
closeButton: false,
});
setTimeout(function () {
location.reload();
}, 5000)
}
</script>
<script src="/static/assets/vendors/js/jquery-ui.js"></script>
<link rel="stylesheet" href="/static/assets/vendors/css/jquery-ui.css">

View File

@ -375,7 +375,7 @@
$('#backup_table').DataTable({
"order": [[1, "desc"]],
"paging": true,
"paging": false,
"lengthChange": false,
"searching": true,
"ordering": true,

View File

@ -6,76 +6,153 @@
{% block title %}Crafty Controller - {{ translate('dashboard', 'dashboard', data['lang']) }}{% end %}
{% block content %}
<div class="content-wrapper col-md login-modal" style="background-color: #222437;">
<img src="/static/assets/images/logo_long.png" style='width: 25%; margin-left: 38%;'>
<hr />
<div class="table-responsive">
<table class="table table-hover">
<thead>
<tr class="rounded">
<th>{{ translate('dashboard', 'server', data['lang']) }}</th>
<th>{{ translate('dashboard', 'players', data['lang']) }}</th>
<th>{{ translate('dashboard', 'motd', data['lang']) }}</th>
<th>{{ translate('dashboard', 'version', data['lang']) }}</th>
<th>{{ translate('dashboard', 'status', data['lang']) }}</th>
</tr>
</thead>
<tbody>
{% if data['running'] != 0 %}
<span id="sync" style="margin-left: 5px;"><i class="fas fa-sync fa-spin"></i></span></h4>
{% end %}
{% for server in data['servers'] %}
<tr>
<td id="server_name_{{ server['stats']['server_id']['server_id'] }}">
<i class="fas fa-server"></i>
{{ server['server_data']['server_name'] }}
</td>
{% if server['stats']['int_ping_results'] != 'False' %}
<td id="server_players_{{ server['stats']['server_id']['server_id'] }}">
{{ server['stats']['online'] }} / {{ server['stats']['max'] }} {{ translate('dashboard', 'max',
data['lang']) }}<br />
</td>
<td id="server_motd_{{ server['stats']['server_id']['server_id'] }}">
{% if server['stats']['desc'] != 'False' %}
<img src="/static/assets/images/pack.png" alt="icon" style="-webkit-filter:grayscale(100%); filter:grayscale(100%)"/>
<span id="input_motd_{{ server['stats']['server_id']['server_id'] }}" class="input_motd">{{
server['stats']['desc'] }}</span> <br />
{% end %}
</td>
<td id="server_version_{{ server['stats']['server_id']['server_id'] }}">
{% if server['stats']['version'] != 'False' %}
{{ server['stats']['version'] }}
{% end %}
</td>
{% else %}
<td id="server_players_{{ server['stats']['server_id']['server_id'] }}">
<span class="text-warning"><i class="fas fa-exclamation-triangle"></i></span>
</td>
<td id="server_motd_{{ server['stats']['server_id']['server_id'] }}">
<span class="text-warning">Crafty can't get infos from this Server </span>
</td>
<td id="server_version_{{ server['stats']['server_id']['server_id'] }}">
<span class="text-warning"><i class="fas fa-question"></i></i></span>
</td>
<!-- View for Large screen -->
<div class="row justify-content-center">
<div class="content-wrapper col-md login-modal d-none d-sm-block" style="background-color: #222437;">
<img src="/static/assets/images/logo_long.png" style='width: 25%; margin-left: 38%;'>
<hr />
<div class="table-responsive">
<table class="table table-hover">
<thead>
<tr class="rounded">
<th>{{ translate('dashboard', 'server', data['lang']) }}</th>
<th>{{ translate('dashboard', 'players', data['lang']) }}</th>
<th>{{ translate('dashboard', 'motd', data['lang']) }}</th>
<th>{{ translate('dashboard', 'version', data['lang']) }}</th>
<th>{{ translate('dashboard', 'status', data['lang']) }}</th>
</tr>
</thead>
<tbody>
{% if data['running'] != 0 %}
<span id="sync" style="margin-left: 5px;"><i class="fas fa-sync fa-spin"></i></span></h4>
{% end %}
<td id="server_online_status_{{ server['stats']['server_id']['server_id'] }}">
{% if server['stats']['running'] %}
<span class="text-success"><i class="fas fa-signal"></i> {{ translate('dashboard', 'online', data['lang'])
}}</span>
{% for server in data['servers'] %}
<tr>
<td id="server_name_{{ server['stats']['server_id']['server_id'] }}">
<i class="fas fa-server"></i>
{{ server['server_data']['server_name'] }}
</td>
{% if server['stats']['int_ping_results'] != 'False' %}
<td id="server_players_{{ server['stats']['server_id']['server_id'] }}">
{{ server['stats']['online'] }} / {{ server['stats']['max'] }} {{ translate('dashboard', 'max',
data['lang']) }}<br />
</td>
<td id="server_motd_{{ server['stats']['server_id']['server_id'] }}">
{% if server['stats']['desc'] != 'False' %}
<img src="/static/assets/images/pack.png" alt="icon" style="-webkit-filter:grayscale(100%); filter:grayscale(100%)" />
<span id="input_motd_{{ server['stats']['server_id']['server_id'] }}" class="input_motd">{{
server['stats']['desc'] }}</span> <br />
{% end %}
</td>
<td id="server_version_{{ server['stats']['server_id']['server_id'] }}">
{% if server['stats']['version'] != 'False' %}
{{ server['stats']['version'] }}
{% end %}
</td>
{% else %}
<span class="text-danger"><i class="fas fa-ban"></i> {{ translate('dashboard', 'offline', data['lang'])
}}</span>
<td id="server_players_{{ server['stats']['server_id']['server_id'] }}">
<span class="text-warning"><i class="fas fa-exclamation-triangle"></i></span>
</td>
<td id="server_motd_{{ server['stats']['server_id']['server_id'] }}">
<span class="text-warning">Crafty can't get infos from this Server </span>
</td>
<td id="server_version_{{ server['stats']['server_id']['server_id'] }}">
<span class="text-warning"><i class="fas fa-question"></i></i></span>
</td>
{% end %}
</td>
</tr>
{% end %}
</tbody>
</table>
<td id="server_online_status_{{ server['stats']['server_id']['server_id'] }}">
{% if server['stats']['running'] %}
<span class="text-success"><i class="fas fa-signal"></i> {{ translate('dashboard', 'online', data['lang'])
}}</span>
{% else %}
<span class="text-danger"><i class="fas fa-ban"></i> {{ translate('dashboard', 'offline', data['lang'])
}}</span>
{% end %}
</td>
</tr>
{% end %}
</tbody>
</table>
</div>
<hr />
</div>
<hr />
</div>
<!-- View for Small screen -->
<div class="row justify-content-center align-items-sm-center">
<div class="content-wrapper login-modal d-sm-none d-block">
<img src="/static/assets/images/logo_long.png" style='width: 100%;'>
<hr />
{% if data['running'] != 0 %}
<span id="m_sync" style="margin-left: 5px;"><i class="fas fa-sync fa-spin"></i></span></h4>
{% end %}
<div class="accordion" id="accordionServers">
{% for server in data['servers'] %}
<div class="card mb-0">
<div class="card-header" id="heading-{{server['server_data']['server_id']}}">
<h2 class="mb-0 container overflow-hidden">
<div class="row">
<div class="col-8 mx-0 px-0">
<a id="m_server_name_{{ server['stats']['server_id']['server_id'] }}" class="btn btn-link d-flex justify-content-center" type="button" data-toggle="collapse"
data-target="#collapse-{{server['server_data']['server_id']}}" aria-expanded="false"
aria-controls="collapse-{{server['server_data']['server_id']}}">
<i class="fas fa-server"></i>
{{ server['server_data']['server_name'] }}
</a>
</div>
<div class="col-4 mx-0 px-0">
<a id="m_server_online_status_{{ server['stats']['server_id']['server_id'] }}" class="btn btn-link d-flex justify-content-center" type="button">
{% if server['stats']['running'] %}
<div id="m_server_players_{{ server['stats']['server_id']['server_id'] }}">
<span class="text-success"><i class="fas fa-signal"></i> {{ server['stats']['online'] }} / {{ server['stats']['max'] }}</span>
</div>
{% else %}
<span class="text-danger"><i class="fas fa-ban"></i> {{ translate('dashboard', 'offline', data['lang']) }}</span>
{% end %}
</a>
</div>
</div>
</h2>
</div>
<div id="collapse-{{server['server_data']['server_id']}}" class="collapse"
aria-labelledby="heading-{{server['server_data']['server_id']}}" data-parent="#accordionServers">
<div class="card-body">
{% if server['stats']['int_ping_results'] != 'False' %}
<div id="m_server_motd_{{ server['stats']['server_id']['server_id'] }}" class="media">
{% if server['stats']['desc'] != 'False' %}
<img src="/static/assets/images/pack.png" class="w-25 mr-3" alt="icon" style="-webkit-filter:grayscale(100%); filter:grayscale(100%);" />
{% end %}
<div class="media-body">
{% if server['stats']['desc'] != 'False' %}
<div id="m_server_motd_{{ server['stats']['server_id']['server_id'] }}">
<span id="input_motd_{{ server['stats']['server_id']['server_id'] }}" class="input_motd">{{
server['stats']['desc'] }}</span> <br />
</div>
{% end %}
</div>
</div>
<br />
<div id="m_server_version_{{ server['stats']['server_id']['server_id'] }}">
{% if server['stats']['version'] != 'False' %}
{{ server['stats']['version'] }}
{% end %}
</div>
{% else %}
<div class="row">
<div class="col-12">
<div id="m_server_motd_{{ server['stats']['server_id']['server_id'] }}">
<span class="text-warning"><i class="fas fa-exclamation-triangle"></i> Crafty can't get infos from this Server </span>
</div>
</div>
</div>
{% end %}
</div>
</div>
</div>
{% end %}
</div>
</div>
</div>
{% end %}
{% block js %}
@ -90,17 +167,23 @@
}
function update_one_server_status(server) {
/* Normal Screen view */
server_players = document.getElementById('server_players_' + server.id);
server_motd = document.getElementById('server_motd_' + server.id);
server_version = document.getElementById('server_version_' + server.id);
server_online_status = document.getElementById('server_online_status_' + server.id);
/* Small Screen view */
m_server_players = document.getElementById('m_server_players_' + server.id);
m_server_motd = document.getElementById('m_server_motd_' + server.id);
m_server_version = document.getElementById('m_server_version_' + server.id);
m_server_online_status = document.getElementById('m_server_online_status_' + server.id);
/* TODO Update each element */
if (server.int_ping_results) {
document.getElementById('sync').innerHTML='';
document.getElementById('sync').innerHTML = '';
document.getElementById('m_sync').innerHTML = '';
/* Update Players */
if (server.players)
{
if (server.players) {
server_players.innerHTML = server.online + ` / ` + server.max + ` {{ translate('dashboard', 'max', data['lang']) }}<br />`
}
@ -109,36 +192,44 @@
if (server.desc) {
if (server.icon) {
motd = `<img src="data:image/png;base64,` + server.icon + `" alt="icon" /> `;
m_motd = `<img src="data:image/png;base64,` + server.icon + `" alt="icon" /> `;
}
else {
motd = `<img src="/static/assets/images/pack.png" alt="icon" /> `;
m_motd = `<img class="w-25 mr-3" src="/static/assets/images/pack.png" alt="icon" /> `;
}
motd = motd + `<span id="input_motd_` + server.id + `" class="input_motd">` + server.desc + `</span> <br />`;
m_motd = m_motd + `<div class="media-body"><span id="input_motd_` + server.id + `" class="input_motd">` + server.desc + `</span></div>`;
server_motd.innerHTML = motd;
m_server_motd.innerHTML = m_motd;
}
/* Version */
if (server.version)
{
server_version.innerHTML = server.version
if (server.version) {
server_version.innerHTML = server.version;
m_server_version.innerHTML = server.version;
}
}
else {
server_players.innerHTML = `<span class="text-warning"><i class="fas fa-exclamation-triangle"></i></span>`;
server_motd.innerHTML = `<span class="text-warning">Crafty can't get infos from this Server </span>`;
server_version.innerHTML = `<span class="text-warning"><i class="fas fa-question"></i></i></span>`
server_version.innerHTML = `<span class="text-warning"><i class="fas fa-question"></i></i></span>`;
m_server_motd.innerHTML = `<span class="text-warning"><i class="fas fa-exclamation-triangle"></i> Crafty can't get infos from this Server </span>`;
}
/* Update Online Status */
var online_status = "";
if (server.running) {
online_status = `<span class="text-success"><i class="fas fa-signal"></i> {{ translate('dashboard', 'online', data['lang'])}}</span>`;
m_online_status = `<span class="text-success"><i class="fas fa-signal"></i>` + server.online + ` / ` + server.max + `</span>`;
}
else {
online_status = `<span class="text-danger"><i class="fas fa-ban"></i> {{ translate('dashboard', 'offline', data['lang'])}}</span>`;
m_online_status = `<span class="text-danger"><i class="fas fa-ban"></i> {{ translate('dashboard', 'offline', data['lang'])}}</span>`;
}
server_online_status.innerHTML = online_status;
m_server_online_status.innerHTML = m_online_status;
}
function update_servers_status(data) {
@ -150,11 +241,10 @@
$(document).ready(function () {
console.log("ready!");
if (webSocket)
{
if (webSocket) {
webSocket.on('update_server_status', update_servers_status);
}
}());
</script>
{% end %}
{% end %}

View File

@ -27,13 +27,11 @@
<body class="dark-theme">
<div class="container-scroller">
<div class="container-fluid page-body-wrapper full-page-wrapper">
<div class="content-wrapper d-flex align-items-center auth auth-bg-1 theme-one">
<div class="row w-100">
<div class="mx-auto">
<div class="auto-form-wrapper">
{% block content %}
{% end %}
</div>
<div class="content-wrapper d-flex align-items-sm-center auth auth-bg-1 theme-one">
<div class="mx-auto">
<div class="auto-form-wrapper">
{% block content %}
{% end %}
</div>
</div>
</div>

View File

@ -67,8 +67,8 @@
"cannotSeeOnMobile2": "Versuchen Sie, die Tabelle seitlich zu verschieben.",
"clone": "Klonen",
"cpuCores": "CPU Kerne",
"cpuCurFreq": "Momentaner CPU-takt",
"cpuMaxFreq": "Maximaler CPU-takt",
"cpuCurFreq": "Momentaner CPU-Takt",
"cpuMaxFreq": "Maximaler CPU-Takt",
"cpuUsage": "CPU-Nutzung",
"crashed": "Abgestürzt",
"dashboard": "Dashboard",
@ -90,7 +90,7 @@
"sendingCommand": "Übermittlung Ihres Befehls",
"server": "Server",
"servers": "Server",
"size": "Server-Verzeichniss Größe",
"size": "Serververzeichnis Größe",
"start": "Starten",
"starting": "Verzögerter Start",
"status": "Status",
@ -101,8 +101,8 @@
"datatables": {
"i18n": {
"aria": {
"sortAscending": ": aktivieren, um die Spalte aufsteigend zu sortieren",
"sortDescending": ": aktivieren, um die Spalte absteigend zu sortieren"
"sortAscending": ": Aktivieren, um die Spalte aufsteigend zu sortieren",
"sortDescending": ": Aktivieren, um die Spalte absteigend zu sortieren"
},
"buttons": {
"collection": "Sammlung <span class='ui-button-icon-primary ui-icon ui-icon-triangle-1-s'/>",
@ -127,20 +127,20 @@
},
"decimal": "",
"emptyTable": "Keine Daten in der Tabelle verfügbar",
"info": "Anzeige von _START_ to _END_ of _TOTAL_ Einträge",
"infoEmpty": "Zeigt 0 bis 0 von 0 Einträge",
"info": "Zeige _START_ bis _END_ von insges. _TOTAL_ Einträge(n)",
"infoEmpty": "Zeige 0 bis 0 von insges. 0 Einträgen",
"infoFiltered": "(gefiltert von _MAX_ maximalen Einträgen)",
"infoPostFix": "",
"lengthMenu": "Zeige _MENU_ Einträge",
"loadingRecords": "Laden...",
"paginate": {
"first": "Erster",
"last": "Letzter",
"first": "Erste",
"last": "Letzte",
"next": "Nächste",
"previous": "Vorheriger"
"previous": "Vorherige"
},
"processing": "Verarbeiten...",
"search": "Suchen:",
"search": "Suche:",
"select": {
"cells": {
"0": "Klicken Sie auf eine Zelle, um sie auszuwählen",
@ -176,7 +176,8 @@
"not-downloaded": "Crafty kann die auszuführende Datei nicht finden. Ist der Download abgeschlossen? Sind die Berechtigungen für Crafty korrekt?",
"portReminder": "Wir haben festgestellt, dass dies das erste Mal ist, dass {} ausgeführt wurde. Stellen Sie sicher, dass Sie Port {} durch Ihren Router/Firewall weiterleiten, um den Fernzugriff aus dem Internet zu ermöglichen.",
"start-error": "Der Server {} konnte wegen dem Fehlercode: {} nicht gestartet werden",
"terribleFailure": "Was für ein furchtbarer Fehler!"
"terribleFailure": "Was für ein furchtbarer Fehler!",
"fileTooLarge": "Hochladen fehlgeschlagen. Datei ist zu groß. Wenden Sie sich an Ihren Systemadministrator für weitere Unterstütung."
},
"footer": {
"allRightsReserved": "Alle Rechte vorbehalten",
@ -194,13 +195,13 @@
"backupComplete": "Backup für Server erfolgreich ausgeführt {}",
"backupStarted": "Backup für Server gestartet {}",
"downloadLogs": "Supportprotokolle herunterladen?",
"finishedPreparing": "Wir haben die Bereitstellung der Supportprotokolle abgeschlossen. Bitte klicke Herunterladen um diese Herunterzuladen",
"finishedPreparing": "Wir haben die Bereitstellung der Supportprotokolle abgeschlossen. Bitte klicke 'Herunterladen' um diese herunterzuladen",
"logout": "Abmelden",
"preparingLogs": " Bitte warten, während wir die Protokolle vorbereiten... Wir schicken eine Benachrichtigung, wenn sie fertig sind. Dies kann bei großen Projekten eine Weile dauern.",
"supportLogs": "Supportprotokolle"
},
"panelConfig": {
"adminControls": "Administrations Werkzeuge",
"adminControls": "Administrations-Werkzeuge",
"allowedServers": "Erlaubte Server",
"assignedRoles": "Zugewiesene Rollen",
"cancel": "Abbrechen",
@ -213,31 +214,31 @@
"pageTitle": "Panel Konfiguration",
"role": "Rolle",
"roles": "Rollen",
"roleUsers": "Nutzerrollen",
"roleUsers": "Rollen-Benutzer",
"save": "Speichern",
"superConfirm": "Nur fortfahren, wenn dieser Nutzer zugang zu ALLEM haben soll (alle Benutzerkonten, Server, Panel-Konfiguration etc.). Er kann allen Benutzern die Super-Benutzer-Rechte entziehen.",
"superConfirm": "Nur fortfahren, wenn dieser Nutzer Zugang zu ALLEM haben soll (alle Benutzerkonten, Server, Panel-Konfiguration etc.). Er kann allen Benutzern die Super-Benutzer-Rechte entziehen.",
"superConfirmTitle": "Super-Benutzer Berechtigung erteilen? Sicher, dass diese Aktion ausgeführt werden soll?",
"user": "Benutzer",
"users": "Benutzer"
},
"rolesConfig": {
"config": "Rollen Konfiguration",
"config": "Rollen-Konfiguration",
"configDesc": "Hier kann die Konfiguration von Rollen bearbeitet werden",
"configUpdate": "Zuletzt aktualisiert: ",
"created": "Erstellt: ",
"delRole": "Rolle löschen",
"doesNotExist": "Sie können nichts löschen, was noch nicht existiert!",
"doesNotExist": "Sie können nicht löschen, was noch nicht existiert!",
"pageTitle": "Rolle bearbeiten",
"pageTitleNew": "Neue Rolle",
"permAccess": "Zugriff?",
"permName": "Berechtigungs Name",
"permName": "Berechtigungs-Name",
"permsServer": "Berechtigungen, die diese Rolle für die angegebenen Server hat",
"roleConfigArea": "Rollenkonfigurationsbereich",
"roleConfigArea": "Rollen-Konfigurationsbereich",
"roleDesc": "Wie soll diese Rolle genannt werden?",
"roleName": "Name der Rolle: ",
"rolePerms": "Rollenberechtigungen",
"rolePerms": "Rollen-Berechtigungen",
"roleServers": "Erlaubte Server",
"roleTitle": "Rollen Einstellungen",
"roleTitle": "Rollen-Einstellungen",
"roleUserName": "Benutzername",
"roleUsers": "Nutzer mit dieser Rolle: ",
"serverAccess": "Zugriff?",
@ -253,7 +254,7 @@
"compress": "Backup komprimieren",
"confirm": "Bestätigen",
"confirmDelete": "Möchten Sie diese Backup-Datei löschen? Dies kann nicht rückgängig gemacht werden.",
"confirmRestore": "Sicher, dass diese Sicherung wiederherstellgestellt werden soll? Alle aktuellen Serverdateien werden in den Zustand der Sicherung versetzt und können nicht wiederhergestellt werden.",
"confirmRestore": "Sicher, dass dieses Backup wiederherstellgestellt werden soll? Alle aktuellen Serverdateien werden in den Zustand von diesem Backup versetzt und können nicht wiederhergestellt werden.",
"currentBackups": "Aktuelle Backups",
"delete": "Löschen",
"destroyBackup": "Backup löschen \" + file_to_del + \"?",
@ -270,21 +271,22 @@
"save": "Speichern",
"size": "Größe",
"storageLocation": "Speicherort",
"storageLocationDesc": "Wo wollen Sie die Backups speichern?"
"storageLocationDesc": "Wo wollen Sie die Backups speichern?",
"shutdown": "Server für die Dauer des Backups stoppen"
},
"serverConfig": {
"bePatientDelete": "Bitte haben Sie etwas Geduld, während wir Ihren Server aus dem Crafty-Panel entfernen. Dieser Bildschirm wird in wenigen Augenblicken geschlossen.",
"bePatientDeleteFiles": "Bitte haben Sie etwas Geduld, während wir Ihren Server aus dem Crafty-Panel entfernen und alle Dateien löschen. Dieser Bildschirm wird in wenigen Augenblicken geschlossen.",
"bePatientUpdate": "Bitte haben Sie etwas Geduld, während wir den Server aktualisieren. Die Downloadzeiten können je nach Ihrer Internetgeschwindigkeit variieren.<br /> Dieser Bildschirm wird sich in einem Moment aktualisieren",
"cancel": "Abbrechen",
"crashTime": "Zeitüberschreitung bei Absturz",
"crashTime": "Zeitüberschreitung nach Absturz",
"crashTimeDesc": "Wie lange soll Crafty warten, bevor Crafty den Server als abgestürzt betrachtet?",
"deleteFilesQuestion": "Serverdateien vom Rechner löschen?",
"deleteFilesQuestionMessage": "Möchten Sie, dass Crafty alle Serverdateien auf dem Hostrechner löscht?",
"deleteFilesQuestionMessage": "Möchten Sie, dass Crafty alle Serverdateien auf dem Hostrechner löscht? <br><br><strong>Das schließt die Server-Backups ein.</strong>",
"deleteServer": "Server löschen",
"deleteServerQuestion": "Server löschen?",
"deleteServerQuestionMessage": "Sind Sie sicher, dass Sie diesen Server löschen wollen? Danach gibt es kein Zurück mehr...",
"exeUpdateURL": "Server Ausführbare Update URL",
"exeUpdateURL": "Ausführbare Server Update URL",
"exeUpdateURLDesc": "Direkte Download-URL für Updates.",
"noDelete": "Nein, zurück",
"noDeleteFiles": "Nein, nur aus dem Panel entfernen",
@ -293,25 +295,28 @@
"save": "Speichern",
"sendingDelete": "Lösche den Server",
"sendingRequest": "Ihre Anfrage senden...",
"serverAutoStart": "Server Automatisch starten",
"serverAutoStart": "Server automatisch starten",
"serverAutostartDelay": "Server Autostart-Verzögerung",
"serverAutostartDelayDesc": "Verzögerung vor dem automatischen Start (falls unten aktiviert)",
"serverCrashDetection": "Erkennung von Serverabstürzen",
"serverExecutable": "Server Ausführbare Datei",
"serverExecutable": "Ausführbare Server Datei",
"serverExecutableDesc": "Die ausführbare Datei des Servers",
"javaVersion": "Aktuelle Java Version überschreiben",
"javaVersionDesc": "Wenn Sie die Java-Version überschreiben möchten: Stellen Sie sicher, dass der 'auszuführende Befehl' in Anführungszeichen geschrieben ist (Ausgenommen die Standard-'java'-Variable)",
"javaNoChange": "Nicht überschreiben",
"serverExecutionCommand": "Server Ausführungsbefehl",
"serverExecutionCommandDesc": "Was wird in einem versteckten Terminal gestartet",
"serverExecutionCommandDesc": "Was wird in einer versteckten Konsole gestartet",
"serverIP": "Server IP",
"serverIPDesc": "Die IP, mit der sich Crafty für Statistiken verbinden soll (versuchen Sie eine echte IP anstelle von 127.0.0.1, wenn Sie Probleme haben)",
"serverLogLocation": "Server Log Speicherort",
"serverLogLocationDesc": "Absoluter vollständiger Pfad zur Protokolldatei",
"serverLogLocationDesc": "Pfad zur Protokolldatei",
"serverName": "Server Name",
"serverNameDesc": "Wie möchten Sie diesen Server nennen",
"serverPath": "Server-Arbeitsverzeichnis",
"serverPathDesc": "Absoluter vollständiger Pfad (ohne die ausführbare Datei)",
"serverPort": "Server Port",
"serverPortDesc": "Der Port, mit dem sich Crafty für Statistiken verbinden soll",
"serverStopCommand": "Server Stop Befehl",
"serverStopCommand": "Server Stopp Befehl",
"serverStopCommandDesc": "Befehl an das Programm, um es zu stoppen",
"stopBeforeDeleting": "Bitte stoppen Sie den Server, bevor Sie ihn löschen",
"update": "Server Datei aktualisieren",
@ -343,7 +348,7 @@
"playerControls": "Spieler-Management",
"schedule": "Zeitplan",
"serverDetails": "Server Details",
"terminal": "Terminal"
"terminal": "Konsole"
},
"serverFiles": {
"clickUpload": "Klicken Sie hier, um Ihre Dateien auszuwählen",
@ -367,12 +372,13 @@
"noscript": "Der Dateimanager funktioniert nicht ohne JavaScript",
"rename": "Umbenennen",
"renameItemQuestion": "Wie soll der neue Name lauten?",
"size": "Editorgröße umschalten",
"save": "Speichern",
"stayHere": "VERLASSEN SIE DIESE SEITE NICHT!",
"unsupportedLanguage": "Warnung: Dies ist ein nicht unterstützter Dateityp",
"unzip": "Entpacken",
"upload": "Hochladen",
"uploadTitle": "Dateien hochladen in: ",
"uploadTitle": "Dateien hochladen nach: ",
"waitUpload": "Bitte warten Sie, während wir Ihre Dateien hochladen... Dies kann eine Weile dauern.",
"yesDelete": "Ja, ich verstehe die Konsequenzen"
},
@ -441,7 +447,7 @@
"sendCommand": "Befehl senden",
"start": "Start",
"starting": "Verzögertes Starten",
"stop": "Stop",
"stop": "Stopp",
"stopScroll": "Automatisches Scrollen stoppen",
"updating": "Aktualisierung..."
},
@ -452,7 +458,7 @@
"autoCreate": "Wenn keine ausgewählt werden, wird Crafty eine erstellen!",
"bePatient": "Bitte haben Sie etwas Geduld, da wir ' + (importing ? 'import' : 'download')",
"buildServer": "Server erstellen!",
"clickRoot": "Hier klicken, um das root Verzeichniss auszuwählen",
"clickRoot": "Hier klicken, um das Stammverzeichnis auszuwählen",
"close": "Schließen",
"defaultPort": "25565 (Standard)",
"downloading": "Server herunterladen...",
@ -466,14 +472,14 @@
"myNewServer": "Mein neuer Server",
"newServer": "Neuen Server erstellen",
"quickSettings": "Schnelleinstellungen",
"quickSettingsDescription": "Keine Sorge, Änderungen können später immernoch vorgenommen werden.",
"quickSettingsDescription": "Keine Sorge, Änderungen können später immer noch vorgenommen werden.",
"resetForm": "Konfiguration zurücksetzen",
"save": "Speichern",
"selectRole": "Rolle(n) auswählen",
"selectRoot": "Archivstammverzeichnis auswählen",
"selectType": "Typ auswählen",
"selectVersion": "Version auswählen",
"selectZipDir": "Das Verzeichnis im Archiv wählen, aus dem die Dateien entpacken werden sollen",
"selectZipDir": "Das Verzeichnis im Archiv wählen, aus dem die Dateien entpackt werden sollen",
"serverJar": "Server Java Datei",
"serverName": "Server Name",
"serverPath": "Server Pfad",
@ -513,13 +519,13 @@
"lastUpdate": "Letzte Aktualisierung: ",
"leaveBlank": "Um den Benutzer zu bearbeiten, ohne das Passwort zu ändern, lassen Sie das Feld leer.",
"member": "Mitglied?",
"notExist": "Sie können nichts löschen, was nicht existiert!",
"notExist": "Sie können nicht löschen, was nicht existiert!",
"pageTitle": "Benutzer bearbeiten",
"pageTitleNew": "Benutzer erstellen",
"password": "Passwort",
"permName": "Berechtigungsname",
"repeat": "Passwort wiederholen",
"roleName": "Rollen Name",
"roleName": "Rollenname",
"super": "Super Benutzer",
"userLang": "Sprache des Benutzers",
"userName": "Benutzername",

View File

@ -66,6 +66,7 @@
"cannotSeeOnMobile": "Not seeing everything on mobile?",
"cannotSeeOnMobile2": "Try scrolling the table sideways.",
"clone": "Clone",
"cloneConfirm": "Are you sure you would like to clone this server? This process may take a while.",
"cpuCores": "CPU Cores",
"cpuCurFreq": "CPU Current Clock",
"cpuMaxFreq": "CPU Maximum Clock",