

<div class="ipFltObj detailCon">
	<div class="tableCon">
		<div class="tableBorderCon"><table id="diskTable" class="dataGrid"></table></div>
		<div id="editDiskMgt" class="tableEditLyCon">
			<div class="tableEditCon tableEditConA">
				<div class="innerCon">
					<h4 class="title">{%label.diskSetting%}</h4>
					<ul class="line">
						<li class="line lineF">
							<label class="des desA" for="diskId">{%label.diskId%}</label>
							<span id="diskNum" class="text textA"></span>
						</li>
						<li class="line lineF">
							<label class="des desA" for="rwAttrSel">{%label.diskProperty%}</label>
							<span class="selCon">
								<span id="rwAttrSel" class="select">
									<span class="value hsValueA"></span>
									<i class="arrow"></i>
								</span>
							</span>
						</li>
						<li class="line lineF">
							<label class="des desA" for="groupSel">{%label.group%}</label>
							<span class="selCon">
								<span id="groupSel" class="select">
									<span class="value hsValueA"></span>
									<i class="arrow"></i>
								</span>
							</span>
						</li>
					</ul>
					<div class="tablePopUpToolBar tablePopUpToolBarA"></div>
				</div>
			</div>
		</div>
	</div>
	<ul class="line">
		<li class="line">
			<label class="des desC2">{%menuStr.diskManage%}</label>
		</li>
	</ul>
	<ul class="line lineCon"></ul>
	<ul class="line lineX1">
		<li class="line lineX">
			<label class="des desA mlR">{%label.cycleUse%}</label>
			<div id="ipFltrSwitch" class="switchCon">
				<i class="switchBg"></i>
				<i class="switchBall"></i>
			</div>
			<label class="des desH">ON</label>
		</li>
	</ul>
	<ul class="line">
		<li class="line lineX">
			<label class="des desA mlR">{%label.videoRatio%}</label>
			<input class="text textTime" id="videoRatio" maxlength="3" />
			<label class="des desC">%</label>
			<label class="des desC mlR">{%label.videoSpace%}</label>
			<span id="videoSpace" class="text textA"></span>
		</li>
	</ul>
	<ul class="line lineL">
		<li class="line lineX">
			<label class="des desA mlR">{%label.pictureRatio%}</label>
			<input class="text textTime" id="pictureRatio" maxlength="3" />
			<label class="des desC">%</label>
			<label class="des desC mlR">{%label.pictureSpace%}</label>
			<span id="pictureSpace" class="text textA"></span>
		</li>
	</ul>
	<div class="funcBtnCon">
		<!--<input class="subBtn btnA" type="button" id="resetDefault" value="{%btn.resetDefault%}" />-->
		<input class="subBtn btnA" type="button" id="save" value="{%btn.save%}" />
	</div>
</div>
<script type="text/javascript">function init(){function u(a,c){var b="";switch(a){case ENONE:return!0;case ESYSTEM:b=errStr.systemErr;break;case IPCUMGUESTNAUTH:b=errStr.invPermissionDenied;break;case EDISKLOOP:b=errStr.diskLoopErr;break;case EDISKRATIO:b=errStr.diskRatioErr;break;case EDISKNAME:b=errStr.diskNameErr;break;default:b=errStr.invRequestFail}closeToast();showAlert(b,c);return!1}function J(a){cycleUseState=a}function Q(){var a=id("videoRatio").value;checkNum(a)?(100<a&&(a=100,id("videoRatio").value=100),id("pictureRatio").value=
100-a):showNote("videoRatio",errStr.inputNumFormatErr)}function R(){var a=id("pictureRatio").value;checkNum(a)?(100<a&&(a=100,id("pictureRatio").value=100),id("videoRatio").value=100-a):showNote("pictureRatio",errStr.inputNumFormatErr)}function k(a){switch(a){case uciDiskManage.optValue.normal:return label.normal2;case uciDiskManage.optValue.insufficient:return label.insufficient;case uciDiskManage.optValue.unformatted:return label.unformatted;case uciDiskManage.optValue.offline:return label.offline;
case uciDiskManage.optValue.formatting:return label.formatting;case uciDiskManage.optValue.abnormal:return label.abnormal;case uciDiskManage.optValue.none:return label.diskNone;case uciDiskManage.optValue.full:return label.diskFull;default:return a}}function g(a){a=parseInt(a,10);a=1.073741824E7<=a?(a/1073741824).toFixed(2)+"GB":"0.00GB";return a.toString()}function q(a){var c=a.substring(a.length-2,a.length-1).toUpperCase();return a="G"==c?1073741824*parseFloat(a.substring(0,a.length-2)):"M"==c?
1048576*parseInt(a.substring(0,a.length-2)):"K"==c?1024*parseInt(a.substring(0,a.length-2)):parseInt(a.substring(0,a.length-1))}function S(a){return function(c,b){var f,d;if("object"===typeof c&&"object"===typeof b&&c&&b)return f=c[a],d=b[a],f===d?0:typeof f===typeof d?f<d?-1:1:typeof f<typeof d?-1:1;showAlert(errStr.diskAndNetErr)}}function n(a){var m={},b={},f=0,d=0,B=0,C=0,D=0,K=0;v?(id("videoRatio").onblur=Q,id("pictureRatio").onblur=R):($("#videoRatio").parent().hide(),$("#pictureRatio").parent().hide());
m[c]=b;b[KEY_NAME]=[s,w,x];b[KEY_TABLE]=[L];$.query(m,function(b){if(!0==u(b[ERR_CODE]))if(!0==$.local)h=[{disk_id:"3",total_space:"500G",free_space:"300G",status:"normal",rw_attr:"rw",type:"local"}],ipSwitch=new Switch("ipFltrSwitch",0,J),a({});else{var m=formatTableData(b[c][L]);v&&(id("videoRatio").value=b[c][w][y],id("pictureRatio").value=b[c][x][y]);K=m.length;h=[];for(var n=0,t=K;n<t;n++)if(itemInfo=m[n],itemInfo[z]!=uciDiskManage.optValue.local||itemInfo[e]!=uciDiskManage.optValue.offline){h[D]=
{};itemDisk=h[D];D++;if(null==itemInfo)break;f+=q(itemInfo[M]);d+=q(itemInfo[T]);B+=q(itemInfo[U]);C+=q(itemInfo[V]);itemDisk[p]=parseInt(itemInfo[p]);itemDisk[e]=k(itemInfo[e]);W==itemInfo[e]?(itemDisk[e]=0==d&&N==b[c][s][E]?k(uciDiskManage.optValue.full):k(uciDiskManage.optValue.normal),X==itemInfo[A]?itemDisk[e]=k(label.dilatant_suspect):Y==itemInfo[A]?itemDisk[e]=k(label.dilatant):Z==itemInfo[A]?itemDisk[e]=k(label.cid_illegal):aa==itemInfo[A]&&(itemDisk[e]=k(label.low_speed)),itemDisk[F]=g(q(itemInfo[M]))+
"/"+g(d)):itemDisk[F]=g(q(itemInfo[ba]))+"/"+g(d);var G=itemDisk,I=H,l;a:switch(l=itemInfo[H],l){case uciDiskManage.optValue.r:l=label.readOnly;break a;case uciDiskManage.optValue.rw:l=label.diskRWAble;break a}G[I]=l;G=itemDisk;I=z;a:switch(l=itemInfo[z],l){case uciDiskManage.optValue.local:l=label.local;break a;case uciDiskManage.optValue.remote:l=label.remote;break a}G[I]=l}h.sort(S(p));id("videoSpace").innerHTML=g(f)+"/"+g(d);id("pictureSpace").innerHTML=g(B)+"/"+g(C);r.setDataSource(h);r.refresh();
O();a(b)}})}function O(){$.setTimeout(function(){$("td:contains("+label.offline+")").next().children().css("display","none");$("td:contains("+label.formatting+")").next().children().css("display","none")},0)}var c=uciDiskManage.fileName,E=uciDiskManage.optName.loop,ba=uciDiskManage.optName.total_space,M=uciDiskManage.optName.video_total_space,T=uciDiskManage.optName.video_free_space,U=uciDiskManage.optName.picture_total_space,V=uciDiskManage.optName.picture_free_space,e=uciDiskManage.optName.status,
A=uciDiskManage.optName.detect_status,H=uciDiskManage.optName.rw_attr,p=uciDiskManage.optName.disk_id,z=uciDiskManage.optName.type,y=uciDiskManage.optName.ratio,t=uciDiskManage.optName.result,ca=uciDiskManage.optName.percent,W=uciDiskManage.optValue.normal,X=uciDiskManage.optValue.dilatant_suspect,Y=uciDiskManage.optValue.dilatant,Z=uciDiskManage.optValue.cid_illegal,aa=uciDiskManage.optValue.low_speed,P=uciDiskManage.optValue.on,N=uciDiskManage.optValue.off,w=uciDiskManage.secName.video,x=uciDiskManage.secName.picture,
s=uciDiskManage.secName.storage,L=uciDiskManage.secType.disk_info,da=uciDiskManage.actionName.get_format_status,F="space",h,r,v=!1;parseInt($.moduleSpec[uciFunction.optName.licensePlateRecongnition]);r=new DataGrid;r.init({max:32,id:"diskTable",data:h,hasID:!1,hasSelBox:!1,edit:!1,head:[{field:label.diskId,width:120,className:"TAC"},{field:label.diskType,width:100},{field:label.diskProperty,width:150},{field:label.diskSpace,width:275},{field:label.diskStatus,width:150},{field:"",width:250}],list:[{name:p,
maxSize:30,className:"TAC"},{name:z,maxSize:30},{name:H},{name:F},{name:e},{type:"btn",value:label.format,className:"formatLink",click:function(a){function m(){var b={},f={},d=$("div p.formatProgressBar"),e=$("div input.formatText"),g=$("div div.formatProgressBg").css("width"),k=g.substr(0,g.length-2);$("#diskTable tbody tr:eq("+(a+1)+") td:eq(4)").html(label.formatting);b[c]={};b[c][da]=f;f[p]=h[a][p].toString();showToast();$.action(b,function(a){u(a[ERR_CODE])&&("success"==a[t]?(percent=100,n(function(a){e.val("100%");
d.css("width",parseInt(percent)*k/100);showToast("success");$.setTimeout(function(){r.setDataSource(h);r.refresh();O()},1E3)})):"waiting"==a[t]?($.setTimeout(m,1E3),percent=a[ca],d.css("width",parseInt(percent)*k/100),e.val(parseInt(percent)+"%")):"failed"==a[t]&&(closeToast(),showAlert(errStr.diskFormatErr),n()))})}h[a][e]==label.offline?showAlert(label.offlineTip):showConfirmC(label.formatTitle,label.formatTip,function(b){if(!0==b){b=$("#diskTable tbody tr:eq("+(a+1)+") td:last-child");var f=document.createElement("div"),
d=document.createElement("p"),e=document.createElement("input");f.className="formatProgressBg";d.className="formatProgressBar";e.className="formatText";e.value="0%";b.children().css("display","none");f.appendChild(d);b.append(f);b.append(e);b={};showToast();b[c]={};b[c][uciDiskManage.actionName.format_disk]=h[a][p].toString();$.action(b,function(a){u(a[ERR_CODE])&&m()})}})}}]});n(function(a){ipSwitch=new Switch("ipFltrSwitch",a[c][s][E]==P?1:0,J);showDetailCon()});id("save").onclick=function(){var a=
{};if(!v||checkNum(id("videoRatio").value)&&checkNum(id("pictureRatio").value))showToast(),a[c]={},a[c][s]={},a[c][s][E]=0==ipSwitch.state?N:P,v&&(a[c][w]={},a[c][w][y]=id("videoRatio").value,a[c][x]={},a[c][x][y]=id("pictureRatio").value),$.modify(a,function(a){u(a[ERR_CODE])&&showToast("success")})}}init();
</script><style type="text/css">div.authorityListFunCon{margin:15px 0 0 80px}div.authorityListFunCon input{background:#404040!important;margin-right:10px}div.authorityListFunCon input{*padding-left:18px;*padding-right:18px}div.tableEditConA{width:400px}label.mlR{margin-right:4px!important;width:90px!important}input.formatLink{background:transparent;color:#325fe0;cursor:pointer;font-size:13px;border:0;padding:0}input.textTime{height:24px;line-height:24px;margin-right:12px;width:40px}ul.lineX1{font-size:0;width:720px}ul.line label.desC2{font-size:16px;color:#7a8599;margin-top:32px}ul.lineCon{background:url(../../web-static/images/line.png) repeat-x 0 10px;clear:both;padding-top:42px;font-size:0}div div.formatProgressBg{border-radius:10px;overflow:hidden;height:8px;margin:15px auto;border:1px solid #c8cdd9;background:#d3dde6;*zoom:1;display:inline-block;*display:inline;vertical-align:middle;width:60%;margin:0}div p.formatProgressBar{width:0;height:10px;position:relative;top:-1px;font-size:0;border-radius:10px;background:#5a92ff}div input.formatText{*zoom:1;width:25%;display:inline;background-color:transparent;border:0;text-align:left;vertical-align:middle;margin-left:10px}ul.lineL{width:100%}</style>