feat: no longer enable auto upgrade when marketplace is disabled (#24… (#24101)
This commit is contained in:

committed by
GitHub

parent
5e8fe30035
commit
531e784a92
@@ -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",
|
||||
|
@@ -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')
|
||||
|
@@ -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<Props> = ({
|
||||
const { auto_upgrade: autoUpdateConfig, permission: privilege } = payload || {}
|
||||
const [tempPrivilege, setTempPrivilege] = useState<Permissions>(privilege)
|
||||
const [tempAutoUpdateConfig, setTempAutoUpdateConfig] = useState<AutoUpdateConfig>(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<Props> = ({
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
|
||||
{
|
||||
enable_marketplace && (
|
||||
<AutoUpdateSetting payload={tempAutoUpdateConfig} onChange={setTempAutoUpdateConfig} />
|
||||
)
|
||||
}
|
||||
<div className='flex h-[76px] items-center justify-end gap-2 self-stretch p-6 pt-5'>
|
||||
<Button
|
||||
className='min-w-[72px]'
|
||||
|
Reference in New Issue
Block a user