Zone list is now tablized. Need to hack up some CSS To make it pretty.
This commit is contained in:
parent
7135a48d64
commit
26187f738b
|
@ -12,6 +12,10 @@ import dns.query
|
||||||
import dns.zone
|
import dns.zone
|
||||||
import socket
|
import socket
|
||||||
|
|
||||||
|
def binder_index(request):
|
||||||
|
return render_to_response('bcommon/index.htm',
|
||||||
|
{ 'server_list' : server_list })
|
||||||
|
|
||||||
def list_servers(request):
|
def list_servers(request):
|
||||||
server_list = BindServer.objects.all().order_by('hostname')
|
server_list = BindServer.objects.all().order_by('hostname')
|
||||||
return render_to_response('bcommon/list_servers.htm',
|
return render_to_response('bcommon/list_servers.htm',
|
||||||
|
@ -52,7 +56,11 @@ def list_zone(request, dns_hostname, zone_name):
|
||||||
for n in names:
|
for n in names:
|
||||||
current_record = z[n].to_text(n)
|
current_record = z[n].to_text(n)
|
||||||
for split_record in current_record.split("\n"): # Split the records on the newline
|
for split_record in current_record.split("\n"): # Split the records on the newline
|
||||||
record_array.append([split_record]) # Add each record to our array
|
record_array.append({'rr_name' : split_record.split(" ")[0],
|
||||||
|
'rr_ttl' : split_record.split(" ")[1],
|
||||||
|
'rr_class' : split_record.split(" ")[2],
|
||||||
|
'rr_type' : split_record.split(" ")[3],
|
||||||
|
'rr_data' : split_record.split(" ")[4]})
|
||||||
|
|
||||||
return render_to_response('bcommon/list_zone.htm',
|
return render_to_response('bcommon/list_zone.htm',
|
||||||
{ 'record_array' : record_array,
|
{ 'record_array' : record_array,
|
||||||
|
|
|
@ -2,9 +2,24 @@
|
||||||
|
|
||||||
{% block body %}
|
{% block body %}
|
||||||
|
|
||||||
<ul>
|
<table>
|
||||||
|
<tr>
|
||||||
|
<th>Name</th>
|
||||||
|
<th>TTL</th>
|
||||||
|
<th>Class</th>
|
||||||
|
<th>Type</th>
|
||||||
|
<th>Data</th>
|
||||||
|
</tr>
|
||||||
|
|
||||||
{% for current_record in record_array %}
|
{% for current_record in record_array %}
|
||||||
<li> {{ current_record }}
|
<tr>
|
||||||
|
<td>{{ current_record.rr_name }}</td>
|
||||||
|
<td>{{ current_record.rr_ttl }}</td>
|
||||||
|
<td>{{ current_record.rr_class }}</td>
|
||||||
|
<td>{{ current_record.rr_type }}</td>
|
||||||
|
<td>{{ current_record.rr_data }}</td>
|
||||||
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
</table>
|
||||||
|
|
||||||
{% endblock body %}
|
{% endblock body %}
|
||||||
|
|
Loading…
Reference in New Issue