add added files
[bcm963xx.git] / userapps / broadcom / cfm / html / portmapedit.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         <script src="usr_menus.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="portName.js"></script>
16         <script type="text/javascript">
17 <!-- hide
18 setPageTitle("<%ejGetWl(wlInterface)%>");
19
20 var groupName = '<%ejGetOther(getPMapGroupName)%>';
21
22 function frmLoad() {
23    with ( document.choiceForm ) {
24       var gName = '<%ejGetOther(getPMapGroupName)%>';
25       if ( groupName == gName )
26          groupName = '';
27       else
28          txtGroupName.value = groupName;
29    }
30 }
31
32 function btnRemove() {
33    with ( document.choiceForm ) {
34       var arrSelected = new Array();
35       var count = 0;
36       for ( i = 0; i < lstChoice.options.length; i++ ) {
37          if ( lstChoice.options[i].selected == true ) {
38             arrSelected[count] = lstChoice.options[i].value;
39             //varOpt = new Option(lstChoice.options[i].text, lstChoice.options[i].value);
40             //lstAvailable.options[lstAvailable.length] = varOpt;
41             //lstChoice.options[i] = null;
42          }
43          count++;
44       }
45       var x = 0;
46       for (i = 0; i < lstChoice.options.length; i++) {
47          for (x = 0; x < arrSelected.length; x++) {
48             if (lstChoice.options[i].value == arrSelected[x]) {
49                varOpt = new Option(lstChoice.options[i].text, lstChoice.options[i].value);
50                lstAvailable.options[lstAvailable.length] = varOpt;
51                lstChoice.options[i] = null;
52             }
53          }
54       }
55    }
56 }
57
58 function btnAdd() {
59    with ( document.choiceForm ) {
60       var arrSelected = new Array();
61       var count = 0;
62       for ( i = 0; i < lstAvailable.options.length; i++ ) {
63          if ( lstAvailable.options[i].selected == true ) {
64             arrSelected[count] = lstAvailable.options[i].value;
65          }
66          count++;
67       }
68       var x = 0;
69       for (i = 0; i < lstAvailable.options.length; i++) {
70          for (x = 0; x < arrSelected.length; x++) {
71             if (lstAvailable.options[i].value == arrSelected[x]) {
72                varOpt = new Option(lstAvailable.options[i].text, lstAvailable.options[i].value);
73                lstChoice.options[lstChoice.length] = varOpt;
74                lstAvailable.options[i] = null;
75             }
76          }
77       }
78    }
79 }
80
81 function btnApply() {
82    var loc = 'portmapcfg.cmd?action=edit';
83    with ( document.forms[0] ) {
84       var i = 0;
85
86       loc += '&groupName=' + '<%ejGetOther(getPMapGroupName)%>';
87       var ifc = '';
88       var tempList = '';
89       var interfaces = '';
90       var brdId = '<%ejGet(boardID)%>';
91       if (lstChoice.length == 0) {
92          alert('Need to provide at least one interface "Select one from the Available list."');
93          return;
94       }
95       for (i = 0; i < lstChoice.length; i++ ) {
96          if (lstChoice.options[i].value == '')
97             continue;
98          tempList += lstChoice.options[i].value + '|';
99       }
100       interfaces = tempList.split('|');
101       interfaces.sort();
102       for (i = 0; i < interfaces.length; i++) {
103          ifc += getLNameByUName(brdId + '|' + interfaces[i]) + '|';
104       }
105       loc += '&choiceBox=' + ifc;
106    }
107    var code = 'location.assign("' + loc + '")';
108    eval(code);
109 }
110
111         // done hiding -->
112         </script>
113 </head>
114 <body onload="initMenu('idMenu'); frmLoad();">
115
116 <script type="text/javascript">
117         writeHeader("Port Mapping", "<%ejGet(curUserName)%>", "<%ejGetOther(sysInfo, adslStd)%>", "<%ejGetOther(sysInfo, noBrPrtcl)%>", <%ejGetOther(sysInfo, pppIpExtension)%>, <%ejGetOther(sysInfo, enblFirewall)%>, <%ejGetOther(sysInfo, enblNat)%>, "<%ejGetWl(wlInterface)%>", <%ejGet(enblQos)%>);
118 </script>
119
120 <form name="choiceForm">
121    <h3>Edit</h3>
122
123    <p>To edit the port mapping configuration:</p>
124
125         <ol>
126                 <li>To add interfaces to the grouped list, select the interfaces in the
127                 <b>Available interfaces</b> list.</li>
128                 <li>Use the right arrow button to move the selected interfaces to the grouped list.</li>
129                 <li>To remove the interfaces, select the interface in the <b>Grouped interfaces</b> list
130                 and press the left arrow button.</li>
131
132                 <li>Press the <b>Save</b> button to make the changes effective.</li>
133         </ol>
134
135    <p><b>Note:</b> The selected interfaces will be removed from their
136    existing groups and added to the new group.</p>
137
138         <p><label for="">Group name:</label> <b><%ejGetOther(getPMapGroupName)%></b></p>
139
140    <table border="0" cellpadding="0" cellspacing="0">
141       <tr>
142          <td><label for="">Available interfaces:</label></td>
143          <td></td>
144          <td><label for="">Grouped interfaces:</label></td>
145       </tr>
146       <tr>
147                    <td>
148                        <select multiple name="lstAvailable" size="10" style="width: 100">
149 <script type="text/javascript">
150 <!-- hide
151 {
152    var i = 0;
153    var interfaceInfo = '';
154    var dispName = '';
155    var brdId = '<%ejGet(boardID)%>';
156    if (groupName == '') {
157       interfaceInfo = '<%ejGetOther(bridgeInterfaceInfo, all)%>';
158    } else {
159       interfaceInfo = '<%ejGetOther(bridgeInterfaceInfo, group)%>';
160    }
161    var interfaces = interfaceInfo.split('|');
162    interfaces.sort();
163    for ( i = 0; i < interfaces.length; i++ ) {
164       if (interfaces[i] != '') {
165          document.write("  <option value='" + interfaces[i] + "'>");
166       }
167       dispName = getUNameByLName(brdId + '|' + interfaces[i]);
168       document.writeln(dispName);
169    }
170 }
171 // done hiding -->
172 </script>
173           </select>
174       </td>
175                    <td>
176                       <table border="0" cellpadding="0" cellspacing="5">
177                          <tr><td>
178                             <input type="button" value="->" onClick="btnAdd()" style="width: 30; height: 30">
179                          </td></tr>
180                          <tr><td>
181                             <input type="button" value="<-" onClick="btnRemove()" style="width: 30; height: 30">
182                          </td></tr>
183                       </table>
184                    </td>
185          <td>
186              <select multiple name="lstChoice" id="lstChoice" size="10">
187 <script type="text/javascript">
188 <!-- hide
189 {
190    if ( groupName != '' ) {
191       var i = 0;
192       var brdId = '<%ejGet(boardID)%>';
193       var dispName = '';
194       var grpedIntfInfo = '<%ejGetOther(bridgeGroupInfo, group)%>';
195       var grpedInterfaces = grpedIntfInfo.split('|');
196       grpedInterfaces.sort();
197       for ( i = 0; i < grpedInterfaces.length; i++ ) {
198          if (grpedInterfaces[i] != '') {
199             document.write("  <option value='" + grpedInterfaces[i] + "'>");
200          }
201          dispName = getUNameByLName(brdId + '|' + grpedInterfaces[i]);
202          document.writeln(dispName);
203       }
204    }
205 }
206 // done hiding -->
207 </script>
208              </select>
209            </td>
210    </table>
211
212         <p><input type='button' onClick='btnApply()' value="Save"></p>
213 </form>
214
215 <script type="text/javascript">
216         writeFooter();
217 </script>
218
219 </body>
220 </html>