Files
system_update/server/services/report.ts
T
2026-06-05 04:05:23 +02:00

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}\`
`;
}