mirror of
https://github.com/acepanel/panel.git
synced 2026-02-04 09:13:49 +08:00
feat: 优化自带镜像
This commit is contained in:
@@ -15,8 +15,14 @@ const proxyLoading = ref(false)
|
||||
const proxyOptions = [
|
||||
{ label: $gettext('Official (proxy.golang.org)'), value: 'https://proxy.golang.org,direct' },
|
||||
{ label: $gettext('China - Qiniu (goproxy.cn)'), value: 'https://goproxy.cn,direct' },
|
||||
{ label: $gettext('China - Alibaba (mirrors.aliyun.com)'), value: 'https://mirrors.aliyun.com/goproxy/,direct' },
|
||||
{ label: $gettext('China - Tencent (mirrors.cloud.tencent.com)'), value: 'https://mirrors.cloud.tencent.com/go/,direct' }
|
||||
{
|
||||
label: $gettext('China - Alibaba (mirrors.aliyun.com)'),
|
||||
value: 'https://mirrors.aliyun.com/goproxy/,direct'
|
||||
},
|
||||
{
|
||||
label: $gettext('China - Tencent (mirrors.tencent.com)'),
|
||||
value: 'https://mirrors.tencent.com/go/,direct'
|
||||
}
|
||||
]
|
||||
|
||||
// 获取当前代理设置
|
||||
@@ -52,9 +58,7 @@ const handleSaveProxy = async () => {
|
||||
<common-page show-footer>
|
||||
<n-flex vertical>
|
||||
<n-card>
|
||||
<template #header>
|
||||
Go {{ slug }}
|
||||
</template>
|
||||
<template #header> Go {{ slug }} </template>
|
||||
<template #header-extra>
|
||||
<n-button type="info" @click="handleSetCli">
|
||||
{{ $gettext('Set as CLI Default Version') }}
|
||||
@@ -66,7 +70,11 @@ const handleSaveProxy = async () => {
|
||||
<n-spin :show="proxyLoading">
|
||||
<n-flex vertical>
|
||||
<n-alert type="info" :show-icon="false">
|
||||
{{ $gettext('GOPROXY is used to configure the Go module proxy. Using a domestic mirror can speed up dependency downloads.') }}
|
||||
{{
|
||||
$gettext(
|
||||
'GOPROXY is used to configure the Go module proxy. Using a domestic mirror can speed up dependency downloads.'
|
||||
)
|
||||
}}
|
||||
</n-alert>
|
||||
<n-form-item :label="$gettext('Proxy Address')">
|
||||
<n-select
|
||||
|
||||
@@ -14,9 +14,18 @@ const registryLoading = ref(false)
|
||||
// 预设的镜像选项
|
||||
const registryOptions = [
|
||||
{ label: $gettext('Official (registry.npmjs.org)'), value: 'https://registry.npmjs.org/' },
|
||||
{ label: $gettext('China - npmmirror (npmmirror.com)'), value: 'https://registry.npmmirror.com/' },
|
||||
{ label: $gettext('China - Tencent (mirrors.cloud.tencent.com)'), value: 'https://mirrors.cloud.tencent.com/npm/' },
|
||||
{ label: $gettext('China - Huawei (repo.huaweicloud.com)'), value: 'https://repo.huaweicloud.com/repository/npm/' }
|
||||
{
|
||||
label: $gettext('China - npmmirror (npmmirror.com)'),
|
||||
value: 'https://registry.npmmirror.com/'
|
||||
},
|
||||
{
|
||||
label: $gettext('China - Tencent (mirrors.tencent.com)'),
|
||||
value: 'https://mirrors.tencent.com/npm/'
|
||||
},
|
||||
{
|
||||
label: $gettext('China - Huawei (repo.huaweicloud.com)'),
|
||||
value: 'https://repo.huaweicloud.com/repository/npm/'
|
||||
}
|
||||
]
|
||||
|
||||
// 获取当前镜像设置
|
||||
@@ -52,9 +61,7 @@ const handleSaveRegistry = async () => {
|
||||
<common-page show-footer>
|
||||
<n-flex vertical>
|
||||
<n-card>
|
||||
<template #header>
|
||||
Node.js {{ slug }}
|
||||
</template>
|
||||
<template #header> Node.js {{ slug }} </template>
|
||||
<template #header-extra>
|
||||
<n-button type="info" @click="handleSetCli">
|
||||
{{ $gettext('Set as CLI Default Version') }}
|
||||
@@ -66,7 +73,11 @@ const handleSaveRegistry = async () => {
|
||||
<n-spin :show="registryLoading">
|
||||
<n-flex vertical>
|
||||
<n-alert type="info" :show-icon="false">
|
||||
{{ $gettext('npm registry is used to configure the npm package source. Using a domestic mirror can speed up package downloads.') }}
|
||||
{{
|
||||
$gettext(
|
||||
'npm registry is used to configure the npm package source. Using a domestic mirror can speed up package downloads.'
|
||||
)
|
||||
}}
|
||||
</n-alert>
|
||||
<n-form-item :label="$gettext('Registry Address')">
|
||||
<n-select
|
||||
|
||||
@@ -14,11 +14,22 @@ const mirrorLoading = ref(false)
|
||||
// 预设的镜像选项
|
||||
const mirrorOptions = [
|
||||
{ label: $gettext('Official (pypi.org)'), value: 'https://pypi.org/simple' },
|
||||
{ label: $gettext('China - Tsinghua (tuna.tsinghua.edu.cn)'), value: 'https://pypi.tuna.tsinghua.edu.cn/simple' },
|
||||
{ label: $gettext('China - Alibaba (mirrors.aliyun.com)'), value: 'https://mirrors.aliyun.com/pypi/simple/' },
|
||||
{ label: $gettext('China - Tencent (mirrors.cloud.tencent.com)'), value: 'https://mirrors.cloud.tencent.com/pypi/simple/' },
|
||||
{ label: $gettext('China - Douban (pypi.douban.com)'), value: 'https://pypi.douban.com/simple/' },
|
||||
{ label: $gettext('China - USTC (pypi.mirrors.ustc.edu.cn)'), value: 'https://pypi.mirrors.ustc.edu.cn/simple/' }
|
||||
{
|
||||
label: $gettext('China - Alibaba (mirrors.aliyun.com)'),
|
||||
value: 'https://mirrors.aliyun.com/pypi/simple/'
|
||||
},
|
||||
{
|
||||
label: $gettext('China - Tencent (mirrors.tencent.com)'),
|
||||
value: 'https://mirrors.tencent.com/pypi/simple/'
|
||||
},
|
||||
{
|
||||
label: $gettext('China - Tsinghua (tuna.tsinghua.edu.cn)'),
|
||||
value: 'https://pypi.tuna.tsinghua.edu.cn/simple'
|
||||
},
|
||||
{
|
||||
label: $gettext('China - USTC (pypi.mirrors.ustc.edu.cn)'),
|
||||
value: 'https://pypi.mirrors.ustc.edu.cn/simple/'
|
||||
}
|
||||
]
|
||||
|
||||
// 获取当前镜像设置
|
||||
@@ -54,9 +65,7 @@ const handleSaveMirror = async () => {
|
||||
<common-page show-footer>
|
||||
<n-flex vertical>
|
||||
<n-card>
|
||||
<template #header>
|
||||
Python {{ slug }}
|
||||
</template>
|
||||
<template #header> Python {{ slug }} </template>
|
||||
<template #header-extra>
|
||||
<n-button type="info" @click="handleSetCli">
|
||||
{{ $gettext('Set as CLI Default Version') }}
|
||||
@@ -68,7 +77,11 @@ const handleSaveMirror = async () => {
|
||||
<n-spin :show="mirrorLoading">
|
||||
<n-flex vertical>
|
||||
<n-alert type="info" :show-icon="false">
|
||||
{{ $gettext('pip mirror is used to configure the Python package source. Using a domestic mirror can speed up package downloads.') }}
|
||||
{{
|
||||
$gettext(
|
||||
'pip mirror is used to configure the Python package source. Using a domestic mirror can speed up package downloads.'
|
||||
)
|
||||
}}
|
||||
</n-alert>
|
||||
<n-form-item :label="$gettext('Mirror Address')">
|
||||
<n-select
|
||||
|
||||
Reference in New Issue
Block a user