install from settings

This commit is contained in:
JzoNg 2024-11-08 16:33:00 +08:00
parent f70c23dd7a
commit 1f1c61541e
2 changed files with 7 additions and 2 deletions

View File

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

View File

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