From 037758accbae8253d3df7178b41f5107af9d1fb1 Mon Sep 17 00:00:00 2001 From: Andrew Date: Mon, 22 Aug 2022 20:04:40 -0400 Subject: [PATCH] Working live graph --- app/classes/shared/server.py | 1 + app/frontend/templates/base.html | 6 +- .../panel/parts/m_server_controls_list.html | 2 +- .../panel/parts/server_controls_list.html | 2 +- .../templates/panel/server_metrics.html | 104 +++++++++++++++--- app/translations/en_EN.json | 8 +- 6 files changed, 99 insertions(+), 24 deletions(-) diff --git a/app/classes/shared/server.py b/app/classes/shared/server.py index 499a0080..74e93ba7 100644 --- a/app/classes/shared/server.py +++ b/app/classes/shared/server.py @@ -1223,6 +1223,7 @@ class ServerInstance: "version": raw_ping_result.get("version"), "icon": raw_ping_result.get("icon"), "crashed": self.is_crashed, + "created": datetime.datetime.now().strftime("%Y/%m/%d, %H:%M:%S"), }, ) total_players += int(raw_ping_result.get("online")) diff --git a/app/frontend/templates/base.html b/app/frontend/templates/base.html index 543d3c71..1ab50da8 100755 --- a/app/frontend/templates/base.html +++ b/app/frontend/templates/base.html @@ -40,12 +40,12 @@ - + diff --git a/app/frontend/templates/panel/parts/m_server_controls_list.html b/app/frontend/templates/panel/parts/m_server_controls_list.html index dba3802a..52f3d04d 100644 --- a/app/frontend/templates/panel/parts/m_server_controls_list.html +++ b/app/frontend/templates/panel/parts/m_server_controls_list.html @@ -30,7 +30,7 @@ {% if data['permissions']['Players'] in data['user_permissions'] and data['server_data']['type'] != 'minecraft-bedrock' %} {{ translate('serverDetails', 'playerControls', data['lang']) }} {% end %} - Metrics + {{ translate('serverDetails', 'metrics', data['lang']) }} \ No newline at end of file diff --git a/app/frontend/templates/panel/parts/server_controls_list.html b/app/frontend/templates/panel/parts/server_controls_list.html index 17fa1b74..4212bde6 100644 --- a/app/frontend/templates/panel/parts/server_controls_list.html +++ b/app/frontend/templates/panel/parts/server_controls_list.html @@ -51,6 +51,6 @@ {% end %} \ No newline at end of file diff --git a/app/frontend/templates/panel/server_metrics.html b/app/frontend/templates/panel/server_metrics.html index 3b65e9d7..01456c61 100644 --- a/app/frontend/templates/panel/server_metrics.html +++ b/app/frontend/templates/panel/server_metrics.html @@ -38,8 +38,14 @@ {% include "parts/m_server_controls_list.html %} - - + + {% if data['user_data']['hints'] %} + + {% end %} @@ -50,7 +56,14 @@ + {% end %} \ No newline at end of file diff --git a/app/translations/en_EN.json b/app/translations/en_EN.json index f398ccf5..cd3620d0 100644 --- a/app/translations/en_EN.json +++ b/app/translations/en_EN.json @@ -351,7 +351,8 @@ "playerControls": "Player Management", "schedule": "Schedule", "serverDetails": "Server Details", - "terminal": "Terminal" + "terminal": "Terminal", + "metrics": "Metrics" }, "serverFiles": { "clickUpload": "Click here to select your files", @@ -472,6 +473,9 @@ "stopScroll": "Stop Auto Scrolling", "updating": "Updating..." }, + "serverMetrics": { + "resetZoom": "Reset Zoom" + }, "serverWizard": { "absoluteServerPath": "Absolute path to your server", "absoluteZipPath": "Absolute path to your server", @@ -558,4 +562,4 @@ "userSettings": "User Settings", "uses": "Number of uses allowed (-1==No Limit)" } -} +} \ No newline at end of file