Skip to content

Commit

Permalink
feat: update HTML report to use Bootstrap 5 and enhance navigation wi…
Browse files Browse the repository at this point in the history
…th app name
  • Loading branch information
Kremilly committed Dec 11, 2024
1 parent a8b451d commit 912960a
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/plugins/reports_xss.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use std::{

use crate::{
utils::file::FileUtils,
constants::global::Global,
ui::report_alerts::ReportAlerts,
handlers::reports_handlers::ReportsHandlers,
};
Expand Down Expand Up @@ -83,9 +84,17 @@ impl ReportsXSS {

pub fn html(&self, detections: Vec<(String, usize, String, String)>, output_path: &str) -> Result<(), Box<dyn Error>> {
let mut file = File::create(output_path)?;
file.write_all(b"<html><head><title>XSS Reports</title><link href='https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css' rel='stylesheet'></head>")?;
file.write_all(b"<html><head><title>XSS Reports</title><link href='https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css' rel='stylesheet'></head>")?;
file.write_all(b"<body>")?;
file.write_all(b"<div class='container-fluid gap-3'><table class='table table-striped table-bordered table-hover'>")?;

file.write_all(format!(
"<nav class='navbar navbar-dark navbar-expand-lg bg-dark'><div class='container-fluid'>
<a class='navbar-brand' href='#'>{}: XSS Scan Results</a></div>
</nav>",
Global::APP_NAME
).as_bytes())?;

file.write_all(b"<div class='container-fluid pt-3'><table class='table table-striped table-bordered table-hover table-dark'>")?;
file.write_all(b"<tr><th>Table</th><th>Row Index</th><th>Column</th><th>Value</th></tr>")?;

for (table, row_index, column, value) in detections {
Expand Down

0 comments on commit 912960a

Please sign in to comment.