Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

export & download #57

Merged
merged 2 commits into from
Jan 15, 2021
Merged

export & download #57

merged 2 commits into from
Jan 15, 2021

Conversation

mark-prins
Copy link
Contributor

fixes #56

Adds support to generate an excel spreadsheet for a specific panel, by providing the rawSQL used.
Allows a front-end client to download the spreadsheet

Copy link
Contributor

@josh-griffin josh-griffin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't installed a go environment yet on this laptop so I haven't given it a spin. However it's wicked and the code looks great so I am approving 😎

@@ -43,6 +45,8 @@ func (server *HttpServer) ResourceHandler(sqliteDatasource *dbstore.SQLiteDataso
mux.HandleFunc("/report-content/{id}", bugsnag.HandlerFunc(server.deleteReportContent)).Methods("DELETE")

mux.HandleFunc("/test-email", bugsnag.HandlerFunc(server.testEmail)).Queries("schedule-id", "{schedule-id}").Methods("GET")
mux.HandleFunc("/export-panel", bugsnag.HandlerFunc(server.exportPanel)).Methods("POST")
mux.PathPrefix("/download/").Handler(http.StripPrefix("/download/", http.FileServer(http.Dir("../data")))).Methods("GET")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so nice so easy 😄

So if I navigate to .../download/ I see a list of all the reports in data? Because we don't delete them and we just update them?

But, if I navigate to a specific report .../download/cool-report.xlsx it downloads?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it doesn't support the directory browsing, even though it feels like it should - just returns a 404
but that's good for me, as I only wanted to download specific excel files 😃

@mark-prins mark-prins merged commit b96ea5c into master Jan 15, 2021
@mark-prins mark-prins deleted the #56-export-to-excel branch January 15, 2021 01:12
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Export to excel
2 participants