diff --git a/astrbot/dashboard/routes/plugin.py b/astrbot/dashboard/routes/plugin.py index cfb8d821b..56600224f 100644 --- a/astrbot/dashboard/routes/plugin.py +++ b/astrbot/dashboard/routes/plugin.py @@ -25,15 +25,29 @@ class PluginRoute(Route): self.register_routes() async def get_online_plugins(self): - url = "https://soulter.github.io/AstrBot_Plugins_Collection/plugins.json" - try: - async with aiohttp.ClientSession(trust_env=True) as session: - async with session.get(url) as response: - result = await response.json() - return Response().ok(result).__dict__ - except Exception as e: - logger.error(f"获取插件列表失败:{e}") - return Response().error(str(e)).__dict__ + custom = request.args.get("custom_registry") + + if custom: + urls = [custom] + else: + urls = [ + "https://soulter.github.io/AstrBot_Plugins_Collection/plugins.json", + "https://api.soulter.top/astrbot/plugins" + ] + + for url in urls: + try: + async with aiohttp.ClientSession(trust_env=True) as session: + async with session.get(url) as response: + if response.status == 200: + result = await response.json() + return Response().ok(result).__dict__ + else: + logger.error(f"请求 {url} 失败,状态码:{response.status}") + except Exception as e: + logger.error(f"请求 {url} 失败,错误:{e}") + + return Response().error("获取插件列表失败").__dict__ async def get_plugins(self): _plugin_resp = [] diff --git a/dashboard/src/components/shared/AstrBotConfig.vue b/dashboard/src/components/shared/AstrBotConfig.vue index a5d3b81ca..a94f8bddb 100644 --- a/dashboard/src/components/shared/AstrBotConfig.vue +++ b/dashboard/src/components/shared/AstrBotConfig.vue @@ -4,7 +4,7 @@
- @@ -52,7 +52,7 @@
+ v-if="!metadata[metadataKey].items[key]?.obvious_hint && metadata[metadataKey].items[key]?.hint && !metadata[metadataKey].items[key]?.invisible"> mdi-help {{ metadata[metadataKey].items[key]?.hint @@ -63,7 +63,7 @@
- @@ -106,7 +106,7 @@
+ v-if="!metadata[metadataKey]?.obvious_hint && metadata[metadataKey]?.hint && !metadata[metadataKey]?.invisible"> mdi-help {{ metadata[metadataKey]?.hint diff --git a/dashboard/src/views/ExtensionPage.vue b/dashboard/src/views/ExtensionPage.vue index 4070a7429..200fb8610 100644 --- a/dashboard/src/views/ExtensionPage.vue +++ b/dashboard/src/views/ExtensionPage.vue @@ -37,7 +37,11 @@ import axios from 'axios';
-

🧩 插件市场

+
+

🧩 插件市场

+ 如无法显示,请打开 链接 复制想安装插件对应的 `repo` 链接然后点击右下角 + 号安装,或打开链接下载压缩包安装。 +
+