-
Notifications
You must be signed in to change notification settings - Fork 0
Add GUI interface with progress bar and Patch My PC branding #2
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
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: JordanTheITGuy <32438363+JordanTheITGuy@users.noreply.github.com>
Co-authored-by: JordanTheITGuy <32438363+JordanTheITGuy@users.noreply.github.com>
|
Add a dark mode to the ui. Also make the default be with gui, and the no gui launch start with /nogui instead. Also it mentions that it launches using local host 8080 that seems like the outcome would be a launching a web browser. Does it launch a web browser or just an app inside the frame? |
JordanTheITGuy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a dark mode to the ui.
Also make the default be with gui, and the no gui launch start with /nogui instead.
Also it mentions that it launches using local host 8080 that seems like the outcome would be a launching a web browser. Does it launch a web browser or just an app inside the frame?
There was a problem hiding this comment.
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 modern web-based GUI interface to the Patch My PC Network Tester while maintaining full backward compatibility with the existing CLI functionality. The application now supports both CLI mode (default) and GUI mode (using -gui flag), providing a real-time web interface with progress tracking and Patch My PC branding.
- Adds dual-mode support with CLI as default and GUI accessible via
-guiflag - Implements WebSocket-based real-time communication for live progress updates and test results
- Introduces web-based GUI with Patch My PC branding, progress bars, and responsive design
Reviewed Changes
Copilot reviewed 4 out of 7 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| main.go | Adds command-line flag parsing to support GUI mode selection |
| gui.go | Implements complete web GUI functionality with WebSocket communication and HTML interface |
| go.mod | Adds gorilla/websocket dependency for real-time GUI updates |
| readme.md | Updates documentation with usage instructions for both CLI and GUI modes |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| upgrader: websocket.Upgrader{ | ||
| CheckOrigin: func(r *http.Request) bool { | ||
| return true // Allow connections from any origin | ||
| }, | ||
| }, |
Copilot
AI
Sep 24, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The WebSocket upgrader allows connections from any origin, which poses a security risk. Since this is a local application, restrict the CheckOrigin function to only allow localhost connections by checking if the request origin is from localhost or 127.0.0.1.
| func (w *WebGUI) connectionTestWeb(connection connectionInfo, wg *sync.WaitGroup) connectionResult { | ||
| defer wg.Done() | ||
|
|
||
| // Duplicate the connectionTest logic to avoid WaitGroup conflicts |
Copilot
AI
Sep 24, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment indicates this is duplicated logic from an existing connectionTest function. Consider refactoring the original connectionTest function to accept a callback parameter or extract the common logic into a shared helper function to avoid code duplication.
| for _, record := range records { | ||
| if len(record) > 5 && shouldConnect(record[2]) { | ||
| totalConnections++ | ||
| } | ||
| } |
Copilot
AI
Sep 24, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The magic number 5 is used to check record length without explanation. Consider defining a constant like const MinRecordFields = 5 to make the code more readable and maintainable.
|
|
||
| current := 0 | ||
| for _, record := range records { | ||
| if len(record) > 5 { |
Copilot
AI
Sep 24, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same magic number 5 is repeated here. This should use the same constant suggested in the previous comment to maintain consistency.
This PR adds a modern web-based GUI interface to the Patch My PC Network Tester while maintaining full backward compatibility with the existing CLI functionality.
New Features
Dual Mode Support
The application now supports both CLI and GUI modes:
PMPC-NetworkTester.exe(original functionality preserved)PMPC-NetworkTester.exe -gui(launches web interface at http://localhost:8080)GUI Interface Features
Windows Compatibility
The GUI meets all specified requirements:
github.com/gorilla/websocketfor real-time updatesTechnical Implementation
The GUI is implemented using Go's standard HTTP server with HTML/CSS/JavaScript frontend and WebSocket communication for real-time updates. This approach was chosen over native GUI frameworks to ensure:
Screenshots
Initial GUI Interface:

GUI During Testing:

GUI With Results:

Updated Documentation
The README has been updated with:
Backward Compatibility
All existing CLI functionality remains unchanged. The application defaults to CLI mode when run without the
-guiflag, ensuring no breaking changes for existing users or automation scripts.Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
patchmypc.com./PMPC-NetworkTester.exe(dns block)./PMPC-NetworkTester(dns block)./PMPC-NetworkTester -gui(dns block)If you need me to access, download, or install something from one of these locations, you can either:
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.