New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove the ablity to store the PDF reports into the filesystem #6487
Comments
Research - Download file directlyThe current approach to generating a PDF reports is as follows:
When I tried to change the approach to download the file directly, I found some problems. Generating the file as a bufferThe current version of the library used to generate the PDF reports is I found a recent version Saving the file in the frontend sideOnce I adapted the API endpoints that generate the PDF reports to return the file instead of a JSON response, I found a problem saving the response data in a file. I was trying an approach with the I tried multiples things but they doesn't work. I found that setting the I created a service that wraps the logic to save the file, using the API response from /**
* Export response data to file
*/
export const exportResponseToFile = async (response: IExportResponseToFile) => {
// Get the filename from the response headers
const [_, filename] =
response?.headers?.['content-disposition']?.match?.(/filename="([^"]+)"/) ||
[];
// Create blob
const blob = new Blob([response.data], {
type: response.headers['content-type'],
});
// Save file from frontend side
FileSaver.saveAs(blob, filename);
}; |
Changes
|
Changes
|
Changes
|
ResearchSome dashboards contain visualizations of type table. In the previous reporting, the data is sent from frontend side to the backend side through the With the change in the render of the dashboard, we can't use the same mechanism to get this data. I was researching this topic but I didn't get this works. |
I moved the issue to blocked until the work integration of the new method to render the dashboard is implemented. |
Changes
|
We will close this issue due to this feature needs to be discussed and moved to a major version because it is a breaking change. |
Description
As part of the issue that pretends to remove the stateful of the Wazuh dashboard plugins, we need to remove the ability to store the PDF reports files in the filesystem.
We want to move this feature to be managed in the same way that the Reporting plugin, but this could not be possible due to some PDF reports containing data of the Wazuh API.
An intermediate solution is keeping the reporting feature, but removing the feature to store the generated PDF reports to they are downloaded directly instead.
Tasks
Reporting
applicationThe text was updated successfully, but these errors were encountered: