diff --git a/app/run.py b/app/run.py
index e53e9a6..5f8d3f4 100644
--- a/app/run.py
+++ b/app/run.py
@@ -212,6 +212,25 @@ def get_share_files():
return jsonify(share_file_list)
+@app.route("/get_savepath")
+def get_savepath():
+ if not is_login():
+ return jsonify({"error": "未登录"})
+ data = read_json()
+ account = Quark(data["cookie"][0], 0)
+ if path := request.args.get("path"):
+ if path == "/":
+ fid = 0
+ elif get_fids := account.get_fids([path]):
+ fid = get_fids[0]["fid"]
+ else:
+ return jsonify([])
+ else:
+ fid = request.args.get("fid", 0)
+ file_list = account.ls_dir(fid)
+ return jsonify(file_list)
+
+
# 定时任务执行的函数
def run_python(args):
logging.info(f">>> 定时运行任务")
diff --git a/app/templates/index.html b/app/templates/index.html
index 567cb1e..1705c15 100644
--- a/app/templates/index.html
+++ b/app/templates/index.html
@@ -184,7 +184,20 @@
@@ -369,6 +382,7 @@
taskDirs: [""],
taskDirSelected: "",
taskNameFilter: "",
+ savepaths: [],
modalLoading: false,
shareFiles: [],
forceTaskIndex: null
@@ -500,12 +514,33 @@
clearData(target) {
this[target] = "";
},
+ selectSavepath(index, fid, name) {
+ const savepath = `/${this.formData.tasklist[index].savepath}/${name}`.replace(/\/{2,}/g, '/')
+ Vue.set(this.formData.tasklist[index], 'savepath', savepath);
+ this.getSavepathDirs(fid);
+ },
+ getSavepathDirs(fid = 0) {
+ if (fid.includes('/')) {
+ params = { path: fid }
+ } else {
+ params = { fid: fid }
+ }
+ this.savepaths = [{ fid: 0, dir: true, file_name: "加载中..." }]
+ console.log(this.savepaths)
+ axios.get('/get_savepath', { params: params })
+ .then(response => {
+ this.savepaths = response.data
+ console.log(this.savepaths)
+ })
+ .catch(error => {
+ console.error('Error get_share_files:', error);
+ });
+ },
selectStartFid(fid) {
Vue.set(this.formData.tasklist[this.forceTaskIndex], 'startfid', fid);
$('#shareDetailModal').modal('toggle')
},
showShareFiles(index) {
-
this.shareFiles = []
$('#shareDetailModal').modal('toggle')
this.modalLoading = true