<%+cbi/valueheader%>

<script type="text/javascript">//<![CDATA[
	function act_download_rule(btn,filename)
	{
		btn.disabled = true;
		btn.value    = '<%:Downloading...%> ';
		XHR.get('<%=luci.dispatcher.build_url("admin", "services", "clash","ruleproviders")%>',
			{
				filename: filename
			},
			function(x,status)
			{
				if ( x && x.status == 200 ) {
					if(status.rulep=="0")
					{
						btn.value    = '<%:Error%>';
					}
					else if (status.rulep=="1")
					{
						btn.value    = '<%:Successful%>';
						window.location.reload();
					}else if (status.rulep=="2")
					{
						btn.value = '<%:Not Updated%>';
					}
				}
				else {
					btn.value    = '<%:Timeout%>';
				}
			}
		);
		btn.disabled = false;
		return false;
	}
//]]></script>


<input type="button" class="cbi-button cbi-input-reload" value="<%:Update Rule Providers%>" onclick="return act_download_rule(this,'<%=self:cfgvalue(section)%>')" />

<%+cbi/valuefooter%>