import { useConfigStore } from "@/stores/configStore"; import { Slider, RadioGroup, Radio, Input } from "@heroui/react"; import { SettingCard, PageHeader, SectionTitle, fieldCls } from "@/components/setting"; const downloadSources = [ { value: "mirror", label: "尽量使用镜像源(推荐国内用户)" }, { value: "official", label: "优先使用官方源" }, { value: "official-only", label: "仅使用官方源" }, ]; export function DownloadSetting() { const dl = useConfigStore((s) => s.config.download); const setDownload = useConfigStore((s) => s.setDownload); return (
下载源

文件下载源

游戏文件(jar、lib)的下载来源

setDownload({ fileSource: String(v) })} className="mt-2 space-y-2" > {downloadSources.map((opt) => ( {opt.label} ))}

版本列表源

获取可用游戏版本列表的来源

setDownload({ versionSource: String(v) })} className="mt-2 space-y-2" > {downloadSources.map((opt) => ( {opt.label} ))}
并发控制

最大下载线程数

同时下载的文件数量,过高可能导致不稳定

{dl.threads}
setDownload({ threads: typeof v === "number" ? v : v[0] })} minValue={1} maxValue={64} step={1} >
1 64
速度限制

下载速度上限

单位 KB/s,0 表示不限速

setDownload({ speedLimit: Number(e.target.value) })} className={`w-28 ${fieldCls}`} /> KB/s
); }