pipeline-sdlc/wwwroot/api/cockpit_project_picker.dspy
yumoqing 82f9fb6764 fix: 当前项目/迭代按钮改为选择器弹窗,无选中时显示列表供选择
- 当前项目按钮:无项目时弹出选择器,有项目时显示详情
- 当前迭代按钮:无迭代时弹出选择器(按项目过滤),有迭代时显示详情
- 新增 cockpit_project_picker.dspy:返回项目列表
- 新增 cockpit_iteration_picker.dspy:返回迭代列表(支持project_id过滤)
- 新增 cockpit_context_update.dspy:保存选择到 pipeline_agent_settings
2026-08-07 15:06:17 +08:00

20 lines
439 B
Plaintext

# cockpit_project_picker.dspy - Returns all projects as {value, text} for dropdown
# Used by cockpit context bar project picker
dbname = get_module_dbname('pipeline-sdlc')
async with DBPools().sqlorContext(dbname) as sor:
recs = await sor.sqlExe(
"SELECT id, name FROM sd_projects ORDER BY name",
{}
)
rows = []
for r in recs:
rows.append({
'value': r.id,
'text': r.name,
})
return rows