deduplicate table data

This commit is contained in:
Tobias Brunner 2025-05-26 15:42:06 +02:00
parent 7989d4e553
commit 06b4cba4bc
No known key found for this signature in database

View file

@ -112,24 +112,40 @@
{% for service_level, pricing_data in service_levels.items %} {% for service_level, pricing_data in service_levels.items %}
<div class="mb-4"> <div class="mb-4">
<h3 class="mb-3 text-secondary">{{ service_level }}</h3> <h3 class="mb-3">SLA: {{ service_level }}</h3>
{% if pricing_data %} {% if pricing_data %}
{# Display common values for this service level #}
{% with pricing_data.0 as first_row %}
<div class="row mb-3">
<div class="col-md-2">
<strong>Cloud Provider:</strong> {{ first_row.cloud_provider }}
</div>
<div class="col-md-2">
<strong>Service:</strong> {{ first_row.service }}
</div>
<div class="col-md-2">
<strong>CPU/Memory Ratio:</strong> {{ first_row.cpu_mem_ratio }}
</div>
<div class="col-md-2">
<strong>Variable Unit:</strong> {{ first_row.variable_unit }}
</div>
<div class="col-md-2">
<strong>Replica Enforce:</strong> {{ first_row.replica_enforce }}
</div>
</div>
{% endwith %}
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-striped table-bordered table-sm pricing-table"> <table class="table table-striped table-bordered table-sm pricing-table">
<thead class="table-dark"> <thead class="table-dark">
<tr> <tr>
<th>Cloud Provider</th>
<th>Service</th>
<th>Compute Plan</th> <th>Compute Plan</th>
<th>vCPUs</th> <th>vCPUs</th>
<th>RAM (GB)</th> <th>RAM (GB)</th>
<th>CPU/Memory Ratio</th>
<th>Term</th> <th>Term</th>
<th>Currency</th> <th>Currency</th>
<th>Compute Plan Price</th> <th>Compute Plan Price</th>
<th>Variable Unit</th>
<th>Units</th> <th>Units</th>
<th>Replica Enforce</th>
<th>SLA Base</th> <th>SLA Base</th>
<th>SLA Per Unit</th> <th>SLA Per Unit</th>
<th>SLA Price</th> <th>SLA Price</th>
@ -143,18 +159,13 @@
<tbody> <tbody>
{% for row in pricing_data %} {% for row in pricing_data %}
<tr> <tr>
<td>{{ row.cloud_provider }}</td>
<td>{{ row.service }}</td>
<td>{{ row.compute_plan }}</td> <td>{{ row.compute_plan }}</td>
<td>{{ row.vcpus }}</td> <td>{{ row.vcpus }}</td>
<td>{{ row.ram }}</td> <td>{{ row.ram }}</td>
<td>{{ row.cpu_mem_ratio }}</td>
<td>{{ row.term }}</td> <td>{{ row.term }}</td>
<td>{{ row.currency }}</td> <td>{{ row.currency }}</td>
<td>{{ row.compute_plan_price|floatformat:2 }}</td> <td>{{ row.compute_plan_price|floatformat:2 }}</td>
<td>{{ row.variable_unit }}</td>
<td>{{ row.units }}</td> <td>{{ row.units }}</td>
<td>{{ row.replica_enforce }}</td>
<td>{{ row.sla_base|floatformat:2 }}</td> <td>{{ row.sla_base|floatformat:2 }}</td>
<td>{{ row.sla_per_unit|floatformat:4 }}</td> <td>{{ row.sla_per_unit|floatformat:4 }}</td>
<td>{{ row.sla_price|floatformat:2 }}</td> <td>{{ row.sla_price|floatformat:2 }}</td>