From 531e784a92324f7f4fff294acf456a18455b5329 Mon Sep 17 00:00:00 2001 From: "Junyan Qin (Chin)" Date: Mon, 18 Aug 2025 15:57:33 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20no=20longer=20enable=20auto=20upgrade?= =?UTF-8?q?=20when=20marketplace=20is=20disabled=20(#24=E2=80=A6=20(#24101?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/extensions/ext_celery.py | 2 +- .../plugins/plugin-detail-panel/detail-header.tsx | 4 ++++ .../components/plugins/reference-setting-modal/modal.tsx | 9 +++++++-- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/api/extensions/ext_celery.py b/api/extensions/ext_celery.py index 198f60e55..6010d85eb 100644 --- a/api/extensions/ext_celery.py +++ b/api/extensions/ext_celery.py @@ -145,7 +145,7 @@ def init_app(app: DifyApp) -> Celery: minutes=dify_config.QUEUE_MONITOR_INTERVAL if dify_config.QUEUE_MONITOR_INTERVAL else 30 ), } - if dify_config.ENABLE_CHECK_UPGRADABLE_PLUGIN_TASK: + if dify_config.ENABLE_CHECK_UPGRADABLE_PLUGIN_TASK and dify_config.MARKETPLACE_ENABLED: imports.append("schedule.check_upgradable_plugin_task") beat_schedule["check_upgradable_plugin_task"] = { "task": "schedule.check_upgradable_plugin_task.check_upgradable_plugin_task", diff --git a/web/app/components/plugins/plugin-detail-panel/detail-header.tsx b/web/app/components/plugins/plugin-detail-panel/detail-header.tsx index 9f20a0e22..3f03a632e 100644 --- a/web/app/components/plugins/plugin-detail-panel/detail-header.tsx +++ b/web/app/components/plugins/plugin-detail-panel/detail-header.tsx @@ -45,6 +45,7 @@ import { convertUTCDaySecondsToLocalSeconds, timeOfDayToDayjs } from '../referen import useReferenceSetting from '../plugin-page/use-reference-setting' import { AUTO_UPDATE_MODE } from '../reference-setting-modal/auto-update-setting/types' import { useAppContext } from '@/context/app-context' +import { useGlobalPublicStore } from '@/context/global-public-context' const i18nPrefix = 'plugin.action' @@ -69,6 +70,7 @@ const DetailHeader = ({ const { setShowUpdatePluginModal } = useModalContext() const { refreshModelProviders } = useProviderContext() const invalidateAllToolProviders = useInvalidateAllToolProviders() + const { enable_marketplace } = useGlobalPublicStore(s => s.systemFeatures) const { installation_id, @@ -122,6 +124,8 @@ const DetailHeader = ({ const { referenceSetting } = useReferenceSetting() const { auto_upgrade: autoUpgradeInfo } = referenceSetting || {} const isAutoUpgradeEnabled = useMemo(() => { + if (!enable_marketplace) + return false if (!autoUpgradeInfo || !isFromMarketplace) return false if(autoUpgradeInfo.strategy_setting === 'disabled') diff --git a/web/app/components/plugins/reference-setting-modal/modal.tsx b/web/app/components/plugins/reference-setting-modal/modal.tsx index d47e78ecd..f50f9cdd4 100644 --- a/web/app/components/plugins/reference-setting-modal/modal.tsx +++ b/web/app/components/plugins/reference-setting-modal/modal.tsx @@ -10,6 +10,7 @@ import { PermissionType } from '@/app/components/plugins/types' import type { AutoUpdateConfig } from './auto-update-setting/types' import AutoUpdateSetting from './auto-update-setting' import { defaultValue as autoUpdateDefaultValue } from './auto-update-setting/config' +import { useGlobalPublicStore } from '@/context/global-public-context' import Label from './label' const i18nPrefix = 'plugin.privilege' @@ -28,6 +29,7 @@ const PluginSettingModal: FC = ({ const { auto_upgrade: autoUpdateConfig, permission: privilege } = payload || {} const [tempPrivilege, setTempPrivilege] = useState(privilege) const [tempAutoUpdateConfig, setTempAutoUpdateConfig] = useState(autoUpdateConfig || autoUpdateDefaultValue) + const { enable_marketplace } = useGlobalPublicStore(s => s.systemFeatures) const handlePrivilegeChange = useCallback((key: string) => { return (value: PermissionType) => { setTempPrivilege({ @@ -77,8 +79,11 @@ const PluginSettingModal: FC = ({ ))} - - + { + enable_marketplace && ( + + ) + }