diff --git a/pkg/filesystem/factory.ts b/pkg/filesystem/factory.ts index 48d77a12a..14eda4e92 100644 --- a/pkg/filesystem/factory.ts +++ b/pkg/filesystem/factory.ts @@ -10,7 +10,7 @@ export type FileSystemType = "zip" | "webdav" | "baidu-netdsik" | "onedrive"; export type FileSystemParams = { [key: string]: { title: string; - type?: "select" | "authorize"; + type?: "select" | "authorize" | "password"; options?: string[]; }; }; @@ -52,7 +52,7 @@ export default class FileSystemFactory { }, url: { title: i18next.t("url") }, username: { title: i18next.t("username") }, - password: { title: i18next.t("password") }, + password: { title: i18next.t("password"), type: "password" }, }, "baidu-netdsik": {}, onedrive: {}, diff --git a/src/pages/components/FileSystemParams/index.tsx b/src/pages/components/FileSystemParams/index.tsx index 39aeab874..8976de608 100644 --- a/src/pages/components/FileSystemParams/index.tsx +++ b/src/pages/components/FileSystemParams/index.tsx @@ -86,6 +86,20 @@ const FileSystemParams: React.FC<{ )} + {fsParams[fileSystemType][key].type === "password" && ( + <> + {fsParams[fileSystemType][key].title} + { + onChangeFileSystemParams({ + ...fileSystemParams, + [key]: value, + }); + }} + /> + + )} {!fsParams[fileSystemType][key].type && ( <> {fsParams[fileSystemType][key].title}