From b5acf56e20a79d36496619116af2e460d7e20a87 Mon Sep 17 00:00:00 2001 From: DerLinkman Date: Tue, 2 May 2023 16:08:58 +0000 Subject: [PATCH] Added Platform Information on Status Page --- data/Dockerfiles/dockerapi/dockerapi.py | 4 +++- data/web/js/site/debug.js | 8 +++++++- data/web/lang/lang.de-de.json | 4 +++- data/web/lang/lang.en-gb.json | 4 +++- data/web/templates/debug.twig | 8 +++++++- 5 files changed, 23 insertions(+), 5 deletions(-) diff --git a/data/Dockerfiles/dockerapi/dockerapi.py b/data/Dockerfiles/dockerapi/dockerapi.py index 1ab651b5b..63436b62b 100644 --- a/data/Dockerfiles/dockerapi/dockerapi.py +++ b/data/Dockerfiles/dockerapi/dockerapi.py @@ -9,6 +9,7 @@ import os import json import asyncio import redis +import platform from datetime import datetime import logging from logging.config import dictConfig @@ -485,7 +486,8 @@ async def get_host_stats(wait=5): "swap": psutil.swap_memory() }, "uptime": time.time() - psutil.boot_time(), - "system_time": system_time.strftime("%d.%m.%Y %H:%M:%S") + "system_time": system_time.strftime("%d.%m.%Y %H:%M:%S"), + "architecture": platform.machine() } redis_client.set('host_stats', json.dumps(host_stats), ex=10) diff --git a/data/web/js/site/debug.js b/data/web/js/site/debug.js index 55b6660bb..78a4ccaa9 100644 --- a/data/web/js/site/debug.js +++ b/data/web/js/site/debug.js @@ -43,7 +43,7 @@ $(document).ready(function() { if (mailcow_info.branch === "master"){ check_update(mailcow_info.version_tag, mailcow_info.project_url); } - $("#maiclow_version").click(function(){ + $("#mailcow_version").click(function(){ if (mailcow_cc_role !== "admin" && mailcow_cc_role !== "domainadmin" || mailcow_info.branch !== "master") return; @@ -1302,6 +1302,12 @@ function update_stats(timeout=5){ $("#host_cpu_usage").text(parseInt(data.cpu.usage).toString() + "%"); $("#host_memory_total").text((data.memory.total / (1024 ** 3)).toFixed(2).toString() + "GB"); $("#host_memory_usage").text(parseInt(data.memory.usage).toString() + "%"); + if (data.architecture == "aarch64"){ + $("#host_architecture").html('' + data.architecture + ' ⚠️'); + } + else { + $("#host_architecture").html(data.architecture); + } // update cpu and mem chart var cpu_chart = Chart.getChart("host_cpu_chart"); diff --git a/data/web/lang/lang.de-de.json b/data/web/lang/lang.de-de.json index 4bd4b3faa..e1cfee1b4 100644 --- a/data/web/lang/lang.de-de.json +++ b/data/web/lang/lang.de-de.json @@ -498,6 +498,7 @@ } }, "debug": { + "architecture": "Architektur", "chart_this_server": "Chart (dieser Server)", "containers_info": "Container-Information", "container_running": "Läuft", @@ -534,7 +535,8 @@ "update_available": "Es ist ein Update verfügbar", "no_update_available": "Das System ist auf aktuellem Stand", "update_failed": "Es konnte nicht nach einem Update gesucht werden", - "username": "Benutzername" + "username": "Benutzername", + "wip": "Aktuell noch in Arbeit" }, "diagnostics": { "cname_from_a": "Wert abgeleitet von A/AAAA-Eintrag. Wird unterstützt, sofern der Eintrag auf die korrekte Ressource zeigt.", diff --git a/data/web/lang/lang.en-gb.json b/data/web/lang/lang.en-gb.json index df83987cb..56a5bf905 100644 --- a/data/web/lang/lang.en-gb.json +++ b/data/web/lang/lang.en-gb.json @@ -498,6 +498,7 @@ } }, "debug": { + "architecture": "Architecture", "chart_this_server": "Chart (this server)", "containers_info": "Container information", "container_running": "Running", @@ -534,7 +535,8 @@ "update_available": "There is an update available", "no_update_available": "The System is on the latest version", "update_failed": "Could not check for an Update", - "username": "Username" + "username": "Username", + "wip": "Currently Work in Progress" }, "diagnostics": { "cname_from_a": "Value derived from A/AAAA record. This is supported as long as the record points to the correct resource.", diff --git a/data/web/templates/debug.twig b/data/web/templates/debug.twig index d24d7ed68..adc19b267 100644 --- a/data/web/templates/debug.twig +++ b/data/web/templates/debug.twig @@ -49,6 +49,12 @@

{{ hostname }}

+ + {{ lang.debug.architecture }} +
+

-

+
+ IPs @@ -70,7 +76,7 @@ Version
-

{{ mailcow_info.version_tag }}

+

{{ mailcow_info.version_tag }}