From 227be5258ebb3bf2401c99d35aed640f72402c3e Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Wed, 8 Jan 2025 15:01:48 +0800 Subject: [PATCH 1/4] up --- plugins/rsyncd/index.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/plugins/rsyncd/index.py b/plugins/rsyncd/index.py index a35c14a6a..a2c48cbae 100755 --- a/plugins/rsyncd/index.py +++ b/plugins/rsyncd/index.py @@ -387,9 +387,16 @@ def addRec(): args_ps = args['ps'] if not mw.isAppleSystem(): - os.system("mkdir -p " + args_path + " &") - os.system("chown -R www:www " + args_path + " &") - os.system("chmod -R 755 " + args_path + " &") + if os.path.exists(args_path): + import utils.file as utils_file + info = utils_file.getAccess(args_path) + file_chown = info['chown'] + if file_chown != 'www': + return mw.returnJson(False, '建议手动执行命令: chown -R www:www '+ args_path) + else: + os.system("mkdir -p " + args_path + " &") + os.system("chown -R www:www " + args_path + " &") + os.system("chmod -R 755 " + args_path + " &") delRecBy(args_name) From 19f55fde6eee820ac2d643d31946cbe05efe51c7 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Wed, 8 Jan 2025 15:03:16 +0800 Subject: [PATCH 2/4] Update rsyncd.js --- plugins/rsyncd/js/rsyncd.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/rsyncd/js/rsyncd.js b/plugins/rsyncd/js/rsyncd.js index bbfc1115d..ae20c9dbe 100755 --- a/plugins/rsyncd/js/rsyncd.js +++ b/plugins/rsyncd/js/rsyncd.js @@ -667,7 +667,9 @@ function addReceive(name = ""){ var loadT = layer.msg('正在获取...', { icon: 16, time: 0, shade: 0.3 }); rsPost('add_rec', args, function(data){ var rdata = $.parseJSON(data.data); - layer.close(loadOpen); + if (rdata['status']){ + layer.close(loadOpen); + } layer.msg(rdata.msg,{icon:rdata.status?1:2,time:2000,shade: [0.3, '#000']}); setTimeout(function(){rsyncdReceive();},2000); }); From 90d4fb245a9438f31571602b5640f88249397e1e Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Wed, 8 Jan 2025 15:06:16 +0800 Subject: [PATCH 3/4] Update rsyncd.js --- plugins/rsyncd/js/rsyncd.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/plugins/rsyncd/js/rsyncd.js b/plugins/rsyncd/js/rsyncd.js index ae20c9dbe..af055cbe3 100755 --- a/plugins/rsyncd/js/rsyncd.js +++ b/plugins/rsyncd/js/rsyncd.js @@ -668,10 +668,13 @@ function addReceive(name = ""){ rsPost('add_rec', args, function(data){ var rdata = $.parseJSON(data.data); if (rdata['status']){ - layer.close(loadOpen); + layer.close(loadOpen); + layer.msg(rdata.msg,{icon:rdata.status?1:2,time:2000,shade: [0.3, '#000']}); + setTimeout(function(){rsyncdReceive();},2000); + } else { + layer.msg(rdata.msg,{icon:rdata.status?1:2,time:10000,shade: [0.3, '#000']}); + setTimeout(function(){rsyncdReceive();},10000); } - layer.msg(rdata.msg,{icon:rdata.status?1:2,time:2000,shade: [0.3, '#000']}); - setTimeout(function(){rsyncdReceive();},2000); }); } }); From a67ad5a7dbb9fe92e14f0b942ab47f52e98eadac Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Wed, 8 Jan 2025 15:07:49 +0800 Subject: [PATCH 4/4] Update rsyncd.js --- plugins/rsyncd/js/rsyncd.js | 1 - 1 file changed, 1 deletion(-) diff --git a/plugins/rsyncd/js/rsyncd.js b/plugins/rsyncd/js/rsyncd.js index af055cbe3..f7e2a7f23 100755 --- a/plugins/rsyncd/js/rsyncd.js +++ b/plugins/rsyncd/js/rsyncd.js @@ -673,7 +673,6 @@ function addReceive(name = ""){ setTimeout(function(){rsyncdReceive();},2000); } else { layer.msg(rdata.msg,{icon:rdata.status?1:2,time:10000,shade: [0.3, '#000']}); - setTimeout(function(){rsyncdReceive();},10000); } }); }