From 9f1003ca18925b1c3ef8de6cd4c393d0d0f97dc3 Mon Sep 17 00:00:00 2001 From: Przeblysk Date: Thu, 19 Sep 2024 15:50:26 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20=E4=BC=98=E5=8C=96WebDAV?= =?UTF-8?q?=E5=AF=86=E7=A0=81=E8=BE=93=E5=85=A5=EF=BC=8C=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E4=B8=BA=E5=AF=86=E7=A0=81=E6=A1=86=20(#311)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/filesystem/factory.ts | 4 ++-- src/pages/components/FileSystemParams/index.tsx | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/pkg/filesystem/factory.ts b/pkg/filesystem/factory.ts index 48d77a12..14eda4e9 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 39aeab87..8976de60 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}