feat(web): version info

This commit is contained in:
zhaoying
2026-04-02 10:37:02 +08:00
parent 767f9ab17c
commit 57eb5aa967

View File

@@ -3,8 +3,8 @@
* @Version: 0.0.1 * @Version: 0.0.1
* @Author: yujiangping * @Author: yujiangping
* @Date: 2026-01-12 16:34:59 * @Date: 2026-01-12 16:34:59
* @LastEditors: yujiangping * @LastEditors: ZhaoYing
* @LastEditTime: 2026-01-23 19:07:36 * @LastEditTime: 2026-04-02 10:36:37
*/ */
import React, { useEffect, useState, useMemo } from 'react'; import React, { useEffect, useState, useMemo } from 'react';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
@@ -13,6 +13,7 @@ import { Flex } from 'antd';
import { getVersion, type versionResponse } from '@/api/common' import { getVersion, type versionResponse } from '@/api/common'
import Empty from '@/components/Empty'; import Empty from '@/components/Empty';
import { useI18n } from '@/store/locale'; import { useI18n } from '@/store/locale';
import { formatDateTime } from '@/utils/format'
const VersionCard: React.FC = () => { const VersionCard: React.FC = () => {
const { t } = useTranslation(); const { t } = useTranslation();
@@ -51,18 +52,18 @@ const VersionCard: React.FC = () => {
{introduction {introduction
? (<> ? (<>
<div className="rb:text-[#5B6167] rb:text-[12px] rb:leading-4.5 rb:mt-1 rb:mb-2"> <div className="rb:text-[#5B6167] rb:text-[12px] rb:leading-4.5 rb:mt-1 rb:mb-2">
{t('version.releaseDate')}: {introduction.releaseDate} | {t('version.name')}: {introduction.codeName} {t('version.releaseDate')}: {formatDateTime(introduction.releaseDate, 'YYYY-MM-DD')} | {t('version.name')}: {introduction.codeName}
</div> </div>
<div className="rb:max-h-76 rb:overflow-y-auto"> <div className="rb:max-h-76 rb:overflow-y-auto">
<p <p
className='rb:text-[12px] rb:leading-4.5' className='rb:text-[12px] rb:leading-4.5'
dangerouslySetInnerHTML={{ __html: introduction.upgradePosition }} dangerouslySetInnerHTML={{ __html: introduction.upgradePosition?.replace(/\n/g, '<br>') }}
/> />
{introduction.coreUpgrades?.map((item: string, index: number) => ( {introduction.coreUpgrades?.map((item: string, index: number) => (
<p <p
key={index} key={index}
className='rb:text-[12px] rb:leading-4.5 rb:mt-2' className='rb:text-[12px] rb:leading-4.5 rb:mt-2'
dangerouslySetInnerHTML={{ __html: item }} dangerouslySetInnerHTML={{ __html: item?.replace(/\n/g, '<br>') }}
/> />
))} ))}
</div> </div>