From 6b617bd448bf0122f2183e60f0fb4537b13caece Mon Sep 17 00:00:00 2001 From: Javier Sánchez Parra Date: Fri, 25 Mar 2022 13:09:50 +0100 Subject: Check swap size is not zero If the server do not have swap, show a warning. --- ogcp/templates/dashboard.html | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ogcp/templates/dashboard.html b/ogcp/templates/dashboard.html index 5187b15..a84ae4d 100644 --- a/ogcp/templates/dashboard.html +++ b/ogcp/templates/dashboard.html @@ -118,6 +118,7 @@ {{ _('Swap') }}
+ {% if stats['swap']['size'] %} + {% else %} +

No swap

+ {% endif %}
@@ -259,6 +263,7 @@ document.getElementById('memoryChart'), memoryChartConfig, ); + {% if stats['swap']['size'] %} const swapChartConfig = { type: 'doughnut', data: { @@ -294,5 +299,6 @@ document.getElementById('swapChart'), swapChartConfig, ); + {% endif %} {% endblock %} -- cgit v1.2.3-18-g5258