73 lines
2.9 KiB
HTML
73 lines
2.9 KiB
HTML
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Subnet</th>
|
|
<th>Type</th>
|
|
<th>Pool</th>
|
|
<th>Addresses</th>
|
|
<th>Note</th>
|
|
<th>Status</th>
|
|
<th>Created</th>
|
|
<th>Actions</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for a in allocations %}
|
|
<tr>
|
|
<td data-label="Subnet"><a href="/allocations/{{ a.id }}">{{ a.cidr }}</a></td>
|
|
<td data-label="Type">{{ a.kind }}</td>
|
|
<td data-label="Pool">{{ a.pool_name }}</td>
|
|
<td data-label="Addresses">{{ a.address_count }}</td>
|
|
<td data-label="Note">{{ a.note }}</td>
|
|
<td data-label="Status"><span class="status {{ a.status }}">{{ a.status }}</span></td>
|
|
<td data-label="Created">{{ a.created_at_local }}</td>
|
|
<td data-label="Actions">
|
|
<a href="/allocations/{{ a.id }}">Detail</a>
|
|
{% if a.status == "active" || a.status == "reserved" %}
|
|
| <button type="button" class="btn-link release-btn" data-id="{{ a.id }}">Release</button>
|
|
{% endif %}
|
|
</td>
|
|
</tr>
|
|
{% else %}
|
|
<tr>
|
|
<td colspan="8" style="text-align:center;">No allocations.</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
|
|
{% for a in allocations %}
|
|
{% if a.status == "active" || a.status == "reserved" %}
|
|
<div id="release-modal-{{ a.id }}" class="modal-overlay" style="display:none;">
|
|
<div class="modal">
|
|
<h2 class="modal-title">Release subnet {{ a.cidr }}</h2>
|
|
<form method="post" action="/allocations/{{ a.id }}/release" class="modal-body" id="release-form-{{ a.id }}">
|
|
<input type="hidden" name="csrf_token" value="{{ csrf_token }}">
|
|
<p class="small">The subnet will be marked as <span class="status released">released</span> and its address space will become available again. The record remains in history.</p>
|
|
<label for="release-note-{{ a.id }}">Release note *</label>
|
|
<textarea id="release-note-{{ a.id }}" name="release_note" rows="3" required minlength="3" maxlength="500"></textarea>
|
|
<div class="modal-actions">
|
|
<button type="button" class="btn btn-secondary cancel-btn" data-modal="release-modal-{{ a.id }}">Cancel</button>
|
|
<button type="submit" class="btn btn-danger">Release</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
{% endfor %}
|
|
|
|
{% if total_pages > 1 %}
|
|
<div class="pagination">
|
|
<div>
|
|
{% if page > 1 %}
|
|
<a class="btn btn-secondary" href="?page={{ page - 1 }}{% if query != "" %}&q={{ query }}{% endif %}{% if pool_filter != "" %}&pool={{ pool_filter }}{% endif %}{% if status_filter != "" %}&status={{ status_filter }}{% endif %}">← Previous</a>
|
|
{% endif %}
|
|
</div>
|
|
<div>Page {{ page }} / {{ total_pages }} (total {{ total_count }})</div>
|
|
<div>
|
|
{% if page < total_pages %}
|
|
<a class="btn btn-secondary" href="?page={{ page + 1 }}{% if query != "" %}&q={{ query }}{% endif %}{% if pool_filter != "" %}&pool={{ pool_filter }}{% endif %}{% if status_filter != "" %}&status={{ status_filter }}{% endif %}">Next →</a>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
{% endif %}
|