From 77b4bc9ad4b4d3ddb9a6e505bf1475cf2bdcb51d Mon Sep 17 00:00:00 2001 From: Smittix Date: Wed, 14 Jan 2026 20:37:43 +0000 Subject: [PATCH] Add save button to TSCM report - Add Save Report button next to Print button - Downloads report as HTML file with date-stamped filename - Style both buttons consistently with flex container Co-Authored-By: Claude Opus 4.5 --- templates/index.html | 37 ++++++++++++++++++++++++++++++------- 1 file changed, 30 insertions(+), 7 deletions(-) diff --git a/templates/index.html b/templates/index.html index e520c88..5ab4b4e 100644 --- a/templates/index.html +++ b/templates/index.html @@ -9224,10 +9224,15 @@ .recommendations li { margin-bottom: 8px; } - .print-btn { + .report-actions { position: fixed; top: 20px; right: 20px; + display: flex; + gap: 10px; + z-index: 1000; + } + .report-btn { padding: 12px 24px; background: #4a9eff; color: #000; @@ -9236,11 +9241,16 @@ font-weight: 600; cursor: pointer; font-size: 14px; - z-index: 1000; } - .print-btn:hover { + .report-btn:hover { background: #6bb3ff; } + .report-btn.save { + background: #22c55e; + } + .report-btn.save:hover { + background: #2ecc71; + } @media print { body { background: #fff; color: #000; padding: 20px; } .report-container { box-shadow: none; } @@ -9250,14 +9260,17 @@ .section-title { color: #1a1a2e; } th { background: #f0f0f0; color: #333; } td { border-color: #ddd; } - .print-btn { display: none; } + .report-actions { display: none; } .device-row.high_interest { background: rgba(255, 51, 51, 0.1); } .device-row.review { background: rgba(255, 204, 0, 0.1); } } - +
+ + +
@@ -9420,8 +9433,18 @@
- // Auto-focus print on load (optional) - // window.onload = () => window.print(); + function saveReport() { + const html = document.documentElement.outerHTML; + const blob = new Blob([html], { type: 'text/html' }); + const url = URL.createObjectURL(blob); + const a = document.createElement('a'); + a.href = url; + a.download = 'TSCM_Report_${startTime.toISOString().split('T')[0]}.html'; + document.body.appendChild(a); + a.click(); + document.body.removeChild(a); + URL.revokeObjectURL(url); + }