Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
midoks committed Oct 11, 2024
1 parent 60f3dbf commit c85fb94
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
15 changes: 15 additions & 0 deletions plugins/alist/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,19 @@ def clearCopyTask():
restart()
return mw.returnJson(True, '清空成功并重启服务!')

def homePage():

import json
content = mw.readFile(getConf())
data = json.loads(content)
http_port = data['scheme']['http_port']
ip = mw.getLocalIp()
if mw.isAppleSystem():
ip = '127.0.0.1'
url = 'http://'+ip+":"+str(http_port)
# print(url)
return mw.returnJson(True, 'ok!', url)

if __name__ == "__main__":
func = sys.argv[1]
if func == 'status':
Expand Down Expand Up @@ -274,5 +287,7 @@ def clearCopyTask():
print(readConfigTpl())
elif func == 'clear_copy_task':
print(clearCopyTask())
elif func == 'home_page':
print(homePage())
else:
print('error')
13 changes: 11 additions & 2 deletions plugins/alist/js/alist.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,25 @@ function clearTaskCopy(){
layer.confirm('您真的要清空复制任务吗?', { icon: 3, closeBtn: 2 }, function() {
alistPost('clear_copy_task', '', {}, function(data){
var rdata = $.parseJSON(data.data);
showMsg(rdata.msg, function(){},{ icon: rdata.status ? 1 : 2 });
showMsg(rdata.msg, function(){},{ icon: rdata.status ? 1 : 2 });
});
});
}

function commonHomePage(){

alistPost('home_page', '', {}, function(data){
var rdata = $.parseJSON(data.data);
window.open(rdata.data);
});
}

//php超时限制
function alistCommonFunc(){
var con = '';
con += '<hr/><p class="conf_p" style="text-align:center;">\
<button class="btn btn-default btn-sm" onclick="clearTaskCopy()">清空复制任务</button> \
<button class="btn btn-default btn-sm" onclick="commonHomePage()">主页</button>\
<button class="btn btn-default btn-sm" onclick="clearTaskCopy()">清空复制任务</button>\
</p>';

$(".soft-man-con").html(con);
Expand Down

0 comments on commit c85fb94

Please sign in to comment.