diff --git a/web/src/components/dashboard/AnnouncementsPanel.jsx b/web/src/components/dashboard/AnnouncementsPanel.jsx index 89d5f335..e24f8da2 100644 --- a/web/src/components/dashboard/AnnouncementsPanel.jsx +++ b/web/src/components/dashboard/AnnouncementsPanel.jsx @@ -68,26 +68,29 @@ const AnnouncementsPanel = ({ > {announcementData.length > 0 ? ( - - {announcementData.map((item, idx) => ( - -
-
- {item.extra && ( + + {announcementData.map((item, idx) => { + const htmlExtra = item.extra ? marked.parse(item.extra) : ''; + return ( + - )} -
- - ))} + ) : null} + > +
+
+
+ + ); + })} ) : (
diff --git a/web/src/components/dashboard/index.jsx b/web/src/components/dashboard/index.jsx index 47731173..411c3c54 100644 --- a/web/src/components/dashboard/index.jsx +++ b/web/src/components/dashboard/index.jsx @@ -108,10 +108,18 @@ const Dashboard = () => { // ========== 数据准备 ========== const apiInfoData = statusState?.status?.api_info || []; - const announcementData = (statusState?.status?.announcements || []).map(item => ({ - ...item, - time: getRelativeTime(item.publishDate) - })); + const announcementData = (statusState?.status?.announcements || []).map(item => { + const pubDate = item?.publishDate ? new Date(item.publishDate) : null; + const absoluteTime = pubDate && !isNaN(pubDate.getTime()) + ? `${pubDate.getFullYear()}-${String(pubDate.getMonth() + 1).padStart(2, '0')}-${String(pubDate.getDate()).padStart(2, '0')} ${String(pubDate.getHours()).padStart(2, '0')}:${String(pubDate.getMinutes()).padStart(2, '0')}` + : (item?.publishDate || ''); + const relativeTime = getRelativeTime(item.publishDate); + return ({ + ...item, + time: absoluteTime, + relative: relativeTime + }); + }); const faqData = statusState?.status?.faq || []; const uptimeLegendData = Object.entries(UPTIME_STATUS_MAP).map(([status, info]) => ({ diff --git a/web/src/components/layout/NoticeModal.jsx b/web/src/components/layout/NoticeModal.jsx index a768f39d..e92aa0a3 100644 --- a/web/src/components/layout/NoticeModal.jsx +++ b/web/src/components/layout/NoticeModal.jsx @@ -41,14 +41,21 @@ const NoticeModal = ({ visible, onClose, isMobile, defaultTab = 'inApp', unreadK const getKeyForItem = (item) => `${item?.publishDate || ''}-${(item?.content || '').slice(0, 30)}`; const processedAnnouncements = useMemo(() => { - return (announcements || []).slice(0, 20).map(item => ({ - key: getKeyForItem(item), - type: item.type || 'default', - time: getRelativeTime(item.publishDate), - content: item.content, - extra: item.extra, - isUnread: unreadSet.has(getKeyForItem(item)) - })); + return (announcements || []).slice(0, 20).map(item => { + const pubDate = item?.publishDate ? new Date(item.publishDate) : null; + const absoluteTime = pubDate && !isNaN(pubDate.getTime()) + ? `${pubDate.getFullYear()}-${String(pubDate.getMonth() + 1).padStart(2, '0')}-${String(pubDate.getDate()).padStart(2, '0')} ${String(pubDate.getHours()).padStart(2, '0')}:${String(pubDate.getMinutes()).padStart(2, '0')}` + : (item?.publishDate || ''); + return ({ + key: getKeyForItem(item), + type: item.type || 'default', + time: absoluteTime, + content: item.content, + extra: item.extra, + relative: getRelativeTime(item.publishDate), + isUnread: unreadSet.has(getKeyForItem(item)) + }); + }); }, [announcements, unreadSet]); const handleCloseTodayNotice = () => { @@ -131,7 +138,7 @@ const NoticeModal = ({ visible, onClose, isMobile, defaultTab = 'inApp', unreadK return (
- + {processedAnnouncements.map((item, idx) => { const htmlContent = marked.parse(item.content || ''); const htmlExtra = item.extra ? marked.parse(item.extra) : ''; @@ -139,7 +146,13 @@ const NoticeModal = ({ visible, onClose, isMobile, defaultTab = 'inApp', unreadK + ) : null} className={item.isUnread ? '' : ''} >
@@ -147,12 +160,6 @@ const NoticeModal = ({ visible, onClose, isMobile, defaultTab = 'inApp', unreadK className={item.isUnread ? 'shine-text' : ''} dangerouslySetInnerHTML={{ __html: htmlContent }} /> - {item.extra && ( -
- )}
); @@ -177,8 +184,7 @@ const NoticeModal = ({ visible, onClose, isMobile, defaultTab = 'inApp', unreadK {t('通知')}} itemKey='inApp' /> {t('系统公告')}} itemKey='system' /> diff --git a/web/src/components/table/model-pricing/layout/PricingSidebar.jsx b/web/src/components/table/model-pricing/layout/PricingSidebar.jsx index ed96e7fc..074ee181 100644 --- a/web/src/components/table/model-pricing/layout/PricingSidebar.jsx +++ b/web/src/components/table/model-pricing/layout/PricingSidebar.jsx @@ -92,7 +92,7 @@ const PricingSidebar = ({ }); return ( -
+
{t('筛选')} diff --git a/web/src/components/table/model-pricing/view/card/PricingCardSkeleton.jsx b/web/src/components/table/model-pricing/view/card/PricingCardSkeleton.jsx index 42944378..6da5be49 100644 --- a/web/src/components/table/model-pricing/view/card/PricingCardSkeleton.jsx +++ b/web/src/components/table/model-pricing/view/card/PricingCardSkeleton.jsx @@ -26,7 +26,7 @@ const PricingCardSkeleton = ({ showRatio = false }) => { const placeholder = ( -
+
{Array.from({ length: skeletonCount }).map((_, index) => ( +
{paginatedModels.map((model, index) => { const modelKey = getModelKey(model); diff --git a/web/src/index.css b/web/src/index.css index fff2f1d1..6cf3d838 100644 --- a/web/src/index.css +++ b/web/src/index.css @@ -754,7 +754,7 @@ html.dark .with-pastel-balls::before { } .pricing-search-header { - padding: 1rem; + padding: 0.5rem; background-color: var(--semi-color-bg-0); flex-shrink: 0; position: sticky;