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_pppoe').disabled
= a
;
44 E('_f_log_sched').disabled
= a
;
46 elem
.display(PR('_log_remoteip'), b
);
47 E('_log_remoteip').disabled
= !b
;
48 E('_log_remoteport').disabled
= !b
;
51 if (!v_range('_log_limit', quiet
, 0, 2400)) return 0;
52 if (!v_range('_log_mark', quiet
, 0, 1440)) return 0;
54 if ((!v_ip('_log_remoteip', quiet
)) || (!v_port('_log_remoteport', quiet
))) return 0;
58 a
= E('_f_log_wm').checked
;
59 b
= E('_log_wmtype').value
!= 0;
60 E('_log_wmtype').disabled
= !a
;
61 E('_f_log_wmip').disabled
= !a
;
62 E('_log_wmdmax').disabled
= !a
;
63 E('_log_wmsmax').disabled
= !a
;
64 elem
.display(PR('_f_log_wmip'), b
);
68 if (!v_iptip('_f_log_wmip', quiet
, 15)) return 0;
70 if (!v_range('_log_wmdmax', quiet
, 0, 9999)) return 0;
71 if (!v_range('_log_wmsmax', quiet
, 0, 9999)) return 0;
81 if (!verifyFields(null, false)) return;
84 fom
.log_remote
.value
= E('_f_log_remote').checked
? 1 : 0;
85 fom
.log_file
.value
= E('_f_log_file').checked
? 1 : 0;
88 if (E('_f_log_acre').checked
) a
.push('acre');
89 if (E('_f_log_crond').checked
) a
.push('crond');
90 if (E('_f_log_dhcpc').checked
) a
.push('dhcpc');
91 if (E('_f_log_ntp').checked
) a
.push('ntp');
92 if (E('_f_log_pppoe').checked
) a
.push('pppoe');
93 if (E('_f_log_sched').checked
) a
.push('sched');
94 fom
.log_events
.value
= a
.join(',');
96 fom
.log_wm
.value
= E('_f_log_wm').checked
? 1 : 0;
97 fom
.log_wmip
.value
= fom
.f_log_wmip
.value
.split(/\s*,\s*/).join(',');
105 <form id='_fom' method='post' action='tomato.cgi'
>
106 <table id='container' cellspacing=
0>
107 <tr><td colspan=
2 id='header'
>
108 <div class='title'
>Tomato
</div>
109 <div class='version'
>Version <%
version(); %></div>
111 <tr id='body'
><td id='navi'
><script type='text/javascript'
>navi()</script></td>
113 <div id='ident'
><%
ident(); %></div>
117 <input type='hidden' name='_nextpage' value='admin-log.asp'
>
118 <input type='hidden' name='_service' value='logging-restart'
>
120 <input type='hidden' name='log_remote'
>
121 <input type='hidden' name='log_file'
>
122 <input type='hidden' name='log_events'
>
124 <input type='hidden' name='log_wm'
>
125 <input type='hidden' name='log_wmip'
>
127 <script type='text/javascript'
>
130 <div class='section-title'
>Syslog
</div>
131 <div class='section'
>
132 <script type='text/javascript'
>
136 if (nvram
.log_mark
>= 120) nvram
.log_mark
= 120;
137 else if (nvram
.log_mark
>= 60) nvram
.log_mark
= 60;
138 else if (nvram
.log_mark
> 0) nvram
.log_mark
= 30;
139 else nvram
.log_mark
= 0;
141 createFieldTable('', [
142 { title
: 'Log Internally', name
: 'f_log_file', type
: 'checkbox', value
: nvram
.log_file
== 1 },
143 { title
: 'Log To Remote System', name
: 'f_log_remote', type
: 'checkbox', value
: nvram
.log_remote
== 1 },
144 { title
: 'IP Address / Port', indent
: 2, multi
: [
145 { name
: 'log_remoteip', type
: 'text', maxlen
: 15, size
: 17, value
: nvram
.log_remoteip
, suffix
: ':' },
146 { name
: 'log_remoteport', type
: 'text', maxlen
: 5, size
: 7, value
: nvram
.log_remoteport
} ]},
147 { title
: 'Generate Marker', name
: 'log_mark', type
: 'select', options
: [[0,'Disabled'],[30,'Every 30 Minutes'],[60,'Every 1 Hour'],[120,'Every 2 Hours']], value
: nvram
.log_mark
},
148 { title
: 'Events Logged', text
: '<small>(some of the changes will take effect after a restart)</small>' },
149 { title
: 'Access Restriction', indent
: 2, name
: 'f_log_acre', type
: 'checkbox', value
: (nvram
.log_events
.indexOf('acre') != -1) },
150 { title
: 'Cron', indent
: 2, name
: 'f_log_crond', type
: 'checkbox', value
: (nvram
.log_events
.indexOf('crond') != -1) },
151 { title
: 'DHCP Client', indent
: 2, name
: 'f_log_dhcpc', type
: 'checkbox', value
: (nvram
.log_events
.indexOf('dhcpc') != -1) },
152 { title
: 'NTP', indent
: 2, name
: 'f_log_ntp', type
: 'checkbox', value
: (nvram
.log_events
.indexOf('ntp') != -1) },
153 { title
: 'PPPoE', indent
: 2, name
: 'f_log_pppoe', type
: 'checkbox', value
: (nvram
.log_events
.indexOf('pppoe') != -1) },
154 { title
: 'Scheduler', indent
: 2, name
: 'f_log_sched', type
: 'checkbox', value
: (nvram
.log_events
.indexOf('sched') != -1) },
155 { title
: 'Connection Logging' },
156 { 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
},
157 { 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
},
158 { 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>' }
163 <div class='section-title'
>Web Monitor
</div>
164 <div class='section'
>
165 <script type='text/javascript'
>
166 createFieldTable('', [
167 { title
: 'Monitor Web Usage', name
: 'f_log_wm', type
: 'checkbox', value
: nvram
.log_wm
== 1 },
168 { title
: 'Monitor', name
: 'log_wmtype', type
: 'select', options
: [[0,'All Computers / Devices'],[1,'The Following...'],[2,'All Except...']], value
: nvram
.log_wmtype
},
169 { title
: 'IP Address(es)', indent
: 2, name
: 'f_log_wmip', type
: 'text', maxlen
: 512, size
: 64, value
: nvram
.log_wmip
},
170 { title
: 'Number of Entries to remember' },
171 { title
: 'Domains', indent
: 2, name
: 'log_wmdmax', type
: 'text', maxlen
: 4, size
: 6, value
: nvram
.log_wmdmax
, suffix
: ' <small>(0 to disable)</small>' },
172 { title
: 'Searches', indent
: 2, name
: 'log_wmsmax', type
: 'text', maxlen
: 4, size
: 6, value
: nvram
.log_wmsmax
, suffix
: ' <small>(0 to disable)</small>' }
180 <tr><td id='footer' colspan=
2>
181 <span id='footer-msg'
></span>
182 <input type='button' value='Save' id='save-button' onclick='save()'
>
183 <input type='button' value='Cancel' id='cancel-button' onclick='javascript:reloadPage();'
>
187 <script type='text/javascript'
>verifyFields(null, 1);</script>