Very rough spec display in instance detail

This commit is contained in:
Tobias Kunze 2025-04-11 16:40:32 +02:00
parent 7afc4400b7
commit 40811cbc08

View file

@ -96,6 +96,41 @@
</div> </div>
</div> </div>
{% endif %} {% endif %}
{% if instance.spec %}
<div class="col-12">
<div class="card">
<div class="card-header">
<h4>{% translate "Specification" %}</h4>
</div>
<div class="card-body">
<div class="table-responsive">
<table class="table table-bordered">
<thead>
<tr>
<th>{% translate "Property" %}</th>
<th>{% translate "Value" %}</th>
</tr>
</thead>
<tbody>
{% for key, value in instance.spec.items %}
<tr>
<td>{{ key }}</td>
<td>
{% if value|default:""|stringformat:"s"|slice:":1" == "{" or value|default:""|stringformat:"s"|slice:":1" == "[" %}
<pre>{{ value|pprint }}</pre>
{% else %}
{{ value }}
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
</div>
{% endif %}
</div> </div>
</section> </section>
{% endblock content %} {% endblock content %}