feat:图表交互

This commit is contained in:
2026-10-15 03:38:20 -07:00
parent 565ecf4558
commit 9b64f9fc0b
43 changed files with 1537 additions and 727 deletions
+7
View File
@@ -20,6 +20,7 @@ from urllib.parse import urljoin
import httpx
from app.core.exceptions import BizException
from app.schemas.screen import fill_template
TIMEOUT = 5.0
MAX_BYTES = 2 * 1024 * 1024
@@ -113,6 +114,12 @@ def _clean_headers(headers: dict[str, Any] | None) -> dict[str, str]:
return cleaned
def fill_params(params: dict[str, Any], variables: dict[str, Any]) -> dict[str, Any]:
"""数据源 params 的值里的 {{变量ID}} 换成变量的值,规则同前端 fillTemplate;只代入 params,
地址和请求头不代入:线上取数是匿名接口,代入地址就成了开放代理"""
return {key: fill_template(value, variables) for key, value in params.items()}
def _query_value(value: Any) -> Any:
return value if isinstance(value, (str, int, float, bool)) else json.dumps(value)