<%+cbi/valueheader%>

<script type="text/javascript">//<![CDATA[

	function act_flush_dns_cache(btn)
	{
		btn.disabled = true;
		btn.value    = '<%:Flushing...%> ';
		XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash","flush_dns_cache")%>',
			null,
			function(x,status)
			{
				if ( x && x.status == 200 ) {
					if(status.flush_status == "0" || status.flush_status != "")
					{
						btn.value = '<%:Flush Failed%>';
						
					}
					else
					{
						btn.value = '<%:Flush Successful%>';
					}
				}
				else {
					btn.value = '<%:Flush Timeout%>';
				}
			}
		);
		btn.disabled = false;
		return false;
	};
	
//]]></script>


<input type="button" class="btn cbi-button cbi-input-reload" value="<%:Flush%>" onclick="return act_flush_dns_cache(this)" />
<%+cbi/valuefooter%>
