From 827ca4a50b74d7293fd6ebf7b326e278a8728beb Mon Sep 17 00:00:00 2001 From: 3wc <3wc.cyberia@doesthisthing.work> Date: Wed, 21 Jul 2021 12:19:28 +0200 Subject: [PATCH] Auto-generate the pricing table from the database --- capsulflask/landing.py | 2 ++ capsulflask/static/style.css | 3 +-- capsulflask/templates/pricing.html | 36 +++++++++++++++++++++--------- 3 files changed, 29 insertions(+), 12 deletions(-) diff --git a/capsulflask/landing.py b/capsulflask/landing.py index 3c1781e..8161352 100644 --- a/capsulflask/landing.py +++ b/capsulflask/landing.py @@ -12,9 +12,11 @@ def index(): @bp.route("/pricing") def pricing(): + vm_sizes = get_model().vm_sizes_dict() operating_systems = get_model().operating_systems_dict() return render_template( "pricing.html", + vm_sizes=vm_sizes, operating_systems=operating_systems ) diff --git a/capsulflask/static/style.css b/capsulflask/static/style.css index f4a2d32..515f1a6 100644 --- a/capsulflask/static/style.css +++ b/capsulflask/static/style.css @@ -241,7 +241,6 @@ thead { background: #bdc7b812; } td, th { - padding: 0.1em 1em; } table.small td, table.small th { @@ -378,4 +377,4 @@ footer { border: 1px solid rgba(255, 223, 155, 0.8); box-sizing: border-box; position: relative; -} \ No newline at end of file +} diff --git a/capsulflask/templates/pricing.html b/capsulflask/templates/pricing.html index b985e67..5d34117 100644 --- a/capsulflask/templates/pricing.html +++ b/capsulflask/templates/pricing.html @@ -6,21 +6,37 @@

CAPSUL TYPES & PRICING

+
+ + + + + + + + + + + + + {% for vm_size_key, vm_size in vm_sizes.items() %} + + + + + + + + + {% endfor %} + +
typemonthly*cpusmemssdnet
{{ vm_size_key }}${{ vm_size['dollars_per_month'] }}{{ vm_size['vcpus'] }}{{ vm_size['memory_mb'] }}25G{{ vm_size['bandwidth_gb_per_month'] }}
+
-    type     monthly*  cpus  mem     ssd   net*
-    -----    -------   ----  ---     ---   ---
-    f1-xs    $5.00     1     512M    25G   .5TB
-    f1-s     $7.50     1     1024M   25G   1TB
-    f1-m     $12.50    1     2048M   25G   2TB
-    f1-l     $20.00    2     3072M   25G   3TB
-    f1-x     $27.50    3     4096M   25G   4TB
-    f1-xx    $50.00    4     8192M   25G   5TB
-
     * net is calculated as a per-month average
     * vms are billed for a minimum of 24 hours upon creation
     * all VMs come standard with one public IPv4 address
-  
     
     SUPPORTED OPERATING SYSTEMS: