diff --git a/wwwroot/api/cockpit_context_update.dspy b/wwwroot/api/cockpit_context_update.dspy index d2ba7ef..e756a00 100644 --- a/wwwroot/api/cockpit_context_update.dspy +++ b/wwwroot/api/cockpit_context_update.dspy @@ -5,6 +5,9 @@ import json uid = await get_user() +if not uid: + return json.dumps({"success": False, "error": "请先登录"}, ensure_ascii=False) + pid = (params_kw or {}).get('project_id', '') iid = (params_kw or {}).get('iteration_id', '') diff --git a/wwwroot/bricks b/wwwroot/bricks deleted file mode 120000 index a3fc74e..0000000 --- a/wwwroot/bricks +++ /dev/null @@ -1 +0,0 @@ -/home/hermesai/repos/pipeline-app/pkgs/bricks/dist \ No newline at end of file diff --git a/wwwroot/json b/wwwroot/json deleted file mode 120000 index d1d9852..0000000 --- a/wwwroot/json +++ /dev/null @@ -1 +0,0 @@ -../json \ No newline at end of file diff --git a/wwwroot/json/build.sh b/wwwroot/json/build.sh new file mode 100755 index 0000000..4a7eecc --- /dev/null +++ b/wwwroot/json/build.sh @@ -0,0 +1,2 @@ +#!/bin/bash +~/repos/pipeline-app/py3/bin/xls2ui -m ../models -o ../wwwroot pipeline_sdlc *.json diff --git a/wwwroot/json/sd_bug_list.json b/wwwroot/json/sd_bug_list.json new file mode 100644 index 0000000..9038a8d --- /dev/null +++ b/wwwroot/json/sd_bug_list.json @@ -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 + } + } + ] + } +} \ No newline at end of file diff --git a/wwwroot/json/sd_deploy_env_list.json b/wwwroot/json/sd_deploy_env_list.json new file mode 100644 index 0000000..ee0272a --- /dev/null +++ b/wwwroot/json/sd_deploy_env_list.json @@ -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 + } + } + ] + } +} \ No newline at end of file diff --git a/wwwroot/json/sd_iteration_list.json b/wwwroot/json/sd_iteration_list.json new file mode 100644 index 0000000..256a7e7 --- /dev/null +++ b/wwwroot/json/sd_iteration_list.json @@ -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" + } + ] + } +} \ No newline at end of file diff --git a/wwwroot/json/sd_org_setting_list.json b/wwwroot/json/sd_org_setting_list.json new file mode 100644 index 0000000..c3dc9d8 --- /dev/null +++ b/wwwroot/json/sd_org_setting_list.json @@ -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')}}" + } + } +} diff --git a/wwwroot/json/sd_project_list.json b/wwwroot/json/sd_project_list.json new file mode 100644 index 0000000..96362d3 --- /dev/null +++ b/wwwroot/json/sd_project_list.json @@ -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" + } + ] + } +} \ No newline at end of file diff --git a/wwwroot/json/sd_project_repo_list.json b/wwwroot/json/sd_project_repo_list.json new file mode 100644 index 0000000..2317cb0 --- /dev/null +++ b/wwwroot/json/sd_project_repo_list.json @@ -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')}}" + } + } +} diff --git a/wwwroot/json/sd_test_case_list.json b/wwwroot/json/sd_test_case_list.json new file mode 100644 index 0000000..9485094 --- /dev/null +++ b/wwwroot/json/sd_test_case_list.json @@ -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" + } + ] + } + } +} \ No newline at end of file diff --git a/wwwroot/json/sd_test_plan_list.json b/wwwroot/json/sd_test_plan_list.json new file mode 100644 index 0000000..2ccc35e --- /dev/null +++ b/wwwroot/json/sd_test_plan_list.json @@ -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" + } + ] + } +} \ No newline at end of file