mirror of
https://github.com/whyour/qinglong.git
synced 2026-07-17 17:54:32 +08:00
完善拉取私有仓库
This commit is contained in:
@@ -51,6 +51,12 @@ export enum IntervalSchedule {
|
||||
'seconds' = '秒',
|
||||
}
|
||||
|
||||
export enum SubscriptionType {
|
||||
'private-repo' = '私有仓库',
|
||||
'public-repo' = '公开仓库',
|
||||
'file' = '单文件',
|
||||
}
|
||||
|
||||
const Subscription = ({ headerStyle, isPhone, socketMessage }: any) => {
|
||||
const columns: any = [
|
||||
{
|
||||
@@ -88,6 +94,16 @@ const Subscription = ({ headerStyle, isPhone, socketMessage }: any) => {
|
||||
);
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '类型',
|
||||
dataIndex: 'type',
|
||||
key: 'type',
|
||||
width: 130,
|
||||
align: 'center' as const,
|
||||
render: (text: string, record: any) => {
|
||||
return (SubscriptionType as any)[record.type];
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '分支',
|
||||
dataIndex: 'branch',
|
||||
|
||||
@@ -56,7 +56,9 @@ const SubscriptionModal = ({
|
||||
form.setFieldsValue({
|
||||
alias: formatAlias(_url, _branch, e.target.value),
|
||||
});
|
||||
form.validateFields(['url']);
|
||||
if (_url) {
|
||||
form.validateFields(['url']);
|
||||
}
|
||||
};
|
||||
|
||||
const scheduleTypeChange = (e) => {
|
||||
@@ -149,16 +151,28 @@ const SubscriptionModal = ({
|
||||
onChange?: (param: any) => void;
|
||||
}) => {
|
||||
return type === 'ssh-key' ? (
|
||||
<Form.Item name="private_key" label="私钥" rules={[{ required: true }]}>
|
||||
<Input.TextArea rows={4} autoSize={true} placeholder="请输入私钥" />
|
||||
<Form.Item
|
||||
name={['pull_option', 'private_key']}
|
||||
label="私钥"
|
||||
rules={[{ required: true }]}
|
||||
>
|
||||
<Input.TextArea
|
||||
rows={4}
|
||||
autoSize={{ minRows: 1, maxRows: 6 }}
|
||||
placeholder="请输入私钥"
|
||||
/>
|
||||
</Form.Item>
|
||||
) : (
|
||||
<>
|
||||
<Form.Item name="username" label="用户名" rules={[{ required: true }]}>
|
||||
<Form.Item
|
||||
name={['pull_option', 'username']}
|
||||
label="用户名"
|
||||
rules={[{ required: true }]}
|
||||
>
|
||||
<Input placeholder="请输入认证用户名" />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
name="password"
|
||||
name={['pull_option', 'password']}
|
||||
tooltip="Github已不支持密码认证,请使用Token方式"
|
||||
label="密码/Token"
|
||||
rules={[{ required: true }]}
|
||||
|
||||
Reference in New Issue
Block a user