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

@@ -15,6 +15,8 @@ import {
} from '@langgenius/dify-ui/popover'
import { useRef } from 'react'
import { useTranslation } from 'react-i18next'
import { isOfficialDifyUrl } from '@/utils/official-link'
import { visibleAuthorName } from '@/utils/visible-author'
import { useStoreApi } from 'reactflow'
import { handleWorkflowMenuKeyDown } from '../shortcuts/handle-workflow-menu-key-down'
import { ChangeBlockPopup } from './change-block-popup'
@@ -29,6 +31,12 @@ import { useNodeActionsMenuModel } from './use-node-actions-menu-model'
export function NodeActionsContextMenuContent(props: NodeActionsMenuProps) {
const { t } = useTranslation(['common', 'workflow', 'workflowDebug'])
const model = useNodeActionsMenuModel(props)
const helpHref = model.helpLinkUri
const showNodeHelp = Boolean(helpHref) && !isOfficialDifyUrl(helpHref)
const authorName = visibleAuthorName(model.about.author)
const authorLabel = authorName
? `${t(($) => $['panel.createdBy'], { ns: 'workflow' })} ${authorName}`
: undefined
const flowStore = useStoreApi()
const deletingRef = useRef(false)
const hasRunGroup = model.canRun || model.canChangeBlock
@@ -92,7 +100,7 @@ export function NodeActionsContextMenuContent(props: NodeActionsMenuProps) {
</ContextMenuGroup>
)}
{hasRunGroup &&
(hasEditGroup || hasDeleteGroup || model.workflowAppHref || model.helpLinkUri) && (
(hasEditGroup || hasDeleteGroup || model.workflowAppHref || showNodeHelp) && (
<ContextMenuSeparator />
)}
{hasEditGroup && (
@@ -115,7 +123,7 @@ export function NodeActionsContextMenuContent(props: NodeActionsMenuProps) {
</ContextMenuItem>
</ContextMenuGroup>
)}
{hasEditGroup && (hasDeleteGroup || model.workflowAppHref || model.helpLinkUri) && (
{hasEditGroup && (hasDeleteGroup || model.workflowAppHref || showNodeHelp) && (
<ContextMenuSeparator />
)}
{hasDeleteGroup && (
@@ -131,7 +139,7 @@ export function NodeActionsContextMenuContent(props: NodeActionsMenuProps) {
</ContextMenuItem>
</ContextMenuGroup>
)}
{hasDeleteGroup && (model.workflowAppHref || model.helpLinkUri) && <ContextMenuSeparator />}
{hasDeleteGroup && (model.workflowAppHref || showNodeHelp) && <ContextMenuSeparator />}
{model.workflowAppHref && (
<ContextMenuGroup>
<ContextMenuLinkItem
@@ -143,10 +151,10 @@ export function NodeActionsContextMenuContent(props: NodeActionsMenuProps) {
</ContextMenuLinkItem>
</ContextMenuGroup>
)}
{model.workflowAppHref && model.helpLinkUri && <ContextMenuSeparator />}
{model.helpLinkUri && (
{model.workflowAppHref && showNodeHelp && <ContextMenuSeparator />}
{showNodeHelp && (
<ContextMenuGroup>
<ContextMenuLinkItem href={model.helpLinkUri} target="_blank" rel="noopener noreferrer">
<ContextMenuLinkItem href={helpHref} target="_blank" rel="noopener noreferrer">
{t(($) => $['panel.helpLink'], { ns: 'workflow' })}
</ContextMenuLinkItem>
</ContextMenuGroup>
@@ -155,7 +163,7 @@ export function NodeActionsContextMenuContent(props: NodeActionsMenuProps) {
<NodeActionsMenuAbout
title={t(($) => $['panel.about'], { ns: 'workflow' })}
description={model.about.description}
author={`${t(($) => $['panel.createdBy'], { ns: 'workflow' })} ${model.about.author}`}
author={authorLabel}
/>
</ContextMenuContent>
)