1 <!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML
4.0//EN'
>
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.
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>
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
)
31 a
= E('_f_log_file').checked
;
32 b
= E('_f_log_remote').checked
;
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
;
50 if (!v_range('_log_limit', quiet
, 0, 2400)) return 0;
51 if (!v_range('_log_mark', quiet
, 0, 99999)) return 0;
53 c
= E('_log_remoteip');
54 if (!v_ip(c
, 1) && !v_domain(c
, 1)) {
55 if (!quiet
) ferror
.show(c
);
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
);
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;
85 if (!verifyFields(null, false)) return;
88 fom
.log_remote
.value
= E('_f_log_remote').checked
? 1 : 0;
89 fom
.log_file
.value
= E('_f_log_file').checked
? 1 : 0;
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(',');
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>
114 <tr id='body'
><td id='navi'
><script type='text/javascript'
>navi()</script></td>
116 <div id='ident'
><%
ident(); %></div>
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'
>
133 <div class='section-title'
>Syslog
</div>
134 <div class='section'
>
135 <script type='text/javascript'
>
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;
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>' }
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>' }
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();'
>
192 <script type='text/javascript'
>verifyFields(null, 1);</script>