📄 bridge.js
字号:
<? setvariable var:contype bridge ?>
<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/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("bridge");`
`wstDoShowWanTypeWiz("bridge");`
?>
<? if eq `1` `$var:HasDsl`
` pvcDoOnLoad();
uiDoSetBridgeEncaps(document.getElementById("uiPostBridgeEncaps").value);
<? if neq `new` `$var:mode`
` jslDisable("uiViewEncaps0","uiViewEncaps1");
`
` ` ?>
<? if eq `1` `$var:HasVlan` `vlanDoOnLoad();` ` ` ?>
// For not a new encapsid disable encaps
<? if neq `<? query manager:command/encaps/new ?>` `$var:encapsid`
` jslDisable("uiPostBridgeEncaps");
`
` ` ?>
` ` ` ?>
<? if eq `new` `$var:mode` ` `
`
jslSetValue("uiViewLANBridge","uiPostLANBridge");
jslDisable("uiViewWanType");//rick,050825, disable change protocol
` ?>
<? if eq 1 `$var:wizard`
` uiWizDoOnLoad();` ` ` ?>
//doShowPageErrors();
//aids 050722 disallow changing of lan group
<? if neq `new` `$var:mode`
`
jslDisable("uiPostLANBridgeCmd");
jslDisable("uiViewLANBridge");
`
` ` ?>
//aids 050722 disallow changing of lan group
return true;
}
function brgDoValidatePage()
{
var msg="";
return(msg);
}
function uiDoValidate()
{
var msg="";
var message="";
if((msg=wstDoValidate())!="") {
message=msg;
}
if((msg=brgDoValidatePage())!="") {
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()
{
<? if eq `1` `$var:HasDsl` `pvcDoSave();` `` ?>
<? if eq `1` `$var:HasVlan` `vlanDoSave();` ` ` ?>
wstDoSave();
jslSetValue("uiPostConDesc","uiViewConDesc");
uiBridgeLAN(document.getElementById("uiViewLANBridge").value);
<? if eq `1` `$var:HasDsl` `document.getElementById("uiPostBridgeEncaps").value=uiDoGetBridgeEncaps();` ` ` ?>
if(uiDoValidate()==true) {
<? if eq 1 <? query <? query manager:status/$var:langrp/dhcps ?>:settings/state ?>
`alert("DHCP Server has been detected enable. It is recommended for bridge connection to disable DHCP server.");` ?>
jslFormSubmit("uiPostForm");
setTimeout("uiDoNextLoc()", 15000);
}
else
{
return false;
}
}
function uiDoNextLoc()
{
document.location.href="http://"+document.getElementById("uiPostIPAddr").value+"/cgi-bin/webcm?getpage=../html/defs/<? echo $var:style ?>/menus/<? echo $var:main ?>.html&var:style=<? echo $var:style ?>&var:main=<? echo $var:main ?>&var:menu=setup&var:menutitle=Setup&var:pagename=bridge&var:pagetitle=New%20Connection&var:conid=<? echo $var:conid ?>&var:muxid=<? echo $var:muxid ?>&var:encapsid=<? echo $var:encapsid ?>";
}
function uiDoCancel()
{
jslGoTo(null,"home");
}
function uiDoGetBridgeEncaps()
{
if(document.getElementById("uiViewEncaps0").value=="on") // LLC
return "0"; // Bridged LLC
if(document.getElementById("uiViewEncaps1").value=="on") // VC
return "1"; // Bridged VC
}
function uiDoSetBridgeEncaps(arg)
{
switch(arg)
{
case "1":
jslDoToggleRadio("uiViewEncaps",1,2); // VC
break;
case "0":
default:
jslDoToggleRadio("uiViewEncaps",0,2); // LLC
break;
}
}
function uiBridgeLAN(value)
{
document.getElementById("uiPostLANBridgeCmd").value="<? echo $var:conid ?>"+"|"+value;
}
</script>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -