feat(ui): add PDF export via browser print
Adds a PDF button to the report header. Clicking it opens /chart/current?print=true in a new tab, which auto-triggers window.print() so the user can save to PDF via the browser dialog. - chart submodule bumped: PrintMode support (no filter JS, auto-print, @media print CSS) - handlers.go: passes PrintMode=true when ?print=true query param is set - index.html: PDF button alongside Raw Data / Reanimator - app.js: printReport() helper; button shown/hidden with other exports Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Submodule internal/chart updated: 8105c7ec08...fddae50d64
@@ -84,7 +84,10 @@ func (s *Server) handleChartCurrent(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
html, err := chartviewer.RenderHTML(snapshotBytes, title)
|
||||
printMode := r.URL.Query().Get("print") == "true"
|
||||
html, err := chartviewer.RenderHTMLWithOptions(snapshotBytes, title, chartviewer.RenderOptions{
|
||||
PrintMode: printMode,
|
||||
})
|
||||
if err != nil {
|
||||
http.Error(w, "failed to render chart: "+err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user