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

@@ -143,15 +143,12 @@ describe('EmbeddingProcess', () => {
})
describe('Rendering', () => {
it('should render API reference link with correct URL', () => {
it('does not link the API reference to the official documentation site', () => {
const props = createDefaultProps()
render(<EmbeddingProcess {...props} />)
const apiLink = screen.getByRole('link', { name: /access the api/i })
expect(apiLink).toHaveAttribute('href', 'https://docs.dify.ai/api-reference/datasets')
expect(apiLink).toHaveAttribute('target', '_blank')
expect(apiLink).toHaveAttribute('rel', 'noopener noreferrer')
expect(screen.queryByRole('link', { name: /access the api/i })).not.toBeInTheDocument()
})
})
@@ -27,6 +27,7 @@ import DocumentFileIcon from '@/app/components/datasets/common/document-file-ico
import VectorSpaceAdmissionAlert from '@/app/components/datasets/common/vector-space-admission-alert'
import { deploymentEditionAtom } from '@/features/system-features/state'
import { useDatasetApiAccessUrl } from '@/hooks/use-api-access-url'
import { isOfficialDifyUrl } from '@/utils/official-link'
import { DatasourceType } from '@/models/pipeline'
import Link from '@/next/link'
import { consoleQuery } from '@/service/console'
@@ -277,15 +278,17 @@ const EmbeddingProcess = ({
/>
</div>
<div className="mt-6 flex items-center gap-x-2 py-2">
<Link
href={apiReferenceUrl}
target="_blank"
rel="noopener noreferrer"
className={cn(buttonVariants(), 'w-fit')}
>
<RiTerminalBoxLine className="size-4" />
<span>Access the API</span>
</Link>
{apiReferenceUrl && !isOfficialDifyUrl(apiReferenceUrl) ? (
<Link
href={apiReferenceUrl}
target="_blank"
rel="noopener noreferrer"
className={cn(buttonVariants(), 'w-fit')}
>
<RiTerminalBoxLine className="size-4" />
<span>Access the API</span>
</Link>
) : null}
<Link
href={documentsHref}
className={cn(buttonVariants({ variant: 'primary' }), 'w-fit')}
@@ -4,7 +4,6 @@ import { RiBookOpenLine } from '@remixicon/react'
import * as React from 'react'
import { useTranslation } from 'react-i18next'
import { useDatasetDetailContextWithSelector } from '@/context/dataset-detail'
import { useDocLink } from '@/context/i18n'
import EmbeddingProcess from './embedding-process'
type ProcessingProps = {
@@ -14,8 +13,7 @@ type ProcessingProps = {
const Processing = ({ batchId, documents }: ProcessingProps) => {
const { t } = useTranslation(['datasetCreation', 'datasetPipeline'])
const docLink = useDocLink()
const datasetId = useDatasetDetailContextWithSelector((s) => s.dataset?.id)
const datasetId = useDatasetDetailContextWithSelector((s) => s.dataset?.id)
const indexingType = useDatasetDetailContextWithSelector(
(s) => s.dataset?.indexing_technique ?? undefined,
)
@@ -48,14 +46,6 @@ const Processing = ({ batchId, documents }: ProcessingProps) => {
<div className="system-sm-regular text-text-tertiary">
{t(($) => $['stepThree.sideTipContent'], { ns: 'datasetCreation' })}
</div>
<a
href={docLink('/use-dify/knowledge/knowledge-pipeline/authorize-data-source')}
target="_blank"
rel="noreferrer noopener"
className="system-sm-regular text-text-accent"
>
{t(($) => $['addDocuments.stepThree.learnMore'], { ns: 'datasetPipeline' })}
</a>
</div>
</div>
</div>