Show reproducible job diagnostics
This commit is contained in:
@@ -41,9 +41,15 @@ type Job = {
|
||||
type: string;
|
||||
status: string;
|
||||
description: string;
|
||||
command?: string[];
|
||||
cwd?: string;
|
||||
pid?: number | null;
|
||||
exit_code?: number | null;
|
||||
error?: string | null;
|
||||
created_at: string;
|
||||
started_at?: string;
|
||||
finished_at?: string;
|
||||
log_path?: string;
|
||||
log_tail?: string;
|
||||
log_size?: number;
|
||||
params: Record<string, unknown>;
|
||||
@@ -1298,6 +1304,7 @@ function App() {
|
||||
</button>
|
||||
</div>
|
||||
{selectedJob && <JobProgressBar progress={selectedJob.progress} />}
|
||||
{selectedJob && <JobDiagnostics job={selectedJob} />}
|
||||
<pre>{log || "No log selected."}</pre>
|
||||
</div>
|
||||
|
||||
@@ -1326,6 +1333,37 @@ function App() {
|
||||
);
|
||||
}
|
||||
|
||||
function JobDiagnostics({ job }: { job: Job }) {
|
||||
const command = job.command?.join(" ") ?? "";
|
||||
return (
|
||||
<div className="jobDiagnostics">
|
||||
<div className="jobDetailGrid">
|
||||
<div><span>ID</span><strong>{job.id.slice(0, 12)}</strong></div>
|
||||
<div><span>PID</span><strong>{job.pid ?? "-"}</strong></div>
|
||||
<div><span>Exit</span><strong>{job.exit_code ?? "-"}</strong></div>
|
||||
<div><span>Log</span><strong>{formatBytes(job.log_size)}</strong></div>
|
||||
</div>
|
||||
{job.cwd && (
|
||||
<div className="jobPath">
|
||||
<span>CWD</span>
|
||||
<code>{job.cwd}</code>
|
||||
</div>
|
||||
)}
|
||||
{!!job.error && <div className="jobError">{job.error}</div>}
|
||||
{!!command && (
|
||||
<details className="jobDetailBlock" open>
|
||||
<summary>Command</summary>
|
||||
<pre>{command}</pre>
|
||||
</details>
|
||||
)}
|
||||
<details className="jobDetailBlock">
|
||||
<summary>Params</summary>
|
||||
<pre>{JSON.stringify(job.params ?? {}, null, 2)}</pre>
|
||||
</details>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function AgentCheckList({ checks, limit }: { checks: AgentCheck[]; limit: number }) {
|
||||
if (!checks.length) {
|
||||
return <p className="muted">尚未运行验证。</p>;
|
||||
|
||||
Reference in New Issue
Block a user