From f156b4670539cb56782287b6de8fbd7a570ef8be Mon Sep 17 00:00:00 2001 From: Joel Date: Wed, 15 Oct 2025 13:48:39 +0800 Subject: [PATCH] chore: user input readonly --- .../app/configuration/config/index.tsx | 1 + .../configuration/dataset-config/index.tsx | 43 ++++++++++--------- .../app/configuration/debug/index.tsx | 23 ++++++---- 3 files changed, 38 insertions(+), 29 deletions(-) diff --git a/web/app/components/app/configuration/config/index.tsx b/web/app/components/app/configuration/config/index.tsx index adef93f541..79bae2bcd3 100644 --- a/web/app/components/app/configuration/config/index.tsx +++ b/web/app/components/app/configuration/config/index.tsx @@ -80,6 +80,7 @@ const Config: FC = () => { {/* Dataset */} {/* Tools */} diff --git a/web/app/components/app/configuration/dataset-config/index.tsx b/web/app/components/app/configuration/dataset-config/index.tsx index dc22f001c6..fa1103933c 100644 --- a/web/app/components/app/configuration/dataset-config/index.tsx +++ b/web/app/components/app/configuration/dataset-config/index.tsx @@ -39,8 +39,9 @@ import { type Props = { readonly?: boolean + hideMetadataFilter?: boolean } -const DatasetConfig: FC = ({ readonly }) => { +const DatasetConfig: FC = ({ readonly, hideMetadataFilter }) => { const { t } = useTranslation() const userProfile = useAppContextSelector(s => s.userProfile) const { @@ -286,25 +287,27 @@ const DatasetConfig: FC = ({ readonly }) => { )} -
- item.type === MetadataFilteringVariableType.string || item.type === MetadataFilteringVariableType.select)} - availableCommonNumberVars={promptVariablesToSelect.filter(item => item.type === MetadataFilteringVariableType.number)} - /> -
+ {!hideMetadataFilter && ( +
+ item.type === MetadataFilteringVariableType.string || item.type === MetadataFilteringVariableType.select)} + availableCommonNumberVars={promptVariablesToSelect.filter(item => item.type === MetadataFilteringVariableType.number)} + /> +
+ )} {mode === AppType.completion && dataSet.length > 0 && ( = ({ }) => { const { t } = useTranslation() const { + readonly, appId, mode, modelModeType, @@ -413,19 +414,23 @@ const Debug: FC = ({ } {mode !== AppType.completion && ( <> - - - - - + {!readonly && ( + + + + + + + )} + {varList.length > 0 && (
- setExpanded(!expanded)}> + !readonly && setExpanded(!expanded)}> @@ -553,7 +558,7 @@ const Debug: FC = ({ onCancel={handleCancel} /> )} - {!isAPIKeySet && ()} + {!isAPIKeySet && !readonly && ()} ) }