diff --git a/napcat.webui/src/components/system_info.tsx b/napcat.webui/src/components/system_info.tsx index db46de32..52c6074b 100644 --- a/napcat.webui/src/components/system_info.tsx +++ b/napcat.webui/src/components/system_info.tsx @@ -4,6 +4,8 @@ import { Chip } from '@heroui/chip' import { Spinner } from '@heroui/spinner' import { Tooltip } from '@heroui/tooltip' import { useRequest } from 'ahooks' +import { useEffect } from 'react' +import { BsStars } from 'react-icons/bs' import { FaCircleInfo, FaInfo, FaQq } from 'react-icons/fa6' import { IoLogoChrome, IoLogoOctocat } from 'react-icons/io' import { RiMacFill } from 'react-icons/ri' @@ -97,6 +99,42 @@ const NewVersionTip = (props: NewVersionTipProps) => { } } + const AISummaryComponent = () => { + const { + data: aiSummaryData, + loading: aiSummaryLoading, + error: aiSummaryError, + run: runAiSummary + } = useRequest( + (version) => + request.get>( + `https://release.nc.152710.xyz/?version=${version}`, + { + timeout: 30000 + } + ), + { + manual: true + } + ) + + useEffect(() => { + runAiSummary(currentVersion) + }, [currentVersion, runAiSummary]) + + if (aiSummaryLoading) { + return ( +
+ +
+ ) + } + if (aiSummaryError) { + return
AI 摘要获取失败
+ } + return {aiSummaryData?.data.data} + } + return (