- 当前项目按钮:无项目时弹出选择器,有项目时显示详情 - 当前迭代按钮:无迭代时弹出选择器(按项目过滤),有迭代时显示详情 - 新增 cockpit_project_picker.dspy:返回项目列表 - 新增 cockpit_iteration_picker.dspy:返回迭代列表(支持project_id过滤) - 新增 cockpit_context_update.dspy:保存选择到 pipeline_agent_settings
30 lines
813 B
Plaintext
30 lines
813 B
Plaintext
# cockpit_iteration_picker.dspy - Returns iterations as {value, text} for dropdown
|
|
# Optional query param: project_id - filter iterations by project
|
|
# Used by cockpit context bar iteration picker
|
|
|
|
import json
|
|
|
|
pid = (params_kw or {}).get('project_id', '')
|
|
dbname = get_module_dbname('pipeline-sdlc')
|
|
|
|
async with DBPools().sqlorContext(dbname) as sor:
|
|
if pid:
|
|
recs = await sor.sqlExe(
|
|
"SELECT id, iteration_name FROM sd_iterations WHERE project_id=${pid}$ ORDER BY iteration_name",
|
|
{"pid": pid}
|
|
)
|
|
else:
|
|
recs = await sor.sqlExe(
|
|
"SELECT id, iteration_name FROM sd_iterations ORDER BY iteration_name",
|
|
{}
|
|
)
|
|
|
|
rows = []
|
|
for r in recs:
|
|
rows.append({
|
|
'value': r.id,
|
|
'text': r.iteration_name,
|
|
})
|
|
|
|
return rows
|