fix: cockpit_context_update 处理未登录用户

This commit is contained in:
yumoqing 2026-08-07 15:17:34 +08:00
parent 82f9fb6764
commit 6786bfc323
12 changed files with 491 additions and 2 deletions

View File

@ -5,6 +5,9 @@
import json import json
uid = await get_user() uid = await get_user()
if not uid:
return json.dumps({"success": False, "error": "请先登录"}, ensure_ascii=False)
pid = (params_kw or {}).get('project_id', '') pid = (params_kw or {}).get('project_id', '')
iid = (params_kw or {}).get('iteration_id', '') iid = (params_kw or {}).get('iteration_id', '')

View File

@ -1 +0,0 @@
/home/hermesai/repos/pipeline-app/pkgs/bricks/dist

View File

@ -1 +0,0 @@
../json

2
wwwroot/json/build.sh Executable file
View File

@ -0,0 +1,2 @@
#!/bin/bash
~/repos/pipeline-app/py3/bin/xls2ui -m ../models -o ../wwwroot pipeline_sdlc *.json

View File

@ -0,0 +1,103 @@
{
"tblname": "sd_bugs",
"title": "Bug管理",
"params": {
"sortby": [
"created_at desc"
],
"confidential_fields": [],
"browserfields": {
"alters": {
"iteration_id": {
"uitype": "code",
"dataurl": "{{entire_url('../api/get_iteration_options.dspy')}}",
"valueField": "value",
"textField": "text"
},
"severity": {
"uitype": "code",
"dataurl": "{{entire_url('../api/get_search_severity.dspy')}}",
"valueField": "value",
"textField": "text"
},
"priority": {
"uitype": "code",
"dataurl": "{{entire_url('../api/get_search_priority.dspy')}}",
"valueField": "value",
"textField": "text"
},
"status": {
"uitype": "code",
"dataurl": "{{entire_url('../api/get_search_bug_status.dspy')}}",
"valueField": "value",
"textField": "text"
},
"reporter_type": {
"uitype": "code",
"dataurl": "{{entire_url('../api/get_search_reporter_type.dspy')}}",
"valueField": "value",
"textField": "text"
}
}
},
"editexclouded": [
"id",
"created_at",
"updated_at",
"closed_at",
"verified_by",
"fix_commit"
],
"editable": {
"new_data_url": "{{entire_url('../api/sd_bug_create.dspy')}}",
"update_data_url": "{{entire_url('../api/sd_bug_update.dspy')}}",
"delete_data_url": "{{entire_url('../api/sd_bug_delete.dspy')}}"
},
"data_filter": {
"AND": [
{
"field": "iteration_id",
"op": "=",
"var": "iteration_input"
},
{
"field": "severity",
"op": "=",
"var": "severity_input"
},
{
"field": "status",
"op": "=",
"var": "status_input"
},
{
"field": "title",
"op": "LIKE",
"var": "title_input"
}
]
},
"record_toolbar": [
{
"label": "确认",
"actiontype": "dspy",
"url": "{{entire_url('../api/bug_confirm.dspy')}}",
"options": {
"icon": "check",
"cwidth": 16,
"cheight": 9
}
},
{
"label": "关闭",
"actiontype": "dspy",
"url": "{{entire_url('../api/bug_close.dspy')}}",
"options": {
"icon": "block",
"cwidth": 16,
"cheight": 9
}
}
]
}
}

View File

@ -0,0 +1,62 @@
{
"tblname": "sd_deploy_envs",
"title": "部署环境",
"params": {
"sortby": [
"env_type"
],
"confidential_fields": [
"db_password",
"ssh_key_path"
],
"browserfields": {
"exclouded": [
"db_password",
"ssh_key_path"
],
"alters": {
"project_id": {
"uitype": "code",
"dataurl": "{{entire_url('../api/get_project_options.dspy')}}",
"valueField": "value",
"textField": "text"
},
"env_type": {
"uitype": "code",
"dataurl": "{{entire_url('../api/get_search_env_type.dspy')}}",
"valueField": "value",
"textField": "text"
},
"status": {
"uitype": "code",
"dataurl": "{{entire_url('../api/get_search_env_status.dspy')}}",
"valueField": "value",
"textField": "text"
}
}
},
"editexclouded": [
"id",
"verified_at",
"created_at",
"updated_at"
],
"editable": {
"new_data_url": "{{entire_url('../api/sd_deploy_env_create.dspy')}}",
"update_data_url": "{{entire_url('../api/sd_deploy_env_update.dspy')}}",
"delete_data_url": "{{entire_url('../api/sd_deploy_env_delete.dspy')}}"
},
"record_toolbar": [
{
"label": "验证连接",
"actiontype": "dspy",
"url": "{{entire_url('../api/env_verify.dspy')}}",
"options": {
"icon": "check",
"cwidth": 16,
"cheight": 9
}
}
]
}
}

View File

@ -0,0 +1,81 @@
{
"tblname": "sd_iterations",
"title": "迭代管理",
"params": {
"sortby": [
"created_at desc"
],
"confidential_fields": [],
"browserfields": {
"exclouded": [
"scope"
],
"alters": {
"project_id": {
"uitype": "code",
"dataurl": "{{entire_url('../api/get_project_options.dspy')}}",
"valueField": "value",
"textField": "text"
},
"iteration_type": {
"uitype": "code",
"dataurl": "{{entire_url('../api/get_search_iteration_type.dspy')}}",
"valueField": "value",
"textField": "text"
},
"status": {
"uitype": "code",
"dataurl": "{{entire_url('../api/get_search_iteration_status.dspy')}}",
"valueField": "value",
"textField": "text"
}
}
},
"editexclouded": [
"id",
"task_id",
"started_at",
"completed_at",
"created_at",
"updated_at"
],
"editable": {
"new_data_url": "{{entire_url('../api/sd_iteration_create.dspy')}}",
"update_data_url": "{{entire_url('../api/sd_iteration_update.dspy')}}",
"delete_data_url": "{{entire_url('../api/sd_iteration_delete.dspy')}}"
},
"data_filter": {
"AND": [
{
"field": "project_id",
"op": "=",
"var": "project_input"
},
{
"field": "iteration_name",
"op": "LIKE",
"var": "name_input"
},
{
"field": "status",
"op": "=",
"var": "status_input"
}
]
},
"subtables": [
{
"field": "iteration_id",
"title": "Bug列表",
"url": "{{entire_url('../sd_bug_list?iteration_id=${id}')}}",
"subtable": "sd_bugs"
},
{
"field": "iteration_id",
"title": "测试方案",
"url": "{{entire_url('../sd_test_plan_list?iteration_id=${id}')}}",
"subtable": "sd_test_plans"
}
]
}
}

View File

@ -0,0 +1,17 @@
{
"tblname": "sd_org_settings",
"title": "组织SDLC设置",
"params": {
"sortby": ["created_at desc"],
"logined_userorgid": "org_id",
"browserfields": {
"exclouded": []
},
"editexclouded": ["id", "created_at", "updated_at", "org_id"],
"editable": {
"new_data_url": "{{entire_url('../api/sd_org_setting_create.dspy')}}",
"update_data_url": "{{entire_url('../api/sd_org_setting_update.dspy')}}",
"delete_data_url": "{{entire_url('../api/sd_org_setting_delete.dspy')}}"
}
}
}

View File

@ -0,0 +1,80 @@
{
"tblname": "sd_projects",
"title": "项目管理",
"params": {
"sortby": [
"created_at desc"
],
"logined_userorgid": "org_id",
"confidential_fields": [],
"browserfields": {
"exclouded": [
"tech_stack"
],
"alters": {
"status": {
"uitype": "code",
"dataurl": "{{entire_url('../api/get_search_status.dspy')}}",
"valueField": "value",
"textField": "text"
},
"project_type": {
"uitype": "code",
"dataurl": "{{entire_url('../api/get_search_project_type.dspy')}}",
"valueField": "value",
"textField": "text"
},
"pipeline_id": {
"uitype": "code",
"dataurl": "{{entire_url('../api/get_pipeline_options.dspy')}}",
"valueField": "value",
"textField": "text"
}
}
},
"editexclouded": [
"id",
"created_at",
"updated_at",
"org_id"
],
"editable": {
"new_data_url": "{{entire_url('../api/sd_project_create.dspy')}}",
"update_data_url": "{{entire_url('../api/sd_project_update.dspy')}}",
"delete_data_url": "{{entire_url('../api/sd_project_delete.dspy')}}"
},
"data_filter": {
"AND": [
{
"field": "name",
"op": "LIKE",
"var": "name_input"
},
{
"field": "status",
"op": "=",
"var": "status_input"
},
{
"field": "project_type",
"op": "=",
"var": "type_input"
}
]
},
"subtables": [
{
"field": "project_id",
"title": "迭代列表",
"url": "{{entire_url('../sd_iteration_list?project_id=${id}')}}",
"subtable": "sd_iterations"
},
{
"field": "project_id",
"title": "代码仓库",
"url": "{{entire_url('../sd_project_repo_list?project_id=${id}')}}",
"subtable": "sd_project_repos"
}
]
}
}

View File

@ -0,0 +1,17 @@
{
"tblname": "sd_project_repos",
"title": "代码仓库",
"params": {
"sortby": ["created_at desc"],
"logined_userorgid": "org_id",
"browserfields": {
"exclouded": ["org_id"]
},
"editexclouded": ["id", "created_at", "org_id"],
"editable": {
"new_data_url": "{{entire_url('../api/sd_project_repo_create.dspy')}}",
"update_data_url": "{{entire_url('../api/sd_project_repo_update.dspy')}}",
"delete_data_url": "{{entire_url('../api/sd_project_repo_delete.dspy')}}"
}
}
}

View File

@ -0,0 +1,76 @@
{
"tblname": "sd_test_cases",
"title": "测试用例",
"params": {
"sortby": [
"priority desc",
"created_at desc"
],
"confidential_fields": [],
"browserfields": {
"alters": {
"plan_id": {
"uitype": "code",
"dataurl": "{{entire_url('../api/get_test_plan_options.dspy')}}",
"valueField": "value",
"textField": "text"
},
"case_type": {
"uitype": "code",
"dataurl": "{{entire_url('../api/get_search_case_type.dspy')}}",
"valueField": "value",
"textField": "text"
},
"status": {
"uitype": "code",
"dataurl": "{{entire_url('../api/get_search_case_status.dspy')}}",
"valueField": "value",
"textField": "text"
},
"priority": {
"uitype": "code",
"dataurl": "{{entire_url('../api/get_search_priority.dspy')}}",
"valueField": "value",
"textField": "text"
}
}
},
"editexclouded": [
"id",
"actual_result",
"executed_by",
"executed_at",
"duration_ms",
"created_at"
],
"editable": {
"new_data_url": "{{entire_url('../api/sd_test_case_create.dspy')}}",
"update_data_url": "{{entire_url('../api/sd_test_case_update.dspy')}}",
"delete_data_url": "{{entire_url('../api/sd_test_case_delete.dspy')}}"
},
"data_filter": {
"AND": [
{
"field": "plan_id",
"op": "=",
"var": "plan_input"
},
{
"field": "case_type",
"op": "=",
"var": "type_input"
},
{
"field": "status",
"op": "=",
"var": "status_input"
},
{
"field": "priority",
"op": "=",
"var": "priority_input"
}
]
}
}
}

View File

@ -0,0 +1,50 @@
{
"tblname": "sd_test_plans",
"title": "测试方案",
"params": {
"sortby": [
"created_at desc"
],
"confidential_fields": [],
"browserfields": {
"alters": {
"iteration_id": {
"uitype": "code",
"dataurl": "{{entire_url('../api/get_iteration_options.dspy')}}",
"valueField": "value",
"textField": "text"
},
"plan_type": {
"uitype": "code",
"dataurl": "{{entire_url('../api/get_search_plan_type.dspy')}}",
"valueField": "value",
"textField": "text"
},
"status": {
"uitype": "code",
"dataurl": "{{entire_url('../api/get_search_plan_status.dspy')}}",
"valueField": "value",
"textField": "text"
}
}
},
"editexclouded": [
"id",
"created_at",
"updated_at"
],
"editable": {
"new_data_url": "{{entire_url('../api/sd_test_plan_create.dspy')}}",
"update_data_url": "{{entire_url('../api/sd_test_plan_update.dspy')}}",
"delete_data_url": "{{entire_url('../api/sd_test_plan_delete.dspy')}}"
},
"subtables": [
{
"field": "plan_id",
"title": "测试用例",
"url": "{{entire_url('../sd_test_case_list?plan_id=${id}')}}",
"subtable": "sd_test_cases"
}
]
}
}