From 60ec27615a1ecd16b79b91f58c8d59917d5ed60f Mon Sep 17 00:00:00 2001 From: Scott Yeager Date: Wed, 15 Nov 2023 18:28:37 -0800 Subject: [PATCH] Add standby nodes to stats count --- templates/shortcodes/cloud_stats.html | 17 ++++++++++------- templates/shortcodes/grid_stats.html | 17 ++++++++++------- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/templates/shortcodes/cloud_stats.html b/templates/shortcodes/cloud_stats.html index 4c0ff040e..8872140a6 100644 --- a/templates/shortcodes/cloud_stats.html +++ b/templates/shortcodes/cloud_stats.html @@ -1,12 +1,15 @@ -{% set data = load_data(url="https://gridproxy.grid.tf/stats?status=up", required=false, format="json") %} -{% if data %} - {% set capacity = (data.totalHru + data.totalSru) / 1024 / 1024 / 1024 / 1024 / 1024 %} - {% set nodes = data.nodes %} - {% set countries = data.countries %} - {% set cores = data.totalCru %} +{% set online = load_data(url="https://gridproxy.grid.tf/stats?status=up", required=false, format="json") %} +{% set standby = load_data(url="https://gridproxy.grid.tf/stats?status=standby", required=false, format="json") %} +{% if online and standby %} + + {% set capacity = (online.totalHru + standby.totalHru + online.totalSru + standby.totalSru) / 1024 / 1024 / 1024 / 1024 / 1024 %} + {% set nodes = online.nodes + standby.nodes %} + {% set countries = online.countries %} + {% set cores = online.totalCru + standby.totalCru %} + {% endif %} -{% if data %} +{% if online and standby %}
diff --git a/templates/shortcodes/grid_stats.html b/templates/shortcodes/grid_stats.html index 5e30c6dce..72de15bce 100644 --- a/templates/shortcodes/grid_stats.html +++ b/templates/shortcodes/grid_stats.html @@ -1,13 +1,16 @@ {% set styles = "background-image: url('images/V3.png');" %} -{% set data = load_data(url="https://gridproxy.grid.tf/stats?status=up", required=false, format="json") %} -{% if data %} -{% set capacity = (data.totalHru + data.totalSru) / 1024 / 1024 / 1024 / 1024 / 1024 %} -{% set nodes = data.nodes %} - {% set countries = data.countries %} - {% set cores = data.totalCru %} +{% set online = load_data(url="https://gridproxy.grid.tf/stats?status=up", required=false, format="json") %} +{% set standby = load_data(url="https://gridproxy.grid.tf/stats?status=standby", required=false, format="json") %} +{% if online and standby %} + + {% set capacity = (online.totalHru + standby.totalHru + online.totalSru + standby.totalSru) / 1024 / 1024 / 1024 / 1024 / 1024 %} + {% set nodes = online.nodes + standby.nodes %} + {% set countries = online.countries %} + {% set cores = online.totalCru + standby.totalCru %} + {% endif %} -{% if data %} +{% if online and standby %}