feature: add display_num configuration for report generation - #8
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds a configurable display_num parameter that allows users to control how many service status entries are displayed in the HTML report. The feature replaces hardcoded values with dynamic configuration.
Key changes:
- Added
display_numconfiguration field with proper default handling - Updated report generation functions to accept and use the configurable display number
- Moved responsive CSS from static file to template with dynamic breakpoints
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| internal/types/structures/configure/configure.go | Added DisplayNum field to configuration structure |
| internal/types/types/default_config/default_config.go | Added SetDefaultDisplayNum function for default value handling |
| internal/configure/config.go | Integrated display_num into default configuration setup |
| internal/types/structures/reporter/utils.go | Updated functions to accept displayNum parameter instead of using hardcoded values |
| internal/reporter/report.go | Modified GetReport and WriteReport to accept and use displayNum parameter |
| cmd/ponghub/main.go | Updated function calls to pass cfg.DisplayNum |
| cmd/ponghub/main_test.go | Updated test function calls to pass cfg.DisplayNum |
| templates/report.html | Added inline CSS with dynamic DisplayNum values for responsive design |
| static/style.css | Removed hardcoded CSS values that are now dynamically generated |
| README.md | Added documentation for the new display_num configuration option |
| README_CN.md | Added Chinese documentation for the new display_num configuration option |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #4
Type of change
Please delete options that are not relevant.
Checklist