small-package/luci-app-clash/luasrc/view/clash/game_rule.htm

38 lines
837 B
HTML

<%+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","game_rule")%>',
{
filename: filename
},
function(x,status)
{
if ( x && x.status == 200 ) {
if(status.game_rule=="0")
{
btn.value = '<%:Error%>';
}
else
{
btn.value = '<%:Successful%>';
window.location.reload();
}
}
else {
btn.value = '<%:Timeout%>';
}
}
);
btn.disabled = false;
return false;
}
//]]></script>
<input type="button" class="cbi-button cbi-input-reload" value="<%:Update Rule%>" onclick="return act_download_rule(this,'<%=self:cfgvalue(section)%>')" />
<%+cbi/valuefooter%>