Skip to content

Commit

Permalink
🎨 优化WebDAV密码输入,修改为密码框 (#311)
Browse files Browse the repository at this point in the history
  • Loading branch information
Przeblysk authored Sep 19, 2024
1 parent cd749af commit 9f1003c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/filesystem/factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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[];
};
};
Expand Down Expand Up @@ -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: {},
Expand Down
14 changes: 14 additions & 0 deletions src/pages/components/FileSystemParams/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,20 @@ const FileSystemParams: React.FC<{
</Select>
</>
)}
{fsParams[fileSystemType][key].type === "password" && (
<>
<span>{fsParams[fileSystemType][key].title}</span>
<Input.Password
value={fileSystemParams[key]}
onChange={(value) => {
onChangeFileSystemParams({
...fileSystemParams,
[key]: value,
});
}}
/>
</>
)}
{!fsParams[fileSystemType][key].type && (
<>
<span>{fsParams[fileSystemType][key].title}</span>
Expand Down

0 comments on commit 9f1003c

Please sign in to comment.