mirror of
https://github.com/whyour/qinglong.git
synced 2025-05-22 22:36:06 +08:00
修改切换 linux 镜像源
This commit is contained in:
parent
7eb3b60af8
commit
f1a044b59b
|
@ -218,15 +218,15 @@ export default class SystemService {
|
|||
...oDoc,
|
||||
info: { ...oDoc.info, ...info },
|
||||
});
|
||||
let defaultDomain = 'https://dl-cdn.alpinelinux.org';
|
||||
let targetDomain = 'https://dl-cdn.alpinelinux.org';
|
||||
let defaultDomain = 'http://deb.debian.org';
|
||||
let targetDomain = 'http://deb.debian.org';
|
||||
if (os.platform() !== 'linux') {
|
||||
return;
|
||||
}
|
||||
const content = await fs.promises.readFile('/etc/apk/repositories', {
|
||||
const content = await fs.promises.readFile('/etc/apt/sources.list', {
|
||||
encoding: 'utf-8',
|
||||
});
|
||||
const domainMatch = content.match(/(http.*)\/alpine\/.*/);
|
||||
const domainMatch = content.match(/(http.*)\/debian /);
|
||||
if (domainMatch) {
|
||||
defaultDomain = domainMatch[1];
|
||||
}
|
||||
|
@ -239,7 +239,7 @@ export default class SystemService {
|
|||
)}/${targetDomain.replace(
|
||||
/\//g,
|
||||
'\\/',
|
||||
)}/g' /etc/apk/repositories && apk update -f`;
|
||||
)}/g' /etc/apt/sources.list && apt update`;
|
||||
|
||||
this.scheduleService.runTask(
|
||||
command,
|
||||
|
|
|
@ -196,12 +196,12 @@ const Dependence = () => {
|
|||
<Form.Item
|
||||
label={intl.get('Linux 软件包镜像源')}
|
||||
name="linux"
|
||||
tooltip={intl.get('alpine linux 镜像源')}
|
||||
tooltip={intl.get('debian linux 镜像源')}
|
||||
>
|
||||
<Input.Group compact>
|
||||
<Input
|
||||
style={{ width: 250 }}
|
||||
placeholder={'https://mirrors.aliyun.com'}
|
||||
placeholder={'http://deb.debian.org'}
|
||||
value={systemConfig?.linuxMirror}
|
||||
onChange={(e) => {
|
||||
setSystemConfig({
|
||||
|
|
Loading…
Reference in New Issue
Block a user