(self, get)
| 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): |
nothing calls this directly
no test coverage detected