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