


<div id="diagnosTc"  class="context">
	<div>
		<ul class="line lineLWide">
			<!-- 模式选择 -->
            <li class="line lineG">
                <label class="des desD">{%label.diagMode%}</label>
                <span class="selCon">
                    <span id="diagnoseMode" class="select">
                        <span class="value hsValueA"></span>
                        <i class="arrow"></i>
                    </span>
                </span>
            </li>
			<!-- diagVb -->
			<li class="line lineG">
				<label class="des desD ">{%label.selOperate%}</label>
				<input class="inputDiag" name="doType" id="doType1" type="radio" value="ping" /><label
					class=" des desG filterCheckCon" style="margin-right:16px;"for="doType1">Ping</label>
				<input class="inputDiag" name="doType" id="doType2" type="radio" value="tracert" /><label
					class="des desG filterCheckCon" for="doType2">Tracert</label>
			</li>
			<li class="line lineG">
				<label class="des desD">{%label.ipAddrDoname%}</label>
				<input id="addr" class="textInput text textA1" maxlength="64" /><i class="tip"></i>
			</li>
			<div id="ping_display">
				<li class="line lineG">
					<label class="des desD">{%label.pingNum%}</label>
					<input id="sendNum" class="textInput text textA1" maxlength="64" /><i class="tip"></i>
					<label class="desA range verticalFormat" >{%label.numRange%}</label>
				</li>
				<li class="line lineG">
					<label class="des desD">{%label.pingSize%}</label>
					<input id="pSize" class="textInput text textA1" maxlength="64" /><i class="tip"></i>
					<label class="desA range verticalFormat" >{%label.sizeRange%}</label>
				</li>
			</div>
			<div id="ping_option" style="line-height:40;">
				<li class="line lineG" id="overtime">
					<label class="des desD">{%label.pingOvertime%}</label>
					<input id="overTime" class="textInput text textA1" maxlength="64" /><i class="tip"></i>
					<label class="desA range verticalFormat">{%label.timeoutRange%}</label>
				</li>
			</div>
			<div id="tracert_option">
				<li  class="line lineG" id="trhops">
					<label class="des desD">{%label.trHops%}</label>
					<input id="trHops" class="textInput text textA1" maxlength="64" /><i class="tip"></i>
					<label class="desA range verticalFormat">{%label.hopsRange%}</label>
					<input id="start" type="button" value="{%btn.startdiag%}" class="subBtn btnA" style="float:right" />
				</li>
			</div>
		</ul>
	</div>
	<div>
		<ul class="line lineLWide" style="height:40px;">
            <li class="line lineG">
                <label class="des desD">{%label.diagnoseResult%}</label>
            </li>
        </ul>
		<fieldset class="fieldsetDiag">
			<div id="textareaDiagCon">
				<div id="diagnostResult">{%label.ipcReady%}</div>
			</div>
		</fieldset>
	</div>
</div><script type="text/javascript">function init(){function t(a){switch(a){case IPC_DIAGNOSE_PARAMS_INVALID:showAlert("参数错误！");break;case IPC_DIAGNOSE_TASK_BUSY:showAlert("上次诊断未完成！");break;case IPC_DIAGNOSE_TYPE_NOT_SUPPORT:showAlert("类型字段不支持！");break;case IPC_DIAGNOSE_ID_NOT_FOUND:showAlert("未找到诊断实例！");break;case IPC_DIAGNOSE_INTERNAL_ERROR:showAlert("其他错误！");break;case IPC_DIAGNOSE_TASK_FULL:showAlert("系统繁忙！");break;default:showAlert("其他错误！")}}function u(){if(d&&null==e)id(g).value=btn.startdiag,id("diagnoseMode").disable(!1);else{var a=
{};a[uciDiagnostic.fileName]={};a[uciDiagnostic.fileName][uciDiagnostic.actionName.get]={};a[uciDiagnostic.fileName][uciDiagnostic.actionName.get][uciDiagnostic.optName.index]=0;d&&(a[uciDiagnostic.fileName][uciDiagnostic.actionName.get][uciDiagnostic.optName.instanceId]=e);$.action(a,function(c){var f="";if(c[ERR_CODE]!=ENONE)t(c[ERR_CODE]),id(g).value=btn.startdiag,id("diagnoseMode").disable(!1);else{for(var b=0;b<c.data.length;b++)f+=c.data[b]+"\r\n";id("diagnostResult").innerHTML="<pre>"+f.replace(/\r\n/gi,
"<br />")+"</pre>";k.scrollTo(id("diagnostResult").offsetHeight);1==c.status?(subBtn=id(g),subBtn.value=btn.startdiag,f={},f[uciDiagnostic.fileName]={},f[uciDiagnostic.fileName][uciDiagnostic.actionName.stop]={},d&&(f[uciDiagnostic.fileName][uciDiagnostic.actionName.stop][uciDiagnostic.optName.instanceId]=e),$.action(a,function(a){}),c[ERR_CODE]==ENONE&&d&&(e=null),id("diagnoseMode").disable(!1)):$.setTimeout(u,1E3)}})}}function r(){id(s).checked?(document.getElementById("trhops").appendChild(document.getElementById("start")),
document.getElementById("ping_option").style.display="none",document.getElementById("ping_display").style.display="none",document.getElementById("tracert_option").style.display="block"):(document.getElementById("overtime").appendChild(document.getElementById("start")),document.getElementById("ping_option").style.display="block",document.getElementById("ping_display").style.display="block",document.getElementById("tracert_option").style.display="none")}function w(){var a=b.value;if(0==a.length)return showAlert(errStr.inputIpErr,
b),!1;if(!0==/[a-zA-z]/g.test(a)){if(ENONE!=checkDomain(a))return showAlert(errStr.domainErr,b),!1}else{if(ENONE!=validIpFormat(a))return showAlert(errStr.ipAddrFmtErr,b),!1;if(ENONE!=validIpAddr(a))return showAlert(errStr.ipAddrNetErr,b),!1}if(id(m).checked){if(!0!=checkNumRange(id(n).value,50,1))return showAlert(errStr.pingNumErr,n),!1;if(!0!=checkNumRange(id(p).value,1472,4))return showAlert(errStr.pingSizeErr,p),!1;if(!0!=checkNumRange(id(h).value,2,1))return showAlert(errStr.timeoutErr,h),!1;
if(!1==/^\d+$/.test(id(h).value))return showAlert("请输入整数",h),!1}return id(s).checked&&!0!=checkNumRange(id(q).value,30,1)?(showAlert(errStr.hopsErr,q),!1):!0}function v(){var a,c=id("diagnostResult");a=id(g);btn.startdiag==a.value&&!1!=w()?(a.value=btn.stopdiag,id("diagnoseMode").disable(!0),a={},a[uciDiagnostic.fileName]={},a[uciDiagnostic.fileName][uciDiagnostic.actionName.start]={},id(m).checked?(a[uciDiagnostic.fileName][uciDiagnostic.actionName.start][uciDiagnostic.optName.type]=x,a[uciDiagnostic.fileName][uciDiagnostic.actionName.start][uciDiagnostic.optName.addr]=
b.value,a[uciDiagnostic.fileName][uciDiagnostic.actionName.start][uciDiagnostic.optName.num]=id(n).value,a[uciDiagnostic.fileName][uciDiagnostic.actionName.start][uciDiagnostic.optName.size]=id(p).value,a[uciDiagnostic.fileName][uciDiagnostic.actionName.start][uciDiagnostic.optName.timeOut]=id(h).value):(a[uciDiagnostic.fileName][uciDiagnostic.actionName.start][uciDiagnostic.optName.type]=y,a[uciDiagnostic.fileName][uciDiagnostic.actionName.start][uciDiagnostic.optName.addr]=b.value,a[uciDiagnostic.fileName][uciDiagnostic.actionName.start][uciDiagnostic.optName.hops]=
id(q).value),$.action(a,function(a){a[ERR_CODE]<ENONE?(t(a[ERR_CODE]),id(g).value=btn.startdiag,id("diagnoseMode").disable(!1)):0<=a[ERR_CODE]&&(d&&(e=parseInt(a[uciDiagnostic.optName.instanceId])),c.innerHTML="<pre></pre>",u())})):btn.stopdiag==a.value&&(a.value=btn.startdiag,id("diagnoseMode").disable(!1),a={},a[uciDiagnostic.fileName]={},a[uciDiagnostic.fileName][uciDiagnostic.actionName.stop]={},d&&(a[uciDiagnostic.fileName][uciDiagnostic.actionName.stop][uciDiagnostic.optName.instanceId]=e),
$.action(a,function(a){a[ERR_CODE]==ENONE&&(d&&(e=null),c.innerHTML=c.innerHTML.replace(/<\/pre>/gi,"<br />***** User canceled *****<br /></pre>"),k.scrollTo(c.offsetHeight))}))}var g="start",m="doType1",s="doType2",n="sendNum",p="pSize",h="overTime",q="trHops",x=uciDiagnostic.optName.pingMode,y=uciDiagnostic.optName.tracertMode,e=null,l=uciDiagnostic.optValue;selectInit("diagnoseMode",[{str:label.manualDiagnose,value:l.manualDiag},{str:label.fastDiagnose,value:l.fastDiag}],l.manualDiag,function(a){a==
l.manualDiag?loadPage("DiagnosticManual.htm","diaCon"):a==l.fastDiag&&loadPage("DiagnosticFast.htm","diaCon")});var b=id("addr"),d=Boolean("undefined"!=typeof $.diagnoseCapability&&1==parseInt($.diagnoseCapability.support_multi_clients));id(n).value=4;id(p).value=64;id(h).value=1;id(q).value=20;id(m).checked="true";r();id(m).onclick=r;id(s).onclick=r;id(g).onclick=v;b.onkeyup=function(a){a=a||window.event;13==a.keyCode&&v()};b.focus();var k;k=new NiceScroll("textareaDiagCon");k.scrollTipOpacity(1);
k.init()}init();
</script><style type="text/css">input.inputDiag{margin-left:0;vertical-align:middle}fieldset.fieldsetDiag{border:1px solid #ced7e0;border-radius:2px;height:320px;width:720px;margin:0;background-color:white}#textareaDiagCon{height:222px;width:450px;margin-left:10px;overflow:hidden;word-break:break-all;word-wrap:break-word}#diagnostResult{color:#000;font-size:12px;text-align:left;white-space:pre-wrap}#diagnostResult pre{white-space:pre-wrap;word-break:keep-all;word-wrap:break-word}input.diagVb{padding:0;vertical-align:middle}div.context{width:720px;padding:24px 0 40px 48px}label.range{margin-left:4px}label.verticalFormat{vertical-align:middle}label.filterCheckCon{margin:0 24px 0 8px}ul.lineLWide{width:100%}li.line label.noMargin{margin-left:0}</style>