Skip to content

Commit

Permalink
1.7.5.2
Browse files Browse the repository at this point in the history
  • Loading branch information
frainzy1477 committed Jun 30, 2020
1 parent cd32c56 commit eb88678
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions luasrc/view/clash/status.htm
Original file line number Diff line number Diff line change
Expand Up @@ -240,30 +240,22 @@
if ( x && x.status == 200 ) {
if(status.new_version > status.current_version)
{
dnew.innerHTML ='<center><input type="button" class="cbi-button cbi-button-apply" value="<%:Download Update%>" onclick="return download_update(this)"/></center>';
dnew.innerHTML ='<center><br><a href="https://github.com/frainzy1477/luci-app-clash/releases/download/'+status.new_version+'/luci-app-clash_'+status.new_version+'_all.ipk" class="btn" style="height:20px;font-size:15px;margin-top:-20px;background-color:#568fa1;color:#ffffff;" target="_blank"><%:Download Update%></a></center>';

}
}
});

XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "services", "clash", "check_status")%>', null, function(x, status) {
XHR.poll(3, '<%=luci.dispatcher.build_url("admin", "services", "clash", "check_status")%>', null, function(x, status) {
if ( x && x.status == 200 ) {
if(status.new_version > status.current_version)
{
dnew.innerHTML ='<center><input type="button" class="cbi-button cbi-button-apply" value="<%:Download Update%>" onclick="return download_update(this)"/></center>';
dnew.innerHTML ='<center><br><a href="https://github.com/frainzy1477/luci-app-clash/releases/download/'+status.new_version+'/luci-app-clash_'+status.new_version+'_all.ipk" class="btn" style="height:20px;font-size:15px;margin-top:-20px;background-color:#568fa1;color:#ffffff;" target="_blank"><%:Download Update%></a></center>';
}
}
});


function download_update(btn)
{
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "clash", "check_status")%>', null, function(x, status) {

btn.value = '<%:Download Update%>';
url='https://github.com/frainzy1477/luci-app-clash/releases/download/'+status.new_version+'/luci-app-clash_'+status.new_version+'_all.ipk';
window.open(url);
});
}


//]]></script>
Expand Down

0 comments on commit eb88678

Please sign in to comment.