added url in host view

This commit is contained in:
Fabian Faessler 2013-09-29 21:55:34 +02:00
parent 1089ed3170
commit 8cc666190a
2 changed files with 4 additions and 0 deletions

View File

@ -24,6 +24,7 @@
<div class="col-lg-4">
<h3>Update Nameserver Entry</h3>
<p>Usually you configure your router to follow the dyndns protocol. But if you know what you are doing, and you want to update it by hand, you can do it here.</p>
<form method="get" action="{% url 'nic_update_authorized' %}">
<input type="hidden" name="hostname" value="{{ host.get_fqdn }}">
<div class="form-group">
@ -32,6 +33,8 @@
</div>
<button type="submit" class="btn btn-primary">DNS Update</button>
</form>
<p>Or use this url, for example as a bookmark: <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>

View File

@ -127,6 +127,7 @@ class HostView(UpdateView):
def get_context_data(self, *args, **kwargs):
context = super(HostView, self).get_context_data(*args, **kwargs)
context['nav_overview'] = True
context['remote_addr'] = self.request.META['REMOTE_ADDR']
context['hosts'] = Host.objects.filter(created_by=self.request.user)
return context