diff --git a/app/frontend/templates/panel/dashboard.html b/app/frontend/templates/panel/dashboard.html index 618c5042..8b092e83 100644 --- a/app/frontend/templates/panel/dashboard.html +++ b/app/frontend/templates/panel/dashboard.html @@ -15,8 +15,9 @@ @@ -38,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') }}%

@@ -92,8 +93,8 @@ data['lang']) }} {% if len(data['servers']) > 0 %} + data-content="{{ translate('dashboard', 'cannotSeeOnMobile2', data['lang']) }}" , + data-placement="top"> {% end %}
  {{ translate('dashboard', 'newServer', data['lang']) }}
@@ -112,7 +113,7 @@ {% end %} {% if len(data['servers']) > 0 %} - +
@@ -138,17 +139,17 @@ {% if server['user_command_permission'] %} {% if server['stats']['running'] %} + data-toggle="tooltip" title="{{ translate('dashboard', 'stop' , data['lang']) }}">   + data-toggle="tooltip" title="{{ translate('dashboard', 'restart' , data['lang']) }}">   + data-toggle="tooltip" title="{{ translate('dashboard', 'kill' , data['lang']) }}">   @@ -161,20 +162,20 @@ {{ translate('dashboard', 'starting', data['lang']) }} - {% elif server['stats']['downloading']%} - {{ translate('serverTerm', 'downloading', - data['lang']) }} + {% elif server['stats']['downloading']%} + {{ translate('serverTerm', 'downloading', + data['lang']) }} {% else %} + data-toggle="tooltip" title="{{ translate('dashboard', 'start' , data['lang']) }}">   + data-toggle="tooltip" title="{{ translate('dashboard', 'clone' , data['lang']) }}">   + data-toggle="tooltip" title="{{ translate('dashboard', 'kill' , data['lang']) }}">   {% end %} @@ -183,7 +184,7 @@ @@ -256,7 +257,7 @@
{{ translate('dashboard', 'server', data['lang']) }}
+ 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']}}% - @@ -240,13 +241,13 @@
{% if server['stats']['running'] %} - {{ translate('dashboard', 'online', + {{ translate('dashboard', 'online', data['lang']) }} {% elif server['stats']['crashed'] %} - {{ translate('dashboard', 'crashed', - data['lang']) }} + {{ translate('dashboard', 'crashed', + data['lang']) }} {% else %} - {{ translate('dashboard', 'offline', + {{ translate('dashboard', 'offline', data['lang']) }} {% end %}
- +
@@ -277,17 +278,17 @@ {% if server['user_command_permission'] %} {% if server['stats']['running'] %} + data-toggle="tooltip" title="{{ translate('dashboard', 'stop' , data['lang']) }}">   + data-toggle="tooltip" title="{{ translate('dashboard', 'restart' , data['lang']) }}">   + data-toggle="tooltip" title="{{ translate('dashboard', 'kill' , data['lang']) }}">   @@ -298,19 +299,19 @@ {{ translate('dashboard', 'starting', data['lang']) }} - {% elif server['stats']['downloading']%} - {{ translate('serverTerm', 'downloading', data['lang']) }} + {% elif server['stats']['downloading']%} + {{ translate('serverTerm', 'downloading', data['lang']) }} {% else %} + data-toggle="tooltip" title="{{ translate('dashboard', 'start' , data['lang']) }}">   + data-toggle="tooltip" title="{{ translate('dashboard', 'clone' , data['lang']) }}">   + data-toggle="tooltip" title="{{ translate('dashboard', 'kill' , data['lang']) }}">   {% end %} @@ -318,13 +319,13 @@ @@ -332,7 +333,7 @@ - +
{{ translate('dashboard', 'server', data['lang']) }} {% if server['stats']['running'] %} - {{ translate('dashboard', 'online', + {{ translate('dashboard', 'online', data['lang']) }} {% elif server['stats']['crashed'] %} - {{ translate('dashboard', 'crashed', - data['lang']) }} + {{ translate('dashboard', 'crashed', + data['lang']) }} {% else %} - {{ translate('dashboard', 'offline', + {{ translate('dashboard', 'offline', data['lang']) }} {% end %}
@@ -340,7 +341,7 @@
{{ translate('dashboard', 'cpuUsage', data['lang']) }}
+ title="{{server['stats']['cpu']}}">
+ aria-valuemin="0" aria-valuemax="100">
{{server['stats']['cpu']}}%
@@ -359,7 +360,7 @@
{{ translate('dashboard', 'memUsage', data['lang']) }}
+ title="{{server['stats']['mem']}}">
+ aria-valuemin="0" aria-valuemax="100">
{{server['stats']['mem_percent']}}% - @@ -429,15 +430,19 @@ color: white !important; ; } - #desc_id { - -ms-overflow-style: none; /* for Internet Explorer, Edge */ - scrollbar-width: none; /* for Firefox */ - overflow-y: scroll; -} -#desc_id::-webkit-scrollbar { - display: none; /* for Chrome, Safari, and Opera */ -} + #desc_id { + -ms-overflow-style: none; + /* for Internet Explorer, Edge */ + scrollbar-width: none; + /* for Firefox */ + overflow-y: scroll; + } + + #desc_id::-webkit-scrollbar { + display: none; + /* for Chrome, Safari, and Opera */ + } @@ -454,20 +459,20 @@ }; } - $(document).ready(function() { + $(document).ready(function () { $('[data-toggle="popover"]').popover(); if ($(window).width() < 1000) { $('.too_small').popover("show"); } }); - $(window).ready(function() { - $('body').click(function() { + $(window).ready(function () { + $('body').click(function () { $('.too_small').popover("hide"); }); }); - $(window).resize(function() { + $(window).resize(function () { // This will execute whenever the window is resized if ($(window).width() < 1000) { $('.too_small').popover("show"); @@ -545,8 +550,8 @@ cpu_status = "bg-warning"; } - server_cpu.innerHTML = `
`+ server.cpu +`%`; - m_server_cpu.innerHTML = `
`+ server.cpu +`%`; + server_cpu.innerHTML = `
` + server.cpu + `%`; + m_server_cpu.innerHTML = `
` + server.cpu + `%`; /* Update Memory */ @@ -563,8 +568,8 @@ total_mem = server.mem; } - server_mem.innerHTML = `
`+ server.mem_percent +`% - ` + total_mem; - m_server_mem.innerHTML = `
`+ server.mem_percent +`% - ` + total_mem; + server_mem.innerHTML = `
` + server.mem_percent + `% - ` + total_mem; + m_server_mem.innerHTML = `
` + server.mem_percent + `% - ` + total_mem; /* Update World Infos */ server_world.innerHTML = server.world_size @@ -582,7 +587,7 @@ let servers = document.getElementsByClassName("server-player-totals"); let all_total_players = 0; let all_total_max_players = 0; - for(let i = 0; i < servers.length; i++) { + for (let i = 0; i < servers.length; i++) { try { all_total_players += parseInt(servers[i].getAttribute('data-players')); all_total_max_players += parseInt(servers[i].getAttribute('data-max')); @@ -633,17 +638,17 @@ function update_servers_status(data) { try { - update_one_server_status(data[0]); + update_one_server_status(data[0]); } catch (e) { - console.log ('Failed to update server stats', e) + console.log('Failed to update server stats', e) } display_motd(); } - $(document).ready(function() { + $(document).ready(function () { console.log('ready for JS!') - $(".play_button").click(function() { + $(".play_button").click(function () { server_id = $(this).attr("data-id"); send_command(server_id, 'start_server'); bootbox.alert({ @@ -653,7 +658,7 @@ }); }); - $(".stop_button").click(function() { + $(".stop_button").click(function () { console.log("stopping server"); server_id = $(this).attr("data-id"); send_command(server_id, 'stop_server'); @@ -664,7 +669,7 @@ }); }); - $(".restart_button").click(function() { + $(".restart_button").click(function () { server_id = $(this).attr("data-id"); send_command(server_id, 'restart_server'); bootbox.alert({ @@ -673,7 +678,7 @@ message: '
  {% raw translate("dashboard", "bePatientRestart", data["lang"]) %}
' }); }); - $(".kill_button").click(function() { + $(".kill_button").click(function () { server_id = $(this).attr("data-id"); bootbox.confirm({ message: "This will kill the server process and all it's subprocesses. Killing a process can potentially corrupt files. Only do this in extreme circumstances. Are you sure you would like to continue?", @@ -687,7 +692,7 @@ className: 'btn-secondary' } }, - callback: function(result) { + callback: function (result) { if (result) { send_kill(server_id); let dialog = bootbox.dialog({ @@ -695,8 +700,8 @@ message: '

Loading...

' }); - dialog.init(function() { - setTimeout(function() { + dialog.init(function () { + setTimeout(function () { location.reload(); }, 15000); }); @@ -711,7 +716,7 @@ mem_percent = document.getElementById('mem_percent'); - webSocket.on('update_host_stats', function(hostStats) { + webSocket.on('update_host_stats', function (hostStats) { let cpuDataTitle = `{% raw translate('dashboard', 'cpuCores', data['lang']) %}: ${hostStats.cpu_cores}
{% raw translate("dashboard", "cpuCurFreq", data['lang']) %}: ${hostStats.cpu_cur_freq}
{% raw translate("dashboard", "cpuMaxFreq", data['lang']) %}: ${hostStats.cpu_max_freq}`; cpu_data.setAttribute('data-original-title', cpuDataTitle); cpu_usage.textContent = hostStats.cpu_usage; @@ -721,13 +726,13 @@ } if (webSocket) { - webSocket.on('send_start_reload', function() { + webSocket.on('send_start_reload', function () { location.reload() }); } if (webSocket) { - webSocket.on('update_button_status', function(updateButton) { + webSocket.on('update_button_status', function (updateButton) { let serverId = updateButton.server_id; let message = updateButton.string; let updating = updateButton.isUpdating; @@ -746,7 +751,7 @@ webSocket.on('update_server_status', update_servers_status); } - $(".clone_button").click(function() { + $(".clone_button").click(function () { server_id = $(this).attr("data-id"); send_command(server_id, 'clone_server'); bootbox.alert({ @@ -763,21 +768,25 @@ -{% end %} +{% end %} \ No newline at end of file