优化jlocal.py
This commit is contained in:
parent
d7643a853c
commit
6ed95bfaaa
@ -663,6 +663,7 @@ def get_local_agent(name):
|
|||||||
"repository_url": agent.repository_url,
|
"repository_url": agent.repository_url,
|
||||||
"file_url": agent.file_url,
|
"file_url": agent.file_url,
|
||||||
"agent_image": agent.agent_image,
|
"agent_image": agent.agent_image,
|
||||||
|
"agent_flow": agent.agent_flow,
|
||||||
"creation": agent.creation,
|
"creation": agent.creation,
|
||||||
"modified": agent.modified
|
"modified": agent.modified
|
||||||
}
|
}
|
||||||
@ -685,6 +686,8 @@ def create_local_agent(agent_data):
|
|||||||
return {"error": "Agent名称已存在,请使用其他名称"}
|
return {"error": "Agent名称已存在,请使用其他名称"}
|
||||||
|
|
||||||
# 创建Agent
|
# 创建Agent
|
||||||
|
agent_flow = agent_data.get("agent_flow")
|
||||||
|
|
||||||
agent = jingrow.get_pg({
|
agent = jingrow.get_pg({
|
||||||
"pagetype": "Local Agent",
|
"pagetype": "Local Agent",
|
||||||
"agent_name": agent_data["agent_name"],
|
"agent_name": agent_data["agent_name"],
|
||||||
@ -694,7 +697,8 @@ def create_local_agent(agent_data):
|
|||||||
"team": team,
|
"team": team,
|
||||||
"repository_url": agent_data.get("repository_url"),
|
"repository_url": agent_data.get("repository_url"),
|
||||||
"file_url": agent_data.get("file_url"),
|
"file_url": agent_data.get("file_url"),
|
||||||
"agent_image": agent_data.get("agent_image")
|
"agent_image": agent_data.get("agent_image"),
|
||||||
|
"agent_flow": agent_flow
|
||||||
})
|
})
|
||||||
|
|
||||||
agent.insert()
|
agent.insert()
|
||||||
|
|||||||
@ -17,7 +17,9 @@
|
|||||||
"team",
|
"team",
|
||||||
"agent_image",
|
"agent_image",
|
||||||
"section_break_otbv",
|
"section_break_otbv",
|
||||||
"description"
|
"description",
|
||||||
|
"agent_flow_tab",
|
||||||
|
"agent_flow"
|
||||||
],
|
],
|
||||||
"fields": [
|
"fields": [
|
||||||
{
|
{
|
||||||
@ -93,10 +95,20 @@
|
|||||||
"fieldname": "agent_image",
|
"fieldname": "agent_image",
|
||||||
"fieldtype": "Attach Image",
|
"fieldtype": "Attach Image",
|
||||||
"label": "Agent Image"
|
"label": "Agent Image"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "agent_flow_tab",
|
||||||
|
"fieldtype": "Tab Break",
|
||||||
|
"label": "Agent Flow"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "agent_flow",
|
||||||
|
"fieldtype": "JSON",
|
||||||
|
"label": "Agent Flow"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2025-11-02 04:51:31.964965",
|
"modified": "2025-11-03 04:01:44.111717",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Jcloud",
|
"module": "Jcloud",
|
||||||
"name": "Local Agent",
|
"name": "Local Agent",
|
||||||
|
|||||||
@ -14,6 +14,7 @@ class LocalAgent(Page):
|
|||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from jingrow.types import DF
|
from jingrow.types import DF
|
||||||
|
|
||||||
|
agent_flow: DF.JSON | None
|
||||||
agent_image: DF.AttachImage | None
|
agent_image: DF.AttachImage | None
|
||||||
agent_name: DF.Data
|
agent_name: DF.Data
|
||||||
enabled: DF.Check
|
enabled: DF.Check
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user