feat: no longer enable auto upgrade when marketplace is disabled (#24… (#24101)
This commit is contained in:
parent
5e8fe30035
commit
531e784a92
3 changed files with 12 additions and 3 deletions
|
|
@ -145,7 +145,7 @@ def init_app(app: DifyApp) -> Celery:
|
||||||
minutes=dify_config.QUEUE_MONITOR_INTERVAL if dify_config.QUEUE_MONITOR_INTERVAL else 30
|
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")
|
imports.append("schedule.check_upgradable_plugin_task")
|
||||||
beat_schedule["check_upgradable_plugin_task"] = {
|
beat_schedule["check_upgradable_plugin_task"] = {
|
||||||
"task": "schedule.check_upgradable_plugin_task.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 useReferenceSetting from '../plugin-page/use-reference-setting'
|
||||||
import { AUTO_UPDATE_MODE } from '../reference-setting-modal/auto-update-setting/types'
|
import { AUTO_UPDATE_MODE } from '../reference-setting-modal/auto-update-setting/types'
|
||||||
import { useAppContext } from '@/context/app-context'
|
import { useAppContext } from '@/context/app-context'
|
||||||
|
import { useGlobalPublicStore } from '@/context/global-public-context'
|
||||||
|
|
||||||
const i18nPrefix = 'plugin.action'
|
const i18nPrefix = 'plugin.action'
|
||||||
|
|
||||||
|
|
@ -69,6 +70,7 @@ const DetailHeader = ({
|
||||||
const { setShowUpdatePluginModal } = useModalContext()
|
const { setShowUpdatePluginModal } = useModalContext()
|
||||||
const { refreshModelProviders } = useProviderContext()
|
const { refreshModelProviders } = useProviderContext()
|
||||||
const invalidateAllToolProviders = useInvalidateAllToolProviders()
|
const invalidateAllToolProviders = useInvalidateAllToolProviders()
|
||||||
|
const { enable_marketplace } = useGlobalPublicStore(s => s.systemFeatures)
|
||||||
|
|
||||||
const {
|
const {
|
||||||
installation_id,
|
installation_id,
|
||||||
|
|
@ -122,6 +124,8 @@ const DetailHeader = ({
|
||||||
const { referenceSetting } = useReferenceSetting()
|
const { referenceSetting } = useReferenceSetting()
|
||||||
const { auto_upgrade: autoUpgradeInfo } = referenceSetting || {}
|
const { auto_upgrade: autoUpgradeInfo } = referenceSetting || {}
|
||||||
const isAutoUpgradeEnabled = useMemo(() => {
|
const isAutoUpgradeEnabled = useMemo(() => {
|
||||||
|
if (!enable_marketplace)
|
||||||
|
return false
|
||||||
if (!autoUpgradeInfo || !isFromMarketplace)
|
if (!autoUpgradeInfo || !isFromMarketplace)
|
||||||
return false
|
return false
|
||||||
if(autoUpgradeInfo.strategy_setting === 'disabled')
|
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 type { AutoUpdateConfig } from './auto-update-setting/types'
|
||||||
import AutoUpdateSetting from './auto-update-setting'
|
import AutoUpdateSetting from './auto-update-setting'
|
||||||
import { defaultValue as autoUpdateDefaultValue } from './auto-update-setting/config'
|
import { defaultValue as autoUpdateDefaultValue } from './auto-update-setting/config'
|
||||||
|
import { useGlobalPublicStore } from '@/context/global-public-context'
|
||||||
import Label from './label'
|
import Label from './label'
|
||||||
|
|
||||||
const i18nPrefix = 'plugin.privilege'
|
const i18nPrefix = 'plugin.privilege'
|
||||||
|
|
@ -28,6 +29,7 @@ const PluginSettingModal: FC<Props> = ({
|
||||||
const { auto_upgrade: autoUpdateConfig, permission: privilege } = payload || {}
|
const { auto_upgrade: autoUpdateConfig, permission: privilege } = payload || {}
|
||||||
const [tempPrivilege, setTempPrivilege] = useState<Permissions>(privilege)
|
const [tempPrivilege, setTempPrivilege] = useState<Permissions>(privilege)
|
||||||
const [tempAutoUpdateConfig, setTempAutoUpdateConfig] = useState<AutoUpdateConfig>(autoUpdateConfig || autoUpdateDefaultValue)
|
const [tempAutoUpdateConfig, setTempAutoUpdateConfig] = useState<AutoUpdateConfig>(autoUpdateConfig || autoUpdateDefaultValue)
|
||||||
|
const { enable_marketplace } = useGlobalPublicStore(s => s.systemFeatures)
|
||||||
const handlePrivilegeChange = useCallback((key: string) => {
|
const handlePrivilegeChange = useCallback((key: string) => {
|
||||||
return (value: PermissionType) => {
|
return (value: PermissionType) => {
|
||||||
setTempPrivilege({
|
setTempPrivilege({
|
||||||
|
|
@ -77,8 +79,11 @@ const PluginSettingModal: FC<Props> = ({
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
|
{
|
||||||
<AutoUpdateSetting payload={tempAutoUpdateConfig} onChange={setTempAutoUpdateConfig} />
|
enable_marketplace && (
|
||||||
|
<AutoUpdateSetting payload={tempAutoUpdateConfig} onChange={setTempAutoUpdateConfig} />
|
||||||
|
)
|
||||||
|
}
|
||||||
<div className='flex h-[76px] items-center justify-end gap-2 self-stretch p-6 pt-5'>
|
<div className='flex h-[76px] items-center justify-end gap-2 self-stretch p-6 pt-5'>
|
||||||
<Button
|
<Button
|
||||||
className='min-w-[72px]'
|
className='min-w-[72px]'
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue