72 lines
2.3 KiB
HTML
72 lines
2.3 KiB
HTML
{% extends "base.html" %}
|
|
|
|
{% block title %}Manage pools | IP Subnet Allocator{% endblock %}
|
|
|
|
{% block content %}
|
|
<section class="box">
|
|
<div class="box-title">Existing pools</div>
|
|
|
|
{% if pools.len() == 0 %}
|
|
<p>No pools configured yet.</p>
|
|
{% else %}
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Slug</th>
|
|
<th>Parent prefix</th>
|
|
<th>Type</th>
|
|
<th>Allowed prefixes</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for p in pools %}
|
|
<tr>
|
|
<td data-label="Name">{{ p.name }}</td>
|
|
<td data-label="Slug">{{ p.slug }}</td>
|
|
<td data-label="Parent prefix">{{ p.cidr }}</td>
|
|
<td data-label="Type">{{ p.kind }}</td>
|
|
<td data-label="Allowed prefixes">{{ p.allowed_prefixes_json }}</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
{% endif %}
|
|
</section>
|
|
|
|
<section class="box">
|
|
<div class="box-title">Add new pool</div>
|
|
|
|
{% if error != "" %}
|
|
<div class="message error">
|
|
<p>{{ error }}</p>
|
|
</div>
|
|
{% endif %}
|
|
|
|
<form method="post" action="/pools/new">
|
|
<input type="hidden" name="csrf_token" value="{{ csrf_token }}">
|
|
|
|
<label for="slug">Pool slug *</label>
|
|
<input type="text" id="slug" name="slug" required maxlength="50" pattern="[a-z0-9-]+" placeholder="e.g. vpn">
|
|
<p class="small">Lowercase letters, numbers and hyphens only.</p>
|
|
|
|
<label for="name">Pool name *</label>
|
|
<input type="text" id="name" name="name" required minlength="2" maxlength="100" placeholder="e.g. VPN subnets">
|
|
|
|
<label for="cidr">Parent prefix (CIDR) *</label>
|
|
<input type="text" id="cidr" name="cidr" required placeholder="e.g. 10.200.0.0/16">
|
|
|
|
<label for="kind">Type *</label>
|
|
<input type="text" id="kind" name="kind" required maxlength="50" placeholder="e.g. VPN">
|
|
|
|
<label for="allowed_prefixes">Allowed prefix lengths *</label>
|
|
<input type="text" id="allowed_prefixes" name="allowed_prefixes" required value="20,21,22,23,24,25,26,27,28,29,30" placeholder="e.g. 24,25,26">
|
|
<p class="small">Comma-separated list of prefix lengths. Each must be equal to or larger than the pool prefix.</p>
|
|
|
|
<div style="margin-top: 1rem;">
|
|
<button type="submit" class="btn">Add pool</button>
|
|
<a href="/" class="btn btn-secondary">Back</a>
|
|
</div>
|
|
</form>
|
|
</section>
|
|
{% endblock %}
|