www.usr.com/support/gpl/USR9108_release1.5.tar.gz
[bcm963xx.git] / userapps / broadcom / cfm / html / logconfig.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2 <!--
3         (c) 2005 U.S. Robotics Corporation
4 -->
5 <html>
6 <head>
7         <title></title>
8
9         <link href="usr_main.css" rel="stylesheet" type="text/css">
10         <link href="usr_menus.css" rel="stylesheet" type="text/css"><script src="usr_menus.js" type="text/javascript"></script><script src="usr_menus_build.js" type="text/javascript"></script>
11         <script src="usr_common.js" type="text/javascript"></script>
12
13         <meta HTTP-EQUIV='Pragma' CONTENT='no-cache'>
14
15 <script type="text/javascript" src="util.js"></script>
16 <script type="text/javascript">
17 <!-- hide
18 setPageTitle("<%ejGetWlJS(wlInterface)%>");
19
20 var addr = '<%ejGetJS(logIpAddress)%>';
21 var port = '<%ejGetJS(logPort)%>';
22
23 function getLogPort() {
24    var portNum = parseInt(port);
25    if ( isNaN(portNum) || portNum == 0 )
26       portNum = 514; // default system log server port is 514
27
28    return portNum;
29 }
30
31 function frmLoad() {
32    with ( document.forms[0] ) {
33       status[<%ejGetJS(logStatus)%>].checked = true;
34
35       levelLog.selectedIndex = <%ejGetJS(logLevel)%>;
36       levelDisplay.selectedIndex = <%ejGetJS(logDisplay)%>;
37
38       logMode.selectedIndex = <%ejGetJS(logMode)%> - 1;
39       if ( logMode.selectedIndex == 0 ) {
40          logAddr.value = '';
41          logPort.value = '';
42          hideInfo(1);
43       } else {
44          logAddr.value = addr;
45          logPort.value = getLogPort();
46          hideInfo(0);
47       }
48    }
49 }
50
51 function btnApply() {
52    var loc = 'logintro.cgi?';
53    var idx, log, display, mode;
54
55    with ( document.forms[0] ) {
56       if ( status[0].checked == true ) {
57          var msg = 'If disabled, the information captured by the ';
58          msg += 'router will be lost. If you wish to save ';
59          msg += 'the current log information, click the ';
60          msg += '"Cancel" button, view the current system ';
61          msg += 'log, and use the Save option from the File ';
62          msg += 'menu to save the log data.';
63          if ( confirm(msg) == false )
64             return;
65       }
66
67       if ( status[1].checked == true )
68          loc += 'logStatus=1';
69       else
70          loc += 'logStatus=0';
71       idx = levelLog.selectedIndex;
72       log = levelLog.options[idx].value;
73       idx = levelDisplay.selectedIndex;
74       display = levelDisplay.options[idx].value;
75       idx = logMode.selectedIndex;
76       mode = logMode.options[idx].value;
77       if ( mode == 1 ) {
78          valAddr = addr;
79          valPort = getLogPort();
80       } else {
81          if ( isValidIpAddress(logAddr.value) == false ) {
82             alert('Server IP address "' + logAddr.value + '" is invalid IP address.');
83             return;
84          }
85          if ( isNaN(logPort.value) == true ) {
86             alert('Server UDP port "' + logPort.value + '" is invalid.');
87             return;
88          }
89          valAddr = logAddr.value;
90          valPort = logPort.value;
91       }
92       loc += '&logLevel=' + log;
93       loc += '&logDisplay=' + display;
94       loc += '&logMode=' + mode;
95       loc += '&logIpAddress=' + valAddr;
96       loc += '&logPort=' + valPort;
97    }
98
99    var code = 'location = "' + loc + '"';
100    eval(code);
101 }
102
103 function hideInfo(hide) {
104    var status = 'visible';
105
106    if ( hide == 1 ) {
107       status = 'hidden';
108       document.forms[0].logAddr.value = '';
109       document.forms[0].logPort.value = '';
110    } else {
111       document.forms[0].logAddr.value = addr;
112       document.forms[0].logPort.value = getLogPort();
113    }
114
115    if (document.getElementById)  // DOM3 = IE5, NS6
116       document.getElementById('srvInfo').style.visibility = status;
117    else {
118       if (document.layers) { // Netscape 4
119          if ( hide == 1 ) {
120             document.forms[0].logAddr.value = '';
121             document.forms[0].logPort.value = '';
122          }
123       } else  // IE 4
124          document.all.srvInfo.style.visibility = status;
125    }
126 }
127
128 function cbClick(obj) {
129    var idx = obj.selectedIndex;
130    var val = obj.options[idx].value;
131    if ( val == 1 )
132       hideInfo(1);
133    else
134       hideInfo(0);
135 }
136
137 // done hiding -->
138 </script>
139 </head>
140
141 <body onload="initMenu(); frmLoad();">
142
143 <script type="text/javascript">
144         writeHeader("System Log");
145 </script>
146
147
148 <form>
149 <h3>Configuration</h3>
150
151         <p>This dialog allows you to configure System Log settings. All events greater than
152         or equal to the selected level will be logged or displayed. If the selected mode
153         is <b>Remote</b> or <b>Both</b> events will be sent to the specified
154         UDP port of the specified log server.</p>
155
156         <p>Select the desired values and press  <b>Apply</b> to configure the system log options.</p>
157
158         <p>
159             <input name='status' id="optStatusDisable" type='radio'> <label for="optStatusDisable">Disable log</label><br/>
160             <input name='status' id="optStatusEnable" type='radio'> <label for="optStatusEnable">Enable log</label>
161         </p>
162
163         <table border="0" cellpadding="2" cellspacing="0">
164           <tr>
165             <td><label for="">Log level:</label></td>
166             <td colspan=2><select name='levelLog' id='levelLog' size=1>
167               <option value=0>Emergency</option>
168               <option value=1>Alert</option>
169               <option value=2>Critical</option>
170               <option value=3>Error</option>
171               <option value=4>Warning</option>
172               <option value=5>Notice</option>
173               <option value=6>Informational</option>
174               <option value=7>Debugging</option>
175             </select></td>
176           </tr>
177           <tr>
178             <td><label for="">Display level:</label></td>
179             <td colspan=2><select name='levelDisplay' id='levelDisplay' size=1>
180               <option value=0>Emergency</option>
181               <option value=1>Alert</option>
182               <option value=2>Critical</option>
183               <option value=3>Error</option>
184               <option value=4>Warning</option>
185               <option value=5>Notice</option>
186               <option value=6>Informational</option>
187               <option value=7>Debugging</option>
188             </select></td>
189           </tr>
190           <tr>
191             <td><label for="">Mode:</label></td>
192             <td colspan=2><select name='logMode' id='logMode' size=1 onClick='cbClick(this)'>
193               <option value=1>Local</option>
194               <option value=2>Remote</option>
195               <option value=3>Both</option>
196             </select></td>
197           </tr>
198
199                 <div id='srvInfo'>
200                   <tr>
201                     <td><label for="logAddr">Server IP address:</label></td>
202                     <td><input type='text' name='logAddr' id='logAddr'></td>
203                   </tr>
204                   <tr>
205                     <td><label for="logPort">Server UDP port:</label></td>
206                     <td><input type='text' name='logPort' id='logPort'></td>
207                   </tr>
208                 </div>
209         </table>
210
211         <p><input type='button' onClick='btnApply()' value='Apply'></p>
212 </form>
213
214 <script type="text/javascript">
215         writeFooter();
216 </script>
217
218 </body>
219 </html>