Skip to content

feature: add display_num configuration for report generation - #8

Merged
WCY-dt merged 2 commits into
mainfrom
feature/dynamic_data_num
Sep 22, 2025
Merged

feature: add display_num configuration for report generation#8
WCY-dt merged 2 commits into
mainfrom
feature/dynamic_data_num

Conversation

@WCY-dt

@WCY-dt WCY-dt commented Sep 22, 2025

Copy link
Copy Markdown
Member

Description

  • add display_num configuration for report generation

Fixes #4

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation

@WCY-dt
WCY-dt requested a review from Copilot September 22, 2025 12:23
@WCY-dt WCY-dt added documentation Improvements or additions to documentation enhancement New feature or request labels Sep 22, 2025

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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_num configuration 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.

@WCY-dt
WCY-dt merged commit c10b045 into main Sep 22, 2025
1 check passed
@WCY-dt
WCY-dt deleted the feature/dynamic_data_num branch September 22, 2025 12:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

支持配置展示更多的数据

2 participants