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 %}