Implement real plugin store backend and install logic
Replaces mock plugin store data with live fetching from a remote source using mirrors and caching. Implements actual plugin download, extraction, and installation logic in the backend. Updates frontend to call the new install API and display installation results, and removes unused icon/rating display from plugin cards.
This commit is contained in:
1 parent
8b676ed693
commit
24623f18d8
3 files changed
+197
-148
No files matched your search
@@ -86,11 +86,14 @@ export default function PluginStorePage () {
|
||||
];
|
||||
}, [categorizedPlugins]);
|
||||
|
||||
const handleInstall = async () => {
|
||||
toast('该功能尚未完工,敬请期待', {
|
||||
icon: '🚧',
|
||||
duration: 3000,
|
||||
});
|
||||
const handleInstall = async (pluginId: string) => {
|
||||
try {
|
||||
await PluginManager.installPluginFromStore(pluginId);
|
||||
toast.success('插件安装成功!');
|
||||
// 可以选择刷新插件列表或导航到插件管理页面
|
||||
} catch (error: any) {
|
||||
toast.error(`安装失败: ${error.message || '未知错误'}`);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
@@ -145,7 +148,7 @@ export default function PluginStorePage () {
|
||||
<PluginStoreCard
|
||||
key={plugin.id}
|
||||
data={plugin}
|
||||
onInstall={handleInstall}
|
||||
onInstall={() => handleInstall(plugin.id)}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user