diff --git a/CHANGELOG.md b/CHANGELOG.md index 0aafa844..bea6aff3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # 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)) +### 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)) +

+ ## --- [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)) diff --git a/app/frontend/templates/panel/dashboard.html b/app/frontend/templates/panel/dashboard.html index 5b1d74f6..00aee7e1 100644 --- a/app/frontend/templates/panel/dashboard.html +++ b/app/frontend/templates/panel/dashboard.html @@ -60,12 +60,12 @@

+ title="{% raw translate('dashboard', 'cpuCores', data['lang']) %}: {{ data.get('hosts_data').get('cpu_cores') }}
{% raw translate('dashboard', 'cpuCurFreq', data['lang']) %}: {{ data.get('hosts_data').get('cpu_cur_freq') }}
{% raw translate('dashboard', 'cpuMaxFreq', data['lang']) %}: {{ data.get('hosts_data').get('cpu_max_freq') }}"> {{ translate('dashboard', 'cpuUsage', data['lang']) }}: {{ data.get('hosts_data').get('cpu_usage') }}

+ title="{{ translate('dashboard', 'memUsage', data['lang']) }}: {{ data.get('hosts_data').get('mem_usage') }}"> {{ translate('dashboard', 'memUsage', data['lang']) }}: {{ data.get('hosts_data').get('mem_percent') }}%

@@ -116,8 +116,8 @@ {% if len(data['servers']) > 0 %} {% if data['user_data']['hints'] %} + data-content="{{ translate('dashboard', 'cannotSeeOnMobile2', data['lang']) }}" , + data-placement="top"> {% end %} {% end %}
  {{ @@ -156,7 +156,7 @@ {% if server['alert'] %} + href="/panel/server_detail?id={{server['server_data']['server_id']}}"> {{ server['server_data']['server_name'] }}  {% else %} @@ -170,17 +170,17 @@ {% if server['user_command_permission'] %} {% if server['stats']['running'] %} + title="{{ translate('dashboard', 'stop' , data['lang']) }}">   + title="{{ translate('dashboard', 'restart' , data['lang']) }}">   + title="{{ translate('dashboard', 'kill' , data['lang']) }}">   @@ -199,15 +199,15 @@ data['lang']) }} {% else %} + title="{{ translate('dashboard', 'start' , data['lang']) }}">   + title="{{ translate('dashboard', 'clone' , data['lang']) }}">   + title="{{ translate('dashboard', 'kill' , data['lang']) }}">   {% end %} @@ -216,7 +216,7 @@
+ title="{{server['stats']['cpu']}}">
+ aria-valuemin="0" aria-valuemax="100">
{{server['stats']['cpu']}}%
+ title="{{server['stats']['mem']}}">
+ aria-valuemin="0" aria-valuemax="100">
{{server['stats']['mem_percent']}}% - @@ -263,7 +263,7 @@ {% if server['stats']['desc'] != 'False' %}
{{ + style="overflow-wrap: break-word !important; max-width: 85px !important; overflow: scroll;">{{ server['stats']['desc'] }}

{% end %} @@ -287,7 +287,7 @@ {% end %} + data-players="{{ server['stats']['online']}}" data-max="{{ server['stats']['max'] }}"> {% end %} @@ -295,7 +295,7 @@ {% end %} {% if len(data['servers']) > 0 %} - +
{% for server in data['servers'] %} @@ -306,27 +306,27 @@
+ class="btn btn-link d-flex justify-content-start" type="button"> {% if server['stats']['running'] %} {{ translate('dashboard', 'online', data['lang']) }} @@ -348,22 +348,22 @@
+ aria-labelledby="heading-{{server['server_data']['server_id']}}" data-parent="#accordionServers">
{{ translate('dashboard', 'cpuUsage', data['lang']) }}
+ title="{{server['stats']['cpu']}}">
+ aria-valuemax="100">
{{server['stats']['cpu']}}%
@@ -452,7 +452,7 @@
{{ translate('dashboard', 'memUsage', data['lang']) }}
+ title="{{server['stats']['mem']}}">
+ aria-valuemin="0" aria-valuemax="100">
{{server['stats']['mem_percent']}}% - @@ -492,7 +492,7 @@ {% if server['stats']['desc'] != 'False' %}
+ style="overflow-wrap: break-word !important; max-width: 85px !important; overflow: scroll;"> {{ server['stats']['desc'] }}

{% end %} diff --git a/app/frontend/templates/panel/server_backup.html b/app/frontend/templates/panel/server_backup.html index d71e0f68..d97c2d14 100644 --- a/app/frontend/templates/panel/server_backup.html +++ b/app/frontend/templates/panel/server_backup.html @@ -375,7 +375,7 @@ $('#backup_table').DataTable({ "order": [[1, "desc"]], - "paging": true, + "paging": false, "lengthChange": false, "searching": true, "ordering": true, diff --git a/app/frontend/templates/public/status.html b/app/frontend/templates/public/status.html index 2d445f66..0a444158 100644 --- a/app/frontend/templates/public/status.html +++ b/app/frontend/templates/public/status.html @@ -6,76 +6,153 @@ {% block title %}Crafty Controller - {{ translate('dashboard', 'dashboard', data['lang']) }}{% end %} {% block content %} - -
+ +
+ +
{% 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']) }}
` } @@ -109,36 +192,44 @@ if (server.desc) { if (server.icon) { motd = `icon `; + m_motd = `icon `; } else { motd = `icon `; + m_motd = `icon `; } motd = motd + `` + server.desc + `
`; + m_motd = m_motd + `
` + server.desc + `
`; 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 = ``; server_motd.innerHTML = `Crafty can't get infos from this Server `; - server_version.innerHTML = `` + server_version.innerHTML = ``; + m_server_motd.innerHTML = ` Crafty can't get infos from this Server `; } /* Update Online Status */ var online_status = ""; if (server.running) { online_status = ` {{ translate('dashboard', 'online', data['lang'])}}`; + m_online_status = `` + server.online + ` / ` + server.max + ``; } else { online_status = ` {{ translate('dashboard', 'offline', data['lang'])}}`; + m_online_status = ` {{ translate('dashboard', 'offline', data['lang'])}}`; } 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); } }()); -{% end %} +{% end %} \ No newline at end of file diff --git a/app/frontend/templates/public_base.html b/app/frontend/templates/public_base.html index 1254555d..5a6d9bdb 100644 --- a/app/frontend/templates/public_base.html +++ b/app/frontend/templates/public_base.html @@ -27,13 +27,11 @@
-
-
-
-
- {% block content %} - {% end %} -
+
+
+
+ {% block content %} + {% end %}