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
+2
-13
@@ -28,7 +28,6 @@ import {
|
||||
settingsQueryParser,
|
||||
} from '@/app/components/header/account-setting/query-params'
|
||||
import { toast } from '@/app/notifications'
|
||||
import { useDocLink } from '@/context/i18n'
|
||||
import { codeBasedExtensionsQueryOptions } from '@/features/code-based-extension/query'
|
||||
import { LanguagesSupported } from '@/i18n/language'
|
||||
import FormGeneration from './form-generation'
|
||||
@@ -69,8 +68,7 @@ type ModerationSettingModalProps = {
|
||||
|
||||
const ModerationSettingModal: FC<ModerationSettingModalProps> = ({ data, onCancel, onSave }) => {
|
||||
const { t } = useTranslation(['appDebug', 'common', 'navigation'])
|
||||
const docLink = useDocLink()
|
||||
const locale = useLocale()
|
||||
const locale = useLocale()
|
||||
const { data: modelProviders, isPending: isLoading } = useQuery(
|
||||
modelProviderDetailsQueryOptions(),
|
||||
)
|
||||
@@ -429,19 +427,10 @@ const ModerationSettingModal: FC<ModerationSettingModalProps> = ({ data, onCance
|
||||
)}
|
||||
{localeData.type === 'api' && (
|
||||
<div className="flex flex-col gap-1">
|
||||
<div className="flex h-6 items-center justify-between">
|
||||
<div className="flex h-6 items-center justify-between">
|
||||
<div className="system-sm-medium text-text-secondary">
|
||||
{t(($) => $['apiBasedExtension.selector.title'], { ns: 'common' })}
|
||||
</div>
|
||||
<a
|
||||
href={docLink('/use-dify/workspace/api-extension/api-extension')}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="group flex items-center system-xs-regular text-text-tertiary hover:text-primary-600"
|
||||
>
|
||||
<span className="mr-1 i-custom-vender-line-education-book-open-01 size-3 text-text-tertiary group-hover:text-primary-600" />
|
||||
{t(($) => $['apiBasedExtension.link'], { ns: 'common' })}
|
||||
</a>
|
||||
</div>
|
||||
<ApiBasedExtensionSelector
|
||||
value={localeData.config?.api_based_extension_id || ''}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import type { AnyFieldApi } from '@tanstack/react-form'
|
||||
import { isOfficialDifyUrl } from '@/utils/official-link'
|
||||
import type { FieldState, FormSchema, TypeWithI18N } from '@/app/components/base/form/types'
|
||||
import { cn } from '@langgenius/dify-ui/cn'
|
||||
import { Field, FieldItem, FieldLabel } from '@langgenius/dify-ui/field'
|
||||
@@ -541,7 +542,7 @@ const BaseField = ({
|
||||
{translatedDescription}
|
||||
</div>
|
||||
)}
|
||||
{url && (
|
||||
{url && !isOfficialDifyUrl(url) && (
|
||||
<a
|
||||
className="mt-4 flex items-center system-xs-regular text-text-accent"
|
||||
href={url}
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
*/
|
||||
import * as React from 'react'
|
||||
import { useChatContext } from '@/app/components/base/chat/chat/context'
|
||||
import { isOfficialDifyUrl } from '@/utils/official-link'
|
||||
import { isValidUrl } from './utils'
|
||||
|
||||
const filePreviewPathPattern = /\/files\/[^/?#]+\/file-preview(?:[?#]|$)/
|
||||
@@ -57,6 +58,8 @@ const Link = ({ node, children, ...props }: any) => {
|
||||
)
|
||||
}
|
||||
|
||||
if (href && isOfficialDifyUrl(href)) return null
|
||||
|
||||
if (!href || !isValidUrl(href)) return <span>{children}</span>
|
||||
|
||||
return (
|
||||
|
||||
Reference in new issue
Block a user