This commit is contained in:
parent
fa4545f8fe
commit
318dba9d27
|
|
@ -96,7 +96,6 @@ const BlogArticleWrapper = async ({ params }: { params: { slug: string, locale:
|
||||||
progress: "75%",
|
progress: "75%",
|
||||||
statusText: "运行中"
|
statusText: "运行中"
|
||||||
}}
|
}}
|
||||||
className="sticky top-0 z-50 bg-white"
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<div className='mb-40 md:mb-60 w-11/12 lg:w-2/3 xl:w-3/5 mx-auto'>
|
<div className='mb-40 md:mb-60 w-11/12 lg:w-2/3 xl:w-3/5 mx-auto'>
|
||||||
|
|
|
||||||
|
|
@ -115,8 +115,7 @@ export function DetailPageHeader({ data }: { data: any }) {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
setStatusText(source === "icon" ? "正在处理图标操作..." : "正在处理信息操作...");
|
setStatusText(source === "icon" ? "正在处理图标操作..." : "正在处理信息操作...");
|
||||||
try {
|
try {
|
||||||
// 模拟 API 请求
|
await fetch("/api/stub", {
|
||||||
const res = await fetch("/api/stub", {
|
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers: {
|
headers: {
|
||||||
"Content-Type": "application/json"
|
"Content-Type": "application/json"
|
||||||
|
|
@ -124,7 +123,6 @@ export function DetailPageHeader({ data }: { data: any }) {
|
||||||
body: JSON.stringify({ source })
|
body: JSON.stringify({ source })
|
||||||
});
|
});
|
||||||
|
|
||||||
// 假装等待响应
|
|
||||||
await new Promise((resolve) => setTimeout(resolve, 1000));
|
await new Promise((resolve) => setTimeout(resolve, 1000));
|
||||||
|
|
||||||
setStatusText(`操作成功:来自${source === "icon" ? "图标" : "信息区域"}`);
|
setStatusText(`操作成功:来自${source === "icon" ? "图标" : "信息区域"}`);
|
||||||
|
|
@ -136,45 +134,45 @@ export function DetailPageHeader({ data }: { data: any }) {
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="mb-40 md:mb-60 w-11/12 lg:w-2/3 xl:w-3/5 mx-auto">
|
<div className="fixed top-0 left-0 w-full z-50 bg-white shadow-md">
|
||||||
{/* 上方内容区域 */}
|
<div className="w-11/12 lg:w-2/3 xl:w-3/5 mx-auto py-4">
|
||||||
<div className="flex items-start space-x-6">
|
{/* 上方内容区域 */}
|
||||||
{/* 左侧图标区域 - 可点击 */}
|
<div className="flex items-start space-x-6">
|
||||||
<button
|
{/* 左侧图标区域 - 可点击 */}
|
||||||
className="flex items-center justify-center w-32 h-32 border rounded-md text-xl font-bold hover:bg-gray-100 transition"
|
<button
|
||||||
onClick={() => handleClick("icon")}
|
className="flex items-center justify-center w-24 h-24 md:w-32 md:h-32 border rounded-md text-xl font-bold hover:bg-gray-100 transition"
|
||||||
disabled={loading}
|
onClick={() => handleClick("icon")}
|
||||||
>
|
disabled={loading}
|
||||||
{data?.icon || "Deploy"}
|
>
|
||||||
</button>
|
{data?.icon || "Deploy"}
|
||||||
|
</button>
|
||||||
|
|
||||||
{/* 右侧信息区域 - 可点击 */}
|
{/* 右侧信息区域 - 可点击 */}
|
||||||
<div
|
<div
|
||||||
className="text-sm leading-7 space-y-1 cursor-pointer hover:bg-gray-50 p-2 rounded transition"
|
className="text-sm leading-7 space-y-1 cursor-pointer hover:bg-gray-50 p-2 rounded transition"
|
||||||
onClick={() => handleClick("info")}
|
onClick={() => handleClick("info")}
|
||||||
>
|
>
|
||||||
<p><strong>名称:</strong>{data?.name || "未命名组件"}</p>
|
<p><strong>名称:</strong>{data?.name || "未命名组件"}</p>
|
||||||
<p><strong>类别:</strong>{data?.category || "未知"}</p>
|
<p><strong>类别:</strong>{data?.category || "未知"}</p>
|
||||||
<p><strong>更新时间:</strong>{data?.updated_at || "未提供"}</p>
|
<p><strong>更新时间:</strong>{data?.updated_at || "未提供"}</p>
|
||||||
<p><strong>公司:</strong>{data?.company || "未知公司"}</p>
|
<p><strong>公司:</strong>{data?.company || "未知公司"}</p>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* 底部进度条或状态条 */}
|
{/* 底部进度条或状态条 */}
|
||||||
<div className="w-full bg-gray-200 rounded-full h-6 overflow-hidden">
|
<div className="w-full mt-4 bg-gray-200 rounded-full h-6 overflow-hidden">
|
||||||
<div
|
<div
|
||||||
className="bg-blue-500 h-full text-white text-center text-sm flex items-center justify-center transition-all duration-300"
|
className="bg-blue-500 h-full text-white text-center text-sm flex items-center justify-center transition-all duration-300"
|
||||||
style={{ width: data?.progress || "60%" }}
|
style={{ width: data?.progress || "60%" }}
|
||||||
>
|
>
|
||||||
{loading ? "操作中..." : statusText}
|
{loading ? "操作中..." : statusText}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// export function Header() {
|
// export function Header() {
|
||||||
|
|
||||||
// const router = useRouter();
|
// const router = useRouter();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue