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

@@ -4,10 +4,8 @@ import { cn } from '@langgenius/dify-ui/cn'
import { Field, FieldError } from '@langgenius/dify-ui/field'
import { Form } from '@langgenius/dify-ui/form'
import { Input } from '@langgenius/dify-ui/input'
import { RiBookOpenLine } from '@remixicon/react'
import * as React from 'react'
import { useTranslation } from 'react-i18next'
import { useDocLink } from '@/context/i18n'
type ExternalAPIFormProps = {
id: string
@@ -36,7 +34,6 @@ const ExternalAPIForm: FC<ExternalAPIFormProps> = React.memo(
errors,
}) => {
const { t, i18n } = useTranslation(['common', 'dataset'])
const docLink = useDocLink()
const handleFormChange = (key: string, val: string) => {
if (key === 'name') {
@@ -69,17 +66,6 @@ const ExternalAPIForm: FC<ExternalAPIFormProps> = React.memo(
{label[i18n.language] || label.en_US}
{required && <span className="ml-1 text-red-500">*</span>}
</label>
{variable === 'endpoint' && (
<a
href={docLink('/use-dify/knowledge/external-knowledge-api') || '/'}
target="_blank"
rel="noopener noreferrer"
className="flex items-center body-xs-regular text-text-accent"
>
<RiBookOpenLine className="mr-1 size-3 text-text-accent" />
{t(($) => $.externalAPIPanelDocumentation, { ns: 'dataset' })}
</a>
)}
</div>
<Input
type={type === 'secret' ? 'password' : 'text'}
@@ -1,12 +1,11 @@
import { Button } from '@langgenius/dify-ui/button'
import { cn } from '@langgenius/dify-ui/cn'
import { IconButton } from '@langgenius/dify-ui/icon-button'
import { RiAddLine, RiBookOpenLine, RiCloseLine } from '@remixicon/react'
import { RiAddLine, RiCloseLine } from '@remixicon/react'
import { useQuery, useQueryClient } from '@tanstack/react-query'
import * as React from 'react'
import { useTranslation } from 'react-i18next'
import { LoadingPlaceholder } from '@/app/components/base/loading-placeholder'
import { useDocLink } from '@/context/i18n'
import { useModalContext } from '@/context/modal-context'
import { consoleQuery } from '@/service/console'
import ExternalKnowledgeAPICard from '../external-knowledge-api-card'
@@ -21,8 +20,7 @@ const ExternalAPIPanel: React.FC<ExternalAPIPanelProps> = ({
onClose,
}) => {
const { t } = useTranslation(['common', 'dataset'])
const docLink = useDocLink()
const { setShowExternalKnowledgeAPIModal } = useModalContext()
const { setShowExternalKnowledgeAPIModal } = useModalContext()
const queryClient = useQueryClient()
const externalKnowledgeApiQueryOptions =
consoleQuery.datasets.externalKnowledgeApi.get.queryOptions({ input: {} })
@@ -59,16 +57,6 @@ const ExternalAPIPanel: React.FC<ExternalAPIPanelProps> = ({
<div className="self-stretch body-xs-regular text-text-tertiary">
{t(($) => $.externalAPIPanelDescription, { ns: 'dataset' })}
</div>
<a
className="flex cursor-pointer items-center justify-center gap-1 self-stretch"
href={docLink('/use-dify/knowledge/external-knowledge-api')}
target="_blank"
>
<RiBookOpenLine className="size-3 text-text-accent" />
<div className="grow body-xs-regular text-text-accent">
{t(($) => $.externalAPIPanelDocumentation, { ns: 'dataset' })}
</div>
</a>
</div>
<div className="flex items-center">
<IconButton