Ref: https://github.com/openobserve/o2_report_server/issues/10.
This PR adds ".pdf" extension to the report pdf attached to smtp email
message.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
- **New Features**
- Enhanced email attachment functionality by ensuring PDF files are
correctly named with a `.pdf` extension for better recognition by email
clients.
- Improved email body structure by adding the report message before the
dashboard link.
- **Bug Fixes**
- Improved error handling and logging for the email sending process,
providing clearer messages and more context during execution.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
- After calling `browser.close()`, `browser.wait()` needs to be called
to avoid various zombie processes and close the browser properly.
- In triggers usage report, this uses `cached_report` as module type for
destination-less reports.
- For list reports api, filter reports based on dashboard id.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
- **New Features**
- Introduced a new `CachedReport` variant to enhance report handling
capabilities.
- **Improvements**
- Enhanced error handling and control flow in report generation to
ensure browser operations complete before closure.
- Improved logic for differentiating between cached and standard report
triggers based on destination presence.
These updates aim to increase the reliability and functionality of
report generation within the application.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Destination less report for caching purpose.
- [x] Empty destination array is supported for caching purpose. If
destinations array is empty it only spawns a chromium and loads the
dashboard, does not capture pdf.
- [x] For Cache type reports, it uses ui search type so that the
dashboard queries land on only the interactive node and not in the
background node.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
- **New Features**
- Introduced a new filtering system for reports, allowing users to
specify criteria such as dashboard and folder.
- Added support for two report types: PDF and Cache, enhancing report
generation options.
- Enhanced report generation functionality to include dynamic handling
based on report type and recipient count.
- **Bug Fixes**
- Improved error handling and logging for report generation processes.
- **Documentation**
- Updated documentation to reflect new parameters and functionalities in
report handling.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
- **New Features**
- Enhanced report URLs with a `searchtype=reports` parameter for better
categorization and filtering of reports.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
The new endpoint `/config/reload` will refresh the
environment variables.
There are a bunch of env-vars which will not be reloaded
for e.g. HTTP_PORT etc. these will need a restart.
---------
Co-authored-by: Hengfei Yang <hengfei.yang@gmail.com>