获取给gui显示的任务列表 :return:
(self)
| 241 | self.gui_update_task(data) |
| 242 | |
| 243 | def gui_task_list(self) -> str: |
| 244 | """ |
| 245 | 获取给gui显示的任务列表 |
| 246 | :return: |
| 247 | """ |
| 248 | result = {} |
| 249 | for key, value in self.config.model.dict().items(): |
| 250 | if isinstance(value, str): |
| 251 | continue |
| 252 | if key == "restart": |
| 253 | continue |
| 254 | if "scheduler" not in value: |
| 255 | continue |
| 256 | |
| 257 | scheduler = value["scheduler"] |
| 258 | item = {"enable": scheduler["enable"], |
| 259 | "next_run": str(scheduler["next_run"])} |
| 260 | key = self.config.model.type(key) |
| 261 | result[key] = item |
| 262 | return json.dumps(result) |
| 263 | |
| 264 | |
| 265 |