fixes, fully translated tomato, with english dictionary and Polish translation
[tomato.git] / release / src / router / www / advanced-dhcpdns.asp
blob8b60ba371b07ce2d3f3410c137467ba1ea025d7d
1 <!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.0//EN'>
2 <!--
3 Tomato GUI
4 Copyright (C) 2006-2010 Jonathan Zarate
5 http://www.polarcloud.com/tomato/
7 For use with Tomato Firmware only.
8 No part of this file may be used without permission.
9 -->
10 <html>
11 <head>
12 <meta http-equiv='content-type' content='text/html;charset=utf-8'>
13 <meta name='robots' content='noindex,nofollow'>
14 <title>[<% ident(); %>] <% translate("Advanced"); %>: <% translate("DHCP / DNS"); %></title>
15 <link rel='stylesheet' type='text/css' href='tomato.css'>
16 <link rel='stylesheet' type='text/css' href='color.css'>
17 <script type='text/javascript' src='tomato.js'></script>
19 <!-- / / / -->
21 <style type='text/css'>
22 textarea {
23 width: 98%;
24 height: 15em;
26 </style>
28 <script type='text/javascript' src='debug.js'></script>
30 <script type='text/javascript'>
32 // <% nvram("dhcpd_dmdns,dns_addget,dhcpd_gwmode,dns_intcpt,dhcpd_slt,dhcpc_minpkt,dnsmasq_custom,dnsmasq_norw,dhcpd_lmax,dhcpc_custom,dns_norebind"); %>
34 if ((isNaN(nvram.dhcpd_lmax)) || ((nvram.dhcpd_lmax *= 1) < 1)) nvram.dhcpd_lmax = 255;
36 function verifyFields(focused, quiet)
38 var b = (E('_f_dhcpd_sltsel').value == 1);
39 elem.display('_dhcpd_sltman', b);
40 if ((b) && (!v_range('_f_dhcpd_slt', quiet, 1, 43200))) return 0;
41 if (!v_length('_dnsmasq_custom', quiet, 0, 2048)) return 0;
42 if (!v_range('_dhcpd_lmax', quiet, 1, 0xFFFF)) return 0;
43 if (!v_length('_dhcpc_custom', quiet, 0, 80)) return 0;
44 return 1;
47 function nval(a, b)
49 return (a == null || (a + '').trim() == '') ? b : a;
52 function save()
54 if (!verifyFields(null, false)) return;
56 var a;
57 var fom = E('_fom');
59 fom.dhcpd_dmdns.value = E('_f_dhcpd_dmdns').checked ? 1 : 0;
60 a = E('_f_dhcpd_sltsel').value;
61 fom.dhcpd_slt.value = (a != 1) ? a : E('_f_dhcpd_slt').value;
62 fom.dns_addget.value = E('_f_dns_addget').checked ? 1 : 0;
63 fom.dns_norebind.value = E('_f_dns_norebind').checked ? 1 : 0;
64 fom.dhcpd_gwmode.value = E('_f_dhcpd_gwmode').checked ? 1 : 0;
65 fom.dns_intcpt.value = E('_f_dns_intcpt').checked ? 1 : 0;
66 fom.dhcpc_minpkt.value = E('_f_dhcpc_minpkt').checked ? 1 : 0;
68 if (fom.dhcpc_minpkt.value != nvram.dhcpc_minpkt ||
69 fom.dhcpc_custom.value != nvram.dhcpc_custom) {
70 nvram.dhcpc_minpkt = fom.dhcpc_minpkt.value;
71 nvram.dhcpc_custom = fom.dhcpc_custom.value;
72 fom._service.value = '*';
74 else {
75 fom._service.value = 'dnsmasq-restart';
78 if (fom.dns_intcpt.value != nvram.dns_intcpt) {
79 nvram.dns_intcpt = fom.dns_intcpt.value;
80 if (fom._service.value != '*') fom._service.value += ',firewall-restart';
83 /* IPV6-BEGIN */
84 if (fom.dhcpd_dmdns.value != nvram.dhcpd_dmdns) {
85 nvram.dhcpd_dmdns = fom.dhcpd_dmdns.value;
86 if (fom._service.value != '*') fom._service.value += ',radvd-restart';
88 /* IPV6-END */
90 form.submit(fom, 1);
92 </script>
94 </head>
95 <body>
96 <form id='_fom' method='post' action='tomato.cgi'>
97 <table id='container' cellspacing=0>
98 <tr><td colspan=2 id='header'>
99 <div class='title'>Tomato</div>
100 <div class='version'><% translate("Version"); %> <% version(); %></div>
101 </td></tr>
102 <tr id='body'><td id='navi'><script type='text/javascript'>navi()</script></td>
103 <td id='content'>
104 <div id='ident'><% ident(); %></div>
106 <!-- / / / -->
108 <input type='hidden' name='_nextpage' value='advanced-dhcpdns.asp'>
109 <input type='hidden' name='_service' value=''>
111 <input type='hidden' name='dhcpd_dmdns'>
112 <input type='hidden' name='dhcpd_slt'>
113 <input type='hidden' name='dns_addget'>
114 <input type='hidden' name='dns_norebind'>
115 <input type='hidden' name='dhcpd_gwmode'>
116 <input type='hidden' name='dns_intcpt'>
117 <input type='hidden' name='dhcpc_minpkt'>
119 <div class='section-title'><% translate("DHCP / DNS Server"); %> (LAN)</div>
120 <div class='section'>
121 <script type='text/javascript'>
122 createFieldTable('', [
123 { title: '<% translate("Use internal DNS"); %>', name: 'f_dhcpd_dmdns', type: 'checkbox', value: nvram.dhcpd_dmdns == '1' },
124 { title: '<% translate("Use received DNS with user-entered DNS"); %>', name: 'f_dns_addget', type: 'checkbox', value: nvram.dns_addget == '1' },
125 { title: '<% translate("Prevent DNS-rebind attacks"); %>', name: 'f_dns_norebind', type: 'checkbox', value: nvram.dns_norebind == '1' },
126 { title: '<% translate("Intercept DNS port"); %><br>(UDP 53)', name: 'f_dns_intcpt', type: 'checkbox', value: nvram.dns_intcpt == '1' },
127 { title: '<% translate("Use user-entered gateway if WAN is disabled"); %>', name: 'f_dhcpd_gwmode', type: 'checkbox', value: nvram.dhcpd_gwmode == '1' },
128 { title: '<% translate("Maximum active DHCP leases"); %>', name: 'dhcpd_lmax', type: 'text', maxlen: 5, size: 8, value: nvram.dhcpd_lmax },
129 { title: '<% translate("Static lease time"); %>', multi: [
130 { name: 'f_dhcpd_sltsel', type: 'select', options: [[0,'<% translate("Same as normal lease time"); %>'],[-1,'"<% translate("Infinite"); %>"'],[1,'<% translate("Custom"); %>']],
131 value: (nvram.dhcpd_slt < 1) ? nvram.dhcpd_slt : 1 },
132 { name: 'f_dhcpd_slt', type: 'text', maxlen: 5, size: 8, prefix: '<span id="_dhcpd_sltman"> ', suffix: ' <i>(<% translate("minutes"); %>)</i></span>',
133 value: (nvram.dhcpd_slt >= 1) ? nvram.dhcpd_slt : 3600 } ] },
134 { title: '<a href="http://www.thekelleys.org.uk/" target="_new">Dnsmasq</a><br><% translate("Custom configuration"); %>', name: 'dnsmasq_custom', type: 'textarea', value: nvram.dnsmasq_custom }
136 </script>
137 <br>
138 <% translate("Note"); %>: <% translate("The file /etc/dnsmasq.custom is also added to the end of Dnsmasq's configuration file if it exists"); %>.
139 </div>
140 <br>
142 <div class='section-title'><% translate("DHCP Client"); %> (WAN)</div>
143 <div class='section'>
144 <script type='text/javascript'>
145 createFieldTable('', [
146 { title: '<% translate("DHCPC Options"); %>', name: 'dhcpc_custom', type: 'text', maxlen: 80, size: 34, value: nvram.dhcpc_custom },
147 { title: '<% translate("Reduce packet size"); %>', name: 'f_dhcpc_minpkt', type: 'checkbox', value: nvram.dhcpc_minpkt == '1' }
149 </script>
150 </div>
153 <!-- / / / -->
155 </td></tr>
156 <tr><td id='footer' colspan=2>
157 <span id='footer-msg'></span>
158 <input type='button' value='<% translate("Save"); %>' id='save-button' onclick='save()'>
159 <input type='button' value='<% translate("Cancel"); %>' id='cancel-button' onclick='javascript:reloadPage();'>
160 </td></tr>
161 </table>
162 </form>
163 <script type='text/javascript'>verifyFields(null, true);</script>
164 </body>
165 </html>