
<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="_config_check"><%:Collecting data...%></td><td width="25%"> 配置文件更新日期 </td><td width="25%" 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.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "state")%>', null, function(x, status) {
		if ( x && x.status == 200 ) {
		  if (status.config_check == "") {
		     config_check.innerHTML = '<b><font color=green><%:Config Normal%></font></b>';
		  }
		  else if (status.config_check == "1") {
		     config_check.innerHTML = '<b><font color=red><%:未找到配置文件%></font></b>';
		  }
		  else {
		     config_check.innerHTML = '<b><font color=red>'+status.config_check+'<%: - 参数异常%></font></b>';
		  }
			if (status.config == "1") {
			   config.innerHTML = "<b><font color=red><%:未找到配置文件%></font></b>";
			}
			else if (status.config == "0") {
			   config.innerHTML = "<b><font color=green><%:原始配置文件%></font></b>";
			}
			else {
			   config.innerHTML = "<b><font color=green>"+status.config+"</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>";
		}
	});
	XHR.poll(10, '<%=luci.dispatcher.build_url("admin", "services", "openclash", "state")%>', null, function(x, status) {
		if ( x && x.status == 200 ) {
		  if (status.config_check == "") {
		     config_check.innerHTML = '<b><font color=green><%:Config Normal%></font></b>';
		  }
		  else if (status.config_check == "1") {
		     config_check.innerHTML = '<b><font color=red><%:未找到配置文件%></font></b>';
		  }
		  else {
		     config_check.innerHTML = '<b><font color=red>'+status.config_check+'<%: - 参数异常%></font></b>';
		  }
			if (status.config == "1") {
			   config.innerHTML = "<b><font color=red><%:未找到配置文件%></font></b>";
			}
			else if (status.config == "0") {
			   config.innerHTML = "<b><font color=green><%:原始配置文件%></font></b>";
			}
			else {
			   config.innerHTML = "<b><font color=green>"+status.config+"</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>