From c00f05fca4cad13cdc48497b7ae4c3835a2917bb Mon Sep 17 00:00:00 2001 From: How-Sean Xin Date: Sat, 26 Jul 2025 19:22:00 +0800 Subject: [PATCH] Add GitHub link redirection for front-end plugin cards (#1579) * Update package.json * Update PluginMarketComponent.tsx * Update PluginMarketComponent.tsx * Update package.json * Update PluginCardComponent.tsx * perf: no display github button when plugin has no github url --------- Co-authored-by: Junyan Qin --- .../plugin-card/PluginCardComponent.tsx | 31 ++++++++++++++++--- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/web/src/app/home/plugins/plugin-installed/plugin-card/PluginCardComponent.tsx b/web/src/app/home/plugins/plugin-installed/plugin-card/PluginCardComponent.tsx index 119a82bb..e77a2757 100644 --- a/web/src/app/home/plugins/plugin-installed/plugin-card/PluginCardComponent.tsx +++ b/web/src/app/home/plugins/plugin-installed/plugin-card/PluginCardComponent.tsx @@ -109,11 +109,32 @@ export default function PluginCardComponent({ /> -
- {/* */} -
+ {cardVO.repository && + cardVO.repository.trim() && + cardVO.repository.startsWith('http') && ( +
+ { + e.stopPropagation(); // 阻止事件冒泡 + if ( + cardVO.repository && + cardVO.repository.trim() && + cardVO.repository.startsWith('http') + ) { + window.open(cardVO.repository, '_blank'); + } + }} + > + + +
+ )}