fixed different width in templates
This commit is contained in:
parent
884c86defd
commit
553e02f243
@ -5,9 +5,9 @@ from django.forms import ModelForm
|
|||||||
|
|
||||||
class Host(models.Model):
|
class Host(models.Model):
|
||||||
"""TODO: hash update_secret"""
|
"""TODO: hash update_secret"""
|
||||||
fqdn = models.CharField(max_length=256)
|
fqdn = models.CharField(max_length=256,unique=True)
|
||||||
update_secret = models.CharField(max_length=256)
|
update_secret = models.CharField(max_length=256)
|
||||||
comment = models.CharField(max_length=256,default='')
|
comment = models.CharField(max_length=256,default='',blank=True, null=True)
|
||||||
|
|
||||||
last_update = models.DateTimeField(auto_now=True)
|
last_update = models.DateTimeField(auto_now=True)
|
||||||
created = models.DateTimeField(auto_now_add=True)
|
created = models.DateTimeField(auto_now_add=True)
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|
||||||
<div class="col-lg-4">
|
<div class="col-lg-4">
|
||||||
<h3>Delete Host <small><a href="{% url 'overview' %}"><i class="icon-double-angle-left"></i> back to overview</a></small></h3>
|
<h3>Delete Host <small><a href="{% url 'overview' %}"><i class="icon-double-angle-left"></i> back to overview</a></small></h3>
|
||||||
<form action="" method="post">
|
<form action="" method="post">
|
||||||
|
@ -23,8 +23,8 @@
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<h3>New host</h3>
|
|
||||||
<div class="col-lg-4">
|
<div class="col-lg-4">
|
||||||
|
<h3>New host</h3>
|
||||||
<form method="post" action="">
|
<form method="post" action="">
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
{{ form|bootstrap }}
|
{{ form|bootstrap }}
|
||||||
@ -33,13 +33,11 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
<div class="col-lg-12">
|
||||||
<h3>Information</h3>
|
<h3>Information</h3>
|
||||||
<b>your IPv4:</b> <span class="ipv4adr">{{ request.session.ipv4 }}</span> </br>
|
<b>your IPv4:</b> <span class="ipv4adr">{{ request.session.ipv4 }}</span> </br>
|
||||||
<b>your IPv6:</b> <span class="ipv6adr">{{ request.session.ipv6 }}</span>
|
<b>your IPv6:</b> <span class="ipv6adr">{{ request.session.ipv6 }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div style="display: none">
|
|
||||||
<img src="//{{ WWW_IPV4_HOST }}/updateip" />
|
|
||||||
<img src="//{{ WWW_IPV6_HOST }}/updateip" />
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@ -9,6 +9,7 @@ from django.contrib.auth.decorators import login_required
|
|||||||
from django.contrib import messages
|
from django.contrib import messages
|
||||||
from django.utils.decorators import method_decorator
|
from django.utils.decorators import method_decorator
|
||||||
from django.core.urlresolvers import reverse
|
from django.core.urlresolvers import reverse
|
||||||
|
import dns.inet
|
||||||
|
|
||||||
from main.forms import HostForm
|
from main.forms import HostForm
|
||||||
from main.models import Host
|
from main.models import Host
|
||||||
@ -19,8 +20,11 @@ class HomeView(TemplateView):
|
|||||||
|
|
||||||
def get_context_data(self, *args, **kwargs):
|
def get_context_data(self, *args, **kwargs):
|
||||||
context = super(HomeView, self).get_context_data(*args, **kwargs)
|
context = super(HomeView, self).get_context_data(*args, **kwargs)
|
||||||
context.update(create_context(self.request))
|
|
||||||
context['nav_home'] = True
|
context['nav_home'] = True
|
||||||
|
ipaddr = self.request.META['REMOTE_ADDR']
|
||||||
|
af = dns.inet.af_for_address(ipaddr)
|
||||||
|
key = 'ipv4' if af == dns.inet.AF_INET else 'ipv6'
|
||||||
|
self.request.session[key] = ipaddr
|
||||||
return context
|
return context
|
||||||
|
|
||||||
|
|
||||||
|
0
nsupdate/manage.py
Normal file → Executable file
0
nsupdate/manage.py
Normal file → Executable file
@ -51,6 +51,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="container content wrap">
|
<div class="container content wrap">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-lg-12">
|
||||||
<div id="message_box">
|
<div id="message_box">
|
||||||
{% if messages %}
|
{% if messages %}
|
||||||
{% for message in messages %}
|
{% for message in messages %}
|
||||||
@ -61,6 +63,8 @@
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="row" style="background-color: #DDDDDD">
|
<div class="row" style="background-color: #DDDDDD">
|
||||||
<div class="col-sm-4" style="text-align: center">
|
<div class="col-sm-4" style="text-align: center">
|
||||||
@ -88,16 +92,16 @@
|
|||||||
<hr>
|
<hr>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
{% if session.ipv4 and session.ipv6 %}
|
{% if request.session.ipv4 and request.session.ipv6 %}
|
||||||
<p>We think this are your IPs:</p>
|
<p>We think this are your IPs:</p>
|
||||||
{% elif session.ipv4 or session.ipv6 %}
|
{% elif request.session.ipv4 or request.session.ipv6 %}
|
||||||
<p>We think this is your IP:</p>
|
<p>We think this is your IP:</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if session.ipv4 %}
|
{% if request.session.ipv4 %}
|
||||||
<h1>{{session.ipv4}}</h1>
|
<h1>{{request.session.ipv4}}</h1>
|
||||||
{% elif session.ipv6 %}
|
{% elif request.session.ipv6 %}
|
||||||
<h1>{{session.ipv6}}</h1>
|
<h1>{{request.session.ipv4}}</h1>
|
||||||
{% else %}
|
{% else %}
|
||||||
<h1>HeyHo!</h1>
|
<h1>HeyHo!</h1>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@ -120,6 +124,11 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div style="display: none">
|
||||||
|
<img src="//{{ WWW_IPV4_HOST }}/updateip" />
|
||||||
|
<img src="//{{ WWW_IPV6_HOST }}/updateip" />
|
||||||
|
</div>
|
||||||
|
|
||||||
<script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
|
<script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user