394 lines
9.9 KiB
HTML
394 lines
9.9 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 4.0//EN">
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
|
<title>Define your own inbound application</title>
|
|
<meta name="Copyright" content="Copyright (c) 2004 by IBM Corporation">
|
|
<!-- All rights reserved. Licensed Materials Property of IBM -->
|
|
<!-- US Government Users Restricted Rights -->
|
|
<!-- Use, duplication or disclosure restricted by -->
|
|
<!-- GSA ADP Schedule Contract with IBM Corp. -->
|
|
<!--
|
|
----------------------------------------------------------------------------
|
|
START_DESCRIPTION
|
|
Page Function: Define inbound app/port
|
|
|
|
Stored Values:
|
|
parent.hidden.custominboundapps[clientNum][pos][0] = newappname //stores app name
|
|
parent.hidden.custominboundapps[clientNum][pos][1] = port //stores port num
|
|
|
|
Next and Back:
|
|
[Next]: rzalladvqos14.htm
|
|
[Back]: rzalladvqos20.htm
|
|
END_DESCRIPTION
|
|
----------------------------------------------------------------------------
|
|
-->
|
|
<LINK rel="stylesheet" type="text/css" href="../rzahg/ic.css">
|
|
<script language = "Javascript" src = "../rzahg/iccommon.js"></script>
|
|
<script language="Javascript" type="text/javascript">
|
|
|
|
var ports = new Array()
|
|
var pos
|
|
|
|
error2 = "You cannot add an application on a port that you have already defined."
|
|
error3 = "You must define at least one application"
|
|
error4 = "To add an application, you must define both an application name and port number."
|
|
error5 = "You cannot define multiple applications with the same name."
|
|
error6 = "A port must be a numeric value between 1 and 65535."
|
|
|
|
//START NON-TRANSLATABLE
|
|
clientNum = parent.hidden.retClientNumber()
|
|
customStart = parent.hidden.inboundClientInfo[clientNum][0];//custom apps start position which is also used on panel 25 and 26.
|
|
|
|
|
|
var app_name
|
|
|
|
|
|
function onNext(nextURL,direction) {
|
|
clearApps();
|
|
var pos = 0
|
|
|
|
selectlength = document.otherapps.newapplist.length
|
|
|
|
if ( selectlength != 0 && !isNaN(customStart) ) {//this tests the "numberness" of a value. True is returned if the value is not a number and false if it is a number
|
|
|
|
//find end of applist
|
|
//need to intercept if custom apps have been defined
|
|
|
|
app_length = parent.hidden.retCustomInAppLength(clientNum)
|
|
|
|
for ( var i=0; i<selectlength; i++ ) {
|
|
appname = document.otherapps.newapplist.options[i].text
|
|
start = appname.indexOf("(")
|
|
newappname = appname.substring(0,start)
|
|
end = appname.length
|
|
port = appname.substring(start+1,end-1)
|
|
|
|
//storing values now
|
|
|
|
parent.hidden.custominboundapps[clientNum][pos][0] = newappname //stores app name
|
|
parent.hidden.custominboundapps[clientNum][pos][1] = port //stores port num
|
|
//parent.hidden.custominboundapps[clientNum][pos][2] = 'R'
|
|
pos ++;
|
|
|
|
}
|
|
|
|
window.location = nextURL;
|
|
combineIt();
|
|
|
|
|
|
|
|
}
|
|
|
|
else if ( selectlength == 0 && direction =='back' ) {
|
|
window.location = nextURL;
|
|
}
|
|
|
|
else {
|
|
alert(error3)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function addapp() {
|
|
appname = document.otherapps.addappname.value
|
|
portnum = document.otherapps.addappport.value
|
|
var isOK = true;
|
|
myInteger = document.otherapps.addappport.value;
|
|
listlength = document.otherapps.newapplist.length
|
|
|
|
|
|
|
|
isOK = checkcomplete()
|
|
|
|
positive = parent.hidden.isPosInteger(myInteger);
|
|
//positive = isPosInteger(myInteger) //added by ljs in response to review comment on 1/30
|
|
if ( !positive ) {
|
|
alert(error6)
|
|
document.otherapps.addappport.focus()
|
|
return false;
|
|
}
|
|
|
|
if (isOK){ //checking for duplicate user defined ports
|
|
|
|
isOK = checkuserdefinedports(portnum,appname)
|
|
|
|
}
|
|
|
|
|
|
if ( isOK ) {
|
|
|
|
isOK = checkuserdefinedapps(portnum,appname)
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( isOK ) {
|
|
|
|
document.otherapps.newapplist.options[listlength] = new Option(appname + "(" + portnum + ")",portnum)
|
|
document.otherapps.addappname.value = ""
|
|
document.otherapps.addappport.value = ""
|
|
document.otherapps.addappname.focus();
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function checkcomplete() {
|
|
if ( document.otherapps.addappport.value == '' || document.otherapps.addappname.value == '' ) {
|
|
alert(error4)
|
|
|
|
return false;
|
|
|
|
}
|
|
else {return true;}
|
|
}
|
|
|
|
|
|
|
|
|
|
function checkuserdefinedports(portnum,appname) {
|
|
|
|
listlength = document.otherapps.newapplist.length
|
|
for ( var i=0; i<listlength; i++ ) {
|
|
if ( document.otherapps.newapplist.options[i].value == portnum ) {
|
|
alert(error2);
|
|
document.otherapps.addappport.focus()
|
|
return false;
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
return true;
|
|
}
|
|
|
|
function isPosInteger(myInteger) { //checking for positive integer
|
|
|
|
myInteger = myInteger.toString();
|
|
|
|
for ( var i=0; i<myInteger.length; i++ ) {
|
|
var onechar = myInteger.charAt(i)
|
|
if ( onechar < "0" || onechar > "9" ) {
|
|
return false;
|
|
}
|
|
|
|
|
|
}
|
|
return true;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function checkuserdefinedapps(portnum,appname){
|
|
listlength = document.otherapps.newapplist.length
|
|
|
|
for ( var i=0; i<listlength; i++ ) {
|
|
testApp = document.otherapps.newapplist.options[i].text
|
|
|
|
end = testApp.indexOf('(')
|
|
newAppName = testApp.substring(0,end)
|
|
|
|
|
|
if ( appname == newAppName ) {
|
|
|
|
alert(error5);
|
|
document.otherapps.addappname.focus()
|
|
return false;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
return true;
|
|
|
|
}
|
|
|
|
function removeapp() {
|
|
|
|
selected = document.otherapps.newapplist.options[document.otherapps.newapplist.selectedIndex].value
|
|
remove_pos = 0
|
|
for ( var i=0; i<document.otherapps.newapplist.length; i++ ) {
|
|
if ( document.otherapps.newapplist.options[i].value == selected ) {
|
|
remove_pos = i
|
|
}
|
|
}
|
|
|
|
document.otherapps.newapplist.options[remove_pos] = null;
|
|
|
|
}
|
|
|
|
function removeit() {
|
|
document.otherapps.newapplist.options[0] = null;
|
|
document.otherapps.addappname.focus();
|
|
|
|
}
|
|
|
|
//Obtain name of HTML file in parent frame.
|
|
var parentDir = parent.window.location.href.substring(0,location.href.lastIndexOf('/')+1);
|
|
var parentUrl = parent.window.location.href.substring(parentDir.length,parent.window.location.href.length+1);
|
|
if (parentUrl.indexOf("#") >= 0) { parentUrl = parentUrl.substring(0,parentUrl.indexOf("#"));}
|
|
|
|
function fillin() {
|
|
//Is the hidden frame already loaded with the correct html?
|
|
if (parentUrl != "rzalladvqoswelcome.htm") {
|
|
window.location = "rzalladvqoswelcome.htm"; //load advisor frameset
|
|
return;
|
|
} else {
|
|
//Obtain name of HTML file in hidden frame.
|
|
var hiddenDir = parent.hidden.window.location.href.substring(0,location.href.lastIndexOf('/')+1);
|
|
var hiddenUrl = parent.hidden.window.location.href.substring(hiddenDir.length,parent.hidden.window.location.href.length+1);
|
|
if (hiddenUrl.indexOf("#") >= 0) { hiddenUrl = hiddenUrl.substring(0,hiddenUrl.indexOf("#"));}
|
|
if (hiddenUrl != "rzalladvqoshidden.htm") {
|
|
//Correct HTML not loaded, load it
|
|
parent.hidden.window.location = "rzalladvqoshidden.htm";
|
|
} else { //already loaded
|
|
fillin2();
|
|
}
|
|
}
|
|
}
|
|
|
|
function fillin2() {
|
|
|
|
if ( parent.hidden.custominboundapps[clientNum][0][0] == '' ) {
|
|
removeit()
|
|
}
|
|
|
|
else { // adding previously defined application
|
|
removeit();
|
|
app_length = parent.hidden.retCustomInAppLength(clientNum)
|
|
mypos = 0;
|
|
for ( var i=0; i<app_length; i++ ) {
|
|
appname = parent.hidden.custominboundapps[clientNum][i][0]
|
|
|
|
if ( appname == null || appname == "" ) {
|
|
break;
|
|
}
|
|
else {
|
|
portnum = parent.hidden.custominboundapps[clientNum][i][1]
|
|
document.otherapps.newapplist.options[mypos] = new Option(appname + "(" + portnum + ")",portnum)
|
|
mypos++;
|
|
}
|
|
}
|
|
}
|
|
|
|
clearCustomApps();
|
|
}
|
|
|
|
|
|
function clearCustomApps() {
|
|
|
|
app_length = parent.hidden.retCustomInAppLength(clientNum)
|
|
|
|
for ( var i=0; i<app_length; i++ ) {
|
|
if ( parent.hidden.custominboundapps[clientNum][i][0] != '') {
|
|
parent.hidden.custominboundapps[clientNum][i][0] = '' //stores app name
|
|
parent.hidden.custominboundapps[clientNum][i][1] = ''
|
|
parent.hidden.custominboundapps[clientNum][i][2] = ''
|
|
}
|
|
else {
|
|
break;
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
function clearApps() {
|
|
|
|
app_length = parent.hidden.retInAppLength(clientNum)
|
|
//alert(customStart)
|
|
for ( var i=customStart; i<app_length; i++ ) {
|
|
parent.hidden.inboundapps[clientNum][i][0] = ''
|
|
parent.hidden.inboundapps[clientNum][i][1] = ''
|
|
parent.hidden.inboundapps[clientNum][i][2] = ''
|
|
}
|
|
}
|
|
|
|
|
|
function combineIt() { //this function combines the two arrays if there are custom apps
|
|
|
|
|
|
if ( customStart != null) {
|
|
|
|
app_length = parent.hidden.retCustomInAppLength(clientNum)
|
|
myPos = customStart
|
|
|
|
for ( var i=0; i<app_length; i++ ) {
|
|
appname = parent.hidden.custominboundapps[clientNum][i][0]
|
|
port = parent.hidden.custominboundapps[clientNum][i][1]
|
|
//rsvpAnswer = parent.hidden.customapps[clientNum][i][2]
|
|
|
|
if ( appname == '' || appname == null ) {
|
|
|
|
break;
|
|
}
|
|
|
|
else {
|
|
parent.hidden.inboundapps[clientNum][myPos][0] = appname //stores app name
|
|
parent.hidden.inboundapps[clientNum][myPos][1] = port //stores port num
|
|
//parent.hidden.inboundapps[clientNum][myPos][2] = rsvpAnswer // stores R or N
|
|
myPos ++;
|
|
}
|
|
|
|
}
|
|
parent.hidden.inboundClientInfo[clientNum][13] = myPos; //setting the start point for outbound intserv apps
|
|
}
|
|
}
|
|
|
|
//END NON-TRANSLATABLE
|
|
|
|
|
|
</script>
|
|
|
|
</head>
|
|
|
|
<BODY onload="fillin()">
|
|
<h2>QoS planning advisor: Additional inbound applications</h2>
|
|
<P>Define any other applications that were not previously listed. <P> What other applications do you want to define? </P>
|
|
<p></P>
|
|
<form name="otherapps">
|
|
|
|
<label for="addappname1">Application:</label>
|
|
<INPUT TYPE="text" SIZE=25 MAXLENGTH=25 NAME="addappname" id="addappname1">
|
|
|
|
<label for="addappport1">Port:</label>
|
|
<INPUT TYPE="text" SIZE=5 MAXLENGTH=5 NAME="addappport" id="addappport1">
|
|
|
|
<INPUT TYPE="button" NAME="Add" VALUE=" Add " onClick="addapp()">
|
|
<p></p>
|
|
<table>
|
|
<tr><td>
|
|
<label for="myapps1">My Applications:</label><br>
|
|
<SELECT NAME="newapplist" SIZE=10 onClick = "displayit()" id="myapps1">
|
|
<OPTION VALUE="first">xxxxxxxxxxxxxxxxxxxxxxxx
|
|
</SELECT>
|
|
</td><td>
|
|
<center>
|
|
<br><INPUT TYPE="button" NAME="Remove" VALUE="Remove" onClick="removeapp()">
|
|
</center>
|
|
</td></tr>
|
|
</table>
|
|
<p></p>
|
|
<center>
|
|
<input name=submit type="button" value="<< Back " onClick="onNext('rzalladvqos20.htm','back')">
|
|
<input name=submit type="button" value=" Next >>" onClick="onNext('rzalladvqos14.htm','forward')">
|
|
</CENTER>
|
|
</form>
|
|
|
|
</BODY>
|
|
|
|
</html>
|
|
|