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"); %>
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
;
52 if (!v_range('_log_limit', quiet
, 0, 2400)) return 0;
53 if (!v_range('_log_mark', quiet
, 0, 1440)) return 0;
55 if ((!v_ip('_log_remoteip', quiet
)) || (!v_port('_log_remoteport', quiet
))) return 0;
64 if (!verifyFields(null, false)) return;
67 fom
.log_remote
.value
= E('_f_log_remote').checked
? 1 : 0;
68 fom
.log_file
.value
= E('_f_log_file').checked
? 1 : 0;
71 if (E('_f_log_acre').checked
) a
.push('acre');
72 if (E('_f_log_crond').checked
) a
.push('crond');
73 if (E('_f_log_dhcpc').checked
) a
.push('dhcpc');
74 if (E('_f_log_ntp').checked
) a
.push('ntp');
75 if (E('_f_log_pppoe').checked
) a
.push('pppoe');
76 if (E('_f_log_sched').checked
) a
.push('sched');
77 fom
.log_events
.value
= a
.join(',');
85 <form id='_fom' method='post' action='tomato.cgi'
>
86 <table id='container' cellspacing=
0>
87 <tr><td colspan=
2 id='header'
>
88 <div class='title'
>Tomato
</div>
89 <div class='version'
>Version <%
version(); %></div>
91 <tr id='body'
><td id='navi'
><script type='text/javascript'
>navi()</script></td>
93 <div id='ident'
><%
ident(); %></div>
97 <input type='hidden' name='_nextpage' value='admin-log.asp'
>
98 <input type='hidden' name='_service' value='logging-restart'
>
100 <input type='hidden' name='log_remote'
>
101 <input type='hidden' name='log_file'
>
102 <input type='hidden' name='log_events'
>
104 <script type='text/javascript'
>
107 <div class='section-title'
>Syslog
</div>
108 <div class='section'
>
109 <script type='text/javascript'
>
113 if (nvram
.log_mark
>= 120) nvram
.log_mark
= 120;
114 else if (nvram
.log_mark
>= 60) nvram
.log_mark
= 60;
115 else if (nvram
.log_mark
> 0) nvram
.log_mark
= 30;
116 else nvram
.log_mark
= 0;
118 createFieldTable('', [
119 { title
: 'Log Internally', name
: 'f_log_file', type
: 'checkbox', value
: nvram
.log_file
== 1 },
120 { title
: 'Log To Remote System', name
: 'f_log_remote', type
: 'checkbox', value
: nvram
.log_remote
== 1 },
121 { title
: 'IP Address / Port', indent
: 2, multi
: [
122 { name
: 'log_remoteip', type
: 'text', maxlen
: 15, size
: 17, value
: nvram
.log_remoteip
, suffix
: ':' },
123 { name
: 'log_remoteport', type
: 'text', maxlen
: 5, size
: 7, value
: nvram
.log_remoteport
} ]},
124 { 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
},
125 { title
: 'Events Logged', text
: '<small>(some of the changes will take effect after a restart)</small>' },
126 { title
: 'Access Restriction', indent
: 2, name
: 'f_log_acre', type
: 'checkbox', value
: (nvram
.log_events
.indexOf('acre') != -1) },
127 { title
: 'Cron', indent
: 2, name
: 'f_log_crond', type
: 'checkbox', value
: (nvram
.log_events
.indexOf('crond') != -1) },
128 { title
: 'DHCP Client', indent
: 2, name
: 'f_log_dhcpc', type
: 'checkbox', value
: (nvram
.log_events
.indexOf('dhcpc') != -1) },
129 { title
: 'NTP', indent
: 2, name
: 'f_log_ntp', type
: 'checkbox', value
: (nvram
.log_events
.indexOf('ntp') != -1) },
130 { title
: 'PPPoE', indent
: 2, name
: 'f_log_pppoe', type
: 'checkbox', value
: (nvram
.log_events
.indexOf('pppoe') != -1) },
131 { title
: 'Scheduler', indent
: 2, name
: 'f_log_sched', type
: 'checkbox', value
: (nvram
.log_events
.indexOf('sched') != -1) },
132 { title
: 'Connection Logging' },
133 { 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
},
134 { 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
},
135 { 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>' }
143 <tr><td id='footer' colspan=
2>
144 <span id='footer-msg'
></span>
145 <input type='button' value='Save' id='save-button' onclick='save()'
>
146 <input type='button' value='Cancel' id='cancel-button' onclick='javascript:reloadPage();'
>
150 <script type='text/javascript'
>verifyFields(null, 1);</script>