fix(ui): remove loading headline and use 60-120s estimate
This commit is contained in:
parent
28847b5705
commit
6835078cf5
@ -24,14 +24,6 @@ const PROVIDER_MODEL_LABEL: Record<string, string> = {
|
||||
gemini: "Gemini 图片",
|
||||
};
|
||||
|
||||
const PHASE_TITLE: Record<NonNullable<ImageGenerationLoadingProps["phase"]>, string> = {
|
||||
idle: "准备中",
|
||||
queued: "排队中",
|
||||
processing: "生成中",
|
||||
finalizing: "加载结果",
|
||||
failed: "生成失败",
|
||||
};
|
||||
|
||||
const PHASE_HINT: Record<NonNullable<ImageGenerationLoadingProps["phase"]>, string> = {
|
||||
idle: "任务已创建,正在初始化生成参数。",
|
||||
queued: "任务已进入队列,请稍候。",
|
||||
@ -52,10 +44,9 @@ export const ImageGenerationLoading = memo(
|
||||
const count = Math.min(Math.max(imageCount, 1), maxImages);
|
||||
const resolvedModelName =
|
||||
modelName?.trim() || PROVIDER_MODEL_LABEL[providerType || ""] || "AI 图片模型";
|
||||
const estimateSeconds = Math.max(45, Math.min(180, count * 60));
|
||||
const estimateMinutes = Math.max(1, Math.ceil(estimateSeconds / 60));
|
||||
const estimateRangeLabel = "60~120秒";
|
||||
const elapsedLabel =
|
||||
elapsedSeconds > 0 ? `已等待 ${elapsedSeconds}s` : `预计 ${estimateSeconds}s`;
|
||||
elapsedSeconds > 0 ? `已等待 ${elapsedSeconds}s` : `预计 ${estimateRangeLabel}`;
|
||||
const isFailed = phase === "failed";
|
||||
|
||||
return (
|
||||
@ -71,7 +62,7 @@ export const ImageGenerationLoading = memo(
|
||||
</div>
|
||||
|
||||
<div className="text-[15px] leading-7 text-[#3a4352]">
|
||||
现在开始生成设计图,使用 {resolvedModelName} 模型,预计需要 {estimateMinutes} 分钟。
|
||||
现在开始生成设计图,使用 {resolvedModelName} 模型,预计需要 {estimateRangeLabel}。
|
||||
</div>
|
||||
|
||||
<div className="flex items-center gap-2 text-[#a8b1bf]">
|
||||
@ -79,8 +70,6 @@ export const ImageGenerationLoading = memo(
|
||||
<span className="text-[14px]">{resolvedModelName}</span>
|
||||
</div>
|
||||
|
||||
<div className="text-[34px] font-semibold leading-none text-[#37404d]">{PHASE_TITLE[phase]}</div>
|
||||
|
||||
<div
|
||||
className={cn(
|
||||
"relative overflow-hidden rounded-[22px] border border-[#e1e4ea] bg-[#eaedf2]",
|
||||
@ -111,12 +100,12 @@ export const ImageGenerationLoading = memo(
|
||||
|
||||
<div className="flex items-center gap-2 pt-1 text-[16px] text-[#8c95a3]">
|
||||
<Grid2x2 className="h-5 w-5" />
|
||||
<span className="font-medium">{isFailed ? "生成失败" : "设计图生成中"}</span>
|
||||
<span className="font-medium">{isFailed ? "生成失败" : "设计图处理中"}</span>
|
||||
</div>
|
||||
|
||||
<div className="space-y-0.5 text-[#a0a8b6]">
|
||||
<div className="text-[15px] font-medium">
|
||||
使用 {resolvedModelName} 生成图片,预计 {estimateSeconds}
|
||||
使用 {resolvedModelName} 生成图片,预计 {estimateRangeLabel}
|
||||
</div>
|
||||
{(phase !== "processing" || elapsedSeconds > 0) && (
|
||||
<div className="text-[13px]">
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user