

<div class="detailCon">
	<ul class="line">
		<li class="line lineD">
			<label class="des desA">{%label.beginTime%}</label>
			<input id="beginDate" type="text" class="text textA1 textCalender" readonly="true" />
			<input id="beginTime" type="text" class="text textA1 time textClock" readonly="true" />
		</li>
		<li class="line lineD">
			<label class="des desA">{%label.endTime%}</label>
			<input id="endDate" type="text" class="text textA1 textCalender" readonly="true" />
			<input id="endTime" type="text" class="text textA1 time textClock" readonly="true" />
		</li>
	</ul>
	<ul class="line logType">
		<li class="line lineD">
			<label class="des desA">{%label.logTypeMain%}</label>
			<span class="selCon">
				<span id="mainType" class="select">
					<span class="value hsValueA"></span>
					<i class="arrow"></i>
				</span>
			</span>
		</li>
		<li class="line lineD lineD2">
			<input id="searchLog" type="button" value="{%btn.searchLog%}" class="subBtnB btnA" />
		</li>
	</ul>
	<ul class="line logTypeTips">
		<li class="line lineD">
			<label class="des desLogType">{%label.sysShowType%}</label>
			<label id="showingType" class="des desLogType"></label>
		</li>
	</ul>
	<div class="tableCon">
		<div class="tableBorderCon">
			<table id="logTbl" class="dataGrid">
			</table>
		</div>
		<div id="tabBtn">
			<!--input id="cleanLog" type="button" value="{%btn.cleanLog%}" class="subBtnB btnA btnSmall" /-->
			<input id="outputLog" type="button" value="{%btn.exportLog%}" class="subBtnB btnA btnSmall" />
		</div>
	</div>
</div>
<script type="text/javascript">function init(){function C(a,b){switch(parseInt(a)){case ENONE:return!0;case IPCSYSLOGPARAERR:showStr=errStr.sysLogParErr;break;case IPCSYSLOGTIMEERR:showStr=errStr.sysLogTimeErr;break;case IPCUMGUESTNAUTH:showStr=errStr.invPermissionDenied;break;default:showStr=errStr.invRequestFail}closeToast();showAlert(showStr,b);return!1}function H(a){x=a}function y(a,b,e,c){var f={},d={},k={};f[l]=d;d[I]=k;k[g.startTime]=b;k[g.endTime]=e;k[g.pageNum]=a;k[g.logsPerPage]=s;k[g.type]=c||p;showToast();$.action(f,
function(b){if(C(b[ERR_CODE])){t&&(t=!1,id("showingType").innerHTML=z[p]);closeToast();var e=a,c=b[A],f=b[g.total];b=b[g.page];var d,n,k,l=0;q.blankTable();r=[];if(!0==$.local)for(var c=[],f=s,h=1,m=20;h<m;h++)c[h-1]={},c[h-1][A+"_"+h]="<1>123123123[log]11111111";e>b&&(e=b);k=(e-1)*s+1;h=0;for(m=c.length;h<m;h++)d={},n=c[h][A+"_"+(k+h)],d.date=B(1E3*parseInt(n.substring(n.indexOf(">")+1,n.indexOf("[")),10)),d.event=n.substring(n.indexOf("]")+1),r[l]=d,l++;0<b?q.refreshPage(r,f,b):(q.setDataSource(r),
q.refresh(e))}else t=!1;!0==D&&(D=!1,showDetailCon())});"none"!=$("#logTblpagIngList").css("display")?document.getElementById("tabBtn").className="tableFunc":document.getElementById("tabBtn").className="tableFuncNoPage"}function d(a){10>a&&(a="0"+a);return a}function B(a){a=void 0==a?new Date:new Date(a);return a.getFullYear()+"-"+d(a.getMonth()+1)+"-"+d(a.getDate())+" "+d(a.getHours())+":"+d(a.getMinutes())+":"+d(a.getSeconds())}function J(a){var b={};b[l]={};b[l][NAME]=E;$.query(b,function(b){!0==
C(b[ERR_CODE])&&(F=!0==$.local?1E3:parseInt(b[l][E][K]),a(F))})}function f(a,b){var e=new Date,c=a.value.split("-"),d=b.value.split(":");e.setFullYear(c[0],parseInt(c[1],10)-1,c[2]);e.setHours(parseInt(d[0],10));e.setMinutes(parseInt(d[1],10));e.setSeconds(parseInt(d[2],10));return parseInt(e.getTime()/1E3,10)}function L(){var a={},b={};a[l]={};b=a[l][M]={};b[g.startTime]=f(m,u);b[g.endTime]=f(v,w);b[g.type]=p;$.action(a,function(a){location.href=$.orgURL(a[g.url])})}function N(){q.init({id:"logTbl",
data:r,hasID:!0,edit:!1,hasSelBox:!1,paging:{num:s},head:[{field:label.time,width:80},{field:label.event,width:140}],list:[{name:"date"},{name:"event"}],pageTurnFunc:function(a){y(a,f(m,u),f(v,w))}})}function O(){$.each(G,function(a,b){z[b.value]=b.str})}var F=0,s=8,c=uciSystem.optValue.types,x=c.all,p=c.all,q=new DataGrid,r=[],l=uciSystem.fileName,g=uciSystem.optName,I=uciSystem.actionName.readLogs,E=uciSystem.secName.clockStatus,K=uciSystem.optName.seconds,M=uciSystem.actionName.downloadLogs,A=
uciSystem.secType.syslog,G=[{str:label.sysTypeAll,value:c.all},{str:label.sysTypeWarn,value:c.alarm},{str:label.sysTypeException,value:c.abnormal},{str:label.sysTypeAction,value:c.op},{str:label.sysTypeInfo,value:c.info}],z={},m=id("beginDate"),v=id("endDate"),u=id("beginTime"),w=id("endTime"),D=!0,t=!1;(function(){laydate({elem:"#beginDate"});laydate({elem:"#endDate"});timePickerInit("beginTime");timePickerInit("endTime");selectInit("mainType",G,c.all,H);N();O();id("showingType").innerHTML=z[p];
J(function(a){var b=604800<a?a-604800:0,c=B(1E3*b).split(" "),d=B(1E3*a).split(" ");m.value=c[0];v.value=d[0];u.value=c[1].replace(/\:/g," : ");w.value=d[1].replace(/\:/g," : ");y(1,b,a)});id("searchLog").onclick=function(){p=x;t=!0;y(1,f(m,u),f(v,w),x)};id("outputLog").onclick=L})()}init();
</script><style type="text/css">ul.line li.lineD{width:70%}ul.line li.lineD2{width:30%;text-align:right}li.lineD input.dateText{width:156px}ul.logType{position:relative;*z-index:2}ul.logTypeTips li.lineD{margin-bottom:0}ul.logTypeTips{z-index:1;position:relative}label.desLogType{font-size:13px;color:#666;line-height:32px}ul.logType li.logType{width:50%}span.dateCon{position:relative}span.dateCon i.dateIcon{position:absolute}input.textClock{background:url(../web-static/images/clock.png) no-repeat 160px 5px #fff;cursor:pointer;text-align:left;text-indent:10px}input.textCalender{background:url(../web-static/images/calender.png) no-repeat 160px 5px #fff;cursor:pointer;text-align:left;text-indent:10px;margin-right:8px}div.tableCon div.tableBorderCon{margin-top:0!important}div.tableFunc{margin-top:7px;text-align:right;display:inline-block;*display:inline;*zoom:1}div.tableFuncNoPage{margin-top:7px;*margin-top:-41px;text-align:right;display:inline-block;*display:inline;*zoom:1}div.tableFunc input,div.tableFuncNoPage input{margin-right:12px}</style>