kenzok8-package/luci-app-openclash/luasrc/view/openclash/download_rule.htm
github-actions[bot] ee56391bd7 update-02.28
2022-02-28 09:12:27 +08:00

42 lines
998 B
HTML

<%+cbi/valueheader%>
<script type="text/javascript">//<![CDATA[
function act_download_rule(btn,filename)
{
btn.disabled = true;
btn.value = '<%:Downloading Rule...%> ';
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash","download_rule")%>',
{
filename: filename
},
function(x,status)
{
if ( x && x.status == 200 ) {
if(status.rule_download_status=="0")
{
btn.value = '<%:Download Failed%>';
}
else if (status.rule_download_status=="1")
{
btn.value = '<%:Download Successful%>';
}
else if (status.rule_download_status=="2")
{
btn.value = '<%:Rule No Change%>';
}
}
else {
btn.value = '<%:Download Timeout%>';
}
}
);
btn.disabled = false;
return false;
}
//]]></script>
<input type="button" class="btn cbi-button cbi-input-reload" value="<%:Click to Update%>" onclick="return act_download_rule(this,'<%=self:cfgvalue(section)%>')" />
<%+cbi/valuefooter%>