
<fieldset class="cbi-section">
	<table>
	  <tr><td width="100%" colspan="4" align="center"><b> 一些必要的状态显示，运行前请确保各项目显示正常，需要更新请到更新设置页面操作 </b></td></tr>
		<tr><td width="25%"> OpenClash 配置文件状态 </td><td width="25%" align="left" id="_config_check"><%:Collecting data...%></td><td width="25%"> OpenClash 配置文件更新日期 </td><td width="25%"v align="left" id="_config"><%:Collecting data...%></td></tr>
		<tr><td width="25%"> GEOIP(By MaxMind) 数据库日期 </td><td width="25%" align="left" id="_ipdb"><%: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>
	</table>
</fieldset>

<script type="text/javascript">//<![CDATA[
	var config = document.getElementById('_config');
	var ipdb = document.getElementById('_ipdb');
	var lhie1 = document.getElementById('_lhie1');
	var ConnersHua = document.getElementById('_ConnersHua');
	var ConnersHua_return = document.getElementById('_ConnersHua_return');
	var config_check = document.getElementById('_config_check');
	XHR.poll(2, '<%=luci.dispatcher.build_url("admin", "services", "openclash", "state")%>', null, function(x, status) {
		if ( x && x.status == 200 ) {
			config_check.innerHTML = status.config_check ? '<b><font color=green><%:Config Normal%></font></b>' : '<b><font color=red><%:Config Abnormal%></font></b>';
			config.innerHTML = status.config ? "<b><font color=green>"+status.config+"</font></b>" : "<b><font color=red>"+"<%:File No Update%>"+"</font></b>";
			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>";
		}
	});
//]]></script>