Merge branch 'master' of github.com:asmaps/nsupdate.info
This commit is contained in:
commit
aa3f4ba3d6
@ -191,7 +191,7 @@ def AuthorizedNicUpdateView(request):
|
|||||||
logger.info('%s - is not owned by user: %s' % (hostname, request.user.username, ))
|
logger.info('%s - is not owned by user: %s' % (hostname, request.user.username, ))
|
||||||
return Response('nohost')
|
return Response('nohost')
|
||||||
ipaddr = request.GET.get('myip')
|
ipaddr = request.GET.get('myip')
|
||||||
if ipaddr is None:
|
if not ipaddr:
|
||||||
ipaddr = request.META.get('REMOTE_ADDR')
|
ipaddr = request.META.get('REMOTE_ADDR')
|
||||||
return _update(hostname, ipaddr)
|
return _update(hostname, ipaddr)
|
||||||
|
|
||||||
|
@ -4,9 +4,9 @@
|
|||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
||||||
<div class="row">
|
<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">
|
<div class="col-lg-4">
|
||||||
<h3>Edit Host <small><a href="{% url 'overview' %}"><i class="icon-double-angle-left"></i> back to overview</a></small></h3>
|
<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>
|
<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="">
|
<form method="post" action="">
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
@ -23,16 +23,24 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-lg-4">
|
<div class="col-lg-4">
|
||||||
<h3>Update Nameserver Entry</h3>
|
<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.</p>
|
<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>
|
||||||
<form method="get" action="{% url 'nic_update_authorized' %}">
|
|
||||||
<input type="hidden" name="hostname" value="{{ host.get_fqdn }}">
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label>IPv4 or IPv6</label>
|
<label>IPv4 or IPv6</label>
|
||||||
<input class="form-control" type="text" name="myip" placeholder="Enter IP">
|
<input class="form-control" type="text" id="myip" name="myip" placeholder="use remote address">
|
||||||
</div>
|
</div>
|
||||||
<button type="submit" class="btn btn-primary">DNS Update</button>
|
<button type="button" class="btn btn-primary" onclick="update_host()">DNS Update</button> <span id="update_result"></span>
|
||||||
</form>
|
<script>
|
||||||
|
update_host = function() {
|
||||||
|
$('#update_result').text('updating...');
|
||||||
|
$.get( "{% url 'nic_update_authorized' %}", { myip: $('#myip').val(), hostname: "{{ host.get_fqdn }}" } )
|
||||||
|
.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 → Copy Link Address</a></p>
|
<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 → Copy Link Address</a></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user