www.usr.com/support/gpl/USR9108_release1.5.tar.gz
[bcm963xx.git] / userapps / broadcom / cfm / html / portmapadd.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="portName.js"></script>
16         <script type="text/javascript">
17 <!-- hide
18 setPageTitle("<%ejGetWlJS(wlInterface)%>");
19
20 function btnRemove() {
21    with ( document.choiceForm ) {
22       var arrSelected = new Array();
23       var count = 0;
24       for ( i = 0; i < lstChoice.options.length; i++ ) {
25          if ( lstChoice.options[i].selected == true ) {
26             arrSelected[count] = lstChoice.options[i].value;
27          }
28          count++;
29       }
30       var x = 0;
31       for (i = 0; i < lstChoice.options.length; i++) {
32          for (x = 0; x < arrSelected.length; x++) {
33             if (lstChoice.options[i].value == arrSelected[x]) {
34                varOpt = new Option(lstChoice.options[i].text, lstChoice.options[i].value);
35                lstAvailable.options[lstAvailable.length] = varOpt;
36                lstChoice.options[i] = null;
37             }
38          }
39       }
40    }
41 }
42
43 function btnAdd() {
44    with ( document.choiceForm ) {
45       var arrSelected = new Array();
46       var count = 0;
47       for ( i = 0; i < lstAvailable.options.length; i++ ) {
48          if ( lstAvailable.options[i].selected == true ) {
49             arrSelected[count] = lstAvailable.options[i].value;
50          }
51          count++;
52       }
53       var x = 0;
54       for (i = 0; i < lstAvailable.options.length; i++) {
55          for (x = 0; x < arrSelected.length; x++) {
56             if (lstAvailable.options[i].value == arrSelected[x]) {
57                varOpt = new Option(lstAvailable.options[i].text, lstAvailable.options[i].value);
58                lstChoice.options[lstChoice.length] = varOpt;
59                lstAvailable.options[i] = null;
60             }
61          }
62       }
63    }
64 }
65
66 function btnApply() {
67    var loc = 'portmapcfg.cmd?action=add';
68    with ( document.forms[0] ) {
69       var i = 0;
70
71       if (groupName.value == '') {
72          alert('Need to provide a valid Group Name "A non empty string of characters."');
73          return;
74       }
75       if (lstChoice.length == 0) {
76          alert('Need to provide at least one interface "Select one from the Available list."');
77          return;
78       }
79       loc += '&groupName=' + groupName.value;
80       var ifc = '';
81       var tempList = '';
82       for (i = 0; i < lstChoice.length; i++) {
83          tempList += lstChoice.options[i].value + '|';
84       }
85       var interfaces = tempList.split('|');
86       interfaces.sort();
87       for (i = 0; i < interfaces.length; i++ ) {
88          ifc += interfaces[i] + '|';
89       }
90       loc += '&choiceBox=' + ifc;
91    }
92    var code = 'location = "' + loc + '"';
93    eval(code);
94 }
95
96         // done hiding -->
97         </script>
98 </head>
99 <body onload="initMenu();">
100
101 <script type="text/javascript">
102         writeHeader("Port Mapping");
103 </script>
104
105 <form name="choiceForm">
106    <h3>Add</h3>
107
108    <p>To create a new mapping group:</p>
109
110    <ol>
111         <li>Enter the group name and select interfaces from the
112            <b>Available interfaces</b> list and add them to the <b>Grouped interfaces</b> list
113            using the arrow buttons to create the required mapping of the ports.
114            The group name must be unique.</li>
115
116         <li>Press <b>Save</b> button to make the changes effective.</li>
117    </ol>
118
119    <p><b>Note:</b> The selected interfaces will be removed from their
120    existing groups and added to the new group.</p>
121
122    <p><label for="groupName">Group name:</label> <input type="text" name="groupName" id="groupName" size="30" maxlength="32"></p>
123
124    <table border="0" cellpadding="0" cellspacing="0">
125       <tr>
126          <td><label for="">Available interfaces:</label></td>
127          <td></td>
128          <td><label for="">Grouped interfaces:</label></td>
129       </tr>
130       <tr>
131          <td>
132              <select multiple name="lstAvailable" id="lstAvailable" size="10">
133 <script type="text/javascript">
134 <!-- hide
135 {
136    var i = 0;
137    var dispName = '';
138    var brdId = '<%ejGetJS(boardID)%>';
139    var interfaceInfo = '<%ejGetOther(bridgeInterfaceInfo, all)%>';
140    var interfaces = interfaceInfo.split('|');
141    interfaces.sort();
142    for ( i = 0; i < interfaces.length; i++ ) {
143       if (interfaces[i] != '') {
144          document.write("  <option value='" + interfaces[i] + "'>");
145       }
146       dispName = getUNameByLName(brdId + '|' + interfaces[i]);
147       document.writeln(dispName);
148    }
149 }
150 // done hiding -->
151                   </script>
152                </select>
153            </td>
154       <td>
155          <table border="0" cellpadding="0" cellspacing="5">
156             <tr>
157                 <td><input type="button" value=" -> " onClick="btnAdd()"></td>
158             </tr>
159             <tr>
160                 <td><input type="button" value=" <- " onClick="btnRemove()"></td>
161             </tr>
162          </table>
163       </td>
164       <td>
165           <select multiple name="lstChoice" id="lstChoice" size="10"></select>
166       </td>
167         </table>
168
169         <p><input type='button' onClick='btnApply()' value="Save"></p>
170 </form>
171
172 <script type="text/javascript">
173         writeFooter();
174 </script>
175
176 </body>
177 </html>