ed3cb91cd4
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
26 lines
638 B
TypeScript
26 lines
638 B
TypeScript
// server/services/report.ts
|
|
import type { ExecutionResult } from "@shared/types.js";
|
|
|
|
export function buildReportMarkdown(exec: ExecutionResult, machineName: string): string {
|
|
const lines = exec.importantLogLines.map((l) => ` ${l}`).join("\n");
|
|
return `# Rapport d'exécution — ${machineName}
|
|
|
|
- Exécution : ${exec.executionId}
|
|
- Action : ${exec.action}
|
|
- Statut : ${exec.status}
|
|
- Début : ${exec.startedAt}
|
|
- Fin : ${exec.finishedAt}
|
|
- Redémarrage requis : ${exec.rebootRequiredAfterRun ? "oui" : "non"}
|
|
|
|
## Lignes importantes
|
|
|
|
\`\`\`
|
|
${lines || " (aucune)"}
|
|
\`\`\`
|
|
|
|
## Log brut
|
|
|
|
Référence : \`${exec.rawLogRef}\`
|
|
`;
|
|
}
|