continued work on price model

This commit is contained in:
Tobias Brunner 2025-05-22 16:34:15 +02:00
parent 6f41c8c344
commit a6a15150ea
No known key found for this signature in database
10 changed files with 500 additions and 1 deletions

View file

@ -0,0 +1,78 @@
{% extends 'base.html' %}
{% block content %}
<h1>Compute Plan Price Comparison</h1>
{% for plan_data in plans_data %}
<div class="card mb-4">
<div class="card-header">
<h2>{{ plan_data.plan.name }}</h2>
</div>
<div class="card-body">
<h3>Plan Details</h3>
<table class="table table-striped">
<tr>
<th>Cloud Provider:</th>
<td>{{ plan_data.plan.cloud_provider.name }}</td>
</tr>
<tr>
<th>vCPUs:</th>
<td>{{ plan_data.plan.vcpus }}</td>
</tr>
<tr>
<th>RAM:</th>
<td>{{ plan_data.plan.ram }} GB</td>
</tr>
<tr>
<th>CPU/Memory Ratio:</th>
<td>{{ plan_data.plan.cpu_mem_ratio }}</td>
</tr>
<tr>
<th>Compute Plan Prices:</th>
<td>
{% for price in plan_data.plan.prices.all %}
{{ price.amount }} {{ price.currency }}<br>
{% empty %}
No prices set
{% endfor %}
</td>
</tr>
</table>
<h3>Calculated AppCat Prices</h3>
{% if plan_data.calculated_prices %}
<table class="table table-bordered">
<thead>
<tr>
<th>Service</th>
<th>Variable Unit</th>
<th>Service Level</th>
<th>Units</th>
<th>Currency</th>
<th>Final Price</th>
</tr>
</thead>
<tbody>
{% for price in plan_data.calculated_prices %}
<tr>
<td>{{ price.service }}</td>
<td>{{ price.variable_unit }}</td>
<td>{{ price.service_level }}</td>
<td>{{ price.units }}</td>
<td>{{ price.currency }}</td>
<td>{{ price.price }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<p>No AppCat prices calculated for this plan.</p>
{% endif %}
</div>
</div>
{% empty %}
<div class="alert alert-info">
No compute plans found.
</div>
{% endfor %}
{% endblock %}