feat(dify): 把本地控制台的中文与去外链改动入库
这些界面改动和专家服务草稿停在工作区,没有随上一笔主分支提交进入仓库。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
9c7c80e194
commit
c2cb845a32
211 files changed
+3030
-2794
No files matched your search
+1
-12
@@ -15,7 +15,6 @@ import AutoDisabledDocument from '@/app/components/datasets/common/document-stat
|
||||
import IndexFailed from '@/app/components/datasets/common/document-status-with-action/index-failed'
|
||||
import StatusWithAction from '@/app/components/datasets/common/document-status-with-action/status-with-action'
|
||||
import DatasetMetadataDrawer from '@/app/components/datasets/metadata/metadata-dataset/dataset-metadata-drawer'
|
||||
import { useDocLink } from '@/context/i18n'
|
||||
import { DataSourceType } from '@/models/datasets'
|
||||
import { useIndexStatus } from '../status-item/hooks'
|
||||
|
||||
@@ -87,8 +86,7 @@ const DocumentsHeader: FC<DocumentsHeaderProps> = ({
|
||||
const { t } = useTranslation(['dataset', 'datasetDocuments'])
|
||||
const statusFilterId = useId()
|
||||
const statusFilterLabelId = useId()
|
||||
const docLink = useDocLink()
|
||||
const DOC_INDEX_STATUS_MAP = useIndexStatus()
|
||||
const DOC_INDEX_STATUS_MAP = useIndexStatus()
|
||||
|
||||
const isDataSourceNotion = dataSourceType === DataSourceType.NOTION
|
||||
const isDataSourceWeb = dataSourceType === DataSourceType.WEB
|
||||
@@ -139,15 +137,6 @@ const DocumentsHeader: FC<DocumentsHeaderProps> = ({
|
||||
</h1>
|
||||
<div className="flex items-center space-x-0.5 text-sm font-normal text-text-tertiary">
|
||||
<span>{t(($) => $['list.desc'], { ns: 'datasetDocuments' })}</span>
|
||||
<a
|
||||
className="flex items-center text-text-accent"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
href={docLink('/use-dify/knowledge/integrate-knowledge-within-application')}
|
||||
>
|
||||
<span>{t(($) => $['list.learnMore'], { ns: 'datasetDocuments' })}</span>
|
||||
<span className="i-ri-external-link-line size-3" />
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
+12
-9
@@ -4,6 +4,7 @@ import { Separator } from '@langgenius/dify-ui/separator'
|
||||
import { Tooltip, TooltipContent, TooltipTrigger } from '@langgenius/dify-ui/tooltip'
|
||||
import * as React from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { isOfficialDifyUrl } from '@/utils/official-link'
|
||||
import CredentialSelector from './credential-selector'
|
||||
|
||||
type HeaderProps = {
|
||||
@@ -39,15 +40,17 @@ const Header = ({ docTitle, docLink, onClickConfiguration, pluginName, ...rest }
|
||||
<TooltipContent>{configurationTip}</TooltipContent>
|
||||
</Tooltip>
|
||||
</div>
|
||||
<a
|
||||
className="flex shrink-0 items-center gap-x-1 system-xs-medium text-text-accent"
|
||||
href={docLink}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
<span aria-hidden className="i-ri-book-open-line size-3.5 shrink-0" />
|
||||
<span title={docTitle}>{docTitle}</span>
|
||||
</a>
|
||||
{docLink && !isOfficialDifyUrl(docLink) && (
|
||||
<a
|
||||
className="flex shrink-0 items-center gap-x-1 system-xs-medium text-text-accent"
|
||||
href={docLink}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
<span aria-hidden className="i-ri-book-open-line size-3.5 shrink-0" />
|
||||
<span title={docTitle}>{docTitle}</span>
|
||||
</a>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
+2
-5
@@ -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()
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
+12
-9
@@ -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')}
|
||||
|
||||
+1
-11
@@ -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>
|
||||
|
||||
Reference in new issue
Block a user