mirror of
https://github.com/smittix/intercept.git
synced 2026-07-29 02:58:11 -07:00
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 <noreply@anthropic.com>
This commit is contained in:
+30
-7
@@ -9224,10 +9224,15 @@
|
|||||||
.recommendations li {
|
.recommendations li {
|
||||||
margin-bottom: 8px;
|
margin-bottom: 8px;
|
||||||
}
|
}
|
||||||
.print-btn {
|
.report-actions {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top: 20px;
|
top: 20px;
|
||||||
right: 20px;
|
right: 20px;
|
||||||
|
display: flex;
|
||||||
|
gap: 10px;
|
||||||
|
z-index: 1000;
|
||||||
|
}
|
||||||
|
.report-btn {
|
||||||
padding: 12px 24px;
|
padding: 12px 24px;
|
||||||
background: #4a9eff;
|
background: #4a9eff;
|
||||||
color: #000;
|
color: #000;
|
||||||
@@ -9236,11 +9241,16 @@
|
|||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
z-index: 1000;
|
|
||||||
}
|
}
|
||||||
.print-btn:hover {
|
.report-btn:hover {
|
||||||
background: #6bb3ff;
|
background: #6bb3ff;
|
||||||
}
|
}
|
||||||
|
.report-btn.save {
|
||||||
|
background: #22c55e;
|
||||||
|
}
|
||||||
|
.report-btn.save:hover {
|
||||||
|
background: #2ecc71;
|
||||||
|
}
|
||||||
@media print {
|
@media print {
|
||||||
body { background: #fff; color: #000; padding: 20px; }
|
body { background: #fff; color: #000; padding: 20px; }
|
||||||
.report-container { box-shadow: none; }
|
.report-container { box-shadow: none; }
|
||||||
@@ -9250,14 +9260,17 @@
|
|||||||
.section-title { color: #1a1a2e; }
|
.section-title { color: #1a1a2e; }
|
||||||
th { background: #f0f0f0; color: #333; }
|
th { background: #f0f0f0; color: #333; }
|
||||||
td { border-color: #ddd; }
|
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.high_interest { background: rgba(255, 51, 51, 0.1); }
|
||||||
.device-row.review { background: rgba(255, 204, 0, 0.1); }
|
.device-row.review { background: rgba(255, 204, 0, 0.1); }
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<button class="print-btn" onclick="window.print()">🖨️ Print Report</button>
|
<div class="report-actions">
|
||||||
|
<button class="report-btn save" onclick="saveReport()">💾 Save Report</button>
|
||||||
|
<button class="report-btn" onclick="window.print()">🖨️ Print Report</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="report-container">
|
<div class="report-container">
|
||||||
<div class="report-header">
|
<div class="report-header">
|
||||||
@@ -9420,8 +9433,18 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<scr` + `ipt>
|
<scr` + `ipt>
|
||||||
// Auto-focus print on load (optional)
|
function saveReport() {
|
||||||
// window.onload = () => window.print();
|
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);
|
||||||
|
}
|
||||||
</scr` + `ipt>
|
</scr` + `ipt>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
Reference in New Issue
Block a user