diff options
Diffstat (limited to 'portal-gui/templates')
-rw-r--r-- | portal-gui/templates/base.html | 25 | ||||
-rw-r--r-- | portal-gui/templates/myrpki/add_conf.html | 23 | ||||
-rw-r--r-- | portal-gui/templates/myrpki/asn_view.html | 87 | ||||
-rw-r--r-- | portal-gui/templates/myrpki/child_view.html | 30 | ||||
-rw-r--r-- | portal-gui/templates/myrpki/conf_empty.html | 8 | ||||
-rw-r--r-- | portal-gui/templates/myrpki/conf_list.html | 17 | ||||
-rw-r--r-- | portal-gui/templates/myrpki/dashboard.html | 135 | ||||
-rw-r--r-- | portal-gui/templates/myrpki/parent_resource.html | 15 | ||||
-rw-r--r-- | portal-gui/templates/myrpki/parent_view.html | 25 | ||||
-rw-r--r-- | portal-gui/templates/myrpki/prefix_view.html | 95 | ||||
-rw-r--r-- | portal-gui/templates/myrpki/resource_view.html | 63 | ||||
-rw-r--r-- | portal-gui/templates/myrpki/roaform.html | 13 | ||||
-rw-r--r-- | portal-gui/templates/myrpki/xml_import.html | 20 | ||||
-rw-r--r-- | portal-gui/templates/registration/login.html | 26 |
14 files changed, 582 insertions, 0 deletions
diff --git a/portal-gui/templates/base.html b/portal-gui/templates/base.html new file mode 100644 index 00000000..7645cf9f --- /dev/null +++ b/portal-gui/templates/base.html @@ -0,0 +1,25 @@ +<html> +<head> + <title>{% block title %}MyRPKI{% endblock %}</title> + {% block head %}{% endblock %} + <style type="text/css"> + {% block css %}{% endblock %} + </style> +</head> +<body> + <div id="header"> + <img src="/site_media/img/my.png"/> + <img src="/site_media/img/rpki.png"/> + </div> + <div id="content"> + {% if user.is_authenticated %} + <span style="float: right; font-size: 80%;">Logged in as {{ user }} | + {% if user.is_staff %}<a href="/admin/">admin</a> |{% endif %} + <a href="{% url django.contrib.auth.views.logout %}">Log Out</a></span> + {% else %} + <span style="float: right; font-size: 80%;"><a href="{% url django.contrib.auth.views.login %}">Log In</a></span> + {% endif %} + {% block content %}{% endblock %} + </div> +</body> +</html> diff --git a/portal-gui/templates/myrpki/add_conf.html b/portal-gui/templates/myrpki/add_conf.html new file mode 100644 index 00000000..a3440e4a --- /dev/null +++ b/portal-gui/templates/myrpki/add_conf.html @@ -0,0 +1,23 @@ +{% extends "base.html" %} + +{% block content %} +<h1>Add Configuration</h1> +<p>Please enter a unique handle for your RPKI instance. + +{% if errors %} +<ul> +{% for m in errors %} +<li class="errmsg">{{ m }} +{% endfor %} +</ul> +{% endif %} + +<form action="/myrpki/conf/add" method="post"> +<table> +{{ form.as_table }} +<tr><td><input type="submit" value="Submit" /></td></tr> +</table> +</form> + +{% endblock %} +{% extends "base.html" %} diff --git a/portal-gui/templates/myrpki/asn_view.html b/portal-gui/templates/myrpki/asn_view.html new file mode 100644 index 00000000..ef020355 --- /dev/null +++ b/portal-gui/templates/myrpki/asn_view.html @@ -0,0 +1,87 @@ +{% extends "base.html" %} + +{% block css %} +table { border-collapse: collapse } +th { border: solid 1px; padding: 1em } +td { border: solid 1px; text-align: center; padding-left: 1em; padding-right: 1em } +{% endblock %} + +{% block content %} +<p>Handle: <a href="{% url rpkigui.myrpki.views.dashboard %}">{{ request.session.handle }}</a> + +<h1>ASN View</h1> + +<table> + <tr> <td>ASN:</td><td>{{ asn }}</td> </tr> + {% if asn.parent %} + <tr> + <td>Suballocated from:</td> + <td><a href="{{ asn.parent.get_absolute_url }}">{{ asn.parent }}</a></td> + </tr> + {% endif %} + <tr> + <td>Received from:</td> + <td> + {% for p in parent %} + <a href="{{ p.get_absolute_url }}">{{ p.handle }}</a> + {% endfor %} + </td> + </tr> + <tr><td>Validity:</td><td>{{ asn.from_cert.all.0.not_before }} - {{ asn.from_cert.all.0.not_after }} </td></tr> + + {% if asn.allocated %} + <tr><td>Allocated:</td><td><a href="{{asn.allocated.get_absolute_url}}">{{asn.allocated.handle}}</a></td></tr> + {% endif %} +</table> + +{% if asn.children.count %} +<h2>Suballocations</h2> + +<ul> +{% for subaddr in asn.children.all %} +<li><a href="{{ subaddr.get_absolute_url }}">{{ subaddr }}</a> +{% endfor %} +</ul> + +{% endif %} + +{% if roas %} +<h2>ROAs</h2> +<table> + <tr><th>Prefixes</th></tr> + {% for r in roas %} + <tr> + <td style='text-align: left'> + <ul> + {% for p in r.from_roa_request.all %} + <li><a href="{{ p.prefix.get_absolute_url }}">{{ p.prefix }}</a> + {% endfor %} + </ul> + </td> + </tr> + {% endfor %} + </ul> +</table> +{% endif %} <!-- roas --> + +{% if unallocated %} +<h2>Unallocated</h2> +<ul> +{% for u in unallocated %} +<li>{{ u }} +{% endfor %} +</ul> +{% endif %} + +{% if form %} +<h2>Edit</h2> +<form method="POST" action="{{ request.get_full_path }}"> + {{ form.as_p }} + <input type="submit"> +</form> +{% endif %} + +<p>Action: +<a href="{{asn.get_absolute_url}}/allocate">give to child</a> + +{% endblock %} diff --git a/portal-gui/templates/myrpki/child_view.html b/portal-gui/templates/myrpki/child_view.html new file mode 100644 index 00000000..62709f0d --- /dev/null +++ b/portal-gui/templates/myrpki/child_view.html @@ -0,0 +1,30 @@ +{% extends "base.html" %} + +{% block content %} +<p>Handle: <a href="{% url rpkigui.myrpki.views.dashboard %}">{{ request.session.handle.handle }}</a> +<h1>Child View</h1> +<p>Child: {{ child.handle }} + +<h2>Delegated Addresses</h2> +{% if child.address_range.all %} +<ul> +{% for a in child.address_range.all %} +<li><a href="{{ a.get_absolute_url }}">{{ a }}</a> +{% endfor %} +</ul> +{% else %} +<p>--none-- +{% endif %} + +<h2>Delegated ASNs</h2> +{% if child.asn.all %} +<ul> +{% for a in child.asn.all %} +<li><a href="{{ a.get_absolute_url }}">{{ a }}</a> +{% endfor %} +</ul> +{% else %} +<p>--none-- +{% endif %} + +{% endblock %} diff --git a/portal-gui/templates/myrpki/conf_empty.html b/portal-gui/templates/myrpki/conf_empty.html new file mode 100644 index 00000000..0ef9366c --- /dev/null +++ b/portal-gui/templates/myrpki/conf_empty.html @@ -0,0 +1,8 @@ +{% extends "base.html" %} + +{% block content %} + +<h1>Error!</h1> +<p>Your account does not have permission to manage any resource handles on this server. Please contact your portal-gui operator. + +{% endblock %} diff --git a/portal-gui/templates/myrpki/conf_list.html b/portal-gui/templates/myrpki/conf_list.html new file mode 100644 index 00000000..4bb18114 --- /dev/null +++ b/portal-gui/templates/myrpki/conf_list.html @@ -0,0 +1,17 @@ +{% extends "base.html" %} + +{% block content %} +<h1>Handle List</h1> +<p>Please select a handle.</p> + +<ul> +{% for c in conf_list %} +<li><a href="{{ select_url }}?handle={{ c.handle }}&next={{ next_url }}">{{ c.handle }}</a></li> +{% endfor %} +</ul> + +<!-- +<p><a href="/myrpki/conf/add?next={{ next_url }}">[create]</a> +--> + +{% endblock %} diff --git a/portal-gui/templates/myrpki/dashboard.html b/portal-gui/templates/myrpki/dashboard.html new file mode 100644 index 00000000..af99e89e --- /dev/null +++ b/portal-gui/templates/myrpki/dashboard.html @@ -0,0 +1,135 @@ +{% extends "base.html" %} + +{% block css %} +table { border-collapse: collapse } +th { border: solid 1px; padding: 1em } +td { border: solid 1px; text-align: center; padding-left: 1em; padding-right: 1em } +{% endblock %} + +{% block content %} +<p>Handle: {{ request.session.handle }} +| <a href="{% url rpkigui.myrpki.views.conf_export %}">export identity</a> +| <a href="{% url rpkigui.myrpki.views.conf_list %}">select</a> + +<div style="border: inset"> +<h1 style="text-align: center">Parents</h1> + +<ul> +{% for parent in request.session.handle.parents.all %} +<li><a href="{{ parent.get_absolute_url }}">{{ parent.handle }}</a> +<p> +<table> +<tr><th>Accepted Resource</th><th>Not Before</th><th>Not After</th></tr> +{% for cert in parent.resources.all %} + +{% for asn in cert.asn.all %} +<tr><td style='text-align:left'><a href="{{ asn.get_absolute_url }}">{{ asn }}</a></td> +<td>{{cert.not_before}}</td> +<td>{{cert.not_after}}</td> +</tr> +{% endfor %} + +{% for address in cert.address_range.all %} +<tr> + <td style='text-align: left'><a href="{{ address.get_absolute_url }}">{{ address }}</a></td> + <td>{{cert.not_before}}</td> + <td>{{cert.not_after}}</td> +</tr> +{% endfor %} + +{% endfor %} <!--certs--> +</table> + +{% endfor %} +</ul> + +<!-- +<a href="/myrpki/import/parent">[add]</a> +--> +</div> + +<span> +<div style="border: outset"> +<h1 style="text-align: center">Children</h1> +{% if request.session.handle.children.all %} +<ul> +{% for child in request.session.handle.children.all %} +<li><a href="{% url rpkigui.myrpki.views.child_view child.handle %}">{{ child.handle }}</a> +{% if child.address_range.count or child.asn.count %} +<p>Delegated resources: +<ul> +{% for asn in child.asn.all %} +<li><a href="{{ asn.get_absolute_url }}">{{ asn }}</a> +{% endfor %} +{% for address in child.address_range.all %} +<li><a href="{{ address.get_absolute_url}}">{{ address }}</a> +{% endfor %} +</ul> +{% endif %} +{% endfor %} +</ul> +<!-- +<a href="/myrpki/import/child">[add]</a> +--> +{% else %} +<p>-- none -- +{% endif %} + +<p> +Export (csv): <a href="{% url rpkigui.myrpki.views.download_asns request.session.handle %}">asns</a> | +<a href="{% url rpkigui.myrpki.views.download_prefixes request.session.handle %}">prefixes</a> + +</div> + +<div style="border: outset"> <!-- ROAs --> +<h1 style="text-align: center">My ROA [request]s</h1> + +<table> +<tr> <th>Prefix</th> <th>ASN</th> </tr> + +{% for roa in request.session.handle.roas.all %} +<tr> + <td style='text-align: left'> + <ul style='list-style-position: outside'> +{% for req in roa.from_roa_request.all %} + <li><a href="{{ req.prefix.get_absolute_url }}">{{ req.as_roa_prefix }}</a> +{% endfor %} + </ul> + </td> + <td>{{ roa.asn }}</td> +</tr> +{% endfor %} +</table> + +<p><a href="{% url rpkigui.myrpki.views.download_roas request.session.handle %}">export (csv)</a> + +</div><!-- roas --> + +<div style="border: outset"> + <h1 style="text-align: center">Unallocated Resources</h1> + {% if asns or ars %} + + {% if asns %} + <ul> + {% for asn in asns %} + <li>{{ asn.as_ul|safe }} + {% endfor %} <!-- ASNs --> + </ul> + {% endif %} + + {% if ars %} + <ul> + {% for addr in ars %} + <li>{{ addr.as_ul|safe }} + {% endfor %} <!-- addrs --> + </ul> + {% endif %} + + {% else %} + <p>-- none -- + {% endif %} + + </ul> +</div> +</span> +{% endblock %} diff --git a/portal-gui/templates/myrpki/parent_resource.html b/portal-gui/templates/myrpki/parent_resource.html new file mode 100644 index 00000000..764207e4 --- /dev/null +++ b/portal-gui/templates/myrpki/parent_resource.html @@ -0,0 +1,15 @@ +{% extends "base.html" %} + +{% block content %} + +<p>Handle: <a href="/myrpki/">{{ request.session.handle }}</a> + +<h1>Add Resource Range</h1> +<form action="{{ request.url }}" method="post"> +<table> +{{ form.as_table }} +</table> +<input type="submit" value="Submit" /> +</form> + +{% endblock %} diff --git a/portal-gui/templates/myrpki/parent_view.html b/portal-gui/templates/myrpki/parent_view.html new file mode 100644 index 00000000..e1852245 --- /dev/null +++ b/portal-gui/templates/myrpki/parent_view.html @@ -0,0 +1,25 @@ +{% extends "base.html" %} + +{% block content %} +<p>Handle: <a href="{% url rpkigui.myrpki.views.dashboard %}">{{ request.session.handle.handle }}</a> +<h1>Parent View</h1> +<p>Parent: {{ parent.handle }} +<h2>Delegated Addresses</h2> +<ul> +{% for c in parent.resources.all %} +{% for a in c.address_range.all %} +<li><a href="{{ a.get_absolute_url }}">{{ a }}</a> +{% endfor %} +{% endfor %} +</ul> + +<h2>Delegated ASNs</h2> +<ul> +{% for c in parent.resources.all %} +{% for a in c.asn.all %} +<li><a href="{{ a.get_absolute_url }}">{{ a }}</a> +{% endfor %} +{% endfor %} +</ul> + +{% endblock %} diff --git a/portal-gui/templates/myrpki/prefix_view.html b/portal-gui/templates/myrpki/prefix_view.html new file mode 100644 index 00000000..1e1ca797 --- /dev/null +++ b/portal-gui/templates/myrpki/prefix_view.html @@ -0,0 +1,95 @@ +{% extends "base.html" %} + +{% block css %} +table { border: solid 1px; border-collapse: collapse } +th { border: solid 1px; padding: 1em } +td { border: solid 1px; text-align: center; padding-left: 1em; padding-right: 1em } +{% endblock %} + +{% block content %} +<p>Handle: <a href="{% url rpkigui.myrpki.views.dashboard %}">{{ request.session.handle }}</a> + +<h1>Prefix View</h1> + +<table> + <tr> <td>Range:</td><td>{{ addr }}</td> </tr> + {% if addr.parent %} + <tr> + <td>Suballocated from:</td> + <td><a href="{{ addr.parent.get_absolute_url }}">{{ addr.parent }}</a></td> + </tr> + {% endif %} + <tr> + <td>Received from:</td> + <td> + {% for p in parent %} + <a href="{{ p.get_absolute_url }}">{{ p.handle }}</a> + {% endfor %} + </td> + </tr> + <tr><td>Validity:</td><td>{{ addr.from_cert.all.0.not_before }} - {{ addr.from_cert.all.0.not_after }} </td></tr> + + {% if addr.allocated %} + <tr> + <td>Allocated:</td> + <td><a href="{{addr.allocated.get_absolute_url}}">{{ addr.allocated.handle }}</a></td> + </tr> + {% endif %} +</table> + +{% if addr.children.count %} +<h2>Suballocations</h2> +<ul> +{% for subaddr in addr.children.all %} + <li><a href="{{ subaddr.get_absolute_url }}">{{ subaddr }}</a> +{% endfor %} +</ul> +{% endif %} <!-- suballocations --> + +{% if addr.roa_requests.count %} +<h2>ROA requests</h2> +<table> + <tr><th>ASN</th><th>Max Length</th></tr> + + {% for r in addr.roa_requests.all %} + <tr> + <td>{{ r.roa.asn }}</td> + <td>{{ r.max_length }}</td> + <td><a href="{{ r.get_absolute_url }}/delete">delete</a></td> + </tr> + {% endfor %} +</table> +{% endif %} <!-- roa requests --> + +{% if unallocated %} +<h2>Unallocated</h2> +<ul> + {% for u in unallocated %} + <li>{{ u }} + {% endfor %} +</ul> +{% endif %} + +{% if form %} +<h2>Edit</h2> +<form method="POST" action="{{ request.get_full_path }}"> + {{ form.as_p }} + <input type="submit"> +</form> +{% endif %} <!-- form --> + +<p>Action:<br> +{% if not addr.allocated %} +<a href="{{addr.get_absolute_url}}/split">split</a><br> +{% endif %} +{% if not addr.roa_requests.all %} +<a href="{{addr.get_absolute_url}}/allocate">give to child</a><br> +{% endif %} +{% if addr.is_prefix and not addr.allocated %} +<a href="{{ addr.get_absolute_url }}/roa">roa</a><br> +{% endif %} +{% if not addr.allocated and addr.parent %} +<a href="{{ addr.get_absolute_url }}/delete">delete</a><br> +{% endif %} + +{% endblock %} diff --git a/portal-gui/templates/myrpki/resource_view.html b/portal-gui/templates/myrpki/resource_view.html new file mode 100644 index 00000000..f8219136 --- /dev/null +++ b/portal-gui/templates/myrpki/resource_view.html @@ -0,0 +1,63 @@ +{% extends "base.html" %} + +{% block content %} +<p>Handle: <a href="/myrpki/">{{ request.session.handle }}</a> +<h1>{{resource_type.capitalize}} View</h1> +<table> + <tr> + <td>Range:</td><td>{{ addr }}</td> + </tr> + <tr> + <td>Received from:</td> + <td> + {% for p in parent %} + <a href="{{ p.get_absolute_url }}">{{ p.handle }}</a> + {% endfor %} + </td> + </tr> + <tr><td>Validity:</td><td>{{ addr.from_cert.all.0.not_before }} - {{ addr.from_cert.all.0.not_after }} </td></tr> + {% if addr.parent %} + <tr> + <td>Suballocated from:</td> + <td><a href="{{ addr.parent.get_absolute_url }}">{{ addr.parent }}</a></td> + </tr> + {% endif %} +</table> + +<h2>Suballocations</h2> + +{% if addr.children.count %} + +<ul> +{% for subaddr in addr.children.all %} +<li><a href="{{ subaddr.get_absolute_url }}">{{ subaddr }}</a> +{% endfor %} +</ul> + +{% else %} + +<p>--none-- + +{% endif %} + +<div> +<h2>Delegate</h2> + +<p>Child: +<!-- +<form action="{{ request.url }}" method="post"> + {{ form.as_p }} + <p><input type="submit" value="Submit"> +</form> +--> +</div> + +{% if resource_type == 'prefix' %} +<div> +<h2>Originate</h2> +<p>ASNs allowed to originate routes for this prefix: +</div> + +{% endif %} + +{% endblock %} diff --git a/portal-gui/templates/myrpki/roaform.html b/portal-gui/templates/myrpki/roaform.html new file mode 100644 index 00000000..c81d0ae8 --- /dev/null +++ b/portal-gui/templates/myrpki/roaform.html @@ -0,0 +1,13 @@ +{% extends "base.html" %} + +{% block content %} +<h1>Edit ROA</h1> + +<p>Handle: <a href="/myrpki/">{{ request.session.handle }}</a> + +<form action="{{ request.url }}" method="POST"> +{{ form.as_p }} +<p><input type="submit" value="Submit"> +</form> + +{% endblock %} diff --git a/portal-gui/templates/myrpki/xml_import.html b/portal-gui/templates/myrpki/xml_import.html new file mode 100644 index 00000000..e26830e3 --- /dev/null +++ b/portal-gui/templates/myrpki/xml_import.html @@ -0,0 +1,20 @@ +{% extends "base.html" %} + +{% block content %} +<h1>Import {{ kind }}</h1> +<p>Handle: {{ request.session.handle }} +<p>Please select the xml file containing the identity of the <strong>{{ kind }}</strong> to import. +{% if errors %} +<ul> +{% for e in errors %} +<li>{{ e }} +{% endfor %} +</ul> +{% endif %} + +<form enctype="multipart/form-data" action="{{ post_url }}" method="post"> +{{ form.as_p }} +<input type="submit" value="Submit" /> +</form> + +{% endblock %} diff --git a/portal-gui/templates/registration/login.html b/portal-gui/templates/registration/login.html new file mode 100644 index 00000000..86b5392a --- /dev/null +++ b/portal-gui/templates/registration/login.html @@ -0,0 +1,26 @@ +{% extends "base.html" %} + +{% block content %} + +{% if form.errors %} +<p>Your username and password didn't match. Please try again.</p> +{% endif %} + +<form method="post" action="{% url django.contrib.auth.views.login %}"> +<table> +<tr> + <td>{{ form.username.label_tag }}</td> + <td>{{ form.username }}</td> +</tr> +<tr> + <td>{{ form.password.label_tag }}</td> + <td>{{ form.password }}</td> +</tr> +</table> + +<input type="submit" value="login" /> +<input type="hidden" name="next" value="{{ next }}" /> +</form> + +{% endblock %} + |