From 25d09e7fe90540f1ad878199090430cee91721a2 Mon Sep 17 00:00:00 2001 From: Faisal Amir Date: Mon, 22 Jan 2024 11:21:58 +0700 Subject: [PATCH 1/3] fix: disabled apikey while server running --- web/containers/DropdownListSidebar/index.tsx | 5 +- web/containers/OpenAiKeyInput/index.tsx | 4 +- web/screens/LocalServer/index.tsx | 54 ++++++++++---------- 3 files changed, 33 insertions(+), 30 deletions(-) diff --git a/web/containers/DropdownListSidebar/index.tsx b/web/containers/DropdownListSidebar/index.tsx index 5780de6b8..fd0223bdb 100644 --- a/web/containers/DropdownListSidebar/index.tsx +++ b/web/containers/DropdownListSidebar/index.tsx @@ -233,7 +233,10 @@ export default function DropdownListSidebar() { - + ) } diff --git a/web/containers/OpenAiKeyInput/index.tsx b/web/containers/OpenAiKeyInput/index.tsx index c6c6e6489..3d4a32f42 100644 --- a/web/containers/OpenAiKeyInput/index.tsx +++ b/web/containers/OpenAiKeyInput/index.tsx @@ -7,9 +7,10 @@ import { useEngineSettings } from '@/hooks/useEngineSettings' type Props = { selectedModel?: Model + serverEnabled?: boolean } -const OpenAiKeyInput: React.FC = ({ selectedModel }) => { +const OpenAiKeyInput: React.FC = ({ selectedModel, serverEnabled }) => { const [openAISettings, setOpenAISettings] = useState< { api_key: string } | undefined >(undefined) @@ -34,6 +35,7 @@ const OpenAiKeyInput: React.FC = ({ selectedModel }) => { API Key { : 'w-0 translate-x-full opacity-0' )} > - -
-
- -
- - {componentDataEngineSetting.filter( - (x) => x.name === 'prompt_template' - ).length !== 0 && ( -
- -
- {settingComponentBuilder(componentDataEngineSetting, true)} -
-
-
- )} - - {componentDataEngineSetting.length !== 0 && ( -
- -
- -
-
-
- )} +
+
+
- + + {componentDataEngineSetting.filter( + (x) => x.name === 'prompt_template' + ).length !== 0 && ( +
+ +
+ {settingComponentBuilder(componentDataEngineSetting, true)} +
+
+
+ )} + + {componentDataEngineSetting.length !== 0 && ( +
+ +
+ +
+
+
+ )} +
) From 0e3df8d9a23d6f83ced4383f73436f429b0f4717 Mon Sep 17 00:00:00 2001 From: Faisal Amir Date: Mon, 22 Jan 2024 11:46:56 +0700 Subject: [PATCH 2/3] remove optional serveEnabled params --- web/containers/OpenAiKeyInput/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/containers/OpenAiKeyInput/index.tsx b/web/containers/OpenAiKeyInput/index.tsx index 3d4a32f42..154745d3e 100644 --- a/web/containers/OpenAiKeyInput/index.tsx +++ b/web/containers/OpenAiKeyInput/index.tsx @@ -7,7 +7,7 @@ import { useEngineSettings } from '@/hooks/useEngineSettings' type Props = { selectedModel?: Model - serverEnabled?: boolean + serverEnabled: boolean } const OpenAiKeyInput: React.FC = ({ selectedModel, serverEnabled }) => { From 368b621af710f30e6f75bacdc67060a9b5113b93 Mon Sep 17 00:00:00 2001 From: hieu-jan <150573299+hieu-jan@users.noreply.github.com> Date: Mon, 22 Jan 2024 15:21:57 +0900 Subject: [PATCH 3/3] fix: hot-fix algolia search --- docs/docusaurus.config.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/docusaurus.config.js b/docs/docusaurus.config.js index d2169a63b..4fec0c005 100644 --- a/docs/docusaurus.config.js +++ b/docs/docusaurus.config.js @@ -155,8 +155,8 @@ const config = { algolia: { appId: process.env.ALGOLIA_APP_ID || "XXX", apiKey: process.env.ALGOLIA_API_KEY || "XXX", - indexName: "jan", - contextualSearch: false, + indexName: "jan_docs", + contextualSearch: true, insights: true, }, // SEO Docusarus