<%+cbi/valueheader%>

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

	function check_port(btn, func)
	{
		btn.disabled = true;
		btn.value    = '<%:Check...%>';
		XHR.get('<%=luci.dispatcher.build_url("admin", "services", "dnscrypt-proxy","resolve_c")%>',
			{ set:func },
			function(x, rv) {
			if(x.readyState === 4 ) {
			if(x.status === 200) {try{res = JSON.parse(x.responseText);}catch(e){res=null;}
			if(res !==null && typeof(res) === "object") {var s = document.getElementById(func + '-status'); if (s)	s.innerHTML =res.ret; btn.disabled = false; btn.value = '<%:Check Server%>';}
			}}});
			return false;
	}
//]]></script>
<input type="button" class="cbi-button cbi-button-apply" value="<%:Check Server%>" onclick="return check_port(this,'<%=self.option%>')" />
<span id="<%=self.option%>-status"><em><%=self.value%></em></span>

<%+cbi/valuefooter%>