mirror of https://github.com/langgenius/dify.git
fix: marketplace list
This commit is contained in:
parent
02854b273f
commit
3db9174f55
|
|
@ -21,7 +21,7 @@ const CardWrapper = ({
|
|||
footer={
|
||||
<CardMoreInfo
|
||||
downloadCount={plugin.install_count}
|
||||
tags={['Search', 'Productivity']}
|
||||
tags={plugin.tags.map(tag => tag.name)}
|
||||
/>
|
||||
}
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -14,14 +14,14 @@ export const getMarketplaceCollectionsAndPlugins = async (query?: CollectionsAnd
|
|||
let marketplaceCollections = [] as MarketplaceCollection[]
|
||||
let marketplaceCollectionPluginsMap = {} as Record<string, Plugin[]>
|
||||
try {
|
||||
const marketplaceCollectionsData = await globalThis.fetch(`${MARKETPLACE_API_PREFIX}/collections`)
|
||||
const marketplaceCollectionsData = await globalThis.fetch(`${MARKETPLACE_API_PREFIX}/collections`, { cache: 'no-store' })
|
||||
const marketplaceCollectionsDataJson = await marketplaceCollectionsData.json()
|
||||
marketplaceCollections = marketplaceCollectionsDataJson.data.collections
|
||||
await Promise.all(marketplaceCollections.map(async (collection: MarketplaceCollection) => {
|
||||
let url = `${MARKETPLACE_API_PREFIX}/collections/${collection.name}/plugins`
|
||||
if (query?.category)
|
||||
url += `?category=${query.category}`
|
||||
const marketplaceCollectionPluginsData = await globalThis.fetch(url)
|
||||
const marketplaceCollectionPluginsData = await globalThis.fetch(url, { cache: 'no-store' })
|
||||
const marketplaceCollectionPluginsDataJson = await marketplaceCollectionPluginsData.json()
|
||||
const plugins = marketplaceCollectionPluginsDataJson.data.plugins.map((plugin: Plugin) => {
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@ import type { Locale } from '@/i18n'
|
|||
|
||||
export enum PluginType {
|
||||
tool = 'tools',
|
||||
model = 'model',
|
||||
extension = 'extension',
|
||||
model = 'models',
|
||||
extension = 'endpoints',
|
||||
}
|
||||
|
||||
export enum PluginSource {
|
||||
|
|
@ -117,6 +117,7 @@ export type Plugin = {
|
|||
endpoint: {
|
||||
settings: CredentialFormSchemaBase[]
|
||||
}
|
||||
tags: { name: string }[]
|
||||
}
|
||||
|
||||
export enum PermissionType {
|
||||
|
|
|
|||
Loading…
Reference in New Issue