From a8f5748dee1d36606aa77c27b348e3b659113d53 Mon Sep 17 00:00:00 2001 From: Joel Date: Wed, 15 Oct 2025 15:21:09 +0800 Subject: [PATCH] chore: vision readonly --- .../app/configuration/config-vision/index.tsx | 80 +++++++++++-------- .../components/app/configuration/preview.tsx | 15 ++-- web/i18n/ja-JP/common.ts | 1 + 3 files changed, 58 insertions(+), 38 deletions(-) diff --git a/web/app/components/app/configuration/config-vision/index.tsx b/web/app/components/app/configuration/config-vision/index.tsx index f0904b3fd8..8d97097fba 100644 --- a/web/app/components/app/configuration/config-vision/index.tsx +++ b/web/app/components/app/configuration/config-vision/index.tsx @@ -13,10 +13,14 @@ import ConfigContext from '@/context/debug-configuration' import { useFeatures, useFeaturesStore } from '@/app/components/base/features/hooks' import Switch from '@/app/components/base/switch' import { SupportUploadFileTypes } from '@/app/components/workflow/types' +import OptionCard from '@/app/components/workflow/nodes/_base/components/option-card' +import { Resolution } from '@/types/app' +import { noop } from 'lodash' +import cn from '@/utils/classnames' const ConfigVision: FC = () => { const { t } = useTranslation() - const { isShowVisionConfig, isAllowVideoUpload } = useContext(ConfigContext) + const { isShowVisionConfig, isAllowVideoUpload, readonly } = useContext(ConfigContext) const file = useFeatures(s => s.features.file) const featuresStore = useFeaturesStore() @@ -53,7 +57,7 @@ const ConfigVision: FC = () => { setFeatures(newFeatures) }, [featuresStore, isAllowVideoUpload]) - if (!isShowVisionConfig) + if (!isShowVisionConfig || (readonly && !isImageEnabled)) return null return ( @@ -74,37 +78,49 @@ const ConfigVision: FC = () => { />
- {/*
-
{t('appDebug.vision.visionSettings.resolution')}
- - {t('appDebug.vision.visionSettings.resolutionTooltip').split('\n').map(item => ( -
{item}
- ))} -
- } + {readonly ? (<> +
+
{t('appDebug.vision.visionSettings.resolution')}
+ + {t('appDebug.vision.visionSettings.resolutionTooltip').split('\n').map(item => ( +
{item}
+ ))} +
+ } + /> +
+
+ + +
+ ) : <> + +
+ - */} - {/*
- handleChange(Resolution.high)} - /> - handleChange(Resolution.low)} - /> -
*/} - -
- + } + ) diff --git a/web/app/components/app/configuration/preview.tsx b/web/app/components/app/configuration/preview.tsx index 7679ee13b6..92212ee515 100644 --- a/web/app/components/app/configuration/preview.tsx +++ b/web/app/components/app/configuration/preview.tsx @@ -25,6 +25,7 @@ import { useGetTryAppDataSets, useGetTryAppInfo } from '@/service/use-try-app' import { noop } from 'lodash' import { correctModelProvider } from '@/utils' import { userInputsFormToPromptVariables } from '@/utils/model-config' +import { useTextGenerationCurrentProviderAndModelAndModelList } from '../../header/account-setting/model-provider-page/hooks' type Props = { appId: string @@ -172,12 +173,14 @@ const Configuration: FC = ({ const query = '' const completionParams = useState({}) - // todo - const currModel: { - features: ModelFeatureEnum[] - } = { - features: [], - } + const { + currentModel: currModel, + } = useTextGenerationCurrentProviderAndModelAndModelList( + { + provider: modelConfig.provider, + model: modelConfig.model_id, + }, + ) const isShowVisionConfig = !!currModel?.features?.includes(ModelFeatureEnum.vision) const isShowDocumentConfig = !!currModel?.features?.includes(ModelFeatureEnum.document) diff --git a/web/i18n/ja-JP/common.ts b/web/i18n/ja-JP/common.ts index 52545c460b..45dbb2bd8d 100644 --- a/web/i18n/ja-JP/common.ts +++ b/web/i18n/ja-JP/common.ts @@ -654,6 +654,7 @@ const translation = { hitScore: '検索スコア:', }, inputPlaceholder: '{{botName}} と話す', + inputDisabledPlaceholder: 'プレビューのみ', thought: '思考', thinking: '考え中...', resend: '再送信してください',