diff --git a/web/app/components/app/configuration/config-var/var-item.tsx b/web/app/components/app/configuration/config-var/var-item.tsx index 78ed4b1031..9b11d65589 100644 --- a/web/app/components/app/configuration/config-var/var-item.tsx +++ b/web/app/components/app/configuration/config-var/var-item.tsx @@ -33,7 +33,7 @@ const VarItem: FC = ({ const [isDeleting, setIsDeleting] = useState(false) return ( -
+
diff --git a/web/app/components/app/configuration/config/index.tsx b/web/app/components/app/configuration/config/index.tsx index 3e8b5f1caa..79bae2bcd3 100644 --- a/web/app/components/app/configuration/config/index.tsx +++ b/web/app/components/app/configuration/config/index.tsx @@ -79,7 +79,8 @@ const Config: FC = () => { {/* Dataset */} {/* Tools */} diff --git a/web/app/components/app/configuration/dataset-config/card-item/item.tsx b/web/app/components/app/configuration/dataset-config/card-item/item.tsx index b671d9c146..60200c4a8d 100644 --- a/web/app/components/app/configuration/dataset-config/card-item/item.tsx +++ b/web/app/components/app/configuration/dataset-config/card-item/item.tsx @@ -29,6 +29,7 @@ const Item: FC = ({ config, onSave, onRemove, + readonly = false, editable = true, }) => { const media = useBreakpoints() @@ -55,6 +56,7 @@ const Item: FC = ({
= ({
{ - editable && { e.stopPropagation() setShowSettingsModal(true) @@ -77,14 +79,18 @@ const Item: FC = ({ } - onRemove(config.id)} - state={isDeleting ? ActionButtonState.Destructive : ActionButtonState.Default} - onMouseEnter={() => setIsDeleting(true)} - onMouseLeave={() => setIsDeleting(false)} - > - - + { + !readonly && ( + onRemove(config.id)} + state={isDeleting ? ActionButtonState.Destructive : ActionButtonState.Default} + onMouseEnter={() => setIsDeleting(true)} + onMouseLeave={() => setIsDeleting(false)} + > + + + ) + }
{ config.indexing_technique && { +type Props = { + readonly?: boolean + hideMetadataFilter?: boolean +} +const DatasetConfig: FC = ({ readonly, hideMetadataFilter }) => { const { t } = useTranslation() const userProfile = useAppContextSelector(s => s.userProfile) const { @@ -254,10 +258,10 @@ const DatasetConfig: FC = () => { className='mt-2' title={t('appDebug.feature.dataSet.title')} headerRight={ -
+ !readonly && (
{!isAgent && } -
+
) } hasHeaderBottomBorder={!hasData} noBodySpacing @@ -271,7 +275,8 @@ const DatasetConfig: FC = () => { config={item} onRemove={onRemove} onSave={handleSave} - editable={item.editable} + editable={item.editable && !readonly} + readonly={readonly} /> ))}
@@ -282,25 +287,27 @@ const DatasetConfig: FC = () => {
)} -
- 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 && ()} ) } diff --git a/web/app/components/app/configuration/preview.tsx b/web/app/components/app/configuration/preview.tsx index eceb4972aa..7679ee13b6 100644 --- a/web/app/components/app/configuration/preview.tsx +++ b/web/app/components/app/configuration/preview.tsx @@ -305,7 +305,7 @@ const Configuration: FC = ({ return ( -
+