feat(web): 存储设置与文件管理的 Alist 存储切换
- 设置 → 媒体库与目录 → 存储:登记 Alist / OpenList(令牌 / 账号密码 / 访客、路径密码、限速与监控选项), 测试连接显示版本、用户与容量;媒体库目录可选存储 - 文件管理左栏多一组「Alist 存储」,路径显示「存储名:/路径」;移动 / 复制目标可选 Alist 存储; 上传按钮;Alist 根点刷新才让 Alist 刷新目录缓存 - 运行状态的挂载根列出存储实例(令牌失效单独提示) Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Cxwgnn2pbzQ7rXv3rq7fei
This commit is contained in:
1 parent
c1bc389058
commit
cf364435eb
18 files changed
+618
-41
No files matched your search
@@ -524,9 +524,19 @@ export function groupRoots<T extends Pick<FileRoot, "kind">>(
|
||||
return [
|
||||
{ title: "下载目录", kind: "download", items: roots.filter((r) => r.kind === "download") },
|
||||
{ title: "媒体库", kind: "library", items: roots.filter((r) => r.kind === "library") },
|
||||
{ title: "Alist 存储", kind: "storage", items: roots.filter((r) => r.kind === "storage") },
|
||||
].filter((g) => g.items.length > 0);
|
||||
}
|
||||
|
||||
/** 根 + 相对路径的显示:本机给本机路径;Alist 给「存储名:/Alist 内路径」(不暴露内部 /@alist 前缀) */
|
||||
export function displayPath(root: Pick<FileRoot, "hostPath" | "storage">, rel = ""): string {
|
||||
const base = root.storage
|
||||
? `${root.storage.name}:${root.storage.path === "/" ? "" : root.storage.path}`
|
||||
: root.hostPath;
|
||||
const joined = `${base}${rel ? `/${rel}` : ""}`;
|
||||
return root.storage && !rel && root.storage.path === "/" ? `${root.storage.name}:/` : joined;
|
||||
}
|
||||
|
||||
/** 目标名在当前目录已存在(忽略自身;不区分大小写只作提示,服务端仍按字节判断) */
|
||||
export function nameTaken(name: string, self: string, siblings: string[]): boolean {
|
||||
const n = name.trim();
|
||||
|
||||
Reference in new issue
Block a user