summaryrefslogtreecommitdiffstats
path: root/src/lib/Server/Hostbase/hostbase/webtemplates/zoneedit.html
blob: c862686144034308838a8c3bc408f3ac06647cef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
{% extends "base.html" %}

{% block pagebanner %}
  <div class="header">
      <h2>Zones</h2>
      <p>Edit information for {{ zone.zone }}
  </div>
  <br/>
{% endblock %}

{% block sidebar %}
{% include "navbar" %}
<ul>
<li><a href="/hostbase/zones/{{ zone.id }}/" class="sidebar">view zone</a><br>
</li>
</ul>
{% endblock %}

{% block content %}

<script language=JavaScript type=text/Javascript>
function toggleField(fieldname){
   if(document.getElementById){
      var style = document.getElementById(fieldname).style;
      style.display = style.display? "":"block";
   }
}
</script>

<style type=text/css>
div#nameserver{
   display: none;
}
div#mx{
   display: none;
}
div#address{
   display: none;
}
</style>

<form name="zonedata" action="?sub=true" method="post">
<input type="hidden" name="zone" value="{{ zone.id }}">
<table border="0" width="100%">
   <colgroup>
   <col width="200">
   <col width="*">
   <tr> <td> <b>zone</b></td>
   <td> <input name="zone" type="text" size="32" value="{{ zone.zone }}"></td></tr>
   <tr> <td> <b>admin</b></td>
   <td> <input name="admin" type="text" size="32" value="{{ zone.admin }}"></td></tr>
   <tr> <td> <b>primary_master</b></td>
   <td> <input name="primary_master" type="text" size="32" value="{{ zone.primary_master }}"></td></tr>
   <tr> <td> <b>expire</b></td>
   <td> <input name="expire" type="text" size="32" value="{{ zone.expire }}"></td></tr>
   <tr> <td> <b>retry</b></td>
   <td> <input name="retry" type="text" size="32" value="{{ zone.retry }}"></td></tr>
   <tr> <td> <b>refresh</b></td>
   <td> <input name="refresh" type="text" size="32" value="{{ zone.refresh }}"></td></tr>
   <tr> <td> <b>ttl</b></td>
   <td> <input name="ttl" type="text" size="32" value="{{ zone.ttl }}"></td></tr>

   <tr><td valign="top"> <b>nameservers</b><br>
   <a style="font-size:75%" href=# onclick="toggleField('nameserver')">add a new NS record</a>
   </td>
   <td>
   {% for nameserver in nameservers %}
       <input name="nameserver{{ forloop.counter0 }}" type="text" size="32" value="{{ nameserver.name }}">
       <a style="font-size:75%" href="/hostbase/zones/{{ zone.id }}/nameserver/{{ nameserver.id }}/confirm">remove<br>
   {% endfor %}
   </td></tr>
   </table>
   <div id=nameserver>
   <table border="0" width="100%">
      <colgroup>
      <col width="200">
      <col width="*">
         <tr> <td></td>
         <td> <input name="new_nameserver" size="32" type="text"></td></tr>
   </table>
   </div>
   <table border="0" width="100%">
      <colgroup>
      <col width="200">
      <col width="*">
   <tr><td valign="top"> <b>mxs</b><br>
   <a style="font-size:75%" href=# onclick="toggleField('mx')">add a new MX record</a>
   </td>
   <td>
   {% for mx in mxs %}
       <input name="priority{{ forloop.counter0 }}" type="text" size="6" value="{{ mx.priority }}">
       <input name="mx{{ forloop.counter0 }}" type="text" size="32" value="{{ mx.mx }}">
       <a style="font-size:75%" href="/hostbase/zones/{{ zone.id }}/zonemx/{{ mx.id }}/confirm">remove<br>
   {% endfor %}
   </td></tr>
   </table>
   <div id=mx>
   <table border="0" width="100%">
      <colgroup>
      <col width="200">
      <col width="*">
         <tr> <td></td>
         <td> <input name="new_priority" type="text" size="6" >
         <input name="new_mx" type="text" size="32" >
         </td></tr>
   </table>
   </div>
   <table border="0" width="100%">
      <colgroup>
      <col width="200">
      <col width="*">
   <tr><td valign="top"> <b>A records</b>
   {% if addresses %}
   <br><a style="font-size:75%" href=# onclick="toggleField('address')">add a new MX record</a>
   {% endif %}
   </td>
   <td>
   {% if addresses %}
   {% for address in addresses %}
       <input name="address{{ forloop.counter0 }}" type="text" value="{{ address.ip_addr }}">
       <a style="font-size:75%" href="/hostbase/zones/{{ zone.id }}/address/{{ address.id }}/confirm">remove<br>
   {% endfor %}
   </td></tr>
   </table>
   <div id=address>
   <table border="0" width="100%">
      <colgroup>
      <col width="200">
      <col width="*">
         <tr> <td></td>
         <td> <input name="new_address" type="text" >
         </td></tr>
   </table>
   </div>
   <table border="0" width="100%">
      <colgroup>
      <col width="200">
      <col width="*">
   {% else %}
      <input name="new_address" type="text" value="none" >
   {% endif %}
   </td></tr>

   <tr> <td valign="top"> <b>aux</b> (for information not generated by the database)</td>
   <td> <textarea rows="20" cols="80" name="aux">{{ zone.aux }}</textarea></td></tr>
   </td></tr>

</table>
<p><input type="submit" value="Submit">
</form>

{% endblock %}