2013-09-28 22:17:24 +02:00
{% extends "base.html" %}
2014-05-23 17:27:18 +02:00
{% load i18n %}{% load bootstrap %}
2013-09-28 22:17:24 +02:00
{% block content %}
< div class = "row" >
2014-08-31 02:03:11 +02:00
< h3 > {{ host.get_fqdn }}< / h3 >
2013-12-30 14:23:02 +01:00
< div class = "col-md-4" >
2014-05-23 17:27:18 +02:00
< h3 > {% trans "Edit Host" %}< / h3 >
2013-09-28 22:17:24 +02:00
< form method = "post" action = "" >
{% csrf_token %}
2013-09-28 23:45:46 +02:00
{{ form|bootstrap }}
2014-05-23 17:27:18 +02:00
< button type = "submit" class = "btn btn-primary" > {% trans "Update" %}< / button >
2013-09-28 22:17:24 +02:00
< / form >
2014-05-23 17:27:18 +02:00
< h3 > {% trans "Delete Host" %}< / h3 >
2013-12-01 13:07:37 +01:00
< p class = "text-danger" >
2014-05-23 17:27:18 +02:00
{% trans "Deleting a host is not undoable. If you need it back, you'll have to add it again and configure a new update secret." %}
2013-12-01 13:05:17 +01:00
< / p >
< form method = "get" action = "{% url 'delete_host' host.pk %}" >
2014-07-14 20:36:19 +02:00
< button type = "submit" class = "btn btn-primary btn-danger" > {% trans "Delete Host" %}< / button >
2013-11-29 10:43:18 +01:00
< / form >
2013-09-28 22:17:24 +02:00
< / div >
2013-12-30 14:23:02 +01:00
< div class = "col-md-4" >
2014-05-23 17:27:18 +02:00
< h3 > {% trans "Show Configuration" %}< / h3 >
2013-11-25 01:44:23 +01:00
< p >
2014-05-23 17:27:18 +02:00
{% blocktrans %}We'll generate a ready-to-use configuration for your router / update
client, filled out with all values (including a new secret).{% endblocktrans %}
2013-11-25 18:34:50 +01:00
< / p >
2013-12-01 13:07:37 +01:00
< p class = "text-warning" >
2014-05-23 17:27:18 +02:00
{% blocktrans %}We'll create a new secret - if you had one before, it will become invalid.
You have to use the new secret in your router / update client configuration.{% endblocktrans %}
2013-11-25 01:44:23 +01:00
< / p >
< form action = "{% url 'generate_secret_view' host.pk %}" method = "get" >
2014-05-23 17:27:18 +02:00
< button type = "submit" class = "btn btn-primary btn-warning" > {% trans "Show Configuration" %}< / button >
2013-11-25 01:44:23 +01:00
< / form >
2014-05-23 17:27:18 +02:00
< h3 > {% trans "Update other Services" %}< / h3 >
< p > {% trans "We can send updates to other services when we receive an update from you." %}< / p >
2013-12-01 13:05:17 +01:00
< form action = "{% url 'updater_hostconfig_overview' host.pk %}" method = "get" >
2014-05-23 17:27:18 +02:00
< button type = "submit" class = "btn btn-primary" > {% trans "Configure Updaters" %}< / button >
2013-11-02 12:21:22 +01:00
< / form >
2013-09-29 03:44:14 +02:00
< / div >
2013-12-30 14:23:02 +01:00
< div class = "col-md-4" >
2014-05-23 17:27:18 +02:00
< h3 > {% trans "Update Nameserver Records" %}< / h3 >
< p > {% blocktrans %}Usually you configure your router to follow the dyndns2 protocol.
But if you know what you are doing, and you want to update manually, you can do it here.{% endblocktrans %}
2013-10-27 09:25:59 +01:00
< br >
2014-05-23 17:27:18 +02:00
{% trans "We populated the input fields for the new addresses with your currently detected remote addresses." %}
2013-10-27 09:25:59 +01:00
< / p >
2013-09-29 03:44:14 +02:00
< div class = "form-group" >
2014-05-23 17:27:18 +02:00
< label for = "current_ipv4" > {% trans "Current IPv4 address from master nameserver" %}< / label >
2013-11-05 00:32:07 +01:00
< input class = "form-control" type = "text" id = "current_ipv4" name = "current_ipv4" value = "{{ host.get_ipv4 }}" disabled >
2014-05-23 17:27:18 +02:00
< label for = "myipv4" > {% trans "Set new IPv4 address" %}< / label >
2014-09-03 14:11:18 +02:00
< input class = "form-control" type = "text" id = "myipv4" name = "myipv4" placeholder = "{% trans " give new ipv4 address " % } " value = "{{ request.session.ipv4 }}" required autofocus >
2013-09-29 03:44:14 +02:00
< / div >
2014-05-23 17:27:18 +02:00
< button type = "button" class = "btn btn-primary" onclick = "update_host_v4('{{ host.get_fqdn }}')" > {% trans "Update" %}< / button > < span id = "update_result_v4" > < / span >
< button type = "button" class = "btn" onclick = "delete_host_v4('{{ host.get_fqdn }}')" > {% trans "Delete" %}< / button > < span id = "delete_result_v4" > < / span >
2013-10-27 09:25:59 +01:00
< p > < / p >
< div class = "form-group" >
2014-05-23 17:27:18 +02:00
< label for = "current_ipv6" > {% trans "Current IPv6 address from master nameserver" %}< / label >
2013-11-05 00:32:07 +01:00
< input class = "form-control" type = "text" id = "current_ipv6" name = "current_ipv6" value = "{{ host.get_ipv6 }}" disabled >
2014-05-23 17:27:18 +02:00
< label for = "myipv6" > {% trans "Set new IPv6 address" %}< / label >
2014-09-03 14:11:18 +02:00
< input class = "form-control" type = "text" id = "myipv6" name = "myipv6" placeholder = "{% trans " give new ipv6 address " % } " value = "{{ request.session.ipv6 }}" required >
2013-10-27 09:25:59 +01:00
< / div >
2014-05-23 17:27:18 +02:00
< button type = "button" class = "btn btn-primary" onclick = "update_host_v6('{{ host.get_fqdn }}')" > {% trans "Update" %}< / button > < span id = "update_result_v6" > < / span >
< button type = "button" class = "btn" onclick = "delete_host_v6('{{ host.get_fqdn }}')" > {% trans "Delete" %}< / button > < span id = "delete_result_v6" > < / span >
2013-09-29 23:34:07 +02:00
< script >
2013-10-27 09:25:59 +01:00
update_host_v4 = function(host) {
$('#update_result_v4').text('updating...');
$.get( "{% url 'nic_update_authorized' %}", { myip: $('#myipv4').val(), hostname: host } )
.done(function( data ) {
$('#update_result_v4').text(data);
}).fail(function( data ) {
$('#update_result_v4').text('error');
});
2013-10-27 13:34:56 +01:00
};
2013-10-27 09:25:59 +01:00
update_host_v6 = function(host) {
$('#update_result_v6').text('updating...');
2013-10-27 09:54:16 +01:00
$.get( "{% url 'nic_update_authorized' %}", { myip: $('#myipv6').val(), hostname: host } )
2013-09-29 23:34:07 +02:00
.done(function( data ) {
2013-10-27 09:25:59 +01:00
$('#update_result_v6').text(data);
2013-09-29 23:34:07 +02:00
}).fail(function( data ) {
2013-10-27 09:25:59 +01:00
$('#update_result_v6').text('error');
2013-09-29 23:34:07 +02:00
});
2013-10-27 13:34:56 +01:00
};
2014-01-21 18:47:27 +01:00
delete_host_v4 = function(host) {
$('#delete_result_v4').text('deleting...');
$.get( "{% url 'nic_delete_authorized' %}", { myip: '0.0.0.0', hostname: host } )
.done(function( data ) {
$('#delete_result_v4').text(data);
}).fail(function( data ) {
$('#delete_result_v4').text('error');
});
};
delete_host_v6 = function(host) {
$('#delete_result_v6').text('deleting...');
$.get( "{% url 'nic_delete_authorized' %}", { myip: '::', hostname: host } )
.done(function( data ) {
$('#delete_result_v6').text(data);
}).fail(function( data ) {
$('#delete_result_v6').text('error');
});
};
2013-09-29 23:34:07 +02:00
< / script >
2013-09-29 03:44:14 +02:00
< / div >
2013-09-28 23:45:46 +02:00
< / div >
2014-09-03 16:56:42 +02:00
< div class = "row" >
< div class = "col-md-12" >
< h3 > {% trans "Result Messages" %}< / h3 >
< form >
< label for = "client_result_msg" > {% trans "Client Result Message" %}< / label >
< input class = "form-control" type = "text" maxlength = "255" id = "client_result_msg" value = "{{ host.client_result_msg }}" disabled >
< label for = "server_result_msg" > {% trans "Server Result Message" %}< / label >
< input class = "form-control" type = "text" maxlength = "255" id = "server_result_msg" value = "{{ host.server_result_msg }}" disabled >
< / form >
< / div >
< / div >
2013-09-29 15:38:52 +02:00
{% endblock %}