


<div class="upObj detailCon detailConMorePad">
	<ul class="line" id="aiFwUpgrade">
		<!--- plugin --->
		<li class="line lineG pluginSet">
			<label class="des desD">{%label.onlineAIFwUpgrade%}</label>
			<input type="button" id="plugUpgradeChk" value="{%label.fwCheckUpdate%}" class="subBtnB btnA" />
			<img class="loading disNone"  id="chkUpPic" src="../web-static/images/loading.gif" />
			<label class="des desH disNone" id="chkUpTip">{%label.fwCheckUpdating%}</label>
			<label class="des desH disNone" id="noNewPlug">{%label.notFindNewAIFw%}</label>
		</li>
		<li class="line lineG pluginSet">
			<label class="des desD">{%label.chooseAIFw%}</label>
			<form enctype="multipart/form-data" id="plugUpFileForm" class="upLoadFileForm" method="post" target="plugUploadIf">
				<div class="fileDiv">
					<iframe id="plugUploadIf" class="uploadIframe" name="plugUploadIf"></iframe>
					<input type="text" id="plugTextfield" class="text textB7" readonly="true" />
					<input type="button" value="{%btn.browse%}" class="subBtnB btnA brower" />
					<input type="file" class="file" name="filename" id="plugFileName" />
				</div>
			</form>
			<input type="button" id="plugUpgrade" class="subBtnB btnA" value="{%btn.fwUpgrade%}" />
		</li>

		<li  class="line lineG">
			<label class="des desD"> </label>
			<label class="des desF">{%label.upgradeDescTipPart1%}<a id="download_plug" href = "javascript:;">{%label.downloadCenter%}</a>{%label.upgradeDescTipPart2%}</label>
		</li>
	</ul>
</div>
<script type="text/javascript">function init(){function s(b){bCheckUpgradeVerClosed=!1;idList=[];showLoading(statusStr.fwCheckUpInfoTip,function(){bCheckUpgradeVerClosed=!0},void 0,!1);for(var d=0,c=b.length;d<c;d++)for(var f in b[d])idList.push(f);onlineUpgrade(function(){!1==bCheckUpgradeVerClosed&&(closeLoading(),showAlert(gOnlineUpgradeNote),gOnlineUpgradeNote="")},function(){!1==bCheckUpgradeVerClosed&&closeLoading()},UPGRADE_PLUGIN,idList)}function B(b){showCover(function(){var d=id("newPlugObj");null==d&&(d=document.createElement("div"),
d.id="newPlugObj",d.innerHTML='<div class="updatePlugShowDiv" id="updatePlugShowDiv"><p class="newPlugVer">'+label.findNewFw+'</p><div class="updatePlugInfo"><p>'+label.upgradeLog+'<span id="updatePlugTime"></span></p><p class="updateSlideDown" id="updateSlideDown">...<span>'+label.slideDown+'</span></p></div><div class="btnFun"><input type="button" id="cancelPlugUpgrade" class="subBtnB btnA" value="{%btn.cancel%}" /><input type="button" id="onlinePlugUpgrade" class="subBtn btnA" style="margin-left:8px" value="{%btn.fwStartUpgrade%}" /></div></div>',
document.body.appendChild(d));d.style.visibility="visible";d.style.top="210px";id("cancelPlugUpgrade").onclick=function(){hideCover(function(){d.style.top="-9999px";d.style.visibility="hidden"})};id("onlinePlugUpgrade").onclick=function(){hideCover(function(){d.style.top="-9999px";d.style.visibility="hidden"});s(b)}})}function C(b){var d=0,c;B(b);var f=document.getElementById("updateSlideDown");c=id("updatePlugNote");if(null==c){var e=document.createElement("p");e.className="updatePlugNote";e.id=
"updatePlugNote";f.parentNode.insertBefore(e,f)}else c.innerHTML="";for(var e=0,p=b.length;e<p;e++)for(var n in b[e])c=id("updatePlugNote"),c.innerHTML+=decodeURI(b[e][n][uciPlgCfg.optName.pluginName]),c.innerHTML+=":<br>"+decodeURI(b[e][n][uciPlgCfg.optName.releaseLog])+"<br>",c.style.height="auto";d=parseInt(getNodeDefaultView(c,"height"));null==document.getElementById("updateSlideDown")&&(e=document.createElement("p"),e.className="updateSlideDown",e.id="updateSlideDown",e.innerHTML="...<span>"+
label.slideDown+"</span>",f.appendChild(e));h=id("updateSlideDown");80<d?(c.style.height="72px",h.style.display="block",h.onclick=function(){this.style.display="none";$("#updatePlugNote").animate({height:d+"px"})}):h.style.display="none"}function D(){var b={};b[n]={};b[n][g.getUpPlg]=null;$.action(b,function(b){b=b[g.getUpPlg];0>=b.length?t.style.display="inline-block":(id("chkUpTip").style.display="none",C(b))})}function E(b){switch(b){case ENONE:return!0;case EFWEXCEPTION:case EFWNOTSUPPORTED:case EFILETOOBIG:b=
errStr.fwFmtErr;break;case EFWNOTINFLANDBL:case EFWNEWEST:b=errStr.fwNotSupported;break;case EINVMEMORYOUT:case EINVDOWNLOADFWFAILED:case EINVSENDREQMSGFAILED:case EINVREQUESTTIMEOUT:case EINVCONNECTTINGCLOUDSERVER:case EINVLASTOPTIONISNOTFINISHED:case ESYSBUSY:b=errStr.fwDownLoadFailed;break;case EFWUNKNOWNBLOCKTYPE:b=errStr.fwUnknownBlockType;break;case EFWISPDATA:b=errStr.fwISPDataErr;break;default:b=errStr.fwUpgradeFailed}showAlert(b);return!1}function F(b,d){var c=b.split("."),f=d.split(".");
if(c.length!=f.length)return-2;for(var e=0;e<c.length;e++){if(c[e]>f[e])return 1;if(c[e]<f[e])return-1}return 0}function G(b,d){var c=b.split("."),f=d.split(".");if(c.length!=f.length)return-2;for(var e=0;e<c.length-1;e++){if(c[e]>f[e])return 1;if(c[e]<f[e])return-1}return 0}function H(b){b=b.value;return""==b?(showAlert(label.upWarn),!1):-1==b.search(/\.bin$/)?(showAlert(errStr.fileFmttErr),!1):u&&r?!0:(u?r||showAlert(errStr.pluginVerErr):showAlert(errStr.pluginNotFound),!1)}function z(){function b(a){var m=
"";switch(parseInt(a)){case ENONE:return!0;case EINVSENDREQMSGFAILED:m=errStr.invSendReqMsgFailed;break;case ESYSBUSY:case EINVLASTOPTIONISNOTFINISHED:m=errStr.invLastOptionIsNotFinished;break;case ESYSTEM:m=errStr.invRequestFail;break;case ENOMEMORY:m=errStr.invMemoryOut;break;case EINVGETDATAFAILED:m=errStr.invGetDataFailed;break;case EINVPARAMETER:m=errStr.invParameter;break;case EINVREQUESTTIMEOUT:m=errStr.invRequestTimeout;break;case EINVDEVICEIDNOTEXIST:case EINVERRORDEVICEIDFORMATERROR:case EINVILLEGALDEVICE:m=
label.cloudDeviceInfoExpt;break;default:a=cloudErrHandle(a),m=!1==a.result?a.tip:errStr.invRequestFail}showAlert(m);return!1}function d(){x.style.display="inline-block";y.style.display="inline-block";t.style.display="none";onlineUpgradeCheck(b,function(a){parseInt(a)==EINVNOTFOUNTNEWFW?t.style.display="inline-block":showConfirmIpc(errStr.updateNetworkExpt,function(a){!1==a&&(closeConfirm(),d())},btn.cloudRetry);x.style.display="none";y.style.display="none"},function(){D(!1);x.style.display="none";
y.style.display="none"},UPGRADE_PLUGIN)}function c(a,b,e,q,d){function c(a,b){closeToast();if(!0!=upgradeTimeoutTag){clearTimeout(upgradeTimeoutHd);upgradeTimeoutHd=null;closeLoading();if(E(a)&&f){var e=b.wait_time?1E3*parseInt(b.wait_time):SYSUPGRADE_SECONDS;showProgBar(e,label.upgrading,function(){lanDetecting(function(){window.location.reload()})},!0,void 0,statusStr.upgradeOk,statusStr.upgradeTip)}z()}}var f=d;if(!0==H(e)){e={};var l=id(a);l.attachEvent?l.attachEvent("onload",function(){iFrmOnload(a,
c)}):l.onload=function(){iFrmOnload(a,c)};e[uciSystem.fileName]={};e[uciSystem.fileName][b]={type:"0"};var k=function(){upgradeTimeoutTag=!0;id(a).onload=null;closeLoading();closeProgBar();clearTimeout(upgradeTimeoutHd);showAlert(errStr.upGradeFail);closeToast();id(a).contentWindow.location.reload();d&&failReboot()};showToast("aiFwUpload");upgradeTimeoutHd=$.setTimeout(k,12E4);$.action(e,function(a){ENONE==a[ERR_CODE]?(q.action=$.orgURL(a.url),q.submit(),q.reset(),upgradeTimeoutTag=!1):k()})}}function f(a,
b,e){for(var q=a.indexOf(b),d=0;d<e-1;d++)q=a.indexOf(b,q+1);return q}function e(a,b,e){$.query(a,function(a){if(parseInt(a[ERR_CODE])==ENONE){a=a[n][v.plugin];for(var d=1,c="",f=0,l=a.length;f<l;f++){for(var k in a[f])plugItem=a[f][k];if(b==plugItem[p.pluginId]){u=!0;for(var d=plugItem[p.pluginValid],d=null==d?1:d,c=void 0,h="",g=0,s=w.length;g<s;g++){for(var t in w[g])c=w[g][t];b==c[uciAiPluginConfig.optName.pluginId]&&(h=c[uciAiPluginConfig.optName.pluginLowestVer])}c=h;if(0==F(plugItem[p.pluginVer],
e)&&parseInt(d))closeToast(),showAlert(errStr.pluginVerErr),r=!1;else if(""!=c&&0!=G(c,e))closeToast(),showAlert(errStr.pluginVerErr),r=!1;else{r=!0;break}}}if(!u)return closeToast(),showAlert(errStr.pluginNotFound),!1;closeToast()}else return closeToast(),showAlert(errStr.systemErr),!1})}var h={},g={},s={0:"校验失败，请升级",1:"",2:"",3:"版本过低，请升级",4:"版本过高",5:"版本MAJOR.MINOR不匹配"};g[KEY_TABLE]=[v.plugin];h[n]=g;$.query(h,function(a){if(parseInt(a[ERR_CODE])!=ENONE){var b=document.getElementsByClassName("pluginSet");
a=0;for(var e=b.length;a<e;a++)b[a].style.display="none"}else{var d=a[n][v.plugin],c="",f="";a=0;for(e=d.length;a<e;a++){for(var h in d[a])b=d[a][h];var l="",k,c=b[p.pluginName],f=b[p.pluginVer],l=b[p.pluginId];k=b[p.pluginValid];k=null==k?1:k;if(!A){var g=document.createElement("li");g.className="line lineG";g.innerHTML='<label class="des desD" id="'+l+'name">"%{label.upCurrSoftVer}%"</label><label class="des desG" id="'+l+'ver" style="padding-right:15px">v1.0</label><label class="des desG" >'+s[k]+
"</label>";k=document.getElementById("aiFwUpgrade");k.insertBefore(g,k.childNodes[0])}id(l+"name").innerHTML=c;id(l+"ver").innerHTML="v"+f}A=!0}});(function(a){var b={},e;if($.moduleSpec&&1==parseInt($.moduleSpec[uciFunction.optName.aiCapability])){var d={};d[uciAiCapability.fileName]={};d[uciAiCapability.fileName][KEY_NAME]=uciAiCapability.secName.capability;$.query(d,function(d){parseInt(d[ERR_CODE])==ENONE&&(b=d[uciAiCapability.fileName][uciAiCapability.secName.capability],e=b[uciAiCapability.optName.supportAiPlugin],
1==parseInt(e)&&"function"==typeof a&&a())})}})(function(){var a={};a[uciAiPluginConfig.fileName]={};a[uciAiPluginConfig.fileName][KEY_TABLE]=uciAiPluginConfig.secName.aiPluginInfo;$.query(a,function(a){parseInt(a[ERR_CODE])==ENONE&&(w=a[uciAiPluginConfig.fileName][uciAiPluginConfig.secName.aiPluginInfo])})});id("plugUpgradeChk").onclick=d;id("plugUpgrade").onclick=function(){c("plugUploadIf",uciSystem.actionName.plugUpgrade,id("plugFileName"),document.forms[0],!0)};id("plugFileName").onchange=function(){showToast("loading");
var a=this.value,a=a.substring(a.lastIndexOf("\\")+1);id("plugTextfield").value=a;var a=this.value,b="",d="",c={},g={};u=r=0;c[KEY_TABLE]=[v.plugin];g[n]=c;if(""==a)return closeToast(),showAlert(label.upWarn),!1;if(-1==a.search(/\.bin$/))return closeToast(),showAlert(errStr.fileFmttErr),!1;if(null!=this.files)a=this.files[0],c=new FileReader,c.readAsArrayBuffer(a),c.onload=function(){var a=this.result,c;c=new Uint8Array(a,4,32);for(var f=0;f<c.byteLength&&"\x00"!=String.fromCharCode(c[f]);f++)b+=
String.fromCharCode(c[f]);c=new Uint8Array(a,36,16);for(f=0;f<c.byteLength&&"\x00"!=String.fromCharCode(c[f]);f++)d+=String.fromCharCode(c[f]);e(g,b,d)};else{var h,c=f(a,"_",2)+1;h=f(a,"_",3);d=b="";b=a.substring(c,h);c=f(a,"_",3)+1;h=f(a,"_",4);d=a.substring(c,h);e(g,b,d)}}}var I=id("download_plug"),A=!1,n=uciPlgCfg.fileName,v=uciPlgCfg.secName,g=uciPlgCfg.actionName,p=uciPlgCfg.optName,t=id("noNewPlug"),h=null,x=id("chkUpPic"),y=id("chkUpTip"),u=0,r=0,w;I.onclick=function(){window.open(label.downloadSwLink)};
z();showDetailCon()}init();
</script><style type="text/css">div.upObj{position:relative;*zoom:1}iframe.uploadIframe{top:-9999px;position:absolute;visibility:hidden}div.fileDiv{height:30px;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}#sysUpgrade{margin-left:10px!important;*margin-top:3px;*padding:2px 16px}form.upLoadFileForm{display:inline-block;vertical-align:middle;width:430px;*width:443px;_width:430px;*display:inline;*zoom:1}input.brower{margin-left:20px;width:88px}ul.line label.desF{line-height:32px;color:#333;margin-right:0;width:612px}img.loading{display:inline-block;width:20px;height:20px;margin-left:12px;vertical-align:middle}div.updatePlugShowDiv{padding:0 24px 28px 24px;background-color:#fff;box-shadow:0 0 8px rgba(0,0,0,0.2);border-radius:2px;width:432px;margin:0 auto}p.newPlugVer{font-size:16px;color:#7a8599;text-align:center;width:432px;height:39px;line-height:39px;border-bottom:1px solid #e1e4e6;margin-bottom:20px}p.updatePlugNote{overflow:hidden}div.updatePlugInfo{color:#333;font-size:14px;margin-bottom:48px}p.updateSlideDown{display:inline-block;_display:inline;*zoom:1}p.updateSlideDown span{color:#333;cursor:pointer}div.updatePlugInfo p{line-height:24px}div.btnFun{text-align:center}#updatePlugShowDiv input.subBtnB{margin-left:8px}#newPlugObj{top:0;position:absolute;margin:auto;width:100%;z-index:1020;visibility:hidden;*zoom:1}ul.line li.line .disNone{display:none}div.downloadAppTip{height:88px;width:220px;float:right;border:1px solid #ccc}</style>