mirror of https://github.com/langgenius/dify.git
Merge branch 'feat/plugins' of https://github.com/langgenius/dify into feat/plugins
This commit is contained in:
commit
7b4d49a79c
|
|
@ -18,6 +18,13 @@ const AgentStrategyList = ({
|
|||
const providerKey = `${detail.plugin_id}/${providerBriefInfo.name}`
|
||||
const { data: strategyProviderDetail } = useStrategyProviderDetail(providerKey)
|
||||
|
||||
const providerDetail = useMemo(() => {
|
||||
return {
|
||||
...strategyProviderDetail?.declaration.identity,
|
||||
tenant_id: detail.tenant_id,
|
||||
}
|
||||
}, [detail.tenant_id, strategyProviderDetail?.declaration.identity])
|
||||
|
||||
const strategyList = useMemo(() => {
|
||||
if (!strategyProviderDetail)
|
||||
return []
|
||||
|
|
@ -39,7 +46,7 @@ const AgentStrategyList = ({
|
|||
{strategyList.map(strategyDetail => (
|
||||
<StrategyItem
|
||||
key={`${strategyDetail.identity.provider}${strategyDetail.identity.name}`}
|
||||
provider={strategyProviderDetail.declaration.identity}
|
||||
provider={providerDetail as any}
|
||||
detail={strategyDetail}
|
||||
/>
|
||||
))}
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ import type {
|
|||
} from '@/app/components/plugins/types'
|
||||
import type { Locale } from '@/i18n'
|
||||
import { useRenderI18nObject } from '@/hooks/use-i18n'
|
||||
import { API_PREFIX } from '@/config'
|
||||
import cn from '@/utils/classnames'
|
||||
|
||||
type Props = {
|
||||
|
|
@ -23,6 +24,7 @@ type Props = {
|
|||
author: string
|
||||
name: string
|
||||
description: Record<Locale, string>
|
||||
tenant_id: string
|
||||
icon: string
|
||||
label: Record<Locale, string>
|
||||
tags: string[]
|
||||
|
|
@ -94,7 +96,7 @@ const StrategyDetail: FC<Props> = ({
|
|||
BACK
|
||||
</div>
|
||||
<div className='flex items-center gap-1'>
|
||||
<Icon size='tiny' className='w-6 h-6' src={provider.icon} />
|
||||
<Icon size='tiny' className='w-6 h-6' src={`${API_PREFIX}/workspaces/current/plugin/icon?tenant_id=${provider.tenant_id}&filename=${provider.icon}`} />
|
||||
<div className=''>{getValueFromI18nObject(provider.label)}</div>
|
||||
</div>
|
||||
<div className='mt-1 text-text-primary system-md-semibold'>{getValueFromI18nObject(detail.identity.label)}</div>
|
||||
|
|
@ -135,7 +137,7 @@ const StrategyDetail: FC<Props> = ({
|
|||
</div>
|
||||
<div className='p-4 pb-1 text-text-primary system-sm-semibold-uppercase'>OUTPUT</div>
|
||||
{outputSchema.length > 0 && (
|
||||
<div className='py-2 space-y-1'>
|
||||
<div className='px-4 py-2 space-y-1'>
|
||||
{outputSchema.map((outputItem, index) => (
|
||||
<div key={index} className='py-1'>
|
||||
<div className='flex items-center gap-2'>
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ type Props = {
|
|||
author: string
|
||||
name: string
|
||||
description: Record<Locale, string>
|
||||
tenant_id: string
|
||||
icon: string
|
||||
label: Record<Locale, string>
|
||||
tags: string[]
|
||||
|
|
|
|||
|
|
@ -280,7 +280,7 @@ const ToolSelector: FC<Props> = ({
|
|||
{currentProvider && currentProvider.type === CollectionType.builtIn && currentProvider.allow_delete && (
|
||||
<div className='px-4 pt-3 flex flex-col'>
|
||||
<div className='flex items-center gap-2'>
|
||||
<div className='text-text-tertiary system-xs-medium-uppercase'>{t('plugin.detailPanel.toolSelector.auth')}</div>
|
||||
<div className='shrink-0 text-text-tertiary system-xs-medium-uppercase'>{t('plugin.detailPanel.toolSelector.auth')}</div>
|
||||
<Divider bgStyle='gradient' className='grow' />
|
||||
</div>
|
||||
<div className='py-2'>
|
||||
|
|
@ -312,7 +312,7 @@ const ToolSelector: FC<Props> = ({
|
|||
{currentToolParams.length > 0 && currentProvider?.is_team_authorization && (
|
||||
<div className='px-4 pt-3'>
|
||||
<div className='flex items-center gap-2'>
|
||||
<div className='text-text-tertiary system-xs-medium-uppercase'>{t('plugin.detailPanel.toolSelector.settings')}</div>
|
||||
<div className='shrink-0 text-text-tertiary system-xs-medium-uppercase'>{t('plugin.detailPanel.toolSelector.settings')}</div>
|
||||
<Divider bgStyle='gradient' className='grow' />
|
||||
</div>
|
||||
<div className='py-2'>
|
||||
|
|
|
|||
|
|
@ -162,12 +162,12 @@ const translation = {
|
|||
selectPackagePlaceholder: 'Please select a package',
|
||||
},
|
||||
upgrade: {
|
||||
title: 'Upgrade Plugin',
|
||||
successfulTitle: 'Upgrade successful',
|
||||
description: 'About to upgrade the following plugin',
|
||||
title: 'Install Plugin',
|
||||
successfulTitle: 'Install successful',
|
||||
description: 'About to install the following plugin',
|
||||
usedInApps: 'Used in {{num}} apps',
|
||||
upgrade: 'Upgrade',
|
||||
upgrading: 'Upgrading...',
|
||||
upgrade: 'Install',
|
||||
upgrading: 'Installing...',
|
||||
close: 'Close',
|
||||
},
|
||||
error: {
|
||||
|
|
|
|||
|
|
@ -162,12 +162,12 @@ const translation = {
|
|||
selectPackagePlaceholder: '请选择一个包',
|
||||
},
|
||||
upgrade: {
|
||||
title: '升级插件',
|
||||
successfulTitle: '升级成功',
|
||||
description: '即将升级以下插件',
|
||||
title: '安装插件',
|
||||
successfulTitle: '安装成功',
|
||||
description: '即将安装以下插件',
|
||||
usedInApps: '在 {{num}} 个应用中使用',
|
||||
upgrade: '升级',
|
||||
upgrading: '升级中...',
|
||||
upgrade: '安装',
|
||||
upgrading: '安装中...',
|
||||
close: '关闭',
|
||||
},
|
||||
error: {
|
||||
|
|
|
|||
Loading…
Reference in New Issue