install from settings

pull/12372/head
JzoNg 2 years ago
parent f70c23dd7a
commit 1f1c61541e

@ -222,7 +222,7 @@ const ModelProviderPage = ({ searchText }: Props) => {
{!collapse && !isPluginsLoading && ( {!collapse && !isPluginsLoading && (
<div className='grid grid-cols-2 gap-2'> <div className='grid grid-cols-2 gap-2'>
{plugins.map(plugin => ( {plugins.map(plugin => (
<ProviderCard key={plugin.plugin_id} payload={plugin} /> <ProviderCard key={plugin.plugin_id} payload={plugin} onSuccess={updateModelProviders} />
))} ))}
</div> </div>
)} )}

@ -19,11 +19,13 @@ import { useBoolean } from 'ahooks'
type Props = { type Props = {
className?: string className?: string
payload: Plugin payload: Plugin
onSuccess: () => void
} }
const ProviderCard: FC<Props> = ({ const ProviderCard: FC<Props> = ({
className, className,
payload, payload,
onSuccess,
}) => { }) => {
const { t } = useTranslation() const { t } = useTranslation()
const [isShowInstallFromMarketplace, { const [isShowInstallFromMarketplace, {
@ -84,7 +86,10 @@ const ProviderCard: FC<Props> = ({
manifest={payload as any} manifest={payload as any}
uniqueIdentifier={payload.latest_package_identifier} uniqueIdentifier={payload.latest_package_identifier}
onClose={hideInstallFromMarketplace} onClose={hideInstallFromMarketplace}
onSuccess={hideInstallFromMarketplace} onSuccess={() => {
onSuccess()
hideInstallFromMarketplace()
}}
/> />
) )
} }

Loading…
Cancel
Save