From 92b47ba29beeb1e489b2dcc5589f9a84ff1987c6 Mon Sep 17 00:00:00 2001 From: lyf <1910527151@qq.com> Date: Tue, 6 Aug 2024 12:45:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/openai.ts | 2 +- app/components/button.tsx | 10 +++++++++- app/components/chat.tsx | 7 ++++++- app/components/sidebar.tsx | 19 +++++++++++++++---- app/config/server.ts | 10 ++++++++-- app/locales/cn.ts | 1 + 6 files changed, 40 insertions(+), 9 deletions(-) diff --git a/app/api/openai.ts b/app/api/openai.ts index 6d11d679215..d32e45dd997 100644 --- a/app/api/openai.ts +++ b/app/api/openai.ts @@ -13,7 +13,7 @@ function getModels(remoteModelRes: OpenAIListModelResponse) { if (config.disableGPT4) { remoteModelRes.data = remoteModelRes.data.filter( - (m) => !m.id.startsWith("gpt-4"), + (m) => !m.id.startsWith("gpt-4") || m.id.startsWith("gpt-40-mini"), ); } diff --git a/app/components/button.tsx b/app/components/button.tsx index c6039acc292..87b4abd30f9 100644 --- a/app/components/button.tsx +++ b/app/components/button.tsx @@ -18,6 +18,7 @@ export function IconButton(props: { tabIndex?: number; autoFocus?: boolean; style?: CSSProperties; + aria?: string; }) { return ( ); diff --git a/app/components/chat.tsx b/app/components/chat.tsx index 6cb0cc88f53..a0d909ca397 100644 --- a/app/components/chat.tsx +++ b/app/components/chat.tsx @@ -382,7 +382,7 @@ export function ChatAction(props: { } as React.CSSProperties } > -
+
{props.icon}
@@ -1337,6 +1337,8 @@ function _Chat() { } bordered + title={Locale.Chat.EditMessage.Title} + aria={Locale.Chat.EditMessage.Title} onClick={() => setIsEditingMessage(true)} />
@@ -1356,6 +1358,8 @@ function _Chat() { : } bordered + title={Locale.Chat.Actions.FullScreen} + aria={Locale.Chat.Actions.FullScreen} onClick={() => { config.update( (config) => (config.tightBorder = !config.tightBorder), @@ -1407,6 +1411,7 @@ function _Chat() {
} + aria={Locale.Chat.Actions.Edit} onClick={async () => { const newMessage = await showPrompt( Locale.Chat.Actions.Edit, diff --git a/app/components/sidebar.tsx b/app/components/sidebar.tsx index d8def056e52..44ea43701f5 100644 --- a/app/components/sidebar.tsx +++ b/app/components/sidebar.tsx @@ -285,7 +285,10 @@ export function SideBar(props: { className?: string }) { -
+
} onClick={async () => { @@ -296,13 +299,21 @@ export function SideBar(props: { className?: string }) { />
- - } shadow /> + + } + shadow + />
diff --git a/app/config/server.ts b/app/config/server.ts index 70c20ce644f..3ac634fabde 100644 --- a/app/config/server.ts +++ b/app/config/server.ts @@ -114,10 +114,16 @@ export const getServerSideConfig = () => { if (disableGPT4) { if (customModels) customModels += ","; - customModels += DEFAULT_MODELS.filter((m) => m.name.startsWith("gpt-4")) + customModels += DEFAULT_MODELS.filter( + (m) => m.name.startsWith("gpt-4") && !m.name.startsWith("gpt-4o-mini"), + ) .map((m) => "-" + m.name) .join(","); - if (defaultModel.startsWith("gpt-4")) defaultModel = ""; + if ( + defaultModel.startsWith("gpt-4") && + !defaultModel.startsWith("gpt-4o-mini") + ) + defaultModel = ""; } const isStability = !!process.env.STABILITY_API_KEY; diff --git a/app/locales/cn.ts b/app/locales/cn.ts index 69ada8784a0..b8561c0b69a 100644 --- a/app/locales/cn.ts +++ b/app/locales/cn.ts @@ -42,6 +42,7 @@ const cn = { PinToastAction: "查看", Delete: "删除", Edit: "编辑", + FullScreen: "全屏", }, Commands: { new: "新建聊天",