From e561e112d44f070f46747c5e360833d38b74a958 Mon Sep 17 00:00:00 2001 From: Andrew Date: Thu, 2 Jun 2022 13:27:38 -0400 Subject: [PATCH 1/2] Refactor jquery-ui to vendors --- .../assets/{ => vendors}/css/jquery-ui.css | 0 .../{ => vendors}/css/jquery-ui.structure.css | 0 .../assets/{ => vendors}/js/jquery-ui.js | 0 app/frontend/templates/panel/dashboard.html | 113 ++++++++++-------- 4 files changed, 62 insertions(+), 51 deletions(-) rename app/frontend/static/assets/{ => vendors}/css/jquery-ui.css (100%) rename app/frontend/static/assets/{ => vendors}/css/jquery-ui.structure.css (100%) rename app/frontend/static/assets/{ => vendors}/js/jquery-ui.js (100%) diff --git a/app/frontend/static/assets/css/jquery-ui.css b/app/frontend/static/assets/vendors/css/jquery-ui.css similarity index 100% rename from app/frontend/static/assets/css/jquery-ui.css rename to app/frontend/static/assets/vendors/css/jquery-ui.css diff --git a/app/frontend/static/assets/css/jquery-ui.structure.css b/app/frontend/static/assets/vendors/css/jquery-ui.structure.css similarity index 100% rename from app/frontend/static/assets/css/jquery-ui.structure.css rename to app/frontend/static/assets/vendors/css/jquery-ui.structure.css diff --git a/app/frontend/static/assets/js/jquery-ui.js b/app/frontend/static/assets/vendors/js/jquery-ui.js similarity index 100% rename from app/frontend/static/assets/js/jquery-ui.js rename to app/frontend/static/assets/vendors/js/jquery-ui.js diff --git a/app/frontend/templates/panel/dashboard.html b/app/frontend/templates/panel/dashboard.html index c51c35f0..dacf2fdc 100644 --- a/app/frontend/templates/panel/dashboard.html +++ b/app/frontend/templates/panel/dashboard.html @@ -39,12 +39,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') }}%

@@ -95,8 +95,8 @@ {% if len(data['servers']) > 0 %} {% if data['user_data']['hints'] %} + data-content="{{ translate('dashboard', 'cannotSeeOnMobile2', data['lang']) }}" , + data-placement="top"> {% end %} {% end %}
  {{ @@ -141,18 +141,18 @@ {% if server['user_command_permission'] %} {% if server['stats']['running'] %} - +   - +   - +   @@ -166,19 +166,20 @@ translate('dashboard', 'delay-explained' , data['lang'])}}">{{ translate('dashboard', 'starting', data['lang']) }} {% elif server['stats']['downloading']%} - {{ translate('serverTerm', 'downloading', + + {{ translate('serverTerm', 'downloading', data['lang']) }} {% else %} - +   - +   - +   {% end %} @@ -187,7 +188,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']}}% - @@ -234,7 +235,7 @@ {% if server['stats']['desc'] != 'False' %}
{{ + style="overflow-wrap: break-word !important; max-width: 85px !important; overflow: scroll;">{{ server['stats']['desc'] }}

{% end %} @@ -249,7 +250,8 @@ {{ translate('dashboard', 'online', data['lang']) }} {% elif server['stats']['crashed'] %} - {{ translate('dashboard', 'crashed', + {{ translate('dashboard', + 'crashed', data['lang']) }} {% else %} {{ translate('dashboard', 'offline', @@ -257,7 +259,7 @@ {% end %} + data-players="{{ server['stats']['online']}}" data-max="{{ server['stats']['max'] }}"> {% end %} @@ -283,41 +285,44 @@ {% if server['user_command_permission'] %} {% if server['stats']['running'] %} - +   - +   - +   {% elif server['stats']['updating']%} - {{ translate('serverTerm', 'updating', data['lang']) }} + {{ translate('serverTerm', 'updating', + data['lang']) }} {% elif server['stats']['waiting_start']%} {{ translate('dashboard', 'starting', data['lang']) }} + translate('dashboard', 'delay-explained' , data['lang'])}}">{{ translate('dashboard', 'starting', + data['lang']) }} {% elif server['stats']['downloading']%} - {{ translate('serverTerm', 'downloading', data['lang']) }} + + {{ translate('serverTerm', 'downloading', data['lang']) }} {% else %} - +   - +   - +   {% end %} @@ -328,7 +333,8 @@ {{ translate('dashboard', 'online', data['lang']) }} {% elif server['stats']['crashed'] %} - {{ translate('dashboard', 'crashed', + {{ translate('dashboard', + 'crashed', data['lang']) }} {% else %} {{ translate('dashboard', 'offline', @@ -336,7 +342,9 @@ {% end %} - + @@ -347,7 +355,7 @@
{{ translate('dashboard', 'cpuUsage', data['lang']) }}
+ title="{{server['stats']['cpu']}}">
+ aria-valuemin="0" aria-valuemax="100">
{{server['stats']['cpu']}}% @@ -366,7 +374,7 @@
{{ translate('dashboard', 'memUsage', data['lang']) }}
+ title="{{server['stats']['mem']}}">
+ aria-valuemin="0" aria-valuemax="100">
{{server['stats']['mem_percent']}}% - @@ -400,11 +408,14 @@
{{ translate('dashboard', 'players', data['lang']) }}
{% if server['stats']['int_ping_results'] %} - {{ server['stats']['online'] }} / {{ server['stats']['max'] }} {{ translate('dashboard', 'max', + {{ server['stats']['online'] }} / {{ server['stats']['max'] }} {{ translate('dashboard', + 'max', data['lang']) }}
{% if server['stats']['desc'] != 'False' %} -
{{ server['stats']['desc'] }}

+
+ {{ server['stats']['desc'] }}

{% end %} {% if server['stats']['version'] != 'False' %} @@ -773,9 +784,9 @@ }); - - - + + +