修复node_management.py里面jingrow_root计算错误

This commit is contained in:
jingrow 2025-11-03 03:17:07 +08:00
parent 5a758b3a8f
commit 6b4c403113

View File

@ -34,7 +34,7 @@ async def export_node_definition(payload: Dict[str, Any]):
export_data = {"metadata": metadata, **(schema or {})}
jingrow_root = get_apps_path() / "jingrow"
jingrow_root = get_apps_path() / "jingrow" / "jingrow"
new_root = jingrow_root / "ai" / "nodes"
target = new_root / node_type / f"{node_type}.json"
atomic_write_json(target, export_data)
@ -49,7 +49,7 @@ async def import_local_node_definitions():
扫描本地节点定义目录 metadata 去重后导入到 Local Ai Node
"""
try:
jingrow_root = get_apps_path() / "jingrow"
jingrow_root = get_apps_path() / "jingrow" / "jingrow"
nodes_root = jingrow_root / "ai" / "nodes"
if not nodes_root.exists():
return {"success": True, "matched": 0, "imported": 0, "skipped_existing": 0}
@ -127,7 +127,7 @@ async def get_all_node_metadata():
获取所有节点的元数据用于流程编排界面
"""
try:
jingrow_root = get_apps_path() / "jingrow"
jingrow_root = get_apps_path() / "jingrow" / "jingrow"
nodes_root = jingrow_root / "ai" / "nodes"
if not nodes_root.exists():
@ -175,7 +175,7 @@ async def get_node_schema(node_type: str):
获取指定节点类型的Schema配置
"""
try:
jingrow_root = get_apps_path() / "jingrow"
jingrow_root = get_apps_path() / "jingrow" / "jingrow"
nodes_root = jingrow_root / "ai" / "nodes"
json_file = nodes_root / node_type / f"{node_type}.json"
@ -306,7 +306,7 @@ async def get_installed_node_types():
"""
try:
# 确定节点目录路径apps/jingrow/jingrow/ai/nodes
jingrow_root = get_apps_path() / "jingrow"
jingrow_root = get_apps_path() / "jingrow" / "jingrow"
nodes_root = jingrow_root / "ai" / "nodes"
node_types = []
@ -527,7 +527,7 @@ def _install_single_node_directory(node_dir: str) -> Dict[str, Any]:
return {'success': False, 'error': '节点定义中缺少 metadata.type'}
# 确定目标目录apps/jingrow/jingrow/ai/nodes
jingrow_root = get_apps_path() / "jingrow"
jingrow_root = get_apps_path() / "jingrow" / "jingrow"
nodes_root = jingrow_root / "ai" / "nodes"
nodes_root.mkdir(parents=True, exist_ok=True)
@ -589,7 +589,7 @@ async def package_node(node_type: str):
try:
from datetime import datetime
jingrow_root = get_apps_path() / "jingrow"
jingrow_root = get_apps_path() / "jingrow" / "jingrow"
nodes_root = jingrow_root / "ai" / "nodes"
node_dir = nodes_root / node_type