fix: load package dsl error
This commit is contained in:
parent
bb2914652a
commit
40d025052d
@ -22,12 +22,12 @@ const PluginList = () => {
|
|||||||
<InstallBundle
|
<InstallBundle
|
||||||
onClose={hide}
|
onClose={hide}
|
||||||
fromDSLPayload={[
|
fromDSLPayload={[
|
||||||
{
|
// {
|
||||||
type: 'marketplace',
|
// type: 'marketplace',
|
||||||
value: {
|
// value: {
|
||||||
plugin_unique_identifier: 'langgenius/google:0.0.2@dcb354c9d0fee60e6e9c9eb996e1e485bbef343ba8cd545c0cfb3ec80970f6f1',
|
// plugin_unique_identifier: 'langgenius/google:0.0.2@dcb354c9d0fee60e6e9c9eb996e1e485bbef343ba8cd545c0cfb3ec80970f6f1',
|
||||||
},
|
// },
|
||||||
},
|
// },
|
||||||
{
|
{
|
||||||
type: 'github',
|
type: 'github',
|
||||||
value: {
|
value: {
|
||||||
@ -37,21 +37,21 @@ const PluginList = () => {
|
|||||||
github_plugin_unique_identifier: 'yixiao0/test:0.0.1@3592166c87afcf944b4f13f27467a5c8f9e00bd349cb42033a072734a37431b4',
|
github_plugin_unique_identifier: 'yixiao0/test:0.0.1@3592166c87afcf944b4f13f27467a5c8f9e00bd349cb42033a072734a37431b4',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
type: 'github',
|
// type: 'github',
|
||||||
value: {
|
// value: {
|
||||||
package: 'dify-test.difypkg',
|
// package: 'dify-test.difypkg',
|
||||||
repo: 'WTW0313/dify-test',
|
// repo: 'WTW0313/dify-test',
|
||||||
release: '0.0.5-beta.2',
|
// release: '0.0.5-beta.2',
|
||||||
github_plugin_unique_identifier: 'wtw0313/dify-test:0.0.1@1633daa043b47155d4228e2db7734245fd6d3e20ba812e5c02ce69fc1e3038f4',
|
// github_plugin_unique_identifier: 'wtw0313/dify-test:0.0.1@1633daa043b47155d4228e2db7734245fd6d3e20ba812e5c02ce69fc1e3038f4',
|
||||||
},
|
// },
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
type: 'marketplace',
|
// type: 'marketplace',
|
||||||
value: {
|
// value: {
|
||||||
plugin_unique_identifier: 'langgenius/openai:0.0.2@7baee9635a07573ea192621ebfdacb39db466fa691e75255beaf48bf41d44375',
|
// plugin_unique_identifier: 'langgenius/openai:0.0.2@7baee9635a07573ea192621ebfdacb39db466fa691e75255beaf48bf41d44375',
|
||||||
},
|
// },
|
||||||
},
|
// },
|
||||||
]} />
|
]} />
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,7 @@ import type { Plugin } from '../../../types'
|
|||||||
import type { PackageDependency } from '../../../types'
|
import type { PackageDependency } from '../../../types'
|
||||||
import { pluginManifestToCardPluginProps } from '../../utils'
|
import { pluginManifestToCardPluginProps } from '../../utils'
|
||||||
import LoadedItem from './loaded-item'
|
import LoadedItem from './loaded-item'
|
||||||
|
import LoadingError from '../../base/loading-error'
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
checked: boolean
|
checked: boolean
|
||||||
@ -17,6 +18,9 @@ const PackageItem: FC<Props> = ({
|
|||||||
checked,
|
checked,
|
||||||
onCheckedChange,
|
onCheckedChange,
|
||||||
}) => {
|
}) => {
|
||||||
|
if (!payload.value?.manifest)
|
||||||
|
return <LoadingError />
|
||||||
|
|
||||||
const plugin = pluginManifestToCardPluginProps(payload.value.manifest)
|
const plugin = pluginManifestToCardPluginProps(payload.value.manifest)
|
||||||
return (
|
return (
|
||||||
<LoadedItem
|
<LoadedItem
|
||||||
|
@ -24,7 +24,7 @@ const InstallByDSLList: FC<Props> = ({
|
|||||||
onLoadedAllPlugin,
|
onLoadedAllPlugin,
|
||||||
}) => {
|
}) => {
|
||||||
const { isLoading: isFetchingMarketplaceData, data: marketplaceRes } = useFetchPluginsInMarketPlaceByIds(allPlugins.filter(d => d.type === 'marketplace').map(d => (d as GitHubItemAndMarketPlaceDependency).value.plugin_unique_identifier!))
|
const { isLoading: isFetchingMarketplaceData, data: marketplaceRes } = useFetchPluginsInMarketPlaceByIds(allPlugins.filter(d => d.type === 'marketplace').map(d => (d as GitHubItemAndMarketPlaceDependency).value.plugin_unique_identifier!))
|
||||||
console.log(allPlugins)
|
// console.log(allPlugins)
|
||||||
const [plugins, setPlugins, getPlugins] = useGetState<(Plugin | undefined)[]>((() => {
|
const [plugins, setPlugins, getPlugins] = useGetState<(Plugin | undefined)[]>((() => {
|
||||||
const hasLocalPackage = allPlugins.some(d => d.type === 'package')
|
const hasLocalPackage = allPlugins.some(d => d.type === 'package')
|
||||||
if (!hasLocalPackage)
|
if (!hasLocalPackage)
|
||||||
|
Loading…
Reference in New Issue
Block a user