Skip to content

Commit

Permalink
fix git auth error
Browse files Browse the repository at this point in the history
  • Loading branch information
Zzm0809 committed Jan 18, 2024
1 parent 457fb37 commit dc400c3
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 43 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ public void write(String str) {
super.write(str);
}
}))
.setCredentialsProvider(new UsernamePasswordCredentialsProvider(username, password))
.call();
git.close();
} else {
Expand Down
4 changes: 2 additions & 2 deletions dinky-web/src/global.less
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,8 @@ ol {
}

.gitCodeTree {
min-height: 70vh;
max-height: 70vh;
min-height: 73vh;
max-height: 73vh;
}

.schemaTree {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export const SiderTree: React.FC<SiderTreeProps> = (props) => {
<PageLoading />
) : treeData.length > 0 ? (
<DirectoryTree
className={'siderTree'}
className={'siderTree treeList gitCodeTree'}
onSelect={(_, info) => onNodeClick(info)}
treeData={buildTreeData(treeData)}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ type ProjectFormProps = {
*/
const CodeEditProps = {
height: '15vh',
width: '20vw',
lineNumbers: 'off',
width: '45vw',
lineNumbers: 'on',
language: 'shell'
};

Expand Down Expand Up @@ -113,23 +113,20 @@ const ProjectForm: React.FC<ProjectFormProps> = (props) => {
placeholder={l('rc.gp.namePlaceholder')}
/>
<ProFormSelect name='type' hidden shouldUpdate initialValue={cloneType} />

<ProFormText
name='url'
width={'xs'}
width={'md'}
label={l('rc.gp.url')}
placeholder={l('rc.gp.urlPlaceholder')}
rules={[{ required: true, message: l('rc.gp.urlPlaceholder') }]}
addonBefore={renderUrlBeforeSelect()}
>
<Input
style={{
width: '18vw'
}}
addonBefore={undefined}
onBlur={cloneType === 1 ? getBranchList : () => Promise<void>}
placeholder={l('rc.gp.urlPlaceholder')}
/>
</ProFormText>
/>
<ProFormSwitch
width='xs'
name='enabled'
label={l('global.table.isEnable')}
{...SWITCH_OPTIONS()}
/>
</ProForm.Group>

<ProForm.Group>
Expand Down Expand Up @@ -162,43 +159,25 @@ const ProjectForm: React.FC<ProjectFormProps> = (props) => {

<ProFormText.Password
name='password'
width={'sm'}
label={l('rc.gp.password')}
placeholder={l('rc.gp.passwordPlaceholder')}
/>

<ProFormSelect
options={branches}
shouldUpdate
disabled={
cloneType === 1
? !form.getFieldsValue().url
: !form.getFieldsValue().privateKey && !form.getFieldsValue().url
}
colon={true}
name='branch'
width={'sm'}
label={l('rc.gp.branch')}
placeholder={l('rc.gp.branchPlaceholder')}
rules={[{ required: true, message: l('rc.gp.branchPlaceholder') }]}
fieldProps={{
onFocus: getBranchList,
}}
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
name='codeType'
width={'xs'}
Expand All @@ -210,18 +189,31 @@ const ProjectForm: React.FC<ProjectFormProps> = (props) => {
<Radio value={2}>{GIT_PROJECT_CODE_TYPE_ENUM[2].text}</Radio>
</Radio.Group>
</ProFormRadio.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>
<ProFormTextArea
name='pom'
width={'md'}
width={'lg'}
label={l('rc.gp.pom')}
placeholder={l('rc.gp.pomPlaceholder')}
/>
<ProFormTextArea
name='description'
width={'md'}
width={'lg'}
label={l('global.table.note')}
placeholder={l('global.table.notePlaceholder')}
/>
Expand All @@ -232,7 +224,7 @@ const ProjectForm: React.FC<ProjectFormProps> = (props) => {

return (
<>
<ProForm form={form} submitter={false} initialValues={values}>
<ProForm form={form} submitter={false} initialValues={values} syncToInitialValues>
{renderGitProjectForm()}
</ProForm>
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ const ProjectModal: React.FC<ProjectModalProps> = (props) => {
destroyOnClose: true,
onCancel: () => handleCancel()
}}
onValuesChange={(changedValues, allValues) => form.setFieldsValue(allValues)}
syncToInitialValues
>
<ProjectForm values={values} form={form} />
</ModalForm>
Expand Down
2 changes: 1 addition & 1 deletion dinky-web/src/services/constants.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export const FORM_LAYOUT_PUBLIC = {
* the modal form layout of public
*/
export const MODAL_FORM_STYLE: any = {
width: '50%',
width: '55%',
style: {
maxHeight: '70vh',
overflowY: 'auto'
Expand Down

0 comments on commit dc400c3

Please sign in to comment.