178 lines
6.9 KiB
HTML
178 lines
6.9 KiB
HTML
<html>
|
|
<head>
|
|
<title></title>
|
|
<SCRIPT LANGUAGE="JavaScript">
|
|
<!--
|
|
function showMap()
|
|
{ var map=window.open('/help_service.html', 'help',
|
|
'width=650,height=350,status=yes,scrollbars=yes,resizable=yes');
|
|
map.main=self;
|
|
map.main.name="sss_main";
|
|
map.focus();
|
|
}
|
|
|
|
function clearForm(form) {
|
|
form.service_name.value="";
|
|
form.modem_maxtries.value = "";
|
|
form.modem_maxmsgsize.value = "";
|
|
form.modem_no.value = "";
|
|
form.modem_device.selectedIndex = -1;
|
|
}
|
|
|
|
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 i;
|
|
}
|
|
|
|
function checkString(inputVal,fieldname)
|
|
{ var inputStr = inputVal.toString()
|
|
for(var i = 0;i < inputStr.length; i++)
|
|
{ var oneChar = inputStr.charAt(i);
|
|
if(oneChar == "\"" || oneChar == " ")
|
|
{ alert("String \"" + fieldname + "\" should not contain \"'s nor blank spaces.");
|
|
return false;
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
|
|
function findDel(setup_form)
|
|
{ document.setup_form.submit_type.value='del'
|
|
}
|
|
|
|
function findAdd(setup_form)
|
|
{ document.setup_form.submit_type.value='add'
|
|
}
|
|
|
|
function verifyData(setup_form)
|
|
{ var serv_n = setup_form.service_name.value;
|
|
setup_form.service_name.focus();
|
|
var mod_mtry = setup_form.modem_maxtries.value;
|
|
setup_form.modem_maxtries.focus();
|
|
var mod_msize = setup_form.modem_maxmsgsize.value;
|
|
setup_form.modem_maxmsgsize.focus();
|
|
var mod_ph = setup_form.modem_no.value;
|
|
setup_form.modem_no.focus();
|
|
var mod_choice = setup_form.modem_device.selectedIndex;
|
|
var mod_dev = setup_form.modem_device.options[mod_choice].text;
|
|
if(document.setup_form.submit_type.value == "del")
|
|
{ if(serv_n == "")
|
|
{ alert("Enter service name to delete")
|
|
return false;
|
|
}
|
|
if(!checkString(serv_n,"Service name")) return false;
|
|
return window.confirm("Service to delete : " + serv_n);
|
|
}
|
|
if(document.setup_form.submit_type.value == "add")
|
|
{ if(serv_n == "" && mod_mtry == "" && mod_msize == "" && mod_ph == "" && (mod_choice == -1 || mod_choice == 0))
|
|
{ alert("Nothing to add/update");
|
|
return false;
|
|
}
|
|
if(serv_n == "")
|
|
{ alert("Missing service name");
|
|
return false;
|
|
}
|
|
if(!checkString(serv_n,"Service name")) return false;
|
|
if(mod_choice == -1 || mod_choice == 0)
|
|
{ alert("Missing modem");
|
|
return false;
|
|
}
|
|
if(mod_mtry == "")
|
|
{ alert("Missing maximum number of retries");
|
|
return false;
|
|
}
|
|
if(!isPosInt(mod_mtry) || mod_mtry < 6)
|
|
{ alert("Maximum number of retries must be a positive number greater then 6");
|
|
return false;
|
|
}
|
|
if(mod_msize == "")
|
|
{ alert("Missing maximum length of the message");
|
|
return false;
|
|
}
|
|
if(!isPosInt(mod_msize))
|
|
{ alert("Maximum length of the message must be a positive number");
|
|
return false;
|
|
}
|
|
if(mod_ph == "")
|
|
{ alert("Missing phone number of the paging service");
|
|
return false;
|
|
}
|
|
var st = isPosInt(mod_ph)
|
|
if(!st)
|
|
{ alert("Phone number must be a positive number without spaces and\/or \"-\"");
|
|
return false;
|
|
}
|
|
if(st < 7)
|
|
{ alert("Incorrect phone number entry")
|
|
return false;
|
|
}
|
|
msg1 = "\n\nService name = " + serv_n;
|
|
msg1 += "\nDevice = " + mod_dev;
|
|
msg1 += "\nMaximum number of retries = " + mod_mtry;
|
|
msg1 += "\nMaximum length of the message = " + mod_msize;
|
|
msg1 += "\nPhone number of the paging service = " + mod_ph;
|
|
return window.confirm("You are adding/updating the following service:" + msg1);
|
|
}
|
|
}
|
|
//-->
|
|
</SCRIPT>
|
|
</head>
|
|
<body bgcolor="#ffffcc" link="#333300" vlink="#333300">
|
|
<form onSubmit="return verifyData(this)" method=POST action="/$sss/rgs/qpageconfsrvr~setservice" name="setup_form">
|
|
<table border=0 cellpadding=0 cellspacing=0 width=100%>
|
|
<tr><td bgcolor="#cccc99" width="15"> </td>
|
|
<td bgcolor="#cccc99"><font face="Arial,Helvetica">SETUP > Paging > Service</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><font face="Arial,Helvetica">
|
|
<table border=0 cellpadding=0 cellspacing=0>
|
|
<tr valign=top><td><font face="Arial,Helvetica" color="#666633"><b>Tip: </b></font></td>
|
|
<td><font face="Arial,Helvetica">You can add as many services as you want by repeating this step. A service with a new service name will be treated as a new one. If an existing service name is entered with new settings, the existing service is updated. To delete a service you need to enter only the name of the service you want to delete.</font></td></tr>
|
|
</table>
|
|
<p><hr><b>Service Setup:</b>
|
|
<dl><dd><table border=0 cellpadding=0 cellspacing=0>
|
|
<tr><td><font face="Arial,Helvetica">Service name:</font></td>
|
|
<td> </td>
|
|
<td><font face="Arial,Helvetica"><input type="text" size=20 name="service_name"></font></td></tr>
|
|
<tr><td colspan=3> </td></tr>
|
|
<tr><td><font face="Arial,Helvetica">Device (for example, /dev/ttyd):</font></td>
|
|
<td> </td>
|
|
<td><font face="Arial,Helvetica">
|
|
<select name=modem_device>
|
|
<option value="0">Select Modems
|
|
<a href="/$sss/rg/qpageconfsrvr~getservice">Device List</a>
|
|
</select></font></td></tr>
|
|
<tr><td colspan=3> </td></tr>
|
|
<tr><td><font face="Arial,Helvetica">Maximum number of retries (must be at least 6):</font></td>
|
|
<td> </td>
|
|
<td><font face="Arial,Helvetica"><input type="text" size=20 name="modem_maxtries"></font></td></tr>
|
|
<tr><td colspan=3> </td></tr>
|
|
<tr><td><font face="Arial,Helvetica">Maximum length of the message (consult your service provider):</font></td>
|
|
<td> </td>
|
|
<td><font face="Arial,Helvetica"><input type="text" size=20 name="modem_maxmsgsize"></font></td></tr>
|
|
<tr><td colspan=3> </td></tr>
|
|
<tr><td><font face="Arial,Helvetica">Phone number of the paging service (no spaces):</font></td>
|
|
<td> </td>
|
|
<td><font face="Arial,Helvetica"><input type="text" size=20 name="modem_no"></font></td></tr>
|
|
</table></dd></dl>
|
|
<table border=0 cellpadding=0 cellspacing=0>
|
|
<tr valign=top><td><font face="Arial,Helvetica" color="#666633"><b>Tip: </b></font></td>
|
|
<td><font face="Arial,Helvetica">If you cannot find a modem that you need in the list above, add it by using <a href="ssnotifier_modem.html">SETUP: Notification: Modem/admin</a>.</font></td></tr>
|
|
</table>
|
|
<p>
|
|
<input type="submit" value="Add/Update" onClick="findAdd(this)">
|
|
|
|
<input type="submit" value="Delete" onClick="findDel(this)">
|
|
<input type="RESET" value=" Clear " onClick="clearForm(this.form)";>
|
|
<input type="hidden" name="submit_type" value=""></font></td></tr>
|
|
</table>
|
|
</form>
|
|
</body>
|
|
</html>
|