Skip to content

Commit eb88678

Browse files
author
frainzy1477
committed
1.7.5.2
1 parent cd32c56 commit eb88678

1 file changed

Lines changed: 4 additions & 12 deletions

File tree

luasrc/view/clash/status.htm

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -240,30 +240,22 @@
240240
if ( x && x.status == 200 ) {
241241
if(status.new_version > status.current_version)
242242
{
243-
dnew.innerHTML ='<center><input type="button" class="cbi-button cbi-button-apply" value="<%:Download Update%>" onclick="return download_update(this)"/></center>';
243+
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>';
244+
244245
}
245246
}
246247
});
247248

248-
XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "services", "clash", "check_status")%>', null, function(x, status) {
249+
XHR.poll(3, '<%=luci.dispatcher.build_url("admin", "services", "clash", "check_status")%>', null, function(x, status) {
249250
if ( x && x.status == 200 ) {
250251
if(status.new_version > status.current_version)
251252
{
252-
dnew.innerHTML ='<center><input type="button" class="cbi-button cbi-button-apply" value="<%:Download Update%>" onclick="return download_update(this)"/></center>';
253+
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>';
253254
}
254255
}
255256
});
256257

257258

258-
function download_update(btn)
259-
{
260-
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "clash", "check_status")%>', null, function(x, status) {
261-
262-
btn.value = '<%:Download Update%>';
263-
url='https://github.com/frainzy1477/luci-app-clash/releases/download/'+status.new_version+'/luci-app-clash_'+status.new_version+'_all.ipk';
264-
window.open(url);
265-
});
266-
}
267259

268260

269261
//]]></script>

0 commit comments

Comments
 (0)