diff --git a/web/app/components/plugins/base/key-value-item.tsx b/web/app/components/plugins/base/key-value-item.tsx index 58c4962a6c..ec8e8155cb 100644 --- a/web/app/components/plugins/base/key-value-item.tsx +++ b/web/app/components/plugins/base/key-value-item.tsx @@ -9,14 +9,17 @@ import { import { useTranslation } from 'react-i18next' import { ClipboardCheck } from '../../base/icons/src/vender/line/files' import Tooltip from '../../base/tooltip' +import cn from '@/utils/classnames' import ActionButton from '@/app/components/base/action-button' type Props = { label: string + labelWidthClassName?: string value: string } const KeyValueItem: FC = ({ label, + labelWidthClassName = 'w-10', value, }) => { const { t } = useTranslation() @@ -41,7 +44,7 @@ const KeyValueItem: FC = ({ return (
- {label} + {label}
{value} diff --git a/web/app/components/plugins/plugin-item/action.tsx b/web/app/components/plugins/plugin-item/action.tsx index 86198b9d70..998c808654 100644 --- a/web/app/components/plugins/plugin-item/action.tsx +++ b/web/app/components/plugins/plugin-item/action.tsx @@ -3,6 +3,9 @@ import type { FC } from 'react' import React from 'react' import { useRouter } from 'next/navigation' import { RiDeleteBinLine, RiInformation2Line, RiLoopLeftLine } from '@remixicon/react' +import { useBoolean } from 'ahooks' +import PluginInfo from '../plugin-page/plugin-info' +import ActionButton from '../../base/action-button' type Props = { pluginId: string @@ -19,11 +22,13 @@ const Action: FC = ({ onDelete, }) => { const router = useRouter() + const [isShowPluginInfo, { + setTrue: showPluginInfo, + setFalse: hidePluginInfo, + }] = useBoolean(false) const handleFetchNewVersion = () => { } - const handleShowInfo = () => { - router.refresh() // refresh the page ... - } + // const handleDelete = () => { } return (
@@ -34,9 +39,9 @@ const Action: FC = ({ } { isShowInfo - &&
+ && -
+ } { isShowDelete @@ -44,6 +49,15 @@ const Action: FC = ({
} + + {isShowPluginInfo && ( + + )}
) } diff --git a/web/app/components/plugins/plugin-page/debug-info.tsx b/web/app/components/plugins/plugin-page/debug-info.tsx index e789f906ec..308b141836 100644 --- a/web/app/components/plugins/plugin-page/debug-info.tsx +++ b/web/app/components/plugins/plugin-page/debug-info.tsx @@ -26,7 +26,7 @@ const DebugInfo: FC = () => {
-
+
void +} + +const PlugInfo: FC = ({ + repository, + release, + packageName, + onHide, +}) => { + const { t } = useTranslation() + const labelWidthClassName = 'w-[96px]' + return ( + +
+ + + +
+
+ ) +} +export default React.memo(PlugInfo) diff --git a/web/i18n/en-US/plugin.ts b/web/i18n/en-US/plugin.ts index 817c9e0296..3d09474264 100644 --- a/web/i18n/en-US/plugin.ts +++ b/web/i18n/en-US/plugin.ts @@ -33,6 +33,12 @@ const translation = { admin: 'Admins', noOne: 'No one', }, + pluginInfoModal: { + title: 'Plugin info', + repository: 'Repository', + release: 'Release', + packageName: 'Package', + }, } export default translation diff --git a/web/i18n/zh-Hans/plugin.ts b/web/i18n/zh-Hans/plugin.ts index d40920e0aa..7f88bda567 100644 --- a/web/i18n/zh-Hans/plugin.ts +++ b/web/i18n/zh-Hans/plugin.ts @@ -33,6 +33,12 @@ const translation = { admin: '管理员', noOne: '无人', }, + pluginInfoModal: { + title: '插件信息', + repository: '仓库', + release: '发布版本', + packageName: '包', + }, } export default translation