From eaaf55149735891678301eb3bd261c047ba054d1 Mon Sep 17 00:00:00 2001 From: -LAN- Date: Wed, 28 May 2025 16:36:08 +0800 Subject: [PATCH 1/8] fix: Instance is not bound to a Session (#20347) Signed-off-by: -LAN- --- .../app/task_pipeline/easy_ui_based_generate_task_pipeline.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/api/core/app/task_pipeline/easy_ui_based_generate_task_pipeline.py b/api/core/app/task_pipeline/easy_ui_based_generate_task_pipeline.py index a98a42f5df..6c768fd86c 100644 --- a/api/core/app/task_pipeline/easy_ui_based_generate_task_pipeline.py +++ b/api/core/app/task_pipeline/easy_ui_based_generate_task_pipeline.py @@ -455,8 +455,6 @@ class EasyUIBasedGenerateTaskPipeline(BasedGenerateTaskPipeline, MessageCycleMan agent_thought: Optional[MessageAgentThought] = ( db.session.query(MessageAgentThought).filter(MessageAgentThought.id == event.agent_thought_id).first() ) - db.session.refresh(agent_thought) - db.session.close() if agent_thought: return AgentThoughtStreamResponse( From 42505010583fa8936b0a091aa4e019159682c225 Mon Sep 17 00:00:00 2001 From: "Junjie.M" <118170653@qq.com> Date: Wed, 28 May 2025 16:36:32 +0800 Subject: [PATCH 2/8] fix: reset password page dark style (#20350) --- web/app/reset-password/set-password/page.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/app/reset-password/set-password/page.tsx b/web/app/reset-password/set-password/page.tsx index dd1c4ef1f4..ee4c114a77 100644 --- a/web/app/reset-password/set-password/page.tsx +++ b/web/app/reset-password/set-password/page.tsx @@ -105,7 +105,7 @@ const ChangePasswordForm = () => {
-
+
{/* Password */}
)}
diff --git a/web/app/components/base/logo/dify-logo.tsx b/web/app/components/base/logo/dify-logo.tsx index 9e8f077372..5369144e1c 100644 --- a/web/app/components/base/logo/dify-logo.tsx +++ b/web/app/components/base/logo/dify-logo.tsx @@ -3,7 +3,6 @@ import type { FC } from 'react' import classNames from '@/utils/classnames' import useTheme from '@/hooks/use-theme' import { basePath } from '@/utils/var' -import { useGlobalPublicStore } from '@/context/global-public-context' export type LogoStyle = 'default' | 'monochromeWhite' export const logoPathMap: Record = { @@ -32,18 +31,12 @@ const DifyLogo: FC = ({ }) => { const { theme } = useTheme() const themedStyle = (theme === 'dark' && style === 'default') ? 'monochromeWhite' : style - const { systemFeatures } = useGlobalPublicStore() - const hasBrandingLogo = Boolean(systemFeatures.branding.enabled && systemFeatures.branding.workspace_logo) - - let src = `${basePath}${logoPathMap[themedStyle]}` - if (hasBrandingLogo) - src = systemFeatures.branding.workspace_logo return ( {hasBrandingLogo ) } diff --git a/web/app/components/custom/custom-web-app-brand/index.tsx b/web/app/components/custom/custom-web-app-brand/index.tsx index 444df98f24..f6f617be85 100644 --- a/web/app/components/custom/custom-web-app-brand/index.tsx +++ b/web/app/components/custom/custom-web-app-brand/index.tsx @@ -24,6 +24,7 @@ import { } from '@/service/common' import { useAppContext } from '@/context/app-context' import cn from '@/utils/classnames' +import { useGlobalPublicStore } from '@/context/global-public-context' const ALLOW_FILE_EXTENSIONS = ['svg', 'png'] @@ -39,6 +40,7 @@ const CustomWebAppBrand = () => { const [fileId, setFileId] = useState('') const [imgKey, setImgKey] = useState(Date.now()) const [uploadProgress, setUploadProgress] = useState(0) + const systemFeatures = useGlobalPublicStore(s => s.systemFeatures) const isSandbox = enableBilling && plan.type === Plan.sandbox const uploading = uploadProgress > 0 && uploadProgress < 100 const webappLogo = currentWorkspace.custom_config?.replace_webapp_logo || '' @@ -244,9 +246,12 @@ const CustomWebAppBrand = () => { {!webappBrandRemoved && ( <>
POWERED BY
- {webappLogo - ? logo - : + { + systemFeatures.branding.enabled && systemFeatures.branding.workspace_logo + ? logo + : webappLogo + ? logo + : } )} @@ -303,9 +308,12 @@ const CustomWebAppBrand = () => { {!webappBrandRemoved && ( <>
POWERED BY
- {webappLogo - ? logo - : + { + systemFeatures.branding.enabled && systemFeatures.branding.workspace_logo + ? logo + : webappLogo + ? logo + : } )} diff --git a/web/app/components/header/account-about/index.tsx b/web/app/components/header/account-about/index.tsx index 6129b48dce..280e276be9 100644 --- a/web/app/components/header/account-about/index.tsx +++ b/web/app/components/header/account-about/index.tsx @@ -9,6 +9,7 @@ import type { LangGeniusVersionResponse } from '@/models/common' import { IS_CE_EDITION } from '@/config' import DifyLogo from '@/app/components/base/logo/dify-logo' import { noop } from 'lodash-es' +import { useGlobalPublicStore } from '@/context/global-public-context' type IAccountSettingProps = { langeniusVersionInfo: LangGeniusVersionResponse @@ -21,6 +22,7 @@ export default function AccountAbout({ }: IAccountSettingProps) { const { t } = useTranslation() const isLatest = langeniusVersionInfo.current_version === langeniusVersionInfo.latest_version + const systemFeatures = useGlobalPublicStore(s => s.systemFeatures) return (
- + {systemFeatures.branding.enabled && systemFeatures.branding.workspace_logo + ? logo + : } +
Version {langeniusVersionInfo?.current_version}
© {dayjs().year()} LangGenius, Inc., Contributors.
diff --git a/web/app/components/header/index.tsx b/web/app/components/header/index.tsx index 6e8d1704dd..a9c26e0070 100644 --- a/web/app/components/header/index.tsx +++ b/web/app/components/header/index.tsx @@ -21,6 +21,7 @@ import { useModalContext } from '@/context/modal-context' import PlanBadge from './plan-badge' import LicenseNav from './license-env' import { Plan } from '../billing/type' +import { useGlobalPublicStore } from '@/context/global-public-context' const navClassName = ` flex items-center relative mr-0 sm:mr-3 px-3 h-8 rounded-xl @@ -36,6 +37,7 @@ const Header = () => { const [isShowNavMenu, { toggle, setFalse: hideNavMenu }] = useBoolean(false) const { enableBilling, plan } = useProviderContext() const { setShowPricingModal, setShowAccountSettingModal } = useModalContext() + const systemFeatures = useGlobalPublicStore(s => s.systemFeatures) const isFreePlan = plan.type === Plan.sandbox const handlePlanClick = useCallback(() => { if (isFreePlan) @@ -61,7 +63,13 @@ const Header = () => { !isMobile &&
- + {systemFeatures.branding.enabled && systemFeatures.branding.workspace_logo + ? logo + : }
/
@@ -76,7 +84,13 @@ const Header = () => { {isMobile && (
- + {systemFeatures.branding.enabled && systemFeatures.branding.workspace_logo + ? logo + : }
/
{enableBilling ? : } diff --git a/web/app/components/share/text-generation/index.tsx b/web/app/components/share/text-generation/index.tsx index 5450fa7ce6..6fd6d17278 100644 --- a/web/app/components/share/text-generation/index.tsx +++ b/web/app/components/share/text-generation/index.tsx @@ -641,11 +641,13 @@ const TextGeneration: FC = ({ !isPC && resultExisted && 'rounded-b-2xl border-b-[0.5px] border-divider-regular', )}>
{t('share.chat.poweredBy')}
- {systemFeatures.branding.enabled ? ( - logo - ) : ( - - )} + { + systemFeatures.branding.enabled && systemFeatures.branding.workspace_logo + ? logo + : customConfig?.replace_webapp_logo + ? logo + : + }
)}
diff --git a/web/app/signin/_header.tsx b/web/app/signin/_header.tsx index 5e85a8d306..0efd30b6cc 100644 --- a/web/app/signin/_header.tsx +++ b/web/app/signin/_header.tsx @@ -7,6 +7,7 @@ import { languages } from '@/i18n/language' import type { Locale } from '@/i18n' import I18n from '@/context/i18n' import dynamic from 'next/dynamic' +import { useGlobalPublicStore } from '@/context/global-public-context' // Avoid rendering the logo and theme selector on the server const DifyLogo = dynamic(() => import('@/app/components/base/logo/dify-logo'), { @@ -20,10 +21,17 @@ const ThemeSelector = dynamic(() => import('@/app/components/base/theme-selector const Header = () => { const { locale, setLocaleOnClient } = useContext(I18n) + const systemFeatures = useGlobalPublicStore(s => s.systemFeatures) return (
- + {systemFeatures.branding.enabled && systemFeatures.branding.login_page_logo + ? logo + : }