summaryrefslogtreecommitdiff
path: root/cleopatre/application/spidgoahead/web/br0.asp
blob: 3fdf176b5a3ff7ac4ee3b9530dca5dbaab676034 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
<html>

<head>
	<title>SPC 300 - SPiDCOM</title>

<link rel="stylesheet" href="style/normal_ws.css" type="text/css">

<style type = 'text/css'>
div.margina,table.margina{
	margin-left:5%;
	width:500px;
	background-color:#F5F5F5;
}
td{
	padding-left:5px;
}

input[type='text']{
	margin-left:auto;
	margin-right:auto;
	text-align:center;
}
input[disabled='disabled'] {
  background-color:BBBBBB;
  color:white;
  cursor:default;
}
body{
   background-image: url("/spidcom.gif");
   background-repeat: no-repeat;
   background-attachment: fixed;
   background-position: center center;
}

</style>
	
<script type='text/javascript'>

var mac = <% spidcomAspGetMac('br0'); %>
var ip_data = <% spidcomAspGetIpData('br0'); %>


//var online_station = '< % spidcomAspEocGetTopo(); % >';
//var station_array = online_station.split('-');


var ip_data_array = ip_data.split(':');

var ip_array;
var nm_array;
var gw_array;

if(ip_data_array[1].length == 0)
        ip_array = new Array("0","0","0","0")
else
        ip_array = ip_data_array[1].split('.');

if(ip_data_array[2].length == 0)
        nm_array = new Array("0","0","0","0")
else
        nm_array = ip_data_array[2].split('.');

if(ip_data_array[4].length == 0)
        gw_array = new Array("0","0","0","0")
else
        gw_array = ip_data_array[4].split('.');



var dhcp = ip_data_array[0];
var mac_array = mac.split(':');



function validate()
{
	parent.footer2.document.getElementById('error_console').innerHTML = "";
	
	if(ip_data.indexOf("error") >= 0) 	// error
		parent.footer2.document.getElementById('error_console').innerHTML += "<small style='margin-left:3px'>IP data : error condition: " + ip_data.toString() + "</small><br>";
	else
		parent.footer2.document.getElementById('error_console').innerHTML += "<small style='margin-left:3px'>IP data : OK</small><br>";
	
	if(mac.indexOf("error") >= 0) 	// error
		parent.footer2.document.getElementById('error_console').innerHTML += "<small style='margin-left:3px'>MAC : error condition: " + mac.toString() + "</small><br>";
	else
		parent.footer2.document.getElementById('error_console').innerHTML += "<small style='margin-left:3px'>MAC : OK</small><br>";
		
	/*
	if(online_station.indexOf("error") >= 0) 	// error
		parent.footer2.document.getElementById('error_console').innerHTML += "<code>Online station : error condition: " + mac.toString(); + "</code><br>";
	else
		parent.footer2.document.getElementById('error_console').innerHTML += "<code>Online station : OK</code><br>";
		*/
}	


function showTip(){
document.getElementById('tooltip').innerHTML = "You must restart modem for the changes to take effect";
}

function clearTip(){
document.getElementById('tooltip').innerHTML = "";
}

function reboot_flag()
{
	document.getElementById('reboot').value = 'yes';
}

function refresh(){
parent.content.location.reload();
}


function joinadd(){
document.getElementById('ip').value = document.getElementById('ipe1').value + '.' + document.getElementById('ipe2').value + '.' + document.getElementById('ipe3').value + '.' + document.getElementById('ipe4').value;
document.getElementById('nm').value = document.getElementById('nete1').value + '.' + document.getElementById('nete2').value + '.' + document.getElementById('nete3').value + '.' + document.getElementById('nete4').value;
document.getElementById('gw').value = document.getElementById('gwe1').value + '.' + document.getElementById('gwe2').value + '.' + document.getElementById('gwe3').value + '.' + document.getElementById('gwe4').value;
}

function set_refresh(){

if (document.getElementById('refresh_or_not').checked)
    document.getElementById("stat_iframe").contentWindow.RestartRefresh();
else
    document.getElementById('stat_iframe').contentWindow.StopRefresh();
}

function checkMainForm(){
	return true;
}

function fill_ip_data()
{

var idip = 'ipe';
var idnet = 'nete';
var idgw = 'gwe';
var idmac = 'mace'

for (var i=1;i<=4;i++)
{
document.getElementById(idip+i).value = ip_array[i-1];
document.getElementById(idnet+i).value = nm_array[i-1];
document.getElementById(idgw+i).value = gw_array[i-1];
document.getElementById(idmac+i).value = mac_array[i-1];
}
document.getElementById(idmac+5).value = mac_array[4];
document.getElementById(idmac+6).value = mac_array[5];


if (dhcp == 'DHCP')
	document.mainForm.dhcp[0].checked = 'checked';

	
	joinadd();
}
</script>
</head>


<body onload='javascript:validate();fill_ip_data();'>
<!-- Settings name -->
<div class='margina' > <h2>Bridge configuration</h2></div>

<!-- Main form -->

<form name='mainForm' action='/goform/formAction' target='_self' method='GET' onSubmit='return checkMainForm();'>

<input type='hidden' name='reboot' id='reboot' value='no'/>			<!--	This will be passed by form	-->
<input type='hidden' name='inter' id='inter' value='br0'/>			<!--	This will be passed by form	-->


<table name = 'ipData' class='margina' style='background-color:#FFFFFF' border='0'>
<tr> 
<td><h3>Network configuration</h3></td>
</tr>
<tr> 
<td>Current IP address</td>
<td></td><td></td>
<td><input id='ipe1' type='text' size=3 maxlength=3 value='0'/> </td>
<td><input id='ipe2' type='text' size=3 maxlength=3 value='0'/> </td>
<td><input id='ipe3' type='text' size=3 maxlength=3 value='0'/> </td>
<td><input id='ipe4' type='text' size=3 maxlength=3 value='0'/> </td>
<td><input type='hidden' name='ip' id='ip' value='0'/> </td>		<!--	This will be passed by form	-->
</tr>

<tr>
<td>Current netmask</td>
<td></td><td></td>
<td><input id='nete1' type='text' size=3 maxlength=3 value='0'/> </td>
<td><input id='nete2' type='text' size=3 maxlength=3 value='0'/> </td>
<td><input id='nete3' type='text' size=3 maxlength=3 value='0'/> </td>
<td><input id='nete4' type='text' size=3 maxlength=3 value='0'/> </td>
<td><input type='hidden' name='nm' id='nm' value='0'/> </td>		<!--	This will be passed by form	-->
</tr>
<tr>
<td>Current gateway address</td>
<td></td><td></td>
<td><input id='gwe1' type='text' size=3 maxlength=3 value='0'/> </td>
<td><input id='gwe2' type='text' size=3 maxlength=3 value='0'/> </td>
<td><input id='gwe3' type='text' size=3 maxlength=3 value='0'/> </td>
<td><input id='gwe4' type='text' size=3 maxlength=3 value='0'/> </td>
<td><input type='hidden' id='gw' name='gw' value='0'/> </td>		<!--	This will be passed by form	-->
</tr>
<tr align='center'>
<td align='left'>MAC address</td>

<td><input disabled='disabled' id='mace1' type='text' size=2 maxlength=2 value='0'/> </td>
<td><input disabled='disabled' id='mace2' type='text' size=2 maxlength=2 value='0'/> </td>
<td><input disabled='disabled' id='mace3' type='text' size=2 maxlength=2 value='0'/> </td>
<td><input disabled='disabled' id='mace4' type='text' size=2 maxlength=2 value='0'/> </td>
<td><input disabled='disabled' id='mace5' type='text' size=2 maxlength=2 value='0'/> </td>
<td><input disabled='disabled' id='mace6' type='text' size=2 maxlength=2 value='0'/> </td>
</tr>
<tr>
<td>DHCP Mode</td>
<td></td><td></td><td></td><td></td>
<td><input type='radio' name='dhcp' value='dhcp'/>ON</td>
<td><input type='radio' name='dhcp' value='static' checked='checked'/>OFF</td> 
</tr>

</table>

<div class='margina'><h2>Activity statistics</h2></div>
<table id='background-image' class='d25' style='margin-left:5%;width:500px' border='0'> <tr align='center'><td colspan='2'>RX:</td><td colspan='2'>TX:</td></tr>
<tr><td class='d25' >Bytes</td><td class='d25'  id='rb' bgcolor='lavender' align='center'></td><td>Bytes</td> <td class='d25'  id = 'tb' bgcolor='lavender' align='center'></td></tr>
<tr><td class='d25' >Packets</td><td class='d25'  id='rp' bgcolor='lavender' align='center'></td><td>Packets</td> <td class='d25'  id = 'tp' bgcolor='lavender' align='center'></td></tr>
<tr><td class='d25' >Errors</td><td class='d25'  id='re' bgcolor='lavender' align='center'></td><td>Errors</td> <td class='d25'  id = 'te' bgcolor='lavender' align='center'></td></tr>
<tr><td class='d25' >Drops</td><td class='d25'  id='rd' bgcolor='lavender' align='center'></td><td>Drops</td> <td class='d25'  id = 'td' bgcolor='lavender' align='center'></td></tr>
<tr><td class='d25' >Fifo</td><td class='d25'  id='rf' bgcolor='lavender' align='center'></td><td>Fifo</td> <td class='d25'  id = 'tf' bgcolor='lavender' align='center'></td></tr>
<tr><td class='d25' >Frame</td><td class='d25'  id='rfr' bgcolor='lavender' align='center'></td><td>Colls</td> <td class='d25'  id = 'tc' bgcolor='lavender' align='center'></td></tr>
<tr><td class='d25' >Compressed</td><td class='d25'  id='rc' bgcolor='lavender' align='center'></td><td>Carrier</td> <td class='d25'  id = 'tcar' bgcolor='lavender' align='center'></td></tr>
<tr><td class='d25' >Multicast</td><td class='d25'  id='rm' bgcolor='lavender' align='center'></td><td>Compressed</td> <td class='d25'  id = 'tcom' bgcolor='lavender' align='center'></td></tr>


</table>
<div class='margina' align='right'>
Auto refresh<input type='checkbox' name='refresh_or_not' id='refresh_or_not'  onchange='set_refresh();' checked='checked' >
</div>

<div class='margina' style='margin-top:5px' align='right'>
<pre ></pre>
<input type='button' value='Refresh' onclick='javascript:refresh();'>
<input type='submit' onclick='javascript:joinadd();' value='Save configuration' onmouseover='javascript:showTip();' onmouseout='javascript:clearTip();'/>
<input type='submit' value='Restart the modem' onclick='javascript:reboot_flag();'/>
<pre  id ='tooltip'></pre>
</div>


</form>







<iframe id='stat_iframe' name='stat_iframe'  src ="stat.asp?interface=br0" frameborder='0' height='5'>
  <p>Your browser does not support iframes.</p>
</iframe>
</body>
</html>