From 13f647feaa40af94ed47a525cb41cc8320fc04c0 Mon Sep 17 00:00:00 2001 From: zxhlyh Date: Thu, 24 Apr 2025 16:51:19 +0800 Subject: [PATCH 1/3] fix: remove chat variable in workflow mode (#18696) --- .../components/workflow-header/chat-variable-trigger.tsx | 6 ++++++ .../components/workflow-app/components/workflow-panel.tsx | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/web/app/components/workflow-app/components/workflow-header/chat-variable-trigger.tsx b/web/app/components/workflow-app/components/workflow-header/chat-variable-trigger.tsx index df93914285..0299d53ac9 100644 --- a/web/app/components/workflow-app/components/workflow-header/chat-variable-trigger.tsx +++ b/web/app/components/workflow-app/components/workflow-header/chat-variable-trigger.tsx @@ -3,9 +3,15 @@ import ChatVariableButton from '@/app/components/workflow/header/chat-variable-b import { useNodesReadOnly, } from '@/app/components/workflow/hooks' +import { useIsChatMode } from '../../hooks' const ChatVariableTrigger = () => { const { nodesReadOnly } = useNodesReadOnly() + const isChatMode = useIsChatMode() + + if (!isChatMode) + return null + return } export default memo(ChatVariableTrigger) diff --git a/web/app/components/workflow-app/components/workflow-panel.tsx b/web/app/components/workflow-app/components/workflow-panel.tsx index 3c1b5c8aac..dd368660ce 100644 --- a/web/app/components/workflow-app/components/workflow-panel.tsx +++ b/web/app/components/workflow-app/components/workflow-panel.tsx @@ -74,7 +74,7 @@ const WorkflowPanelOnRight = () => { ) } { - showChatVariablePanel && ( + showChatVariablePanel && isChatMode && ( ) } From 9982445dadd94830176b8aebbbfdb8a880ea0d36 Mon Sep 17 00:00:00 2001 From: GQ1994 <957534377@qq.com> Date: Thu, 24 Apr 2025 17:14:26 +0800 Subject: [PATCH 2/3] Added the missing path of the webpath prefix and the prefix basepath + of static resources to remove the bug of adding more basepath. (#18658) Co-authored-by: qingguo --- .../configuration/dataset-config/select-dataset/index.tsx | 3 ++- web/app/components/base/logo/logo-embedded-chat-avatar.tsx | 3 ++- .../account-setting/model-provider-page/model-icon/index.tsx | 3 +-- web/app/components/header/dataset-nav/index.tsx | 3 ++- web/app/install/installForm.tsx | 5 +++-- web/next.config.js | 3 ++- web/utils/var-basePath.js | 1 + 7 files changed, 13 insertions(+), 8 deletions(-) diff --git a/web/app/components/app/configuration/dataset-config/select-dataset/index.tsx b/web/app/components/app/configuration/dataset-config/select-dataset/index.tsx index 64a7f6dc46..ffdb714f08 100644 --- a/web/app/components/app/configuration/dataset-config/select-dataset/index.tsx +++ b/web/app/components/app/configuration/dataset-config/select-dataset/index.tsx @@ -14,6 +14,7 @@ import Loading from '@/app/components/base/loading' import Badge from '@/app/components/base/badge' import { useKnowledge } from '@/hooks/use-knowledge' import cn from '@/utils/classnames' +import { basePath } from '@/utils/var' export type ISelectDataSetProps = { isShow: boolean @@ -111,7 +112,7 @@ const SelectDataSet: FC = ({ }} > {t('appDebug.feature.dataSet.noDataSet')} - {t('appDebug.feature.dataSet.toCreate')} + {t('appDebug.feature.dataSet.toCreate')} )} diff --git a/web/app/components/base/logo/logo-embedded-chat-avatar.tsx b/web/app/components/base/logo/logo-embedded-chat-avatar.tsx index 8ea60e1ce8..f09a6a03ed 100644 --- a/web/app/components/base/logo/logo-embedded-chat-avatar.tsx +++ b/web/app/components/base/logo/logo-embedded-chat-avatar.tsx @@ -1,4 +1,5 @@ import type { FC } from 'react' +import { basePath } from '@/utils/var' type LogoEmbeddedChatAvatarProps = { className?: string @@ -8,7 +9,7 @@ const LogoEmbeddedChatAvatar: FC = ({ }) => { return ( logo diff --git a/web/app/components/header/account-setting/model-provider-page/model-icon/index.tsx b/web/app/components/header/account-setting/model-provider-page/model-icon/index.tsx index 9019051989..d302defcfe 100644 --- a/web/app/components/header/account-setting/model-provider-page/model-icon/index.tsx +++ b/web/app/components/header/account-setting/model-provider-page/model-icon/index.tsx @@ -3,7 +3,6 @@ import type { Model, ModelProvider, } from '../declarations' -import { basePath } from '@/utils/var' import { useLanguage } from '../hooks' import { Group } from '@/app/components/base/icons/src/vender/other' import { OpenaiBlue, OpenaiViolet } from '@/app/components/base/icons/src/public/llm' @@ -31,7 +30,7 @@ const ModelIcon: FC = ({ if (provider?.icon_small) { return (
- model-icon + model-icon
) } diff --git a/web/app/components/header/dataset-nav/index.tsx b/web/app/components/header/dataset-nav/index.tsx index 8c997f2115..4894a62484 100644 --- a/web/app/components/header/dataset-nav/index.tsx +++ b/web/app/components/header/dataset-nav/index.tsx @@ -14,6 +14,7 @@ import Nav from '../nav' import type { NavItem } from '../nav/nav-selector' import { fetchDatasetDetail, fetchDatasets } from '@/service/datasets' import type { DataSetListResponse } from '@/models/datasets' +import { basePath } from '@/utils/var' const getKey = (pageIndex: number, previousPageData: DataSetListResponse) => { if (!pageIndex || previousPageData.has_more) @@ -56,7 +57,7 @@ const DatasetNav = () => { icon_background: dataset.icon_background, })) as NavItem[]} createText={t('common.menus.newDataset')} - onCreate={() => router.push('/datasets/create')} + onCreate={() => router.push(`${basePath}/datasets/create`)} onLoadmore={handleLoadmore} /> ) diff --git a/web/app/install/installForm.tsx b/web/app/install/installForm.tsx index c01be722c0..99f2ec6b77 100644 --- a/web/app/install/installForm.tsx +++ b/web/app/install/installForm.tsx @@ -16,6 +16,7 @@ import Button from '@/app/components/base/button' import { fetchInitValidateStatus, fetchSetupStatus, setup } from '@/service/common' import type { InitValidateStatusResponse, SetupStatusResponse } from '@/models/common' +import { basePath } from '@/utils/var' const validPassword = /^(?=.*[a-zA-Z])(?=.*\d).{8,}$/ @@ -80,12 +81,12 @@ const InstallForm = () => { fetchSetupStatus().then((res: SetupStatusResponse) => { if (res.step === 'finished') { localStorage.setItem('setup_status', 'finished') - router.push('/signin') + router.push(`${basePath}/signin`) } else { fetchInitValidateStatus().then((res: InitValidateStatusResponse) => { if (res.status === 'not_started') - router.push('/init') + router.push(`${basePath}/init`) }) } setLoading(false) diff --git a/web/next.config.js b/web/next.config.js index de92fa37a4..4243ffecdf 100644 --- a/web/next.config.js +++ b/web/next.config.js @@ -1,4 +1,4 @@ -const { basePath } = require('./utils/var-basePath') +const { basePath, assetPrefix } = require('./utils/var-basePath') const { codeInspectorPlugin } = require('code-inspector-plugin') const withMDX = require('@next/mdx')({ extension: /\.mdx?$/, @@ -16,6 +16,7 @@ const withMDX = require('@next/mdx')({ /** @type {import('next').NextConfig} */ const nextConfig = { basePath, + assetPrefix, webpack: (config, { dev, isServer }) => { config.plugins.push(codeInspectorPlugin({ bundler: 'webpack' })) return config diff --git a/web/utils/var-basePath.js b/web/utils/var-basePath.js index 763392086d..07b7f7581b 100644 --- a/web/utils/var-basePath.js +++ b/web/utils/var-basePath.js @@ -2,4 +2,5 @@ // same as the one exported from var.ts module.exports = { basePath: '', + assetPrefix: '', } From cd9e6609ad25119cf11a1d97617523e95a6d3eff Mon Sep 17 00:00:00 2001 From: "Junjie.M" <118170653@qq.com> Date: Thu, 24 Apr 2025 17:16:41 +0800 Subject: [PATCH 3/3] fix: project version to 1.3.0 in package.json and uv.lock (#18684) --- api/pyproject.toml | 2 +- api/uv.lock | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/api/pyproject.toml b/api/pyproject.toml index 4992178423..6f526bc705 100644 --- a/api/pyproject.toml +++ b/api/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "dify-api" -version = "1.2.0" +version = "1.3.0" requires-python = ">=3.11,<3.13" dependencies = [ diff --git a/api/uv.lock b/api/uv.lock index 6c8699dd7c..0e2dd9c92a 100644 --- a/api/uv.lock +++ b/api/uv.lock @@ -1148,7 +1148,7 @@ wheels = [ [[package]] name = "dify-api" -version = "1.2.0" +version = "1.3.0" source = { virtual = "." } dependencies = [ { name = "authlib" },