mirror of
https://github.com/RubyMetric/chsrc
synced 2025-07-17 20:57:28 +08:00
Notify users
This commit is contained in:
parent
c0598b2dad
commit
48be5f5acb
@ -506,6 +506,33 @@ iterate_targets_ (const char ***array, size_t size, const char *input, const cha
|
|||||||
|
|
||||||
#define iterate_targets(ary, input, target) iterate_targets_(ary, xy_arylen(ary), input, target)
|
#define iterate_targets(ary, input, target) iterate_targets_(ary, xy_arylen(ary), input, target)
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 我们总是最后告诉用户一些维护信息
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
cli_notify_for_users ()
|
||||||
|
{
|
||||||
|
char *msg = "2025-07-11:\n\n"
|
||||||
|
|
||||||
|
" 有时,同一镜像站对不同资源的实际服务速度差异,可能比不同镜像站之间的差异还要大。\n\n"
|
||||||
|
|
||||||
|
" * 精准测速: 能真实反映您未来使用该资源时的速度,因为它直接测量您关注的那个资源。\n\n"
|
||||||
|
|
||||||
|
" * 模糊测速: 仅代表该镜像站提供服务的一个可能速度。因而可能会出现测速数值较高,但实际使用体验不佳的现象。\n\n"
|
||||||
|
|
||||||
|
" 因此,当您遇到模糊测速时,请务必向我们提交准确的测速链接,这既能帮助您,也能造福所有用户。\n\n"
|
||||||
|
|
||||||
|
" chsrc 是一个自助和共建的项目。 维护者对于不熟悉的生态系统很难提供有价值的贡献。请您将这部分功能视为您的专属,您可以完全掌控和维护它,就像您是唯一的负责人一样。\n";
|
||||||
|
|
||||||
|
br();br();
|
||||||
|
|
||||||
|
chsrc_note2 (msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
TargetOp_Get_Source = 1,
|
TargetOp_Get_Source = 1,
|
||||||
TargetOp_Set_Source,
|
TargetOp_Set_Source,
|
||||||
@ -515,7 +542,7 @@ typedef enum {
|
|||||||
} TargetOp;
|
} TargetOp;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 寻找target,并根据`code`执行相应的操作
|
* 寻找target,并根据 @param:code 执行相应的操作
|
||||||
*
|
*
|
||||||
* @param input 用户输入的目标
|
* @param input 用户输入的目标
|
||||||
* @param code 对target要执行的操作
|
* @param code 对target要执行的操作
|
||||||
@ -585,6 +612,14 @@ get_target (const char *input, TargetOp code, char *option)
|
|||||||
select_mirror_autoly (target->sources, target->sources_n, input);
|
select_mirror_autoly (target->sources, target->sources_n, input);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (TargetOp_Set_Source==code
|
||||||
|
|| TargetOp_Reset_Source==code
|
||||||
|
|| TargetOp_Measure_Source==code)
|
||||||
|
{
|
||||||
|
cli_notify_for_users();
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,11 +36,11 @@ GoProxyIO =
|
|||||||
*/
|
*/
|
||||||
static Source_t pl_go_sources[] =
|
static Source_t pl_go_sources[] =
|
||||||
{
|
{
|
||||||
{&pl_go_upstream, "https://proxy.golang.org"},
|
{&pl_go_upstream, "https://proxy.golang.org", NULL},
|
||||||
{&GoProxyCN, "https://goproxy.cn"},
|
{&GoProxyCN, "https://goproxy.cn", DelegateToMirror},
|
||||||
{&Ali, "https://mirrors.aliyun.com/goproxy/"},
|
{&Ali, "https://mirrors.aliyun.com/goproxy/", NULL},
|
||||||
{&Huawei, "https://mirrors.huaweicloud.com/goproxy/"},
|
{&Huawei, "https://mirrors.huaweicloud.com/goproxy/", NULL},
|
||||||
{&GoProxyIO, "https://goproxy.io"}
|
{&GoProxyIO, "https://goproxy.io", DelegateToMirror}
|
||||||
};
|
};
|
||||||
def_sources_n(pl_go);
|
def_sources_n(pl_go);
|
||||||
|
|
||||||
|
@ -28,26 +28,35 @@ static Source_t pl_rust_cargo_sources[] =
|
|||||||
{
|
{
|
||||||
{&pl_rust_cargo_upstream, "https://github.com/rust-lang/crates.io-index/",
|
{&pl_rust_cargo_upstream, "https://github.com/rust-lang/crates.io-index/",
|
||||||
NULL},
|
NULL},
|
||||||
|
|
||||||
{&MirrorZ, "https://mirrors.cernet.edu.cn/crates.io-index/",
|
{&MirrorZ, "https://mirrors.cernet.edu.cn/crates.io-index/",
|
||||||
NULL},
|
NULL},
|
||||||
{&RsProxyCN, "https://rsproxy.cn/index/",
|
{&RsProxyCN, "https://rsproxy.cn/index/",
|
||||||
NULL},
|
NULL},
|
||||||
{&Ali, "https://mirrors.aliyun.com/crates.io-index/",
|
{&Ali, "https://mirrors.aliyun.com/crates.io-index/",
|
||||||
"https://mirrors.aliyun.com/crates/api/v1/crates/windows/0.58.0/download"},
|
"https://mirrors.aliyun.com/crates/api/v1/crates/windows/0.58.0/download"},
|
||||||
|
|
||||||
{&Zju, "https://mirrors.zju.edu.cn/crates.io-index/",
|
{&Zju, "https://mirrors.zju.edu.cn/crates.io-index/",
|
||||||
NULL},
|
NULL},
|
||||||
|
|
||||||
// {&Nju, "https://mirror.nju.edu.cn/git/crates.io-index.git/",
|
// {&Nju, "https://mirror.nju.edu.cn/git/crates.io-index.git/",
|
||||||
// NULL},
|
// NULL},
|
||||||
|
|
||||||
{&Sjtug_Zhiyuan, "https://mirrors.sjtug.sjtu.edu.cn/crates.io-index/",
|
{&Sjtug_Zhiyuan, "https://mirrors.sjtug.sjtu.edu.cn/crates.io-index/",
|
||||||
NULL},
|
NULL},
|
||||||
|
|
||||||
{&Tuna, "https://mirrors.tuna.tsinghua.edu.cn/crates.io-index/",
|
{&Tuna, "https://mirrors.tuna.tsinghua.edu.cn/crates.io-index/",
|
||||||
NULL},
|
NULL},
|
||||||
|
|
||||||
{&Bfsu, "https://mirrors.bfsu.edu.cn/crates.io-index/",
|
{&Bfsu, "https://mirrors.bfsu.edu.cn/crates.io-index/",
|
||||||
NULL},
|
NULL},
|
||||||
|
|
||||||
{&Ustc, "https://mirrors.ustc.edu.cn/crates.io-index/",
|
{&Ustc, "https://mirrors.ustc.edu.cn/crates.io-index/",
|
||||||
"https://crates-io.proxy.ustclug.org/api/v1/crates/windows/0.58.0/download"},
|
"https://crates-io.proxy.ustclug.org/api/v1/crates/windows/0.58.0/download"},
|
||||||
|
|
||||||
// {&Hust, "https://mirrors.hust.edu.cn/crates.io-index/",
|
// {&Hust, "https://mirrors.hust.edu.cn/crates.io-index/",
|
||||||
// NULL},
|
// NULL},
|
||||||
|
|
||||||
{&Cqu, "https://mirrors.cqu.edu.cn/crates.io-index/",
|
{&Cqu, "https://mirrors.cqu.edu.cn/crates.io-index/",
|
||||||
NULL}
|
NULL}
|
||||||
};
|
};
|
||||||
|
@ -19,15 +19,15 @@ static SourceProvider_t pl_rust_binary_upstream =
|
|||||||
* @update 2025-06-17
|
* @update 2025-06-17
|
||||||
*/
|
*/
|
||||||
static Source_t pl_rust_rustup_sources[] = {
|
static Source_t pl_rust_rustup_sources[] = {
|
||||||
{&pl_rust_binary_upstream, "https://static.rust-lang.org"},
|
{&pl_rust_binary_upstream, "https://static.rust-lang.org", NULL},
|
||||||
{&MirrorZ, "https://mirrors.cernet.edu.cn/rustup"},
|
{&MirrorZ, "https://mirrors.cernet.edu.cn/rustup", NULL},
|
||||||
{&Tuna, "https://mirrors.tuna.tsinghua.edu.cn/rustup"},
|
{&Tuna, "https://mirrors.tuna.tsinghua.edu.cn/rustup", NULL},
|
||||||
{&Ustc, "https://mirrors.ustc.edu.cn/rust-static"},
|
{&Ustc, "https://mirrors.ustc.edu.cn/rust-static", NULL},
|
||||||
{&Nju, "https://mirror.nju.edu.cn/rustup"},
|
{&Nju, "https://mirror.nju.edu.cn/rustup", NULL},
|
||||||
{&Sjtug_Zhiyuan, "https://mirror.sjtu.edu.cn/rust-static"},
|
{&Sjtug_Zhiyuan, "https://mirror.sjtu.edu.cn/rust-static", NULL},
|
||||||
{&Zju, "https://mirrors.zju.edu.cn/rustup"},
|
{&Zju, "https://mirrors.zju.edu.cn/rustup", NULL},
|
||||||
{&Iscas, "https://mirror.iscas.ac.cn/rustup"},
|
{&Iscas, "https://mirror.iscas.ac.cn/rustup", NULL},
|
||||||
{&Ali, "https://mirrors.aliyun.com/rustup"},
|
{&Ali, "https://mirrors.aliyun.com/rustup", NULL},
|
||||||
{&RsProxyCN, "https://rsproxy.cn"}};
|
{&RsProxyCN, "https://rsproxy.cn"}};
|
||||||
def_sources_n(pl_rust_rustup);
|
def_sources_n(pl_rust_rustup);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user