From d7663159e97582fc8008a072bb22d8f25e2ab0e7 Mon Sep 17 00:00:00 2001 From: NFish Date: Tue, 17 Jun 2025 10:45:03 +0800 Subject: [PATCH 01/11] Fix/webapp loop login (#21092) --- web/app/(shareLayout)/layout.tsx | 4 ++-- web/service/base.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/web/app/(shareLayout)/layout.tsx b/web/app/(shareLayout)/layout.tsx index 7de5d51edb..78b8835009 100644 --- a/web/app/(shareLayout)/layout.tsx +++ b/web/app/(shareLayout)/layout.tsx @@ -19,7 +19,7 @@ const Layout: FC<{ const [isLoading, setIsLoading] = useState(true) useEffect(() => { (async () => { - if (!systemFeatures.webapp_auth.enabled) { + if (!isGlobalPending && !systemFeatures.webapp_auth.enabled) { setIsLoading(false) return } @@ -37,7 +37,7 @@ const Layout: FC<{ setWebAppAccessMode(ret?.accessMode || AccessMode.PUBLIC) setIsLoading(false) })() - }, [pathname, redirectUrl, setWebAppAccessMode]) + }, [pathname, redirectUrl, setWebAppAccessMode, isGlobalPending, systemFeatures.webapp_auth.enabled]) if (isLoading || isGlobalPending) { return
diff --git a/web/service/base.ts b/web/service/base.ts index ba398c07a6..5242f15b80 100644 --- a/web/service/base.ts +++ b/web/service/base.ts @@ -408,7 +408,7 @@ export const ssePost = async ( if (data.code === 'web_sso_auth_required') { removeAccessToken() - requiredWebSSOLogin() + requiredWebSSOLogin(data.message, 401) } if (data.code === 'unauthorized') { @@ -492,7 +492,7 @@ export const request = async(url: string, options = {}, otherOptions?: IOther } if (code === 'web_sso_auth_required') { removeAccessToken() - requiredWebSSOLogin() + requiredWebSSOLogin(message, 401) return Promise.reject(err) } if (code === 'unauthorized_and_force_logout') { From 110bb5e5a5e66f03dd7ca07920e65c46a97b5152 Mon Sep 17 00:00:00 2001 From: NFish Date: Tue, 17 Jun 2025 11:33:46 +0800 Subject: [PATCH 02/11] fix: auto redirect to login page if web app needs login (#21096) --- web/service/base.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/service/base.ts b/web/service/base.ts index 5242f15b80..ba398c07a6 100644 --- a/web/service/base.ts +++ b/web/service/base.ts @@ -408,7 +408,7 @@ export const ssePost = async ( if (data.code === 'web_sso_auth_required') { removeAccessToken() - requiredWebSSOLogin(data.message, 401) + requiredWebSSOLogin() } if (data.code === 'unauthorized') { @@ -492,7 +492,7 @@ export const request = async(url: string, options = {}, otherOptions?: IOther } if (code === 'web_sso_auth_required') { removeAccessToken() - requiredWebSSOLogin(message, 401) + requiredWebSSOLogin() return Promise.reject(err) } if (code === 'unauthorized_and_force_logout') { From c5acffb03442ed0724d09dbaed1b3056b039201c Mon Sep 17 00:00:00 2001 From: NFish Date: Tue, 17 Jun 2025 15:48:58 +0800 Subject: [PATCH 03/11] fix: page loop in datasets and apps if current user is dataset_operator (#21114) --- web/app/(commonLayout)/datasets/layout.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/web/app/(commonLayout)/datasets/layout.tsx b/web/app/(commonLayout)/datasets/layout.tsx index bb514fc348..b3fc5147b5 100644 --- a/web/app/(commonLayout)/datasets/layout.tsx +++ b/web/app/(commonLayout)/datasets/layout.tsx @@ -8,15 +8,15 @@ import { useRouter } from 'next/navigation' import { useEffect } from 'react' export default function DatasetsLayout({ children }: { children: React.ReactNode }) { - const { isCurrentWorkspaceEditor } = useAppContext() + const { isCurrentWorkspaceEditor, isCurrentWorkspaceDatasetOperator } = useAppContext() const router = useRouter() useEffect(() => { - if (!isCurrentWorkspaceEditor) + if (!isCurrentWorkspaceEditor && !isCurrentWorkspaceDatasetOperator) router.replace('/apps') - }, [isCurrentWorkspaceEditor, router]) + }, [isCurrentWorkspaceEditor, isCurrentWorkspaceDatasetOperator, router]) - if (!isCurrentWorkspaceEditor) + if (!isCurrentWorkspaceEditor && !isCurrentWorkspaceDatasetOperator) return return ( From 19339c3de1d7ad72ef55ea16e431d70782156850 Mon Sep 17 00:00:00 2001 From: GuanMu Date: Tue, 17 Jun 2025 15:56:45 +0800 Subject: [PATCH 04/11] fix: doc error (#21108) --- web/app/(commonLayout)/datasets/template/template.en.mdx | 2 +- web/app/(commonLayout)/datasets/template/template.zh.mdx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/web/app/(commonLayout)/datasets/template/template.en.mdx b/web/app/(commonLayout)/datasets/template/template.en.mdx index 4d00b7b2b5..e1ff827c96 100644 --- a/web/app/(commonLayout)/datasets/template/template.en.mdx +++ b/web/app/(commonLayout)/datasets/template/template.en.mdx @@ -54,7 +54,7 @@ import { Row, Col, Properties, Property, Heading, SubProperty, PropertyInstructi Index mode - - high_quality High quality: embedding using embedding model, built as vector database index + - high_quality High quality: Embedding using embedding model, built as vector database index - economy Economy: Build using inverted index of keyword table index diff --git a/web/app/(commonLayout)/datasets/template/template.zh.mdx b/web/app/(commonLayout)/datasets/template/template.zh.mdx index d121a93df2..3994356b51 100644 --- a/web/app/(commonLayout)/datasets/template/template.zh.mdx +++ b/web/app/(commonLayout)/datasets/template/template.zh.mdx @@ -55,7 +55,7 @@ import { Row, Col, Properties, Property, Heading, SubProperty, PropertyInstructi 索引方式 - high_quality 高质量:使用 - ding 模型进行嵌入,构建为向量数据库索引 + Embedding 模型进行嵌入,构建为向量数据库索引 - economy 经济:使用 keyword table index 的倒排索引进行构建 From df6451076bb50513bd8d73b328ad345a719b20a7 Mon Sep 17 00:00:00 2001 From: kurokobo Date: Tue, 17 Jun 2025 17:11:30 +0900 Subject: [PATCH 05/11] fix: prevent nodes from being unintentionally deleted by pressing the backspace key. (#21023) --- .../prompt-editor/plugins/component-picker-block/index.tsx | 1 + web/app/components/workflow/hooks/use-shortcuts.ts | 2 +- .../nodes/_base/components/variable/var-reference-vars.tsx | 4 +++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/web/app/components/base/prompt-editor/plugins/component-picker-block/index.tsx b/web/app/components/base/prompt-editor/plugins/component-picker-block/index.tsx index b43d2c8117..bffcdc60d2 100644 --- a/web/app/components/base/prompt-editor/plugins/component-picker-block/index.tsx +++ b/web/app/components/base/prompt-editor/plugins/component-picker-block/index.tsx @@ -165,6 +165,7 @@ const ComponentPicker = ({ isSupportFileVar={isSupportFileVar} onClose={handleClose} onBlur={handleClose} + autoFocus={false} />
) diff --git a/web/app/components/workflow/hooks/use-shortcuts.ts b/web/app/components/workflow/hooks/use-shortcuts.ts index 8b1003e89c..0d0ba80fe1 100644 --- a/web/app/components/workflow/hooks/use-shortcuts.ts +++ b/web/app/components/workflow/hooks/use-shortcuts.ts @@ -61,7 +61,7 @@ export const useShortcuts = (): void => { return !showFeaturesPanel && !isEventTargetInputArea(e.target as HTMLElement) }, [workflowStore]) - useKeyPress(['delete', 'backspace'], (e) => { + useKeyPress(['delete'], (e) => { if (shouldHandleShortcut(e)) { e.preventDefault() handleNodesDelete() diff --git a/web/app/components/workflow/nodes/_base/components/variable/var-reference-vars.tsx b/web/app/components/workflow/nodes/_base/components/variable/var-reference-vars.tsx index 9acbdf4ff7..27063a2ba3 100644 --- a/web/app/components/workflow/nodes/_base/components/variable/var-reference-vars.tsx +++ b/web/app/components/workflow/nodes/_base/components/variable/var-reference-vars.tsx @@ -260,6 +260,7 @@ type Props = { maxHeightClass?: string onClose?: () => void onBlur?: () => void + autoFocus?: boolean } const VarReferenceVars: FC = ({ hideSearch, @@ -271,6 +272,7 @@ const VarReferenceVars: FC = ({ maxHeightClass, onClose, onBlur, + autoFocus = true, }) => { const { t } = useTranslation() const [searchText, setSearchText] = useState('') @@ -323,7 +325,7 @@ const VarReferenceVars: FC = ({ onKeyDown={handleKeyDown} onClear={() => setSearchText('')} onBlur={onBlur} - autoFocus + autoFocus={autoFocus} />
Date: Tue, 17 Jun 2025 16:11:57 +0800 Subject: [PATCH 06/11] fix: some dark theme display incorrect (#21055) --- .../install-plugin/install-from-github/steps/selectPackage.tsx | 2 ++ web/app/components/workflow/panel/env-panel/variable-modal.tsx | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/web/app/components/plugins/install-plugin/install-from-github/steps/selectPackage.tsx b/web/app/components/plugins/install-plugin/install-from-github/steps/selectPackage.tsx index 24e1e39ff5..c77d0d0a70 100644 --- a/web/app/components/plugins/install-plugin/install-from-github/steps/selectPackage.tsx +++ b/web/app/components/plugins/install-plugin/install-from-github/steps/selectPackage.tsx @@ -83,6 +83,7 @@ const SelectPackage: React.FC = ({ installedValue={updatePayload?.originalPackageInfo.version} placeholder={t(`${i18nPrefix}.selectVersionPlaceholder`) || ''} popupClassName='w-[512px] z-[1001]' + triggerClassName='text-components-input-text-filled' />