69 lines
3.6 KiB
HTML

{% extends "base.html" %}
{% load bootstrap %}
{% block content %}
<div class="row">
<h3>{{ host.get_fqdn }} <br><small><a href="{% url 'overview' %}"><i class="icon-double-angle-left"></i> back to overview</a></small></h3>
<div class="col-lg-4">
<h3>Edit Host</h3>
<p>You can only change the comment. If you want to have another host name, you have to delete this host and create a new one.</p>
<form method="post" action="">
{% csrf_token %}
{{ form|bootstrap }}
<button type="submit" class="btn btn-primary">Update</button>
</form>
</div>
<div class="col-lg-4">
<h3>Generate New Secret</h3>
<p>We store your update secret salted and hashed, so if you forget or lose it you will have to create a new one.</p>
<form action="{% url 'generate_secret_view' host.pk %}" method="get">
<button type="submit" class="btn btn-primary">Generate New</button>
</form>
</div>
<div class="col-lg-4">
<h3>Update Nameserver Entry</h3>
<p>Usually you configure your router to follow the dyndns2 protocol. But if you know what you are doing, and you want to update it by hand, you can do it here.<br>If you don't specify an IP address, we use your remote address.</p>
<div class="form-group">
<label>IPv4 or IPv6</label>
<input class="form-control" type="text" id="myip" name="myip" placeholder="use remote address">
</div>
<button type="button" class="btn btn-primary" onclick="update_host('{{ host.get_fqdn }}')">DNS Update</button> <span id="update_result"></span>
<script>
update_host = function(host) {
$('#update_result').text('updating...');
$.get( "{% url 'nic_update_authorized' %}", { myip: $('#myip').val(), hostname: host } )
.done(function( data ) {
$('#update_result').text(data);
}).fail(function( data ) {
$('#update_result').text('error');
});
}
</script>
<p>Or use this url to set the ip via url: <br><a href="{% url 'nic_update_authorized' %}?hostname={{ host.get_fqdn }}&myip={{ remote_addr }}">Right Click &rarr; Copy Link Address</a></p>
</div>
</div>
<hr>
<div class="row">
<div class="col-lg-6">
<div class="well well-sm">
<h3>General Information</h3>
<p>We try to get your IP addresses through a trick. We host two fake images on a IPv4-only and a IPv6-only host and we can associate those with your session.
If we find an IP address, we will update this information accordingly. This allows us to get your IPv4 address even when you are using IPv6 and vice versa.</p>
<b>Your IPv4:</b> <span class="ipv4addr">{{ request.session.ipv4 }}</span> <br>
<b>Your IPv6:</b> <span class="ipv6addr">{{ request.session.ipv6 }}</span>
</div>
</div>
<div class="col-lg-6">
<div class="well well-sm">
<h3>Host Information</h3>
<p>This information comes directly from the name server and shows the current IPs set for your host.</p>
<b>Host IPv4:</b> <span class="ipv4addr">{{ host.getIPv4 }}</span> <br>
<b>Host IPv6:</b> <span class="ipv6addr">{{ host.getIPv6 }}</span>
</div>
</div>
</div>
{% endblock %}