~Change content_list() > list_box()

This commit is contained in:
juewuy
2026-01-25 18:57:43 +08:00
parent f0eb2fc672
commit 71e4816020
6 changed files with 13 additions and 19 deletions

View File

@@ -21,7 +21,7 @@ set_core_config() {
comp_box "\033[30;47m配置文件管理\033[0m"
[ -n "$list" ] && {
content_line "\033[36m输入数字可管理对应提供者\033[0m"
content_list "$list" '...'
list_box "$list" '...'
separator_line "-"
}
content_line "a) \033[32m添加提供者\033[0m(支持订阅/分享链接及本地文件)"
@@ -164,7 +164,7 @@ setproviders() {
done | sort
)
if [ -n "$list" ];then
content_list "$list"
list_box "$list"
separator_line "-"
read -r -p "请选择对应文件或输入具体链接 > " text
else

View File

@@ -42,6 +42,14 @@ btm_box() {
separator_line "="
}
list_box () {
i=1
printf '%s\n' "$1" | while IFS= read -r f; do
content_line "$i) $f$2"
i=$(( i + 1 ))
done
}
# =================================================
common_back() {

View File

@@ -47,7 +47,7 @@ providers() {
content_line "当前规则模版为:\033[32m$provider_temp_des\033[0m"
content_line "\033[33m请选择在线模版\033[0m"
separator_line "-"
content_list "$list"
list_box "$list"
separator_line "-"
content_line "a) 使用\033[36m本地模版\033[0m"
common_back

View File

@@ -104,7 +104,7 @@ gen_link_config() { #选择在线规则模版
separator_line "-"
content_line "当前使用规则为:\033[33m$now\033[0m"
separator_line "-"
content_list "$list"
list_box "$list"
separator_line "-"
common_back
read -r -p "请输入对应数字 > " num
@@ -130,7 +130,7 @@ gen_link_server() { #选择Subconverter服务器
content_line "\033[32m感谢以下作者的无私奉献\033[0m"
content_line "当前使用后端为:\033[33m$now\033[0m"
separator_line "-"
content_list "$list"
list_box "$list"
common_back
read -r -p "请输入对应数字 > " num
totalnum=$(grep -acE '^3|^4' "$CRASHDIR"/configs/servers.list )

View File

@@ -147,11 +147,4 @@ line_break() {
printf "\n\n"
}
content_list() {
i=1
printf '%s\n' "$1" | while IFS= read -r f; do
content_line "$i) $f$2"
i=$(( i + 1 ))
done
}

View File

@@ -15,10 +15,3 @@ line_break() {
return
}
content_list() {
i=1
printf '%s\n' "$1" | while IFS= read -r f; do
content_line "$i) $f$2"
i=$(( i + 1 ))
done
}