diff --git a/web/app/components/plugins/base/key-value-item.tsx b/web/app/components/plugins/base/key-value-item.tsx index ec8e8155cb..2b4dd06d9a 100644 --- a/web/app/components/plugins/base/key-value-item.tsx +++ b/web/app/components/plugins/base/key-value-item.tsx @@ -43,15 +43,15 @@ const KeyValueItem: FC = ({ const CopyIcon = isCopied ? ClipboardCheck : RiClipboardLine return ( -
+
{label}
- + {value} - +
diff --git a/web/app/components/plugins/plugin-page/debug-info.tsx b/web/app/components/plugins/plugin-page/debug-info.tsx index 308b141836..de8149fcd2 100644 --- a/web/app/components/plugins/plugin-page/debug-info.tsx +++ b/web/app/components/plugins/plugin-page/debug-info.tsx @@ -1,6 +1,6 @@ 'use client' import type { FC } from 'react' -import React from 'react' +import React, { useEffect } from 'react' import { RiArrowRightUpLine, RiBugLine, @@ -9,14 +9,23 @@ import { useTranslation } from 'react-i18next' import KeyValueItem from '../base/key-value-item' import Tooltip from '@/app/components/base/tooltip' import Button from '@/app/components/base/button' +import type { DebugInfo as DebugInfoTypes } from '../types' +import { fetchDebugKey } from '@/service/plugins' const i18nPrefix = 'plugin.debugInfo' const DebugInfo: FC = () => { const { t } = useTranslation() + const [info, setInfo] = React.useState(null) + useEffect(() => { + fetchDebugKey().then((res) => { + setInfo(res) + }) + }, []) return (
@@ -29,11 +38,11 @@ const DebugInfo: FC = () => {
diff --git a/web/app/components/plugins/types.ts b/web/app/components/plugins/types.ts index a2c11a8d6c..465f131ed0 100644 --- a/web/app/components/plugins/types.ts +++ b/web/app/components/plugins/types.ts @@ -187,3 +187,9 @@ export type GitHubRepoReleaseResponse = { export type InstallPackageResponse = { plugin_unique_identifier: string } + +export type DebugInfo = { + key: string + host: string + port: number +} diff --git a/web/service/plugins.ts b/web/service/plugins.ts index c072179913..08a7662896 100644 --- a/web/service/plugins.ts +++ b/web/service/plugins.ts @@ -46,3 +46,10 @@ export const installPackageFromGitHub: Fetcher { + return Promise.resolve({ + key: 'f15b079b-bba2-4a62-abad-69119bcd3fa4', + host: 'localhost', + port: 5003, + }) +}