(get)
| 340 | |
| 341 | @staticmethod |
| 342 | def node_create_transfer_task(get): |
| 343 | try: |
| 344 | transfer_task_data = json.loads(get.get('transfer_task_data', "{}")) |
| 345 | if not transfer_task_data: |
| 346 | return json_response(status=False, msg="参数错误") |
| 347 | except Exception as e: |
| 348 | return json_response(status=False, msg="参数错误") |
| 349 | |
| 350 | transfer_task_data["flow_id"] = 0 |
| 351 | transfer_task_data["step_index"] = 0 |
| 352 | transfer_task_data["src_node"] = {"name": "local"} |
| 353 | transfer_task_data["src_node_task_id"] = 0 |
| 354 | if not isinstance(transfer_task_data["dst_nodes"], dict): |
| 355 | return json_response(status=False, msg="请升级升级您当前使用的主节点面板版本") |
| 356 | |
| 357 | fdb = TaskFlowsDB() |
| 358 | tt = TransferTask.from_dict(transfer_task_data) |
| 359 | task_id = fdb.TransferTask.create(tt) |
| 360 | if not task_id: |
| 361 | return json_response(status=False, msg="创建任务失败") |
| 362 | return json_response(status=True, msg="创建成功", data={"task_id": task_id}) |
| 363 | |
| 364 | @classmethod |
| 365 | def node_transferfile_status_history(cls, get): |
nothing calls this directly
no test coverage detected