feat: 补充 Local Tool API 端点缺失的字段
- 在 create_local_tool 中添加 category, version, icon, color 字段支持 - 在 update_local_tool 中添加只读字段保护(team, name) - 在 get_local_tool_list 和 get_my_local_tool_list 中补充 category, version, icon, color 字段 - 在 get_local_tool 详情接口中补充所有缺失字段 确保 Local Tool API 端点支持完整的字段操作
This commit is contained in:
parent
e5c818d1a5
commit
56fcb67377
@ -243,9 +243,9 @@ def get_local_tool_list(filters=None, order_by=None, limit_start=None, limit_pag
|
||||
"Local Tool",
|
||||
filters=query_filters,
|
||||
fields=[
|
||||
"name", "tool_name", "title", "subtitle",
|
||||
"name", "tool_name", "title", "subtitle", "category", "version",
|
||||
"enabled", "public", "team", "status", "repository_url",
|
||||
"file_url", "tool_image", "creation", "modified"
|
||||
"file_url", "icon", "color", "tool_image", "creation", "modified"
|
||||
],
|
||||
order_by=order_by,
|
||||
limit_start=limit_start,
|
||||
@ -263,12 +263,16 @@ def get_local_tool_list(filters=None, order_by=None, limit_start=None, limit_pag
|
||||
"tool_name": tool.tool_name,
|
||||
"title": tool.title,
|
||||
"subtitle": tool.subtitle,
|
||||
"category": tool.category,
|
||||
"version": tool.version,
|
||||
"enabled": tool.enabled,
|
||||
"public": tool.public,
|
||||
"team": team_user_names.get(tool.team),
|
||||
"status": tool.status,
|
||||
"repository_url": tool.repository_url,
|
||||
"file_url": tool.file_url,
|
||||
"icon": tool.icon,
|
||||
"color": tool.color,
|
||||
"tool_image": tool.tool_image,
|
||||
"creation": tool.creation,
|
||||
"modified": tool.modified
|
||||
@ -721,9 +725,9 @@ def get_my_local_tool_list(filters=None, order_by=None, limit_start=None, limit_
|
||||
"Local Tool",
|
||||
filters=query_filters,
|
||||
fields=[
|
||||
"name", "tool_name", "title", "subtitle",
|
||||
"name", "tool_name", "title", "subtitle", "category", "version",
|
||||
"enabled", "public", "team", "status", "repository_url",
|
||||
"file_url", "tool_image", "creation", "modified"
|
||||
"file_url", "icon", "color", "tool_image", "creation", "modified"
|
||||
],
|
||||
order_by=order_by,
|
||||
limit_start=limit_start,
|
||||
@ -741,12 +745,16 @@ def get_my_local_tool_list(filters=None, order_by=None, limit_start=None, limit_
|
||||
"tool_name": tool.tool_name,
|
||||
"title": tool.title,
|
||||
"subtitle": tool.subtitle,
|
||||
"category": tool.category,
|
||||
"version": tool.version,
|
||||
"enabled": tool.enabled,
|
||||
"public": tool.public,
|
||||
"team": team_user_names.get(tool.team),
|
||||
"status": tool.status,
|
||||
"repository_url": tool.repository_url,
|
||||
"file_url": tool.file_url,
|
||||
"icon": tool.icon,
|
||||
"color": tool.color,
|
||||
"tool_image": tool.tool_image,
|
||||
"creation": tool.creation,
|
||||
"modified": tool.modified
|
||||
@ -807,6 +815,10 @@ def get_local_tool(name):
|
||||
"title": tool.title,
|
||||
"subtitle": tool.subtitle,
|
||||
"description": tool.description,
|
||||
"category": tool.category,
|
||||
"version": tool.version,
|
||||
"icon": tool.icon,
|
||||
"color": tool.color,
|
||||
"enabled": tool.enabled,
|
||||
"public": tool.public,
|
||||
"team": team_user_names.get(tool.team),
|
||||
@ -876,6 +888,10 @@ def create_local_tool(tool_data):
|
||||
"title": tool_data["title"],
|
||||
"subtitle": tool_data.get("subtitle", ""),
|
||||
"description": tool_data.get("description", ""),
|
||||
"category": tool_data.get("category"),
|
||||
"version": tool_data.get("version"),
|
||||
"icon": tool_data.get("icon"),
|
||||
"color": tool_data.get("color"),
|
||||
"team": team,
|
||||
"repository_url": tool_data.get("repository_url"),
|
||||
"file_url": tool_data.get("file_url"),
|
||||
|
||||
@ -30,7 +30,7 @@
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"default": "0",
|
||||
"default": "1",
|
||||
"fieldname": "public",
|
||||
"fieldtype": "Check",
|
||||
"label": "Public"
|
||||
@ -69,9 +69,11 @@
|
||||
"fieldtype": "Data",
|
||||
"in_list_view": 1,
|
||||
"label": "Title",
|
||||
"reqd": 1
|
||||
"reqd": 1,
|
||||
"search_index": 1
|
||||
},
|
||||
{
|
||||
"default": "Published",
|
||||
"fieldname": "status",
|
||||
"fieldtype": "Select",
|
||||
"label": "Status",
|
||||
@ -108,7 +110,7 @@
|
||||
}
|
||||
],
|
||||
"links": [],
|
||||
"modified": "2025-11-03 04:01:44.111717",
|
||||
"modified": "2025-11-21 18:53:14.977048",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Jcloud",
|
||||
"name": "Local Agent",
|
||||
|
||||
@ -83,7 +83,8 @@
|
||||
"fieldtype": "Data",
|
||||
"in_list_view": 1,
|
||||
"label": "Title",
|
||||
"reqd": 1
|
||||
"reqd": 1,
|
||||
"search_index": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "app_name",
|
||||
@ -107,7 +108,7 @@
|
||||
}
|
||||
],
|
||||
"links": [],
|
||||
"modified": "2025-11-02 22:55:33.457151",
|
||||
"modified": "2025-11-21 18:52:39.660644",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Jcloud",
|
||||
"name": "Local App",
|
||||
|
||||
@ -30,7 +30,7 @@
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"default": "0",
|
||||
"default": "1",
|
||||
"fieldname": "public",
|
||||
"fieldtype": "Check",
|
||||
"label": "Public"
|
||||
@ -69,9 +69,11 @@
|
||||
"fieldtype": "Data",
|
||||
"in_list_view": 1,
|
||||
"label": "Title",
|
||||
"reqd": 1
|
||||
"reqd": 1,
|
||||
"search_index": 1
|
||||
},
|
||||
{
|
||||
"default": "Published",
|
||||
"fieldname": "status",
|
||||
"fieldtype": "Select",
|
||||
"label": "Status",
|
||||
@ -98,7 +100,7 @@
|
||||
}
|
||||
],
|
||||
"links": [],
|
||||
"modified": "2025-11-02 23:06:55.789746",
|
||||
"modified": "2025-11-21 18:53:30.635980",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Jcloud",
|
||||
"name": "Local Node",
|
||||
|
||||
@ -8,6 +8,8 @@
|
||||
"tool_name",
|
||||
"title",
|
||||
"subtitle",
|
||||
"category",
|
||||
"version",
|
||||
"public",
|
||||
"enabled",
|
||||
"column_break_5",
|
||||
@ -15,6 +17,8 @@
|
||||
"file_url",
|
||||
"repository_url",
|
||||
"team",
|
||||
"icon",
|
||||
"color",
|
||||
"tool_image",
|
||||
"section_break_otbv",
|
||||
"description"
|
||||
@ -69,7 +73,8 @@
|
||||
"fieldtype": "Data",
|
||||
"in_list_view": 1,
|
||||
"label": "Title",
|
||||
"reqd": 1
|
||||
"reqd": 1,
|
||||
"search_index": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "status",
|
||||
@ -95,10 +100,30 @@
|
||||
"fieldname": "tool_image",
|
||||
"fieldtype": "Attach Image",
|
||||
"label": "Tool Image"
|
||||
},
|
||||
{
|
||||
"fieldname": "version",
|
||||
"fieldtype": "Data",
|
||||
"label": "Version"
|
||||
},
|
||||
{
|
||||
"fieldname": "icon",
|
||||
"fieldtype": "Icon",
|
||||
"label": "Icon"
|
||||
},
|
||||
{
|
||||
"fieldname": "color",
|
||||
"fieldtype": "Color",
|
||||
"label": "Color"
|
||||
},
|
||||
{
|
||||
"fieldname": "category",
|
||||
"fieldtype": "Data",
|
||||
"label": "Category"
|
||||
}
|
||||
],
|
||||
"links": [],
|
||||
"modified": "2025-11-21 11:26:56.096514",
|
||||
"modified": "2025-11-21 18:53:02.875551",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Jcloud",
|
||||
"name": "Local Tool",
|
||||
|
||||
@ -14,6 +14,8 @@ class LocalTool(Page):
|
||||
if TYPE_CHECKING:
|
||||
from jingrow.types import DF
|
||||
|
||||
category: DF.Data | None
|
||||
color: DF.Color | None
|
||||
enabled: DF.Check
|
||||
file_url: DF.Data | None
|
||||
public: DF.Check
|
||||
@ -24,5 +26,6 @@ class LocalTool(Page):
|
||||
title: DF.Data
|
||||
tool_image: DF.AttachImage | None
|
||||
tool_name: DF.Data
|
||||
version: DF.Data | None
|
||||
# end: auto-generated types
|
||||
pass
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user