Browse Source

feat: 代码配置添加多个参数

pull/185/head
cp3hnu 10 months ago
parent
commit
872cb80abe
2 changed files with 19 additions and 16 deletions
  1. +9
    -8
      react-ui/src/components/CodeSelect/index.tsx
  2. +10
    -8
      react-ui/src/pages/Pipeline/components/PipelineNodeDrawer/index.tsx

+ 9
- 8
react-ui/src/components/CodeSelect/index.tsx View File

@@ -35,25 +35,26 @@ function CodeSelect({
const { close } = openAntdModal(CodeSelectorModal, {
onOk: (res) => {
if (res) {
const { git_url, git_branch, code_repo_name } = res;
const { id, code_repo_name, git_url, git_branch, git_user_name, git_password, ssh_key } =
res;
const jsonObj = {
id,
name: code_repo_name,
code_path: git_url,
branch: git_branch,
username: git_user_name,
password: git_password,
ssh_private_key: ssh_key,
};
const jsonObjStr = JSON.stringify(jsonObj);
const showValue = code_repo_name;
onChange?.({
value: jsonObjStr,
showValue,
showValue: code_repo_name,
fromSelect: true,
...jsonObj,
});
} else {
onChange?.({
value: undefined,
showValue: undefined,
fromSelect: false,
});
onChange?.(undefined);
}
close();
},


+ 10
- 8
react-ui/src/pages/Pipeline/components/PipelineNodeDrawer/index.tsx View File

@@ -150,19 +150,21 @@ const PipelineNodeParameter = forwardRef(({ onFormChange }: PipelineNodeParamete
const { close } = openAntdModal(CodeSelectorModal, {
onOk: (res) => {
if (res) {
const { id, code_repo_name, git_url, git_branch, git_user_name, git_password, ssh_key } =
res;
const value = JSON.stringify({
id: res.id,
name: res.code_repo_name,
code_path: res.git_url,
branch: res.git_branch,
username: res.git_user_name,
password: res.git_password,
ssh_private_key: res.ssh_key,
id,
name: code_repo_name,
code_path: git_url,
branch: git_branch,
username: git_user_name,
password: git_password,
ssh_private_key: ssh_key,
});
form.setFieldValue(formItemName, {
...item,
value,
showValue: res.code_repo_name,
showValue: code_repo_name,
fromSelect: true,
});
form.validateFields([formItemName]);


Loading…
Cancel
Save