Unverified Commit 11be8fb7 authored by Zzm0809's avatar Zzm0809 Committed by GitHub

[Fix] fix gitlab auth error (#3018)

parent 71e8a1fc
...@@ -124,6 +124,7 @@ public class GitRepository { ...@@ -124,6 +124,7 @@ public class GitRepository {
super.write(str); super.write(str);
} }
})) }))
.setCredentialsProvider(new UsernamePasswordCredentialsProvider(username, password))
.call(); .call();
git.close(); git.close();
} else { } else {
......
...@@ -254,8 +254,8 @@ ol { ...@@ -254,8 +254,8 @@ ol {
} }
.gitCodeTree { .gitCodeTree {
min-height: 70vh; min-height: 73vh;
max-height: 70vh; max-height: 73vh;
} }
.schemaTree { .schemaTree {
......
...@@ -49,7 +49,7 @@ export const SiderTree: React.FC<SiderTreeProps> = (props) => { ...@@ -49,7 +49,7 @@ export const SiderTree: React.FC<SiderTreeProps> = (props) => {
<PageLoading /> <PageLoading />
) : treeData.length > 0 ? ( ) : treeData.length > 0 ? (
<DirectoryTree <DirectoryTree
className={'siderTree'} className={'siderTree treeList gitCodeTree'}
onSelect={(_, info) => onNodeClick(info)} onSelect={(_, info) => onNodeClick(info)}
treeData={buildTreeData(treeData)} treeData={buildTreeData(treeData)}
/> />
......
...@@ -50,8 +50,8 @@ type ProjectFormProps = { ...@@ -50,8 +50,8 @@ type ProjectFormProps = {
*/ */
const CodeEditProps = { const CodeEditProps = {
height: '15vh', height: '15vh',
width: '20vw', width: '45vw',
lineNumbers: 'off', lineNumbers: 'on',
language: 'shell' language: 'shell'
}; };
...@@ -113,23 +113,20 @@ const ProjectForm: React.FC<ProjectFormProps> = (props) => { ...@@ -113,23 +113,20 @@ const ProjectForm: React.FC<ProjectFormProps> = (props) => {
placeholder={l('rc.gp.namePlaceholder')} placeholder={l('rc.gp.namePlaceholder')}
/> />
<ProFormSelect name='type' hidden shouldUpdate initialValue={cloneType} /> <ProFormSelect name='type' hidden shouldUpdate initialValue={cloneType} />
<ProFormText <ProFormText
name='url' name='url'
width={'xs'} width={'md'}
label={l('rc.gp.url')} label={l('rc.gp.url')}
placeholder={l('rc.gp.urlPlaceholder')}
rules={[{ required: true, message: l('rc.gp.urlPlaceholder') }]} rules={[{ required: true, message: l('rc.gp.urlPlaceholder') }]}
addonBefore={renderUrlBeforeSelect()} addonBefore={renderUrlBeforeSelect()}
> />
<Input <ProFormSwitch
style={{ width='xs'
width: '18vw' name='enabled'
}} label={l('global.table.isEnable')}
addonBefore={undefined} {...SWITCH_OPTIONS()}
onBlur={cloneType === 1 ? getBranchList : () => Promise<void>} />
placeholder={l('rc.gp.urlPlaceholder')}
/>
</ProFormText>
</ProForm.Group> </ProForm.Group>
<ProForm.Group> <ProForm.Group>
...@@ -162,43 +159,24 @@ const ProjectForm: React.FC<ProjectFormProps> = (props) => { ...@@ -162,43 +159,24 @@ const ProjectForm: React.FC<ProjectFormProps> = (props) => {
<ProFormText.Password <ProFormText.Password
name='password' name='password'
width={'sm'}
label={l('rc.gp.password')} label={l('rc.gp.password')}
placeholder={l('rc.gp.passwordPlaceholder')} placeholder={l('rc.gp.passwordPlaceholder')}
/> />
<ProFormSelect <ProFormSelect
options={branches} options={branches}
shouldUpdate
disabled={
cloneType === 1
? !form.getFieldsValue().url
: !form.getFieldsValue().privateKey && !form.getFieldsValue().url
}
colon={true}
name='branch' name='branch'
width={'sm'} width={'sm'}
label={l('rc.gp.branch')} label={l('rc.gp.branch')}
placeholder={l('rc.gp.branchPlaceholder')} placeholder={l('rc.gp.branchPlaceholder')}
rules={[{ required: true, message: l('rc.gp.branchPlaceholder') }]} rules={[{ required: true, message: l('rc.gp.branchPlaceholder') }]}
fieldProps={{
onFocus: getBranchList
}}
showSearch showSearch
/> />
</ProForm.Group>
<ProForm.Group>
<ProForm.Item name='buildArgs' label={l('rc.gp.buildArgs')}>
<CodeEdit
onChange={(value) => setBuildArgsValue(value ?? '')}
code={buildArgs}
{...CodeEditProps}
/>
</ProForm.Item>
<ProFormSwitch
width='xs'
name='enabled'
label={l('global.table.isEnable')}
{...SWITCH_OPTIONS()}
/>
<ProFormRadio.Group <ProFormRadio.Group
name='codeType' name='codeType'
width={'xs'} width={'xs'}
...@@ -212,16 +190,26 @@ const ProjectForm: React.FC<ProjectFormProps> = (props) => { ...@@ -212,16 +190,26 @@ const ProjectForm: React.FC<ProjectFormProps> = (props) => {
</ProFormRadio.Group> </ProFormRadio.Group>
</ProForm.Group> </ProForm.Group>
<ProForm.Group>
<ProForm.Item name='buildArgs' label={l('rc.gp.buildArgs')}>
<CodeEdit
onChange={(value: string) => setBuildArgsValue(value ?? '')}
code={buildArgs}
{...CodeEditProps}
/>
</ProForm.Item>
</ProForm.Group>
<ProForm.Group> <ProForm.Group>
<ProFormTextArea <ProFormTextArea
name='pom' name='pom'
width={'md'} width={'lg'}
label={l('rc.gp.pom')} label={l('rc.gp.pom')}
placeholder={l('rc.gp.pomPlaceholder')} placeholder={l('rc.gp.pomPlaceholder')}
/> />
<ProFormTextArea <ProFormTextArea
name='description' name='description'
width={'md'} width={'lg'}
label={l('global.table.note')} label={l('global.table.note')}
placeholder={l('global.table.notePlaceholder')} placeholder={l('global.table.notePlaceholder')}
/> />
...@@ -232,7 +220,7 @@ const ProjectForm: React.FC<ProjectFormProps> = (props) => { ...@@ -232,7 +220,7 @@ const ProjectForm: React.FC<ProjectFormProps> = (props) => {
return ( return (
<> <>
<ProForm form={form} submitter={false} initialValues={values}> <ProForm form={form} submitter={false} initialValues={values} syncToInitialValues>
{renderGitProjectForm()} {renderGitProjectForm()}
</ProForm> </ProForm>
</> </>
......
...@@ -120,6 +120,8 @@ const ProjectModal: React.FC<ProjectModalProps> = (props) => { ...@@ -120,6 +120,8 @@ const ProjectModal: React.FC<ProjectModalProps> = (props) => {
destroyOnClose: true, destroyOnClose: true,
onCancel: () => handleCancel() onCancel: () => handleCancel()
}} }}
onValuesChange={(changedValues, allValues) => form.setFieldsValue(allValues)}
syncToInitialValues
> >
<ProjectForm values={values} form={form} /> <ProjectForm values={values} form={form} />
</ModalForm> </ModalForm>
......
...@@ -93,7 +93,7 @@ export const FORM_LAYOUT_PUBLIC = { ...@@ -93,7 +93,7 @@ export const FORM_LAYOUT_PUBLIC = {
* the modal form layout of public * the modal form layout of public
*/ */
export const MODAL_FORM_STYLE: any = { export const MODAL_FORM_STYLE: any = {
width: '50%', width: '55%',
style: { style: {
maxHeight: '70vh', maxHeight: '70vh',
overflowY: 'auto' overflowY: 'auto'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment