Use a table for instance display

This commit is contained in:
Tobias Kunze 2025-04-04 16:32:56 +02:00
parent ab04d9174c
commit 23ad1c809b

View file

@ -6,13 +6,40 @@
{% endblock page_title %}
{% endblock html_title %}
{% block card_content %}
<ul>
{% for instance in instances %}
<li>
<a href="{{ instance.urls.base }}">{{ instance.name }}</a>
</li>
{% empty %}
<li>No service instances found.</li>
{% endfor %}
</ul>
<table class="table table-striped">
<thead>
<tr>
<th>{% translate "Name" %}</th>
<th>{% translate "Service" %}</th>
<th>{% translate "Service Provider" %}</th>
<th>{% translate "Service Provider Zone" %}</th>
<th>{% translate "Created At" %}</th>
<th>{% translate "Status" %}</th>
</tr>
</thead>
<tbody>
{% for instance in instances %}
<tr>
<td>
<a href="{{ instance.urls.base }}">{{ instance.name }}</a>
</td>
<td>{{ instance.context.service_definition.service.name }}</td>
<td>{{ instance.context.service_offering.provider.name }}</td>
<td>{{ instance.context.control_plane.name }}</td>
<td>{{ instance.created_at|date:"SHORT_DATETIME_FORMAT" }}</td>
<td>
{% if instance.is_deleted %}
<span class="badge text-bg-secondary">{% translate "Deleted" %}</span>
{% else %}
<span class="badge text-bg-success">{% translate "Active" %}</span>
{% endif %}
</td>
</tr>
{% empty %}
<tr>
<td colspan="6">{% translate "No service instances found." %}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endblock %}