From 1239f622d2cd134de17814b4286ec65e34ff3df2 Mon Sep 17 00:00:00 2001 From: Qiao Date: Sun, 1 Feb 2026 13:47:18 +0800 Subject: [PATCH] =?UTF-8?q?feat(webui):=20=E6=8F=92=E4=BB=B6=E5=8D=A1?= =?UTF-8?q?=E7=89=87=E6=B7=BB=E5=8A=A0=E4=BB=93=E5=BA=93=E4=B8=BB=E9=A1=B5?= =?UTF-8?q?=E8=B7=B3=E8=BD=AC=E5=8A=9F=E8=83=BD=20(#1569)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 为插件接口添加主页字段并优化展示组件 本次更新在 PluginPackageJson 接口及相关类型中新增了一个可选的 `homepage` 字段,允许插件指定其主页 URL。插件展示组件已更新,新增了一个指向主页的 GitHub 链接按钮,以提升用户对插件资源的访问便捷性。此外,PluginConfigModal 中新增了一个问题反馈按钮,该按钮直接链接到插件的主页,从而优化了用户支持与反馈机制。 * 优化标题区域样式,确保长标题正确截断显示省略号 * 移除插件相关接口中的可选主页字段,并优化展示组件以简化代码结构。更新了插件展示卡片的样式,确保更好的用户体验。 * 修改 PluginStoreCard 组件,新增 displayId 优化包名展示,并调整卡片样式以提升响应式表现。更新不同屏幕尺寸的最大宽度设置,确保包名截断显示且悬停可查看完整内容。 * Revert "修改 PluginStoreCard 组件,新增 displayId 优化包名展示,并调整卡片样式以提升响应式表现。更新不同屏幕尺寸的最大宽度设置,确保包名截断显示且悬停可查看完整内容。" This reverts commit 0301421bc81cd817329186cddf411e474a9a2bf4. * Revert "移除插件相关接口中的可选主页字段,并优化展示组件以简化代码结构。更新了插件展示卡片的样式,确保更好的用户体验。" This reverts commit 1d22f19fa6d9929fa31b59d43f0228fe5060d1f5. * Revert "优化标题区域样式,确保长标题正确截断显示省略号" This reverts commit 8a0912b5b92045b1e5c76d36a16c5ef1c39ad263. * Revert "为插件接口添加主页字段并优化展示组件" This reverts commit 4e5dddde905ebd7ee8a78b9ea2219b8d1d4250d4. * 再说丑我打死你 --------- Co-authored-by: 手瓜一十雪 --- .../src/components/display_card/container.tsx | 2 +- .../display_card/plugin_store_card.tsx | 25 +++++++++++++++++-- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/packages/napcat-webui-frontend/src/components/display_card/container.tsx b/packages/napcat-webui-frontend/src/components/display_card/container.tsx index 790d09b9..330f3f80 100644 --- a/packages/napcat-webui-frontend/src/components/display_card/container.tsx +++ b/packages/napcat-webui-frontend/src/components/display_card/container.tsx @@ -4,7 +4,7 @@ import clsx from 'clsx'; import key from '@/const/key'; export interface ContainerProps { - title: string; + title: React.ReactNode; tag?: React.ReactNode; action: React.ReactNode; enableSwitch: React.ReactNode; diff --git a/packages/napcat-webui-frontend/src/components/display_card/plugin_store_card.tsx b/packages/napcat-webui-frontend/src/components/display_card/plugin_store_card.tsx index b758a9e5..bfd10580 100644 --- a/packages/napcat-webui-frontend/src/components/display_card/plugin_store_card.tsx +++ b/packages/napcat-webui-frontend/src/components/display_card/plugin_store_card.tsx @@ -1,5 +1,6 @@ import { Button } from '@heroui/button'; import { Chip } from '@heroui/chip'; +import { Tooltip } from '@heroui/tooltip'; import { useState } from 'react'; import { IoMdDownload, IoMdRefresh, IoMdCheckmarkCircle } from 'react-icons/io'; @@ -20,7 +21,7 @@ const PluginStoreCard: React.FC = ({ onInstall, installStatus = 'not-installed', }) => { - const { name, version, author, description, tags, id } = data; + const { name, version, author, description, tags, id, homepage } = data; const [processing, setProcessing] = useState(false); const handleInstall = () => { @@ -53,11 +54,31 @@ const PluginStoreCard: React.FC = ({ }; const buttonConfig = getButtonConfig(); + const titleContent = homepage ? ( + + + {name} + + + ) : ( + name + ); return ( {installStatus === 'installed' && (