-
Notifications
You must be signed in to change notification settings - Fork 426
feat(check_port): Conditionally render protocol status display #2964
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: develop
Are you sure you want to change the base?
feat(check_port): Conditionally render protocol status display #2964
Conversation
|
The plugin now intelligently adapts the UI based on the server's network environment. If a protocol (IPv4 or IPv6) is enabled in the configuration but is detected as unavailable on the server (i.e., a public IP cannot be retrieved), its status icon will now be automatically hidden. This prevents the UI from showing a persistent "unknown" status for an unusable protocol and provides a cleaner, more accurate interface without requiring manual configuration changes from the user. |
bf238d0 to
d3bfa54
Compare
The plugin now offers two ways to conditionally hide the status display for a specific IP protocol (IPv4 or IPv6), providing a cleaner and more adaptive interface. The first approach is manual hiding via configuration. Users can set `$useWebsiteIPv4` or `$useWebsiteIPv6` to `false` in `conf.php` to completely hide the corresponding protocol status from the UI. The second approach is automatic hiding for unavailable protocols. If a protocol is enabled but detected as unavailable on the server, its status is now automatically hidden to prevent showing a persistent "unknown" state.
d3bfa54 to
bf5ba81
Compare
|
I get the following error with IPV6 disabled: We need to refrain from printing an error log when this happens. Otherwise, everything works as intended. Great job @cantalupo555! |
The problem is in this line: I need to submit a commit/pull request to change the logic. I won't have time to implement it today, but the new requests(fix) will be ready tomorrow. The plugin appears simple to the end user, but its overhaul was essential to modernize it and ensure compatibility with the future of IPv6. |
|
Awesome thanks. I'll wait for a commit be added to this pull request. |
|
Hello, taking advantage of the post, for about 2 days the port status icon has been unknown, the problem is that the website :https://ports.yougetsignal.com/check-port.php is offline , how to change this in plugin to use other site and get real port status, check on other site like : https://portchecker.co/check-v0 |
Hello, we might add a fallback in a separate pull request. I'm willing to hold off releasing |
Refactors the port status component to use a modern Flexbox layout instead of the previous inline-block and dynamic margin approach. This change provides a more robust and maintainable method for handling vertical alignment and consistent spacing between elements using the `gap` property. As a result, the corresponding JavaScript was simplified by removing the now-unnecessary logic for manipulating margins, leading to cleaner and more declarative code.
|
New commit: 24f8ebf Another subtle change, during initial loading it now only displays 1 icon. |
@Ser4ph4 |
Previously, if both IP versions were enabled in the configuration, the plugin would render HTML elements for both, even if the system only had connectivity for one. The unused elements were then hidden with CSS, which caused a layout bug where the Flexbox gap property created unwanted spacing. This commit refactors init.js to build the UI completely dynamically on each update. The getPortStatus function now checks for the actual availability of each IP address at runtime before creating and appending its corresponding DOM elements (the .port-group). This ensures that only the necessary HTML is rendered, resulting in a cleaner DOM and definitively fixing the layout spacing issue regardless of the user's network connectivity.
8308cbf to
ef72bd0
Compare
This commit enhances the check_port plugin to more intelligently handle different network configurations and to prevent unnecessary error logging.
Improved IP detection for single-stack environments:
The plugin now suppresses error logs when an IP check fails due to the system lacking either IPv4 or IPv6 connectivity.
cURL error 7 ("Failed to connect to host") is ignored, as it is an expected outcome in these scenarios.
The "invalid IP" error is also suppressed when a service like ipify returns an IP of a different version than requested (e.g., an IPv4 on an IPv6 query), which is common in NAT64/DNS64 networks.
The yougetsignal service, the default for IPv4, has become unstable and is frequently offline. This caused the port check functionality to fail for users with the default configuration. This commit introduces a fallback mechanism to improve service reliability. Fallback Implementation: If the primary service (yougetsignal) fails an IPv4 check (returning an "unknown" status), the plugin will automatically try the check again using the portchecker service as an alternative. This is the first step towards a more robust implementation. Future improvements may include adding more service providers and implementing a similar fallback for the IP detection service (ipify.org).
|
New commit: ef72bd0 New commit: bcb97df New commit: 3eae101 |
|
@stickz Since I am working on a fork, it would be wise to avoid squashing commits. |









The plugin now offers two ways to conditionally hide the status display for a specific IP protocol (IPv4 or IPv6), providing a cleaner and more adaptive interface.
Manual Hiding via Configuration:
$useWebsiteIPv4or$useWebsiteIPv6tofalseinconf.phpto completely hide the corresponding protocol status from the UI.use_ipv4anduse_ipv6flags to the frontend to control visibility based on this setting.Automatic Hiding for Unavailable Protocols: