WLAN can now be assigned to any LAN bridge. Changing VLAN/bridge settings no longer...
[tomato.git] / release / src / router / www / admin-log.asp
blob32708e980140d0ec46ceaae388ee33444d301772
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(); %>] Admin: Logging</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 <script type='text/javascript' src='debug.js'></script>
23 <script type='text/javascript'>
25 // <% nvram("log_remote,log_remoteip,log_remoteport,log_file,log_limit,log_in,log_out,log_mark,log_events,log_wm,log_wmtype,log_wmip,log_wmdmax,log_wmsmax"); %>
27 function verifyFields(focused, quiet)
29 var a, b, c;
31 a = E('_f_log_file').checked;
32 b = E('_f_log_remote').checked;
34 a = !(a || b);
35 E('_log_in').disabled = a;
36 E('_log_out').disabled = a;
37 E('_log_limit').disabled = a;
38 E('_log_mark').disabled = a;
39 E('_f_log_acre').disabled = a;
40 E('_f_log_crond').disabled = a;
41 E('_f_log_dhcpc').disabled = a;
42 E('_f_log_ntp').disabled = a;
43 E('_f_log_sched').disabled = a;
45 elem.display(PR('_log_remoteip'), b);
46 E('_log_remoteip').disabled = !b;
47 E('_log_remoteport').disabled = !b;
49 if (!a) {
50 if (!v_range('_log_limit', quiet, 0, 2400)) return 0;
51 if (!v_range('_log_mark', quiet, 0, 99999)) return 0;
52 if (b) {
53 c = E('_log_remoteip');
54 if (!v_ip(c, 1) && !v_domain(c, 1)) {
55 if (!quiet) ferror.show(c);
56 return 0;
58 if (!v_port('_log_remoteport', quiet)) return 0;
62 a = E('_f_log_wm').checked;
63 b = E('_log_wmtype').value != 0;
64 E('_log_wmtype').disabled = !a;
65 E('_f_log_wmip').disabled = !a;
66 E('_log_wmdmax').disabled = !a;
67 E('_log_wmsmax').disabled = !a;
68 elem.display(PR('_f_log_wmip'), b);
70 if (a) {
71 if (b) {
72 if (!_v_iptaddr('_f_log_wmip', quiet, 15, 1, 1)) return 0;
74 if (!v_range('_log_wmdmax', quiet, 0, 9999)) return 0;
75 if (!v_range('_log_wmsmax', quiet, 0, 9999)) return 0;
78 return 1;
81 function save()
83 var a, fom;
85 if (!verifyFields(null, false)) return;
87 fom = E('_fom');
88 fom.log_remote.value = E('_f_log_remote').checked ? 1 : 0;
89 fom.log_file.value = E('_f_log_file').checked ? 1 : 0;
91 a = [];
92 if (E('_f_log_acre').checked) a.push('acre');
93 if (E('_f_log_crond').checked) a.push('crond');
94 if (E('_f_log_dhcpc').checked) a.push('dhcpc');
95 if (E('_f_log_ntp').checked) a.push('ntp');
96 if (E('_f_log_sched').checked) a.push('sched');
97 fom.log_events.value = a.join(',');
99 fom.log_wm.value = E('_f_log_wm').checked ? 1 : 0;
100 fom.log_wmip.value = fom.f_log_wmip.value.split(/\s*,\s*/).join(',');
102 form.submit(fom, 1);
104 </script>
106 </head>
107 <body>
108 <form id='_fom' method='post' action='tomato.cgi'>
109 <table id='container' cellspacing=0>
110 <tr><td colspan=2 id='header'>
111 <div class='title'>Tomato</div>
112 <div class='version'>Version <% version(); %></div>
113 </td></tr>
114 <tr id='body'><td id='navi'><script type='text/javascript'>navi()</script></td>
115 <td id='content'>
116 <div id='ident'><% ident(); %></div>
118 <!-- / / / -->
120 <input type='hidden' name='_nextpage' value='admin-log.asp'>
121 <input type='hidden' name='_service' value='logging-restart'>
123 <input type='hidden' name='log_remote'>
124 <input type='hidden' name='log_file'>
125 <input type='hidden' name='log_events'>
127 <input type='hidden' name='log_wm'>
128 <input type='hidden' name='log_wmip'>
130 <script type='text/javascript'>
131 </script>
133 <div class='section-title'>Syslog</div>
134 <div class='section'>
135 <script type='text/javascript'>
137 /* REMOVE-BEGIN
138 // adjust (>=1.22)
139 nvram.log_mark *= 1;
140 if (nvram.log_mark >= 120) nvram.log_mark = 120;
141 else if (nvram.log_mark >= 60) nvram.log_mark = 60;
142 else if (nvram.log_mark > 0) nvram.log_mark = 30;
143 else nvram.log_mark = 0;
144 REMOVE-END */
146 createFieldTable('', [
147 { title: 'Log Internally', name: 'f_log_file', type: 'checkbox', value: nvram.log_file == 1 },
148 { title: 'Log To Remote System', name: 'f_log_remote', type: 'checkbox', value: nvram.log_remote == 1 },
149 { title: 'Host or IP Address / Port', indent: 2, multi: [
150 { name: 'log_remoteip', type: 'text', maxlen: 15, size: 17, value: nvram.log_remoteip, suffix: ':' },
151 { name: 'log_remoteport', type: 'text', maxlen: 5, size: 7, value: nvram.log_remoteport } ]},
152 { title: 'Generate Marker', name: 'log_mark', type: 'select', options: [[0,'Disabled'],[30,'Every 30 Minutes'],[60,'Every 1 Hour'],[120,'Every 2 Hours'],[360,'Every 6 Hours'],[720,'Every 12 Hours'],[1440,'Every 1 Day'],[10080,'Every 7 Days']], value: nvram.log_mark },
153 { title: 'Events Logged', text: '<small>(some of the changes will take effect after a restart)</small>' },
154 { title: 'Access Restriction', indent: 2, name: 'f_log_acre', type: 'checkbox', value: (nvram.log_events.indexOf('acre') != -1) },
155 { title: 'Cron', indent: 2, name: 'f_log_crond', type: 'checkbox', value: (nvram.log_events.indexOf('crond') != -1) },
156 { title: 'DHCP Client', indent: 2, name: 'f_log_dhcpc', type: 'checkbox', value: (nvram.log_events.indexOf('dhcpc') != -1) },
157 { title: 'NTP', indent: 2, name: 'f_log_ntp', type: 'checkbox', value: (nvram.log_events.indexOf('ntp') != -1) },
158 { title: 'Scheduler', indent: 2, name: 'f_log_sched', type: 'checkbox', value: (nvram.log_events.indexOf('sched') != -1) },
159 { title: 'Connection Logging' },
160 { title: 'Inbound', indent: 2, name: 'log_in', type: 'select', options: [[0,'Disabled (recommended)'],[1,'If Blocked By Firewall'],[2,'If Allowed By Firewall'],[3,'Both']], value: nvram.log_in },
161 { title: 'Outbound', indent: 2, name: 'log_out', type: 'select', options: [[0,'Disabled (recommended)'],[1,'If Blocked By Firewall'],[2,'If Allowed By Firewall'],[3,'Both']], value: nvram.log_out },
162 { title: 'Limit', indent: 2, name: 'log_limit', type: 'text', maxlen: 4, size: 5, value: nvram.log_limit, suffix: ' <small>(messages per minute / 0 for unlimited)</small>' }
164 </script>
165 </div>
167 <div class='section-title'>Web Monitor</div>
168 <div class='section'>
169 <script type='text/javascript'>
170 createFieldTable('', [
171 { title: 'Monitor Web Usage', name: 'f_log_wm', type: 'checkbox', value: nvram.log_wm == 1 },
172 { title: 'Monitor', name: 'log_wmtype', type: 'select', options: [[0,'All Computers / Devices'],[1,'The Following...'],[2,'All Except...']], value: nvram.log_wmtype },
173 { title: 'IP Address(es)', indent: 2, name: 'f_log_wmip', type: 'text', maxlen: 512, size: 64, value: nvram.log_wmip,
174 suffix: '<br><small>(ex: "1.1.1.1", "1.1.1.0/24" or "1.1.1.1 - 2.2.2.2")</small>' },
175 { title: 'Number of Entries to remember' },
176 { title: 'Domains', indent: 2, name: 'log_wmdmax', type: 'text', maxlen: 4, size: 6, value: nvram.log_wmdmax, suffix: ' <small>(0 to disable)</small>' },
177 { title: 'Searches', indent: 2, name: 'log_wmsmax', type: 'text', maxlen: 4, size: 6, value: nvram.log_wmsmax, suffix: ' <small>(0 to disable)</small>' }
179 </script>
180 </div>
182 <!-- / / / -->
184 </td></tr>
185 <tr><td id='footer' colspan=2>
186 <span id='footer-msg'></span>
187 <input type='button' value='Save' id='save-button' onclick='save()'>
188 <input type='button' value='Cancel' id='cancel-button' onclick='javascript:reloadPage();'>
189 </td></tr>
190 </table>
191 </form>
192 <script type='text/javascript'>verifyFields(null, 1);</script>
193 </body>
194 </html>