fix: 调试发布run

This commit is contained in:
npc0-hue
2026-07-22 11:44:48 +08:00
parent b06623d0ce
commit 6c3eb6e45f
41 changed files with 1289 additions and 206 deletions
@@ -45,6 +45,7 @@ export interface RuntimeTaskDialogAction {
label: string;
onClick: () => void;
disabled?: boolean;
title?: string;
kind?: "primary" | "default" | "danger";
}
@@ -56,6 +57,13 @@ export const runtimeBuildStages: RuntimeTaskStage[] = [
{ key: "package_finalize", label: "打包成功", description: "注入配置、校验 checksum、生成 artifact。" }
];
export const runtimeRunBuildStages: RuntimeTaskStage[] = [
{ key: "git_sync", label: "拉取 run 更新", description: "同步平台批准的 run 源码或发布版本。" },
{ key: "env_check", label: "检测构建环境", description: "检查 Go 工具链、目标平台和隔离构建目录。" },
{ key: "build_compile", label: "构建中", description: "编译所选平台和架构的 run 二进制。" },
{ key: "package_finalize", label: "构建完成", description: "校验 checksum、生成 artifact,并登记可下载产物。" }
];
export const runtimeDownloadStages: RuntimeTaskStage[] = [
{ key: "scope_check", label: "权限校验", description: "确认当前服务器范围和 artifact 授权。" },
{ key: "artifact_lookup", label: "定位产物", description: "读取最新可下载 run 包引用。" },
@@ -319,6 +327,8 @@ export function RuntimeTaskProgressDialog({ task, onClose, actions = [] }: Runti
}
const activeStage = task.stages.find((stage) => stage.key === task.currentStageKey) ?? task.stages[0];
const activeStageIndex = Math.max(0, task.stages.findIndex((stage) => stage.key === activeStage?.key));
const activeStepLabel = task.stages.length > 0 ? `${activeStageIndex + 1}/${task.stages.length}` : "无阶段";
const statusLabel = runtimeTaskStatusLabel(task.status);
const closeLabel = task.status === "running" ? "后台运行" : "关闭";
@@ -338,6 +348,12 @@ export function RuntimeTaskProgressDialog({ task, onClose, actions = [] }: Runti
</span>
</div>
<div className="runtime-task-progress-summary" aria-label="进度展示">
<span></span>
<strong>{activeStage ? `${activeStepLabel} · ${activeStage.label}` : statusLabel}</strong>
<small>{task.status === "running" ? "平台正在执行当前阶段,完成后会自动推进下一步。" : task.status === "succeeded" ? "所有阶段已完成,可下载产物或继续后续操作。" : "任务已停止,请查看失败原因和运行日志。"}</small>
</div>
<div className="runtime-task-meter" aria-label={`${task.title} 进度 ${Math.round(task.percent)}%`}>
<div className="runtime-task-meter-row">
<span>{activeStage?.label ?? statusLabel}</span>
@@ -401,6 +417,7 @@ export function RuntimeTaskProgressDialog({ task, onClose, actions = [] }: Runti
type="button"
className={cx(action.kind === "primary" && "confirm-primary", action.kind === "danger" && "confirm-danger")}
disabled={action.disabled || task.status === "running"}
title={action.title ?? action.label}
onClick={action.onClick}
>
{action.label.includes("下载") ? <Download size={14} /> : <PackageCheck size={14} />}