fix grid stats

This commit is contained in:
samaradel
2024-03-04 17:05:25 +02:00
parent 3bc80c3bbd
commit 5d00d9ebd0
2 changed files with 160 additions and 71 deletions

View File

@@ -1,69 +1,67 @@
{% 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 %}
{% endif %}
{% if data %}
<section class="px-2 h-auto bg-center lg:py-28 p-12 bg-cover bg-no-repeat" style="{{styles}}">
<div class="relative lg:max-w-6xl mx-auto">
<div class="text-center rounded lg:px-6 mt-10 lg:mt-0 mx-auto">
{{body | markdown | safe }}
<div class="my-10 grid lg:grid-cols-4 lg:gap-8">
<!-- capacity -->
<div class="flex flex-col border border-gray-50 shadow-lg bg-white py-8 my-4">
<img class="mx-auto p-4" src="images/V3-08.png" width="150" alt="">
<div class="leading-none font-extrabold text-3xl">
{{ capacity | round(precision=2) }}PB
<div class="flex flex-col border border-gray-50 shadow-lg bg-white py-8 my-4">
<img
class="mx-auto p-4"
src="images/V3-08.png"
width="150"
alt=""
>
<div id="capacity" class="leading-none font-extrabold text-3xl"></div>
<span class="block text-lg mt-4 font-normal capitalize">capacity</span>
</div>
</div>
<!-- Nodes -->
<div class="flex flex-col border border-gray-50 shadow-lg bg-white py-8 my-4">
<img class="mx-auto p-4" src="images/V3-09.png" width="150" alt="">
<div class="leading-none font-extrabold text-3xl">
{{ nodes }}
<div class="flex flex-col border border-gray-50 shadow-lg bg-white py-8 my-4">
<img
class="mx-auto p-4"
src="images/V3-09.png"
width="150"
alt=""
>
<div id="nodes" class="leading-none font-extrabold text-3xl"></div>
<span class="block text-lg mt-4 font-normal capitalize">nodes</span>
</div>
</div>
<!-- countries -->
<div class="flex flex-col border border-gray-50 shadow-lg bg-white py-8 my-4">
<img class="mx-auto p-4" src="images/V3-10.png" width="150" alt="">
<div class="leading-none font-extrabold text-3xl">
{{ countries }}
<div class="flex flex-col border border-gray-50 shadow-lg bg-white py-8 my-4">
<img
class="mx-auto p-4"
src="images/V3-10.png"
width="150"
alt=""
>
<div id="countries" class="leading-none font-extrabold text-3xl"></div>
<span class="block text-lg mt-4 font-normal capitalize">countries</span>
</div>
</div>
<!-- cores -->
<div class="flex flex-col border border-gray-50 shadow-lg bg-white py-8 my-4">
<img class="mx-auto p-4" src="images/V3-11.png" width="150" alt="">
<div class="leading-none font-extrabold text-3xl">
{{ cores | num_format }}
<span class="block text-lg mt-4 font-normal capitalize">cores</span>
<!-- cores -->
<div class="flex flex-col border border-gray-50 shadow-lg bg-white py-8 my-4">
<img
class="mx-auto p-4"
src="images/V3-11.png"
width="150"
alt=""
>
<div id="cores" class="leading-none font-extrabold text-3xl"></div>
<span class="block text-lg mt-4 font-normal capitalize">cores</span>
</div>
</div>
</div>
<button><a href="https://dashboard.grid.tf/explorer/statistics" target="_blank">Explore Grid Capacity</a></button>
<button><a href="/host">Become a Host</a></button>
<button class="my-8">
<a href="https://dashboard.grid.tf/explorer/statistics" target="_blank">
Explore ThreeFold Grid Capacity
</a>
</button>
<button class="my-8">
<a href="/farm" target="_self">
Become a Cloud Provider
</a>
</button>
</div>
</div>
</section>
{% endif %}
<style>
dd {
display: inline-block;
@@ -79,4 +77,4 @@
.bg-pink {
background-color: #ea1ff7;
}
</style>
</style>