208 lines
7.4 KiB
HTML
208 lines
7.4 KiB
HTML
<HTML>
|
|
<HEAD>
|
|
<TITLE>SGI Embedded Support Partner - ver.1.0</TITLE>
|
|
<SCRIPT LANGUAGE="JavaScript">
|
|
<!--
|
|
var map
|
|
function showMap()
|
|
{ if (!map || map.closed)
|
|
{ map=window.open('/help_add_action.html', 'help',
|
|
'width=650,height=350,status=yes,scrollbars=yes,resizable=yes');
|
|
}
|
|
map.focus();
|
|
}
|
|
|
|
function isPosInt(inputVal)
|
|
{ var inputStr = inputVal.toString()
|
|
for(var i = 0;i < inputStr.length; i++)
|
|
{ var oneChar = inputStr.charAt(i);
|
|
if(oneChar < "0" || oneChar > "9") return false;
|
|
}
|
|
return true;
|
|
}
|
|
|
|
function clearForm(form)
|
|
{ form.action_description.value = "";
|
|
form.action_name.value = "";
|
|
form.user_name.value = "";
|
|
form.action_timeout.value = "";
|
|
form.dsmthrottle.value = "";
|
|
form.retryt.value = "";
|
|
}
|
|
|
|
function isTimeCheck(timeout_t)
|
|
{ if(!isPosInt(timeout_t) || ((ans = timeout_t % 5) != 0)) return false;
|
|
return true;
|
|
}
|
|
|
|
function checkString(inputVal,fieldname)
|
|
{ var inputStr = inputVal.toString()
|
|
if(inputStr.charAt(0) == " ")
|
|
{ var i = 1;
|
|
while(inputStr.charAt(i) == " ")
|
|
i++;
|
|
}
|
|
else
|
|
{ for(var j = 0;j < inputStr.length; j++)
|
|
{ var oneChar = inputStr.charAt(j);
|
|
if(oneChar == "\"")
|
|
{ alert("String \"" + fieldname + "\" should not contain \"'s.");
|
|
return false;
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
if(i != inputStr.length) { alert("String \"" + fieldname + "\" cannot contain leading spaces."); return false; }
|
|
else { alert("String \"" + fieldname + "\" cannot contain only spaces."); return false; }
|
|
return true;
|
|
}
|
|
|
|
function checkUsername(inputVal)
|
|
{ if((inputVal == "root") || (inputVal == "ROOT"))
|
|
{ alert("Username cannot be set to root.");
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
|
|
function verifyData(act_add)
|
|
{ var act_timeout = ""
|
|
var ato = ""
|
|
var dsmth_act = ""
|
|
var dsmth = ""
|
|
var retry_act = ""
|
|
var rtrt = ""
|
|
var act_describe = ""
|
|
var actdescr = ""
|
|
var act_name = ""
|
|
var actname = ""
|
|
var uname = "";
|
|
var u_name = "";
|
|
act_describe = act_add.action_description.value;
|
|
act_add.action_description.focus();
|
|
if(act_describe != "")
|
|
{ if(!checkString(act_describe,"Action command")) return false;
|
|
actdescr = "\nAction command string = " + act_describe;
|
|
}
|
|
if(act_add.action_name.value != "")
|
|
{ act_name = act_add.action_name.value;
|
|
act_add.action_name.focus();
|
|
if(!checkString(act_name,"Action description")) return false;
|
|
actname = "\nAction description = " + act_name;
|
|
}
|
|
if(act_add.action_timeout.value != "")
|
|
{ act_timeout = act_add.action_timeout.value;
|
|
act_add.action_timeout.focus();
|
|
if(!isTimeCheck(act_timeout))
|
|
{ alert("Timeout must be a whole positive number multiple of 5");
|
|
return false;
|
|
}
|
|
ato = "\nTimeout = " + act_timeout;
|
|
}
|
|
if(act_add.dsmthrottle.value != "")
|
|
{ dsmth_act = act_add.dsmthrottle.value
|
|
act_add.dsmthrottle.focus()
|
|
if(!isPosInt(dsmth_act))
|
|
{ alert("Number of times event must be registered before the action will be taken must be a positive number")
|
|
return false;
|
|
}
|
|
dsmth = "\nNumber of times event must be registered before the action will be taken = " + dsmth_act
|
|
}
|
|
if(act_add.retryt.value != "")
|
|
{ retry_act = act_add.retryt.value;
|
|
act_add.retryt.focus();
|
|
if((!isPosInt(retry_act)) || (retry_act >= 24))
|
|
{ alert("Retry times must be a whole positive number and less then 24");
|
|
return false;
|
|
}
|
|
if(retry_act > 4)
|
|
rtrt = "\nNumber of retry times = " + retry_act + "\n\nWARNING: It is recommended that you do not retry more than 4 times.";
|
|
else
|
|
rtrt = "\nNumber of retry times = " + retry_act;
|
|
}
|
|
if(act_describe == "" && act_name == "" && act_timeout == "" && dsmth_act == "" && retry_act == "")
|
|
{ alert("Nothing to add");
|
|
return false;
|
|
}
|
|
if(act_add.user_name.value != "")
|
|
{ uname = act_add.user_name.value
|
|
act_add.user_name.focus();
|
|
if(!checkString(uname,"Username")) return false;
|
|
if(!checkUsername(uname)) return false;
|
|
}
|
|
else
|
|
{ uname = "nobody";
|
|
document.act_add.user_name.value = uname;
|
|
}
|
|
u_name = "\nExecute this action as = " + uname;
|
|
if(act_describe == "")
|
|
{ alert("Enter an action command string");
|
|
return false;
|
|
}
|
|
if(act_name == "")
|
|
{ alert("Enter an action description");
|
|
return false;
|
|
}
|
|
if(act_timeout == "")
|
|
{ alert("Enter an action timeout");
|
|
return false;
|
|
}
|
|
if(dsmth_act == "")
|
|
{ msg1 = "Enter a number of times the event must be registered\nwith SGI Support Partner before an action will be taken";
|
|
alert(msg1);
|
|
return false;
|
|
}
|
|
if(retry_act == "")
|
|
{ alert("Enter a number of retry times");
|
|
return false;
|
|
}
|
|
final_act = "\n" + actdescr + actname + u_name + ato + dsmth + rtrt;
|
|
return window.confirm("You entered the following action configuration for update: " + final_act);
|
|
}
|
|
//-->
|
|
</SCRIPT>
|
|
</HEAD>
|
|
<body bgcolor="#ffffcc">
|
|
<a href="/$sss/$nocache"></a>
|
|
<form onSubmit="return verifyData(this)" method=GET action="/$sss/rgs/libsemserver~UPDTACTCONFIRM" name = "act_add">
|
|
<table border=0 cellpadding=0 cellspacing=0 width=100%>
|
|
<tr><td bgcolor="#cccc99" width="15"> </td>
|
|
<td bgcolor="#cccc99"><font face="Arial,Helvetica">SETUP > Actions > Add</font></td></tr>
|
|
<tr><td colspan=2> </td></tr>
|
|
<tr><td align=right colspan=2><font face="Arial,Helvetica"><input TYPE="button" onClick="showMap()" Value=" Help "></font></td></tr>
|
|
<tr><td colspan=2> </td></tr>
|
|
<tr><td></td>
|
|
<td><table border=0 cellpadding=0 cellspacing=0>
|
|
<tr valign=top><td><font face="Arial,Helvetica">Enter action command string:</font></td>
|
|
<td> </td>
|
|
<td colspan=2><font face="Arial,Helvetica"><INPUT TYPE="TEXT" NAME="action_description" size=30></font></td></tr>
|
|
<tr><td colspan=4> </td></tr>
|
|
<tr valign=top><td><font face="Arial,Helvetica">Enter action description:</font></td>
|
|
<td> </td>
|
|
<td colspan=2><font face="Arial,Helvetica"><INPUT TYPE="TEXT" NAME="action_name" size=30></font></td></tr>
|
|
<tr><td colspan=4> </td></tr>
|
|
<tr valign=top><td><font face="Arial,Helvetica">Enter username to execute this action (default = nobody):</font></td>
|
|
<td> </td>
|
|
<td colspan=2><font face="Arial,Helvetica"><INPUT TYPE="TEXT" NAME="user_name" size=10></font></td>
|
|
<tr><td colspan=4> </td></tr>
|
|
<tr valign=top><td><font face="Arial,Helvetica">Enter action timeout (in multiples of 5 seconds):</font></td>
|
|
<td> </td>
|
|
<td colspan=2><font face="Arial,Helvetica"><INPUT TYPE="TEXT" NAME="action_timeout" size=10> seconds</font></td></tr>
|
|
<tr><td colspan=4> </td></tr>
|
|
<tr valign=top><td><font face="Arial,Helvetica">Enter the number of times an event must be registered before the action will be taken:</font></td>
|
|
<td> </td>
|
|
<td colspan=2><font face="Arial,Helvetica"><INPUT TYPE="TEXT" NAME="dsmthrottle" size=10></font></td></tr>
|
|
<tr><td colspan=4> </td></tr>
|
|
<tr valign=top><td><font face="Arial,Helvetica">Enter the number of retry times (up to 23; more then 4 not recommended):</font></td>
|
|
<td> </td>
|
|
<td><font face="Arial,Helvetica"><INPUT TYPE="TEXT" NAME="retryt" size=10></font></td><td></td></tr>
|
|
</table>
|
|
<p><font face="Arial,Helvetica"><INPUT TYPE="SUBMIT" VALUE=" Accept "> <input type="RESET" value=" Clear " onClick="clearForm(this.form)";></font></td></tr>
|
|
</table>
|
|
<INPUT TYPE="hidden" name=multiselect value=0>
|
|
<a href="/$sss/rg/libsemserver~GETSYSID">GETSYSID</a>
|
|
</form>
|
|
</body>
|
|
</html>
|
|
|