📄 pppox.js
字号:
<script language="JavaScript">
<? include ../html/js/val.js ?>
<? include ../html/setup/wst.js ?>
<? if eq `1` `$var:HasDsl` `<? include ../html/setup/pvc.js ?>` `` ?>
<? if eq `1` `$var:HasVlan` `<? include ../html/setup/vlan.js ?>` ` ` ?>
<? include ../html/setup/ppp.js ?>
<? include ../html/js/jsl.js ?>
<? include ../html/js/error.js ?>
//aids 050721 disallow doubleclick of buttons
function uiSaveButton()
{
jslDisable("uiButtonApply");
if (uiDoSave() == false)
{
jslEnable("uiButtonApply");
}
}
//aids 050721 disallow doubleclick of buttons
function uiDoOnLoad()
{
<? if neq 1 `$var:wizard`
`wstDoShowWanType("<? echo $var:contype ?>");`
`wstDoShowWanTypeWiz("<? echo $var:contype ?>");`
?>
pppDoOnLoad();
<? if eq `1` `$var:HasDsl` `pvcDoOnLoad();` `` ?>
<? if eq `1` `$var:HasVlan` `vlanDoOnLoad();` ` ` ?>
<? if eq pppoa $var:contype
` uiDoSetEncapsulation(document.getElementById("uiPostPppEncaps").value);
<? if eq `1` `$var:HasVlan`
` // default vlan is enable but for clip and ppoa default make it disable
document.getElementById("uiPostVlanEnable").value="disable";
jslDoShowComboBox("uiViewVlanEnable", "uiPostVlanEnable");
jslDisable("uiViewVlanEnable","uiViewVlanId","uiViewPvc");
jslDisable("uiPostVlanId");
jslDisable("uiPostPbits","uiViewPbits");
<? if neq `new` `$var:mode`
` jslDisable("uiViewEncaps0","uiViewEncaps1");
jslDisable("uiViewWanType");
`
` ` ?>
` `jslDisable("uiViewPvc");` ?>
`
` ` ?>
//rick,050825, disable change protocol
<? if neq `new` `$var:mode`
`
jslDisable("uiViewWanType");
`
` ` ?>
jslPostToViewCheckBox("uiViewNatControl","uiPostNatControl");
jslPostToViewCheckBox("uiViewFirewallControl","uiPostFirewallControl");
wstDoCheckFwNAT();
jslDoShowComboBox("uiViewPppUnLan", "uiPostPppUnLan");
jslPostToViewCheckBox("uiViewPppUnNum","uiPostPppUnNum");
uiPPPUnnum(document.getElementById("uiViewPppUnNum").value);
<? if eq 1 `$var:wizard`
` uiWizDoOnLoad();` ` ` ?>
//doShowPageErrors();
return true;
}
<? if eq pppoa $var:contype
'
function uiDoGetEncapsulation()
{
if(document.getElementById("uiViewEncaps0").value=="on") return "0";
if(document.getElementById("uiViewEncaps1").value=="on") return "1";
}
function uiDoSetEncapsulation(arg)
{
if(arg=="0") jslDoToggleRadio("uiViewEncaps",0,2);
if(arg=="1") jslDoToggleRadio("uiViewEncaps",1,2);
}
' ?>
function uiDoSelectLAN(value)
{
document.getElementById("uiPostPppUnLan").value=value;
}
function uiPPPUnnum(value)
{
switch(value) {
case 'on':
document.getElementById("uiPostPppDefRoute").value="1";
jslPostToViewCheckBox("uiViewSetRoute","uiPostPppDefRoute");
document.getElementById("uiPostPppUsePeerDNS").value="1";
jslPostToViewCheckBox("uiViewSetADNS","uiPostPppUsePeerDNS");
document.getElementById("uiPostNatControl").value="0";
jslPostToViewCheckBox("uiViewNatControl","uiPostNatControl");
jslDisable("uiViewNatControl","uiViewSetRoute","uiViewSetADNS");
jslEnable("uiViewPppUnLan");
break;
case 'off':
default:
jslEnable("uiViewNatControl","uiViewSetRoute","uiViewSetADNS");
jslDisable("uiViewPppUnLan");
break;
}
}
function uiDoValidate()
{
var msg="";
var message="";
var value;
if((msg=wstDoValidate())!="") {
message=msg;
}
if((msg=pppDoValidatePage())!="") {
if(message!="") message=" and "+msg;
else message=msg;
}
<? if eq `1` `$var:HasDsl` `
if((msg=pvcDoValidatePage())!="") {
if(message!="") message=" and "+msg;
else message=msg;
}
` ` ` ?>
<? if eq `1` `$var:HasVlan` `
if((msg=vlanDoValidatePage())!="") {
if(message!="") message=" and "+msg;
else message=msg;
}
` ` ` ?>
erlDoShowPageErrors();
return jslPageErrorMsg(message);
}
function uiDoSave()
{
jslViewToPostCheckBox("uiPostNatControl","uiViewNatControl");
jslViewToPostCheckBox("uiPostFirewallControl","uiViewFirewallControl");
<? if eq pppoa $var:contype 'document.getElementById("uiPostPppEncaps").value=uiDoGetEncapsulation();' '' ?>
<? if eq `1` `$var:HasDsl` `pvcDoSave();` `` ?>
<? if eq `1` `$var:HasVlan` `vlanDoSave();` `` ?>
wstDoSave();
pppDoOnSave();
jslSetValue("uiPostConDesc","uiViewConDesc");
jslViewToPostCheckBox("uiPostPppUnNum","uiViewPppUnNum");
//aids 050721 Check username and password
if(document.getElementById("uiPostPppUsername").value.length == 0 || document.getElementById("uiPostPppPassword").value.length == 0)
{
alert("Invalid Username/Password");
return false;
}
if(uiDoValidate()==true)
{
jslFormSubmit("uiPostForm");
}
else
{
return false;
}
}
function uiDoCancel()
{
jslGoTo(null,"home");
}
</script>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -