This commit is contained in:
parent
e3d6edbb84
commit
a3767c42a5
|
|
@ -11,7 +11,7 @@ import React from "react";
|
||||||
import { FadeIn, FadeInStagger } from "../landing/fade-in";
|
import { FadeIn, FadeInStagger } from "../landing/fade-in";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { truncateString } from "@/lib/utils";
|
import { truncateString } from "@/lib/utils";
|
||||||
|
import { CloudDownload } from 'lucide-react';
|
||||||
interface CardProps {
|
interface CardProps {
|
||||||
image: string;
|
image: string;
|
||||||
title: string;
|
title: string;
|
||||||
|
|
@ -98,21 +98,31 @@ export const Card: React.FC<ArticleData> = (articleData) => {
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{/* 🔥 只有当 model_parameter 没有值时显示叹号 */}
|
{/* 🔥 只有当 model_parameter 没有值时显示叹号 */}
|
||||||
{(!articleData.model_parameter) && (
|
{/* {(!articleData.model_parameter) && (
|
||||||
<div style={{
|
<div style={{
|
||||||
position: 'absolute',
|
position: 'absolute',
|
||||||
bottom: '8px',
|
bottom: '8px',
|
||||||
right: '8px',
|
right: '8px',
|
||||||
color: 'red', // 只保留文字颜色为红色
|
color: 'red',
|
||||||
fontWeight: 'bold',
|
fontWeight: 'bold',
|
||||||
fontSize: '24px', // 字体稍微大一点,更容易看到
|
fontSize: '24px',
|
||||||
zIndex: 2,
|
zIndex: 2,
|
||||||
}}>
|
}}>
|
||||||
!
|
!
|
||||||
</div>
|
</div>
|
||||||
|
)} */}
|
||||||
|
{(!articleData.model_parameter) && (
|
||||||
|
<div style={{
|
||||||
|
position: 'absolute',
|
||||||
|
bottom: '8px',
|
||||||
|
right: '8px',
|
||||||
|
color: 'red',
|
||||||
|
zIndex: 2,
|
||||||
|
}}>
|
||||||
|
<CloudDownload size={24} strokeWidth={2.5} />
|
||||||
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</figure>
|
</figure>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -170,6 +170,8 @@ export function DetailPageHeader({ data }: { data: any }) {
|
||||||
|
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
|
const hasNonEmptyExtraData = data?.extra_data && typeof data.extra_data === 'object' && !Array.isArray(data.extra_data) && Object.keys(data.extra_data).length > 0;
|
||||||
|
|
||||||
const initWebSocket = async (userName: string, id: number) => {
|
const initWebSocket = async (userName: string, id: number) => {
|
||||||
if (socketRef.current) socketRef.current.close();
|
if (socketRef.current) socketRef.current.close();
|
||||||
|
|
||||||
|
|
@ -486,11 +488,11 @@ export function DetailPageHeader({ data }: { data: any }) {
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="flex items-center gap-[5px] self-end">
|
<div className="flex items-center gap-[5px] self-end">
|
||||||
{data?.extra_data && typeof data.extra_data === 'object' && Object.keys(data.extra_data).length > 0 && (
|
{hasNonEmptyExtraData && (
|
||||||
<button
|
<button
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
console.log("🟢 点击了更新按钮,extra_data = ", data.extra_data);
|
console.log("🟢 点击了更新按钮,extra_data = ", data.extra_data);
|
||||||
// TODO: future update logic here
|
// TODO: 后续处理逻辑写在这里
|
||||||
}}
|
}}
|
||||||
className="hover:text-gray-700 transition self-end text-sm border border-gray-300 rounded px-2 py-1 bg-white"
|
className="hover:text-gray-700 transition self-end text-sm border border-gray-300 rounded px-2 py-1 bg-white"
|
||||||
title="更新"
|
title="更新"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue