sync update from LAN repo (source master @ ca48c4ec)
This commit is contained in:
1 parent
8bc8b0e082
commit
ea9dcff9c0
873 files changed
+107866
-14011
No files matched your search
@@ -2,10 +2,11 @@
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import asyncio
|
||||
import mimetypes
|
||||
import re
|
||||
import zipfile
|
||||
from io import BytesIO
|
||||
import mimetypes
|
||||
from pathlib import Path
|
||||
from typing import Any
|
||||
from urllib.parse import quote
|
||||
@@ -210,15 +211,19 @@ async def get_scheduler_thread(request: Request) -> dict:
|
||||
|
||||
|
||||
@router.get("/html-templates")
|
||||
async def list_html_templates() -> dict:
|
||||
async def list_html_templates(request: Request) -> dict:
|
||||
"""可选的 HTML 模板清单(供「模板数据转换器」内置 agent 填充用)。
|
||||
|
||||
返回 ``{"templates": [{id, name, description}]}``,前端定时任务表单在选中
|
||||
「模板数据转换器」后据此渲染「HTML 模板」下拉。开放给任意登录用户。
|
||||
"""
|
||||
from app.gateway.catalog_cache import cached_catalog
|
||||
from deerflow.runtime.scheduler import template_fill
|
||||
|
||||
return {"templates": template_fill.list_templates()}
|
||||
async def load() -> dict:
|
||||
return {"templates": await asyncio.to_thread(template_fill.list_templates)}
|
||||
|
||||
return await cached_catalog(request, "html_templates", "scheduler-list", load)
|
||||
|
||||
|
||||
class TemplateRenderRequest(BaseModel):
|
||||
|
||||
Reference in new issue
Block a user