From b224103778f3fa51ea6fd2c27f588a0484f6b3c5 Mon Sep 17 00:00:00 2001 From: amcmanu3 Date: Sun, 5 Feb 2023 16:47:12 -0500 Subject: [PATCH] Add storage to the dashboard --- app/classes/web/panel_handler.py | 7 +++- app/frontend/templates/panel/dashboard.html | 37 +++++++++++++++++++-- 2 files changed, 40 insertions(+), 4 deletions(-) diff --git a/app/classes/web/panel_handler.py b/app/classes/web/panel_handler.py index 74c93b88..1f61a702 100644 --- a/app/classes/web/panel_handler.py +++ b/app/classes/web/panel_handler.py @@ -332,7 +332,12 @@ class PanelHandler(BaseHandler): else None, "superuser": superuser, } - + try: + page_data["hosts_data"]["disk_json"] = json.loads( + page_data["hosts_data"]["disk_json"].replace("'", '"') + ) + except: + page_data["hosts_data"]["disk_json"] = {} if page == "unauthorized": template = "panel/denied.html" diff --git a/app/frontend/templates/panel/dashboard.html b/app/frontend/templates/panel/dashboard.html index adfe7645..49dc6d25 100644 --- a/app/frontend/templates/panel/dashboard.html +++ b/app/frontend/templates/panel/dashboard.html @@ -50,7 +50,7 @@
-
+
{{ translate('dashboard', 'host', data['lang']) }} @@ -72,7 +72,7 @@
-
+
{{ translate('dashboard', 'servers', data['lang']) }} @@ -88,7 +88,7 @@
-
+
{{ translate('dashboard', 'players', data['lang']) }} @@ -101,6 +101,37 @@
+
+
+
+
Storage +
+
    + {% for item in data.get('hosts_data').get('disk_json') %} +
  • +
    {{item["mount"]}}
    +
    +
    {{item["used"]}} / {{item["total"]}} +
    +
    + +
  • + {% end %} + +
+
+
+