MCPcopy Create free account
hub / github.com/aaPanel/BaoTa / flow_task_list

Method flow_task_list

mod/project/node/executorMod.py:663–683  ·  view source on GitHub ↗
(self, get)

Source from the content-addressed store, hash-verified

661 return json_response(status=True, data=task_data)
662
663 def flow_task_list(self, get):
664 page_num = max(int(get.get('p/d', 1)), 1)
665 limit = max(int(get.get('limit/d', 16)), 1)
666
667 fdb = TaskFlowsDB()
668 flow_list = fdb.Flow.query_page(page_num=page_num, limit=limit)
669 count = fdb.Flow.count()
670 res = []
671 server_cache: Dict[int, Dict] = {}
672 for flow in flow_list:
673 tmp_data = fdb.history_flow_task(flow.id)
674 tmp_data["server_list"] = [{
675 "id": int(i),
676 "name": self.get_server_info(int(i), server_cache).get("remarks", ""),
677 "server_ip": self.get_server_info(int(i), server_cache).get("server_ip", ""),
678 } for i in tmp_data["server_ids"].strip("|").split("|")]
679 res.append(tmp_data)
680
681 page = public.get_page(count, page_num, limit)
682 page["data"] = res
683 return page
684
685 @staticmethod
686 def remove_flow(get):

Callers

nothing calls this directly

Calls 9

history_flow_taskMethod · 0.95
get_server_infoMethod · 0.95
TaskFlowsDBClass · 0.90
getMethod · 0.45
query_pageMethod · 0.45
countMethod · 0.45
splitMethod · 0.45
appendMethod · 0.45
get_pageMethod · 0.45

Tested by

no test coverage detected