feat(dify): 把本地控制台的中文与去外链改动入库

这些界面改动和专家服务草稿停在工作区,没有随上一笔主分支提交进入仓库。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
wuzilongandCursor committed 2026-11-23 09:44:09 +08:00
1 parent 9c7c80e194
commit c2cb845a32
211 files changed
+3030 -2794

No files matched your search

@@ -47,6 +47,9 @@ describe('processNodesWithoutDataSource', () => {
position: { x: 0, y: 300 },
}),
)
expect(result.nodes[1]?.data.text).toContain('从空白流水线开始')
expect(result.nodes[1]?.data.text).not.toContain('Link to documentation')
expect(result.nodes[1]?.data.text).not.toContain('dify.ai')
expect(result.viewport).toEqual({
x: 160,
y: 164,
@@ -12,6 +12,70 @@ import { NoteTheme } from '@/app/components/workflow/note-node/types'
import { BlockEnum } from '@/app/components/workflow/types'
import { generateNewNode } from '@/app/components/workflow/utils'
const blankPipelineNote = JSON.stringify({
root: {
children: [
{
children: [
{
detail: 0,
format: 1,
mode: 'normal',
style: 'font-size: 14px;',
text: '从空白流水线开始',
type: 'text',
version: 1,
},
],
direction: 'ltr',
format: '',
indent: 0,
type: 'paragraph',
version: 1,
textFormat: 1,
textStyle: 'font-size: 14px;',
},
{
children: [],
direction: 'ltr',
format: '',
indent: 0,
type: 'paragraph',
version: 1,
textFormat: 1,
textStyle: '',
},
{
children: [
{
detail: 0,
format: 0,
mode: 'normal',
style: '',
text: '知识流水线以数据源为起点,以知识库节点为终点。一般步骤是:从数据源导入文档 → 用提取器提取文档内容 → 拆分并清洗为结构化分段 → 存入知识库。',
type: 'text',
version: 1,
},
],
direction: 'ltr',
format: '',
indent: 0,
type: 'paragraph',
version: 1,
textFormat: 0,
textStyle: '',
},
],
direction: 'ltr',
format: '',
indent: 0,
type: 'root',
version: 1,
textFormat: 1,
textStyle: 'font-size: 14px;',
},
})
export const processNodesWithoutDataSource = (nodes: Node[], viewport?: Viewport) => {
let leftNode
for (let i = 0; i < nodes.length; i++) {
@@ -55,12 +119,12 @@ export const processNodesWithoutDataSource = (nodes: Node[], viewport?: Viewport
title: '',
desc: '',
type: '' as any,
text: '{"root":{"children":[{"children":[{"detail":0,"format":1,"mode":"normal","style":"font-size: 14px;","text":"Get started with a blank pipeline","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1,"textFormat":1,"textStyle":"font-size: 14px;"},{"children":[],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1,"textFormat":1,"textStyle":""},{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"A Knowledge Pipeline starts with Data Source as the starting node and ends with the knowledge base node. The general steps are: import documents from the data source → use extractor to extract document content → split and clean content into structured chunks → store in the knowledge base.","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1,"textFormat":0,"textStyle":""},{"children":[],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1,"textFormat":0,"textStyle":""},{"children":[{"children":[{"detail":0,"format":2,"mode":"normal","style":"","text":"Link to documentation","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"link","version":1,"textFormat":2,"rel":"noreferrer","target":"_blank","title":null,"url":"https://dify.ai"}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1,"textFormat":2,"textStyle":""},{"children":[],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1,"textFormat":0,"textStyle":""}],"direction":"ltr","format":"","indent":0,"type":"root","version":1,"textFormat":1,"textStyle":"font-size: 14px;"}}',
text: blankPipelineNote,
theme: NoteTheme.blue,
author: '',
showAuthor: true,
width: 240,
height: 300,
height: 220,
_isTempNode: true,
} as NoteNodeType,
position: {