From 514fb84a565e8bc9eb550164d545fa72d77c2b38 Mon Sep 17 00:00:00 2001 From: Daniel GarcĂ­a Moreno Date: Tue, 8 Jun 2021 12:36:55 +0200 Subject: Add chart to dashboard This patch adds an example chart using chartjs to the dashboard to show the disk usage. https://www.chartjs.org/docs/latest/getting-started/ --- ogcp/templates/dashboard.html | 188 +++++++++++++++++++++++++++--------------- 1 file changed, 122 insertions(+), 66 deletions(-) (limited to 'ogcp/templates/dashboard.html') diff --git a/ogcp/templates/dashboard.html b/ogcp/templates/dashboard.html index c2b10e8..4774804 100644 --- a/ogcp/templates/dashboard.html +++ b/ogcp/templates/dashboard.html @@ -2,84 +2,140 @@ {% block content %}
-
-
- Connected clients (ogClient) -
-
-

{{ clients['clients'] | length }}

+ +
+
+
+ Connected clients (ogClient) +
+
+

{{ clients['clients'] | length }}

+
-
-
- Disk stats -
-
-
    -
  • - Disk size -
  • -
  • - used -
  • -
  • - available -
  • -
  • - use(%) -
  • -
-
    -
  • - {{ disk['total'] // 2**30 }} Gbytes -
  • -
  • - {{ (disk['total'] - disk['free']) // 2**30 }} Gbytes -
  • -
  • - {{ disk['free'] // 2**30 }} Gbytes -
  • -
  • - {{ (((disk['total'] - disk['free']) / disk['total']) * 100)|int }}% -
  • -
-
-
- Number of images -
-
-

{{ images | length }}

+ + +
+
+
+ Latest images +
+ {% for image in images[:10] %} +
    +
  • + {{ image['name'] }} +
  • +
  • + {{ image['modified'] }} +
  • +
+ {% endfor %}
-
-
- Latest images -
- {% for image in images[:10] %} + + +
+
+
+ Disk stats +
+
+
  • - {{ image['name'] }} + Disk size
  • - {{ image['modified'] }} + used +
  • +
  • + available +
  • +
  • + use(%)
- {% endfor %} +
    +
  • + {{ disk['total'] // 2**30 }} Gbytes +
  • +
  • + {{ (disk['total'] - disk['free']) // 2**30 }} Gbytes +
  • +
  • + {{ disk['free'] // 2**30 }} Gbytes +
  • +
  • + {{ (((disk['total'] - disk['free']) / disk['total']) * 100)|int }}% +
  • +
+
+
+ Number of images +
+
+

{{ images | length }}

+
+
-
-
- ogLives + + +
+
+
+ ogLives +
+
    + {% for oglive in oglive_list['oglive'] %} +
  • + {{ oglive['directory'] }} + {% if loop.index0 == oglive_list['default'] %} + (default) + {% endif %} +
  • + {% endfor %} +
-
    - {% for oglive in oglive_list['oglive'] %} -
  • - {{ oglive['directory'] }} - {% if loop.index0 == oglive_list['default'] %} - (default) - {% endif %} -
  • - {% endfor %} -
{% endblock %} + +{% block extrabody %} + +{% endblock %} -- cgit v1.2.3-18-g5258