
<fieldset class="cbi-section">
	<table>
	  <tr><td width="100%" colspan="4">
	  	<p align="center">
	  		<b> 组件的状态显示，运行前请确保各项目显示正常，需要更新请到全局设置页面操作 </b>
	  	</p>
	  </td></tr>
		<tr><td width="25%"> 策略组节点选择 备份日期 </td><td width="25%" align="left" id="_historychecktime"><%:Collecting data...%></td><td width="25%"> lhie1 规则更新日期 </td><td width="25%" align="left" id="_lhie1"><%:Collecting data...%></td></tr>
		<tr><td width="25%"> ConnersHua 规则更新日期 </td><td width="25%" align="left" id="_ConnersHua"><%:Collecting data...%></td><td width="25%"> ConnersHua 回国规则更新日期 </td><td width="25%" align="left" id="_ConnersHua_return"><%:Collecting data...%></td></tr>
		<tr><td width="25%"> 大陆IP白名单 更新日期 </td><td width="25%" align="left" id="_chnroute"><%:Collecting data...%></td><td width="25%"> GEOIP（By MaxMind）数据库日期 </td><td width="25%" align="left" id="_ipdb"><%:Collecting data...%></td></tr>
	</table>
</fieldset>

<script type="text/javascript">//<![CDATA[
	var ipdb = document.getElementById('_ipdb');
	var lhie1 = document.getElementById('_lhie1');
	var ConnersHua = document.getElementById('_ConnersHua');
	var ConnersHua_return = document.getElementById('_ConnersHua_return');
	var chnroute = document.getElementById('_chnroute');
	var historychecktime = document.getElementById('_historychecktime');
	XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "state")%>', null, function(x, status) {
		if ( x && x.status == 200 ) {
			ipdb.innerHTML = status.ipdb ? "<b><font color=green>"+status.ipdb+"</font></b>" : "<b><font color=red>"+"<%:File Not Exist%>"+"</font></b>";
			lhie1.innerHTML = status.lhie1 ? "<b><font color=green>"+status.lhie1+"</font></b>" : "<b><font color=red>"+"<%:File Not Exist%>"+"</font></b>";
			ConnersHua.innerHTML = status.ConnersHua ? "<b><font color=green>"+status.ConnersHua+"</font></b>" : "<b><font color=red>"+"<%:File Not Exist%>"+"</font></b>";
			ConnersHua_return.innerHTML = status.ConnersHua_return ? "<b><font color=green>"+status.ConnersHua_return+"</font></b>" : "<b><font color=red>"+"<%:File Not Exist%>"+"</font></b>";
			chnroute.innerHTML = status.chnroute ? "<b><font color=green>"+status.chnroute+"</font></b>" : "<b><font color=red>"+"<%:File Not Exist%>"+"</font></b>";
			if ( status.historychecktime != "0" ) {
			   historychecktime.innerHTML = "<b><font color=green>"+status.historychecktime+"</font></b>";
			}
		  else {
		  	 historychecktime.innerHTML = "<b><font color=green>"+"<%:暂未备份%>"+"</font></b>";
		  }
		}
	});
	XHR.poll(10, '<%=luci.dispatcher.build_url("admin", "services", "openclash", "state")%>', null, function(x, status) {
		if ( x && x.status == 200 ) {
			ipdb.innerHTML = status.ipdb ? "<b><font color=green>"+status.ipdb+"</font></b>" : "<b><font color=red>"+"<%:File Not Exist%>"+"</font></b>";
			lhie1.innerHTML = status.lhie1 ? "<b><font color=green>"+status.lhie1+"</font></b>" : "<b><font color=red>"+"<%:File Not Exist%>"+"</font></b>";
			ConnersHua.innerHTML = status.ConnersHua ? "<b><font color=green>"+status.ConnersHua+"</font></b>" : "<b><font color=red>"+"<%:File Not Exist%>"+"</font></b>";
			ConnersHua_return.innerHTML = status.ConnersHua_return ? "<b><font color=green>"+status.ConnersHua_return+"</font></b>" : "<b><font color=red>"+"<%:File Not Exist%>"+"</font></b>";
			chnroute.innerHTML = status.chnroute ? "<b><font color=green>"+status.chnroute+"</font></b>" : "<b><font color=red>"+"<%:File Not Exist%>"+"</font></b>";
			if ( status.historychecktime != "0" ) {
			   historychecktime.innerHTML = "<b><font color=green>"+status.historychecktime+"</font></b>";
			}
		  else {
		  	 historychecktime.innerHTML = "<b><font color=green>"+"<%:暂未备份%>"+"</font></b>";
		  }
		}
	});
//]]></script>