fix: 重新创建hermes_services/list端点用于code组件数据格式转换,修正new_session.ui配置
This commit is contained in:
parent
28459df92b
commit
2f312c0554
20
wwwroot/hermes_services/list/index.dspy
Normal file
20
wwwroot/hermes_services/list/index.dspy
Normal file
@ -0,0 +1,20 @@
|
||||
# Get hermes_services list for code dropdown
|
||||
# This .dspy file uses functions released by load_hermes_web_cli()
|
||||
|
||||
try:
|
||||
# Use the function provided by hermes-web-cli module
|
||||
services = get_all_services()
|
||||
|
||||
# Format for code component (value, text pairs)
|
||||
result = []
|
||||
for service in services:
|
||||
result.append({
|
||||
"value": str(service.get('id')),
|
||||
"text": service.get('name', f"Service {service.get('id')}")
|
||||
})
|
||||
|
||||
# Return array directly for code component
|
||||
return result
|
||||
except Exception as e:
|
||||
# On error or no data, return empty array
|
||||
return []
|
||||
@ -26,9 +26,7 @@
|
||||
"label": "Service",
|
||||
"uitype": "code",
|
||||
"required": true,
|
||||
"data_url": "/hermes-web-cli/hermes_services/",
|
||||
"textField": "name",
|
||||
"valueField": "id"
|
||||
"data_url": "/hermes-web-cli/hermes_services/list/"
|
||||
},
|
||||
{
|
||||
"name": "initial_message",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user