Skip to content

Commit

Permalink
Iconify everything
Browse files Browse the repository at this point in the history
  • Loading branch information
lutoma committed Feb 4, 2022
1 parent 9844074 commit 25a4435
Show file tree
Hide file tree
Showing 9 changed files with 69 additions and 46 deletions.
6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
{
"name": "autopeer",
"devDependencies": {
"@fortawesome/fontawesome-pro": "^6.0.0-beta3",
"bootstrap": "^5.1.3",
"browserslist": "^4.19.1",
"del": "^6.0.0",
"gulp": "^4.0.2",
"gulp-autoprefixer": "^8.0.0",
"gulp-sass": "^5.1.0",
"gulp-strip-css-comments": "^2.0.0"
},
"dependencies": {
"@fortawesome/fontawesome-pro": "^5.15.4",
"gulp-strip-css-comments": "^2.0.0",
"sass": "^1.49.7",
"typeface-fira-sans": "^1.1.13"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Generated by Django 4.0.2 on 2022-02-04 21:59

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('peeringmanager', '0015_alter_peering_name_alter_router_lg_id'),
]

operations = [
migrations.AddField(
model_name='router',
name='flag_emoji',
field=models.CharField(default='🇪🇺', max_length=10, verbose_name='Location flag emoji'),
),
migrations.AlterField(
model_name='peering',
name='bandwidth_community',
field=models.IntegerField(choices=[(21, '≥0.1mbit'), (22, '≥1mbit'), (23, '≥10mbit'), (24, '≥100mbit'), (25, '≥1gbit')], default=24, help_text='Used to set <a href="https://dn42.eu/howto/Bird-communities">BGP communities</a>', verbose_name='Link bandwidth'),
),
]
1 change: 1 addition & 0 deletions peeringmanager/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class Router(models.Model):
host_external = models.CharField(max_length=100, verbose_name=_('External host'))
host_internal = models.CharField(max_length=100, verbose_name=_('Internal host'))
ip_internal = models.CharField(max_length=100, verbose_name=_('Internal IP'))
flag_emoji = models.CharField(max_length=10, verbose_name=_('Location flag emoji'), default='🇪🇺')
wg_last_port = models.IntegerField(verbose_name=_('Last allocated wireguard port'), default=42400)
active = models.BooleanField(default=True, verbose_name=_('Active'),
help_text=_('Users can only create peerings to active routers'))
Expand Down
3 changes: 0 additions & 3 deletions scss/screen.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ $fa-font-path: '../fonts';
@import '@fortawesome/fontawesome-pro/scss/fontawesome';
@import '@fortawesome/fontawesome-pro/scss/light';
@import '@fortawesome/fontawesome-pro/scss/regular';
@import '@fortawesome/fontawesome-pro/scss/solid';
@import '@fortawesome/fontawesome-pro/scss/brands';
@import '@fortawesome/fontawesome-pro/scss/duotone';

body {
padding: 2rem 0;
Expand Down
7 changes: 4 additions & 3 deletions templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,20 @@
<div class="container">
<div class="d-flex flex-wrap align-items-center justify-content-center justify-content-lg-start">
<ul class="nav col-12 col-lg-auto me-lg-auto mb-2 justify-content-center mb-md-0">
<li><a href="/" class="nav-link px-2 text-secondary">Home</a></li>

{% if user.is_authenticated %}
<li><a href="/peerings/" class="nav-link px-2 text-white">Peerings</a></li>
{% else %}
<li><a href="/" class="nav-link px-2 text-white">Home</a></li>
{% endif %}
</ul>

<div class="text-end">
{% if not user.is_authenticated %}
<a href="/login/" class="btn btn-outline-light me-2">Login</a>
<a href="/login/" class="btn btn-outline-light me-2"><i class="fa-regular fa-arrow-right-to-bracket"></i> Login</a>
{#<a href="/login/" class="btn btn-warning">Sign up</a>#}
{% else %}
<a href="/logout/" class="btn btn-outline-light me-2">Log out</a>
<a href="/logout/" class="btn btn-outline-light me-2"><i class="fa-regular fa-arrow-right-from-bracket"></i> Log out</a>
{% endif %}
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ <h1 class="display-4 fw-bold lh-1 mb-3">AS64719 automatic peering</h1>
<small class="form-text text-muted">Please enter your mntner object as it exists in the DN42 registry, including the -MNT suffix.</small>
</div>

<button class="w-100 btn btn-lg btn-primary" type="submit">{% trans 'Get verification link' %}</button>
<button class="w-100 btn btn-lg btn-primary" type="submit"><i class="fa-light fa-envelopes"></i> {% trans 'Get verification link' %}</button>
</form>
</div>
</div>
Expand Down
45 changes: 24 additions & 21 deletions templates/peeringmanager/peering_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<div class='col-lg-12 d-flex justify-content-between'>
<div>
<h1>{{ peering.endpoint }}</h1>
<h4>{{ object.router.location }} / BGP state:
<h4>{{ object.router.flag_emoji }} {{ object.router.location }} / BGP state:
{% if status.state == 'Established' %}
<span class='text-success'>{{ status.state }}</span>
{% else %}
Expand All @@ -17,9 +17,9 @@ <h4>{{ object.router.location }} / BGP state:
</div>

<div>
<a class='btn btn-secondary' href='https://stats.dn42.lutoma.org/detail.php?p=interface&amp;pi=wg.{{ peering.name }}&amp;t=if_octets&amp;h={{ peering.router.host_external }}&amp;s=86400' target='_blank'>Traffic stats</a>
<a class='btn btn-secondary' href='https://lg.dn42.lutoma.org/detail/{{ peering.router.lg_id }}/{{ peering.name }}' target='_blank'>Looking glass</a>
<a href='edit/' class='btn btn-primary'>Edit</a>
<a class='btn btn-secondary' href='https://stats.dn42.lutoma.org/detail.php?p=interface&amp;pi=wg.{{ peering.name }}&amp;t=if_octets&amp;h={{ peering.router.host_external }}&amp;s=86400' target='_blank'><i class="fa-regular fa-chart-area"></i> Traffic stats</a>
<a class='btn btn-secondary' href='https://lg.dn42.lutoma.org/detail/{{ peering.router.lg_id }}/{{ peering.name }}' target='_blank'><i class="fa-regular fa-magnifying-glass"></i> Looking glass</a>
<a href='edit/' class='btn btn-primary'><i class="fa-regular fa-pen-to-square"></i> Edit</a>
</div>
</div>

Expand All @@ -30,23 +30,23 @@ <h5 class="card-title">My side</h5>
<table class='table'>
<tbody>
<tr>
<th scope='row'>ASN</th>
<th scope='row'><i class="fa-regular fa-hashtag"></i> ASN</th>
<td>64719</td>
</tr>
<tr>
<th scope='row'>Wireguard endpoint</th>
<th scope='row'><i class="fa-regular fa-bullseye-pointer"></i> Wireguard endpoint</th>
<td>{{ object.router.host_external }}:{{ object.wg_port }}</td>
</tr>
<tr>
<th scope='row'>Wireguard pubkey</th>
<th scope='row'><i class="fa-regular fa-key"></i> Wireguard pubkey</th>
<td><code>{{ object.wg_pubkey }}</code></td>
</tr>
<tr>
<th scope='row'>Internal IPv4</th>
<th scope='row'><i class="fa-regular fa-ethernet"></i> Internal IPv4</th>
<td>{{ object.router.ip_internal }}</td>
</tr>
<tr>
<th scope='row'>Link-local IPv6</th>
<th scope='row'><i class="fa-regular fa-ethernet"></i> Link-local IPv6</th>
<td>fe80::acab</td>
</tr>
</tbody>
Expand All @@ -63,34 +63,35 @@ <h5 class="card-title">Your side</h5>

<tbody>
<tr>
<th scope='row'>ASN</th>
<th scope='row'><i class="fa-regular fa-hashtag"></i> ASN</th>
<td>{{ object.asn }}</td>
</tr>
<tr>
<th scope='row'>Wireguard endpoint</th>
<th scope='row'><i class="fa-regular fa-bullseye-pointer"></i> Wireguard endpoint</th>
<td>{{ object.endpoint }}</td>
</tr>
<tr>
<th scope='row'>Wireguard pubkey</th>
<th scope='row'><i class="fa-regular fa-key"></i> Wireguard pubkey</th>
<td><code>{{ object.wg_peer_pubkey }}</code></td>
</tr>
<tr>
<th scope='row'>Internal IPv4</th>
<th scope='row'><i class="fa-regular fa-ethernet"></i> Internal IPv4</th>
<td>{{ object.endpoint_internal_v4 }}</td>
</tr>
<tr>
<th scope='row'>Link-local IPv6</th>
<th scope='row'><i class="fa-regular fa-ethernet"></i> Link-local IPv6</th>
<td>{{ object.endpoint_internal_v6 }}</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>


<div class='col-lg-6 mt-3'>
<h2 class='mb-2'>Routes</h2>
<div class="row mt-5">
<div class='col-lg-6'>
<h2 class='mb-2'><i class="fa-light fa-route"></i> Routes</h2>
{% if status %}
<table class='table'>
<tbody>
Expand All @@ -105,18 +106,20 @@ <h2 class='mb-2'>Routes</h2>

</div>

<div class='col-lg-6 mt-3'>
<h2 class='mb-2'>Traffic</h2>
<div class='col-lg-6'>
<h2 class='mb-2'><i class="fa-light fa-chart-area"></i> Traffic</h2>

{% if peering.get_traffic %}
<img src='https://stats.dn42.lutoma.org/graph.php?p=interface&amp;pi=wg.{{ peering.name }}&amp;t=if_octets&amp;h={{ peering.router.host_external }}&amp;s=86400' />
{% else %}
<em>Traffic stats are not yet available. Check back in 5-10 minutes.</em>
{% endif %}
</div>
</div>

<div class='col-lg-12' style='margin-top: 2rem;'>
<h2>Example configurations</h2>
<div class="row mt-5">
<div class='col-lg-12'>
<h2><i class="fa-light fa-file-binary"></i> Example configurations</h2>
</div>
<div class='col-lg-6' style='margin-top: .6rem;'>
<h3>wg-quick</h3>
Expand Down
20 changes: 10 additions & 10 deletions templates/peeringmanager/peering_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,21 @@
<div class='col-lg-12 d-flex justify-content-between'>
<h1>Peerings</h1>
<div>
<a href='/peerings/new/' class='btn btn-primary'>Create peering</a>
<a href='/peerings/new/' class='btn btn-primary'><i class="fa-regular fa-plus"></i> Create peering</a>
</div>
</div>

<div class='col-lg-12' style='margin-top: 1rem;'>
<table class='table table-striped'>
<thead>
<tr>
<th scope='col'>ASN</th>
<th scope='col'>State</th>
<th scope='col'>Router</th>
<th scope='col'>Endpoint</th>
<th scope='col'>Routes IPv4</th>
<th scope='col'>Routes IPv6</th>
<th scope='col'>Traffic avg.</th>
<th scope='col'><i class="fa-regular fa-hashtag"></i> ASN</th>
<th scope='col'><i class="fa-regular fa-satellite-dish"></i> State</th>
<th scope='col'><i class="fa-regular fa-server"></i> Router</th>
<th scope='col'><i class="fa-regular fa-bullseye-pointer"></i> Endpoint</th>
<th scope='col'><i class="fa-regular fa-route"></i> Routes IPv4</th>
<th scope='col'><i class="fa-regular fa-route"></i> Routes IPv6</th>
<th scope='col'><i class="fa-regular fa-chart-area"></i> Traffic avg.</th>
<th scope='col'></th>
</thead>

Expand All @@ -37,7 +37,7 @@ <h1>Peerings</h1>
<br><small>since {{ status.state_since }}</small>
</td>
<td>
{{ peering.router.location }}<br />
{{ peering.router.flag_emoji }} {{ peering.router.location }}<br />
<small>{{ peering.router.host_internal }}</small>
</td>
<td>
Expand Down Expand Up @@ -74,7 +74,7 @@ <h1>Peerings</h1>
{% endwith %}
</td>
<td>
<a class='btn btn-secondary' href='/peerings/{{ peering.id }}/'>Details</a>
<a class='btn btn-secondary' href='/peerings/{{ peering.id }}/'><i class="fa-regular fa-circle-info"></i> Details</a>
</td>
</tr>
{% endfor %}
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
# yarn lockfile v1


"@fortawesome/fontawesome-pro@^5.15.4":
version "5.15.4"
resolved "https://npm.fontawesome.com/@fortawesome/fontawesome-pro/-/5.15.4/fontawesome-pro-5.15.4.tgz#aae79a86621a79ae972772ad2906a13ade650a06"
integrity sha512-ApOqpDdKgA79xfLZH3B5PucZxj+TZyQUSrZ4bKkbJCR+zjmveQ4/gp/uXc5bNNhsdtJUy16BYJ/lAVydca2Y5Q==
"@fortawesome/fontawesome-pro@^6.0.0-beta3":
version "6.0.0-beta3"
resolved "https://npm.fontawesome.com/@fortawesome/fontawesome-pro/-/6.0.0-beta3/fontawesome-pro-6.0.0-beta3.tgz#2a0175c233e115923310a445a80e505dfdefd872"
integrity sha512-HzSC707Y1iO4fSzjbqw6BZDRpF1zNm8BWaIr79qqRkUIAyNQXYb6zB1S9pM296fBBwg2e4QWtraRDZkWpN5Yrg==

"@nodelib/[email protected]":
version "2.1.5"
Expand Down

0 comments on commit 25a4435

Please sign in to comment.