Skip to content

Plugins: style layout fix#2095

Merged
limetech merged 4 commits into
unraid:masterfrom
bergware:master
Mar 27, 2025
Merged

Plugins: style layout fix#2095
limetech merged 4 commits into
unraid:masterfrom
bergware:master

Conversation

@bergware

@bergware bergware commented Mar 26, 2025

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features

    • Introduced a dropdown for selecting the regulatory region in WiFi settings, enhancing user configuration options.
    • Added a new file containing country codes and names for better country identification.
  • Style

    • Adjusted layout spacing for improved visual alignment within the plugin manager interface, enhancing the positioning of status indicators and table elements.
    • Updated CSS rules in both black and white themes to refine element margins for better presentation.
    • Added new CSS rules for styling Wi-Fi settings elements, improving the overall UI.
  • Bug Fixes

    • Enhanced conditional logic for wireless configuration, improving flexibility and handling of dynamic settings.

@coderabbitai

coderabbitai Bot commented Mar 26, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

This pull request introduces several changes across multiple files. Two CSS files for the plugin manager interface are updated with new style rules that adjust the top margins of specific elements. The invocation of the start method for NchanSubscriber instances mymonitor and fsState is modified to remove the chained monitor() method call. Additionally, a new dropdown for selecting regulatory regions is added to the WiFi settings, and several functions are updated for improved clarity. A new file containing country codes is also introduced.

Changes

Files Change Summary
emhttp/.../Plugins-black.css, emhttp/.../Plugins-white.css Added CSS rules: applied an 8px top margin to <span> elements with .status and .vhshift, and a -43px top margin to <table id="plugin_table"> (all with !important).
emhttp/.../ArrayOperation.page Modified the invocation of start() for mymonitor and fsState by removing the chained monitor() method call.
emhttp/.../Wireless.page Introduced a new dropdown for regulatory region selection, modified existing WiFi dropdown, added showManual function, and updated equality checks for clarity.
emhttp/.../include/Wireless.php Updated security selection options in saveAttr function, removing 'OPEN' and 'WEP', replacing them with 'open' and 'auto'.
emhttp/.../include/regions.key New file created containing country codes and names in the format `CODE
emhttp/.../sheets/Wireless.css Added new CSS rules for styling Wi-Fi settings: select.wifi with max-width of 100px and input.wifi with specified margin and text transformation.
etc/.../rc.wireless Enhanced wpa_configuration and wifi_join functions for dynamic wireless configuration based on input parameters, removed WEP handling.

Poem

I'm a rabbit with a hop so fine,
Tweaking margins to align,
In black and white, I leave my mark,
CSS magic from dawn till dark,
Hop along, my code's in line!
🐇🌟


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro (Legacy)

📥 Commits

Reviewing files that changed from the base of the PR and between 4bd244c and 64d099f.

📒 Files selected for processing (5)
  • emhttp/plugins/dynamix/Wireless.page (6 hunks)
  • emhttp/plugins/dynamix/include/Wireless.php (1 hunks)
  • emhttp/plugins/dynamix/include/regions.key (1 hunks)
  • emhttp/plugins/dynamix/sheets/Wireless.css (1 hunks)
  • etc/rc.d/rc.wireless (3 hunks)
✅ Files skipped from review due to trivial changes (1)
  • emhttp/plugins/dynamix/include/regions.key
🔇 Additional comments (13)
emhttp/plugins/dynamix/sheets/Wireless.css (1)

9-10: Clean CSS additions for WiFi elements.

The new CSS rules for select.wifi and input.wifi provide consistent styling for the new regulatory region dropdown and input field introduced in the Wireless.page file.

emhttp/plugins/dynamix/include/Wireless.php (1)

189-190: Security options naming improvements.

The change from 'OPEN' to 'open' and 'WEP' to 'auto' aligns with modern security standards. WEP is obsolete and insecure, so replacing it with an automatic option is a good security practice.

etc/rc.d/rc.wireless (4)

146-147: Improved WPA configuration with country code support.

The code now properly handles regulatory regions with conditional country code configuration.


161-164: Enhanced priority-based network selection.

The addition of priority setting and temporary file handling helps manage multiple network configurations effectively.


244-258: Well-implemented automatic security configuration.

The new code block for handling regulatory regions and AUTO security mode is well-structured. It progressively tries different security protocols with decreasing priorities (IEEE 802.1X/SHA-256 → IEEE 802.1X → SAE → PSK) to ensure optimal connection security.


259-260: Improved conditional logic for connecting to open networks.

The condition now correctly handles both empty security settings and the "OPEN" string (case-insensitive).

emhttp/plugins/dynamix/Wireless.page (7)

19-21: Good organization of variables.

The variables are properly organized, and the new $regions array is correctly populated from the regions.key file.


31-34: Added appropriate CSS class for Wi-Fi dropdown.

The addition of the "wifi" class to the select element enables consistent styling through the new CSS rules.


36-45: Well-implemented regulatory region selection dropdown.

The new dropdown for regulatory regions is implemented correctly with:

  • Automatic and Manual options
  • A separator line
  • Dynamic population of country codes from the regions file
  • Proper value handling with the _var function

This enhances compliance with wireless regulations across different countries.


112-114: Clean implementation of showManual function.

The function correctly toggles the visibility of the manual input field based on the selected region value.


116-134: Improved condition clarity in showDHCP function.

The function now uses strict equality checks (== instead of =) which improves code clarity and prevents potential issues.


136-139: Cleaner showDNS function with strict equality.

Similar to the showDHCP function, this now uses strict equality checks for improved clarity and reliability.


153-161: Updated security handling in showSecurity function.

The function has been updated to handle the new 'open' and 'auto' security options correctly, ensuring proper display of username and password fields.


🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 0

🧹 Nitpick comments (1)
emhttp/plugins/dynamix.plugin.manager/sheets/Plugins.css (1)

4-4: CSS Rule Update: table#plugin_table

The application of a negative margin (margin-top: -43px !important;) is used to tweak the layout positioning. While this may resolve the layout issue in the plugin manager interface, ensure that this value is tested for different screen sizes and content scenarios to prevent any potential overlap or layout instability.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8d57668 and 979df0b.

📒 Files selected for processing (1)
  • emhttp/plugins/dynamix.plugin.manager/sheets/Plugins.css (1 hunks)
🔇 Additional comments (1)
emhttp/plugins/dynamix.plugin.manager/sheets/Plugins.css (1)

3-3: CSS Rule Update: span.status.vhshift

The newly added rule applies margin-top: 8px !important; to span elements with both .status and .vhshift classes. This seems intended to force overriding of existing styles. Please verify that using !important is necessary here and aligns with the overall CSS strategy.

- Added "Regulatory region" selection
- Added "automatic" choice in security selection for manually configured networks
- Added support for "auto" security setting on initial boot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants