feat: add HTML audit report export - #3
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Description
generate_html_report(audit: dict) -> strdansbackend/app/reports/html_report.pyavec helpers sûrs (safe_get,esc,render_table,severity_badge,progress_bar,section) et style/CSS intégrés au HTML pour un rendu offline premium.backend/app/main.pypour exécuter la génération HTML après PDF/Excel/JSON, stocker le nom dansaudit["html_filename"], ajouter les erreurs"HTML: ..."et exposerhtml_filename/html_urldans les réponses d’audit.GET /api/reports/{audit_id}/htmlqui renvoie unFileResponse(media_type="text/html")et qui tente de régénérer le HTML à la demande si le fichier est manquant, puis met à jour le stockage.html_filenameet implémentation de_ensure_audit_html_column()(ALTER TABLE si nécessaire) dansbackend/app/database.py, et sauvegarde du champ viabackend/app/services/storage.py.backend/app/static/index.htmletbackend/app/static/app.jspour ajouter le bouton « HTML » et les champshtml_filename,html_exists,html_urldans l’API de listing.Testing
python -m py_compile backend/app/main.py backend/app/database.py backend/app/services/storage.py backend/app/reports/html_report.pya été exécuté avec succès pour valider la syntaxe Python des fichiers modifiés.open_easm_beta_<domaine>_<YYYYMMDD_HHMMSS>.html) et assertions automatiques, et ces tests ont réussi.node --check backend/app/static/app.jsa réussi.app.mainpour lister les routes) n’a pas pu être exécutée dans cet environnement d’intégration car la dépendancefastapin’est pas installée ici, ce qui empêche d’effectuer un test d’exécution complet des routes dans le conteneur de validation.Codex Task