feat:优化webui多个页面的人机交互,修复插件地址问题,放宽插件id限制,增加高级页面缩进,统计页面快捷按钮,优化新手引导
This commit is contained in:
@@ -185,6 +185,16 @@ def _setup_static_files(app: FastAPI):
|
||||
logger.warning(t("startup.webui_dashboard_package_hint", command=_MANUAL_INSTALL_COMMAND))
|
||||
return
|
||||
|
||||
@app.get("/maibot_statistics.html", include_in_schema=False)
|
||||
async def serve_statistics_report():
|
||||
report_path = (_get_project_root() / "maibot_statistics.html").resolve()
|
||||
if not report_path.exists() or not report_path.is_file():
|
||||
raise HTTPException(status_code=404, detail=t("core.not_found"))
|
||||
|
||||
response = FileResponse(report_path, media_type="text/html")
|
||||
response.headers["X-Robots-Tag"] = "noindex, nofollow, noarchive"
|
||||
return response
|
||||
|
||||
@app.get("/{full_path:path}", include_in_schema=False)
|
||||
async def serve_spa(full_path: str):
|
||||
if not full_path or full_path == "/":
|
||||
|
||||
@@ -19,8 +19,6 @@ class ConfigSchemaGenerator:
|
||||
for field_name, field_info in config_class.model_fields.items():
|
||||
if field_name in {"field_docs", "_validate_any", "suppress_any_warning"}:
|
||||
continue
|
||||
if cls._is_advanced_field(field_info):
|
||||
continue
|
||||
|
||||
field_schema = cls._build_field_schema(config_class, field_name, field_info.annotation, field_info)
|
||||
fields.append(field_schema)
|
||||
@@ -50,13 +48,6 @@ class ConfigSchemaGenerator:
|
||||
|
||||
return schema
|
||||
|
||||
@staticmethod
|
||||
def _is_advanced_field(field_info: Any) -> bool:
|
||||
extra = getattr(field_info, "json_schema_extra", None)
|
||||
if not isinstance(extra, dict):
|
||||
return False
|
||||
return extra.get("advanced", False) is True
|
||||
|
||||
@classmethod
|
||||
def _build_nested_schema(cls, annotation: Any) -> Dict[str, Any] | None:
|
||||
origin = get_origin(annotation)
|
||||
|
||||
Reference in New Issue
Block a user