From 14ff46b5cd4b2b80b41a0305952410c308353f5a Mon Sep 17 00:00:00 2001 From: lyf <1910527151@qq.com> Date: Wed, 7 Aug 2024 13:01:08 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E6=8C=89=E9=92=AE=E6=97=A0?= =?UTF-8?q?=E9=9A=9C=E7=A2=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/components/input-range.tsx | 3 ++ app/components/mask.tsx | 6 ++++ app/components/model-config.tsx | 11 +++++++ app/components/sd/sd-panel.tsx | 3 ++ app/components/settings.tsx | 52 +++++++++++++++++++++++++++++++++ app/components/ui-lib.tsx | 13 +++++++-- app/locales/cn.ts | 1 + app/locales/en.ts | 2 ++ 8 files changed, 89 insertions(+), 2 deletions(-) diff --git a/app/components/input-range.tsx b/app/components/input-range.tsx index a8ee9532b..08756e2c8 100644 --- a/app/components/input-range.tsx +++ b/app/components/input-range.tsx @@ -9,6 +9,7 @@ interface InputRangeProps { min: string; max: string; step: string; + aria: string; } export function InputRange({ @@ -19,11 +20,13 @@ export function InputRange({ min, max, step, + aria, }: InputRangeProps) { return (
{title || value} setShowPicker(false)} >
setShowPicker(true)} style={{ cursor: "pointer" }} > @@ -139,6 +141,7 @@ export function MaskConfig(props: { @@ -153,6 +156,7 @@ export function MaskConfig(props: { subTitle={Locale.Mask.Config.HideContext.SubTitle} > { @@ -169,6 +173,7 @@ export function MaskConfig(props: { subTitle={Locale.Mask.Config.Share.SubTitle} > } text={Locale.Mask.Config.Share.Action} onClick={copyMaskLink} @@ -182,6 +187,7 @@ export function MaskConfig(props: { subTitle={Locale.Mask.Config.Sync.SubTitle} > { diff --git a/app/components/model-config.tsx b/app/components/model-config.tsx index 346fd3a71..6ce25f664 100644 --- a/app/components/model-config.tsx +++ b/app/components/model-config.tsx @@ -17,6 +17,7 @@ export function ModelConfigList(props: { <> @@ -159,6 +166,7 @@ export function ModelConfigList(props: { subTitle={Locale.Settings.InputTemplate.SubTitle} > @@ -175,6 +183,7 @@ export function ModelConfigList(props: { subTitle={Locale.Settings.HistoryCount.SubTitle} > diff --git a/app/components/sd/sd-panel.tsx b/app/components/sd/sd-panel.tsx index c27fbd54e..a71e560dd 100644 --- a/app/components/sd/sd-panel.tsx +++ b/app/components/sd/sd-panel.tsx @@ -192,6 +192,7 @@ export function ControlParam(props: { required={item.required} > { if (await showConfirm(Locale.Settings.Danger.Reset.Confirm)) { @@ -260,6 +261,7 @@ function DangerItems() { subTitle={Locale.Settings.Danger.Clear.SubTitle} > { if (await showConfirm(Locale.Settings.Danger.Clear.Confirm)) { @@ -513,6 +515,7 @@ function SyncItems() { >
} text={Locale.UI.Config} onClick={() => { @@ -543,6 +546,7 @@ function SyncItems() { >
} text={Locale.UI.Export} onClick={() => { @@ -550,6 +554,7 @@ function SyncItems() { }} /> } text={Locale.UI.Import} onClick={() => { @@ -687,6 +692,7 @@ export function Settings() { subTitle={Locale.Settings.Access.CustomEndpoint.SubTitle} > @@ -706,6 +712,7 @@ export function Settings() { subTitle={Locale.Settings.Access.OpenAI.Endpoint.SubTitle} >
} onClick={() => navigate(Path.Home)} bordered @@ -1267,6 +1304,8 @@ export function Settings() { open={showEmojiPicker} >
{ setShowEmojiPicker(!showEmojiPicker); @@ -1304,6 +1343,7 @@ export function Settings() { { updateConfig( @@ -1339,6 +1380,7 @@ export function Settings() { @@ -1408,6 +1453,7 @@ export function Settings() { subTitle={Locale.Settings.SendPreviewBubble.SubTitle} > @@ -1428,6 +1474,7 @@ export function Settings() { subTitle={Locale.Settings.Mask.Splash.SubTitle} > @@ -1445,6 +1492,7 @@ export function Settings() { subTitle={Locale.Settings.Mask.Builtin.SubTitle} > @@ -1463,6 +1511,7 @@ export function Settings() { subTitle={Locale.Settings.Prompt.Disable.SubTitle} > @@ -1482,6 +1531,7 @@ export function Settings() { )} > } text={Locale.Settings.Prompt.Edit} onClick={() => setShowPromptModal(true)} @@ -1503,6 +1553,7 @@ export function Settings() { subTitle={Locale.Settings.Access.Provider.SubTitle} > ) { - const [visible, setVisible] = useState(false); +// 定义一个接口 AriaProps,包含一个可选的 aria 属性 +interface AriaProps { + aria?: string; +} +// 定义一个接口 PasswordInputProps,继承自 HTMLProps 和 AriaProps +// 用于描述密码输入框组件的属性 +interface PasswordInputProps extends HTMLProps, AriaProps {} + +export function PasswordInput(props: PasswordInputProps) { + const [visible, setVisible] = useState(false); function changeVisibility() { setVisible(!visible); } @@ -275,6 +283,7 @@ export function PasswordInput(props: HTMLProps) { return (
: } onClick={changeVisibility} className={"password-eye"} diff --git a/app/locales/cn.ts b/app/locales/cn.ts index 4db555422..02b3a9d40 100644 --- a/app/locales/cn.ts +++ b/app/locales/cn.ts @@ -133,6 +133,7 @@ const cn = { Settings: { Title: "设置", SubTitle: "所有设置选项", + ShowPassword: "显示密码", Danger: { Reset: { diff --git a/app/locales/en.ts b/app/locales/en.ts index ac7880329..6cca963a9 100644 --- a/app/locales/en.ts +++ b/app/locales/en.ts @@ -44,6 +44,7 @@ const en: LocaleType = { PinToastAction: "View", Delete: "Delete", Edit: "Edit", + FullScreen: "FullScreen", }, Commands: { new: "Start a new chat", @@ -135,6 +136,7 @@ const en: LocaleType = { Settings: { Title: "Settings", SubTitle: "All Settings", + ShowPassword: "ShowPassword", Danger: { Reset: { Title: "Reset All Settings",