mirror of
https://github.com/whyour/qinglong.git
synced 2025-05-22 22:36:06 +08:00
订阅增加代理参数
This commit is contained in:
parent
5ee00e52a8
commit
0a6166c557
|
@ -49,6 +49,7 @@ export default (app: Router) => {
|
|||
sub_after: Joi.string().optional().allow('').allow(null),
|
||||
schedule_type: Joi.string().required(),
|
||||
alias: Joi.string().required(),
|
||||
proxy: Joi.string().optional().allow('').allow(null),
|
||||
}),
|
||||
}),
|
||||
async (req: Request, res: Response, next: NextFunction) => {
|
||||
|
@ -177,6 +178,7 @@ export default (app: Router) => {
|
|||
sub_before: Joi.string().optional().allow('').allow(null),
|
||||
sub_after: Joi.string().optional().allow('').allow(null),
|
||||
alias: Joi.string().required(),
|
||||
proxy: Joi.string().optional().allow('').allow(null),
|
||||
id: Joi.number().required(),
|
||||
}),
|
||||
}),
|
||||
|
|
|
@ -43,7 +43,13 @@ export default class SshKeyService {
|
|||
host: string,
|
||||
proxy?: string,
|
||||
): string {
|
||||
return `\nHost ${alias}\n Hostname ${host}\n IdentityFile ${this.sshPath}/${alias}\n StrictHostKeyChecking no\n`;
|
||||
if (host === 'github.com' && proxy) {
|
||||
host = 'ssh.github.com';
|
||||
}
|
||||
const proxyStr = proxy
|
||||
? ` Port 443\n HostkeyAlgorithms +ssh-rsa\n PubkeyAcceptedAlgorithms +ssh-rsa\n ProxyCommand nc -v -x ${proxy} %h %p\n`
|
||||
: '';
|
||||
return `\nHost ${alias}\n Hostname ${host}\n IdentityFile ${this.sshPath}/${alias}\n StrictHostKeyChecking no\n${proxyStr}`;
|
||||
}
|
||||
|
||||
private generateSshConfig(configs: string[]) {
|
||||
|
|
|
@ -16,7 +16,7 @@ DefaultCronRule=""
|
|||
## ql repo命令拉取脚本时需要拉取的文件后缀,直接写文件后缀名即可
|
||||
RepoFileExtensions="js py"
|
||||
|
||||
## 代理地址,支持http/https/socks,例如 http://127.0.0.1:7890
|
||||
## 代理地址,支持HTTP/SOCK5,例如 http://127.0.0.1:7890
|
||||
ProxyUrl=""
|
||||
|
||||
## 资源告警阙值,默认CPU 80%、内存80%、磁盘90%
|
||||
|
|
|
@ -253,10 +253,11 @@ textarea:-webkit-autofill:focus,
|
|||
select:-webkit-autofill,
|
||||
select:-webkit-autofill:hover,
|
||||
select:-webkit-autofill:focus {
|
||||
border: none;
|
||||
box-shadow: none;
|
||||
transition: background-color 5000s ease-in-out 0s;
|
||||
-webkit-text-fill-color: @text-color;
|
||||
caret-color: @text-color;
|
||||
color: @text-color;
|
||||
}
|
||||
|
||||
::placeholder {
|
||||
|
|
|
@ -439,6 +439,19 @@ const SubscriptionModal = ({
|
|||
</Form.Item>
|
||||
</>
|
||||
)}
|
||||
<Form.Item
|
||||
name="proxy"
|
||||
label="代理"
|
||||
tooltip="公开仓库支持HTTP/SOCK5代理,私有仓库支持SOCK5代理"
|
||||
>
|
||||
<Input
|
||||
placeholder={
|
||||
type === 'private-repo'
|
||||
? 'SOCK5代理,例如 IP:PORT'
|
||||
: 'HTTP/SOCK5代理,例如 http://127.0.0.1:1080'
|
||||
}
|
||||
/>
|
||||
</Form.Item>
|
||||
</Form>
|
||||
</Modal>
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue
Block a user