

<div class="sysConf detailCon detailConMorePad">
	<ul class="line">
		<li class="line lineG">
			<label class="des desD">{%label.resetDefaultConf%}</label>
			<input type="button" value="{%label.resetDefaultConf%}" id="sysReset" class="subBtnB btnA" />
		</li>
		<li class="line lineG">
			<label class="des desD">{%label.loadIpcFile%}</label>
			<input type="button" value="{%label.backupConf%}" id="sysBackup" class="subBtnB btnA" />
		</li>
		<li class="line lineG">
			<label class="des desD">{%label.upConf%}</label>
			<form enctype="multipart/form-data" id="upFileForm" method="post" target="restoreIf">
				<div class="fileDiv">
					<iframe id="restoreIf" name="restoreIf"></iframe>
					<input type="text" id="textfield" class="text textB7" readonly="true" />
					<input type="button" value="{%btn.browse%}" class="subBtnB btnA brower" />
					<input type="file" class="file" name="filename" id="fileName" />
				</div>
			</form>
			<input type="button" id="sysRestore" class="subBtnB btnA" value="{%btn.restoreConf%}" />
		</li>
	</ul>
</div><script type="text/javascript">function init(){function t(){var a=m.value;return""==a?(showAlert(label.upConfigWarn),!1):-1==a.search(/\.bin$/)?(showAlert(errStr.fileFmttErr),!1):!0}function u(){$.action({system:{reboot:null}},function(){})}function n(){closeLoading();closeProgBar();restoreTimeoutTag=!0;clearTimeout(restoreTimeoutHd);id("restoreIf").onload=null;showAlert(errStr.restoreFail);closeToast()}function v(a){closeToast();if(!0!=restoreTimeoutTag)if(clearTimeout(restoreTimeoutHd),restoreTimeoutHd=null,closeLoading(),a==
ENONE){var b,c,e,f;a={};a[d]={};a[uciDeviceInfo.fileName]={};a[d][KEY_NAME]=[g.wan];a[uciDeviceInfo.fileName][KEY_NAME]=[uciDeviceInfo.secName.info];a[h]={};a[h][NAME]=[p.main];$.query(a,function(a){a=a||{};a[ERR_CODE]==ENONE&&(f=a[d][g.wan][q.ip],b=a[uciDeviceInfo.fileName][uciDeviceInfo.secName.info][uciDeviceInfo.optName.domainName],c=a[d][g.wan][q.wanType],e=a[h][p.main][w.listenHttpPort])},!1);u();showProgBar(REBOOT_SECONDS,void 0,function(){if(c==uciNetwork.optValue.proto.staticIp&&void 0!=
f){var a=f+":"+e;$.changeDomain(a);lanDetecting(function(){window.location.href=-1==location.href.toString().indexOf(b)?"http://"+a:"http://"+b+":"+e})}else if(c==uciNetwork.optValue.proto.dynIp){var d=label.configDhcpMode+"，"+label.portValue+e;closeProgBar();showAlert(d)}},!0,statusStr.rebootingTip,statusStr.rebootOk,statusStr.rebootTip)}else a==EFILETOOBIG?showAlert(errStr.fileSizeErr):showAlert(errStr.bakNRestoreFail)}var k=id("sysReset"),r=id("sysRestore"),s=id("sysBackup"),l=document.forms[0],
m=id("fileName"),h=uciUhttpd.fileName,p=uciUhttpd.secName,w=uciUhttpd.optName,d=uciNetwork.fileName,q=uciNetwork.optName,g=uciNetwork.secName;(function(){var a,b,c="";!0==$.local?k.onclick=function(){showConfirmC(label.resetDefaultConf,label.resetConfirmIpc,function(a){!0==a&&$.action({system:{reset:null}},function(a){ENONE==a[ERR_CODE]&&showProgBar(RESTORE_SECONDS,label.resetConing,function(){closeProgBar()},!1,void 0,statusStr.resetOk,statusStr.resetTip)})})}:USER_GROUP_REMOTE==$.authRltObj.group?
disableBtn(k,!0):(a={},a[uciProto.fileName]={},a[uciProto.fileName][KEY_NAME]=uciProto.secName.sta,a[uciDeviceInfo.fileName]={},a[uciDeviceInfo.fileName][KEY_NAME]=uciDeviceInfo.secName.info,$.query(a,function(a){IPCUMGUESTNAUTH==a[ERR_CODE]&&showAlert(errStr.invPermissionDenied);ENONE==a[ERR_CODE]&&(c=a[uciProto.fileName][uciProto.secName.sta][uciProto.optName.facIp],b=a[uciDeviceInfo.fileName][uciDeviceInfo.secName.info][uciDeviceInfo.optName.domainName],k.onclick=function(){GROUP_ROOT!=$.group?
showAlert(errStr.guestPermissionDenied):showConfirmC(label.resetDefaultConf,label.resetConfirmIpc,function(a){!0==a&&$.action({system:{reset:null}},function(a){ENONE==a[ERR_CODE]?showProgBar(RESTORE_SECONDS,label.resetConing,function(){$.setLg("","");$.changeDomain(c);lanDetecting(function(){window.location.href=-1==location.href.toString().indexOf(b)?"http://"+c:"http://"+b})},!1,void 0,statusStr.resetOk,statusStr.resetTip):showAlert(errStr.invSendReqMsgFailed)})})})}))})();(function(){m.onchange=
function(){var a=this.value,a=a.substring(a.lastIndexOf("\\")+1);id("textfield").value=a};USER_GROUP_REMOTE==$.authRltObj.group?(disableBtn(r,!0),disableBtn(s,!0)):(r.onclick=function(){!0==t()&&showConfirmC(btn.restoreConf,label.upConfig,function(a){!0==a&&(a={},a[uciSystem.fileName]={},a[uciSystem.fileName][uciSystem.actionName.uploadConf]=null,$("#restoreIf").one("load",function(){iFrmOnload("restoreIf",v)}),showToast("bakUpload"),restoreTimeoutHd=$.setTimeout(n,1E4),$.action(a,function(a){ENONE==
a[ERR_CODE]?(l.action=$.orgURL(a.url),l.submit(),l.reset(),restoreTimeoutTag=!1):n()}))})},s.onclick=function(){var a={};a[uciSystem.fileName]={};a[uciSystem.fileName][uciSystem.actionName.downloadConf]=null;$.action(a,function(a){location.href=$.domainUrl+$.orgURL(a.url)},!0)})})();showDetailCon()}init();
</script><style type="text/css">div.sysConf{position:relative;*zoom:1}#restoreIf{top:-9999px;position:absolute;visibility:hidden}div.fileDiv{*display:inline;*zoom:1;height:32px;*height:32px;overflow:hidden;position:relative;vertical-align:middle}input.file{font-size:110px;top:-5px;right:-5px;opacity:0;filter:alpha(opacity:0);cursor:pointer;position:absolute;vertical-align:top;z-index:1}#sysRestore{margin-left:10px!important;*margin-top:4px;*padding:2px 20px}#upFileForm{display:inline-block;vertical-align:middle;overflow:hidden;padding-top:2px;*display:inline;*zoom:1}label.upTip{vertical-align:middle}input.brower{margin-left:20px;width:88px}div.sysConf li.lineG{font-size:0}</style>