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:
手瓜一十雪
2026-01-27 22:03:47 +08:00
parent e43e58e6a0
commit de522a0db5
3 changed files with 197 additions and 148 deletions

View File

@@ -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>