Skip to content

Conversation

@zackspear
Copy link
Contributor

@zackspear zackspear commented Dec 6, 2024

Summary by CodeRabbit

Release Notes

  • New Features

    • Introduced a new activation modal for user onboarding.
    • Added partner logo display functionality based on activation codes.
    • Enhanced server state management to include activation code data.
    • Implemented a new Bash script for synchronizing activation code directories.
    • Added a welcome modal to enhance user experience upon first access.
    • Expanded translation capabilities with new entries for user prompts and onboarding messages.
    • Introduced a new script for resetting web GUI banners and logos.
    • Added new Vue components for displaying partner logos and activation modals.
  • Bug Fixes

    • Improved error handling during plugin installation and removal processes.
  • Documentation

    • Expanded localization support with new key-value pairs for user prompts and messages.
  • Chores

    • Refactored various scripts for better organization and maintainability.
    • Updated configuration files to streamline component paths and ignore unnecessary directories.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 6, 2024

Walkthrough

This pull request introduces comprehensive changes to the Unraid web interface and plugin system, focusing on activation code management, user onboarding, and system configuration. The modifications span multiple components, including new scripts, Vue components, and store management, to enhance the user experience during system setup and activation. Key improvements include dynamic partner logo handling, welcome modal implementation, and robust activation code extraction and validation mechanisms.

Changes

File/Directory Change Summary
plugin/plugins/dynamix.unraid.net.plg Enhanced installation and removal scripts with improved error handling, version checks, and activation management.
plugin/scripts/rsync-activation-dir.sh New script for synchronizing activation code directories.
plugin/source/dynamix.unraid.net/.../activation-code-extractor.php New class for extracting and managing activation code data.
plugin/source/dynamix.unraid.net/.../activation_code_setup New script for setting up activation environment and managing system configurations.
plugin/source/dynamix.unraid.net/.../activation_code_remove New script for resetting web GUI banners and logos.
web/components/Activation/* New Vue components for handling activation modals, partner logos, and related UI elements.
web/store/activationCode.ts New Pinia store for managing activation code state and modal visibility.
web/types/server.ts Updated interfaces to support activation code data and server state management.
web/locales/en_US.json Added new localization entries for activation-related prompts.
web/nuxt.config.ts Reorganized configuration settings and added new component paths.
web/package.json Modified build script to remove type-checking step.
web/pages/index.vue Introduced type imports and color arrays for UI components.

Possibly related PRs

Suggested Reviewers

  • ljm42
  • mdatelle
  • elibosley

Poem

🐰 A Rabbit's Ode to Activation 🔑

In circuits of code, a welcome unfurls,
Where servers and partners dance in new swirls.
Activation magic, with logos so bright,
Unraid's system sparkles, a technological delight!

Hop, hop, configuration complete! 🚀


📜 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 20d846a and 6ef7f50.

📒 Files selected for processing (4)
  • plugin/plugins/dynamix.unraid.net.plg (4 hunks)
  • plugin/source/dynamix.unraid.net/usr/local/emhttp/plugins/dynamix.my.servers/scripts/activation_code_remove (1 hunks)
  • web/components/Modal.vue (9 hunks)
  • web/components/WelcomeModal.ce.vue (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • plugin/source/dynamix.unraid.net/usr/local/emhttp/plugins/dynamix.my.servers/scripts/activation_code_remove
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Build Web App
  • GitHub Check: Build and Test API

Note

🎁 Summarized by CodeRabbit Free

Your organization has reached its limit of developer seats under the Pro Plan. For new users, CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please add seats to your subscription by visiting https://app.coderabbit.ai/login.If you believe this is a mistake and have available seats, please assign one to the pull request author through the subscription management page using the link above.

🪧 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 generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @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.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 9, 2024

This plugin has been deployed to Cloudflare R2 and is available for testing.
Download it at this URL: https://preview.dl.unraid.net/unraid-api/pr/973/dynamix.unraid.net.staging.plg

@github-actions
Copy link
Contributor

github-actions bot commented Dec 9, 2024

This plugin has been deployed to Cloudflare R2 and is available for testing.
Download it at this URL: https://preview.dl.unraid.net/unraid-api/pr/973/dynamix.unraid.net.staging.plg

@github-actions
Copy link
Contributor

github-actions bot commented Dec 9, 2024

This plugin has been deployed to Cloudflare R2 and is available for testing.
Download it at this URL: https://preview.dl.unraid.net/unraid-api/pr/973/dynamix.unraid.net.staging.plg

@github-actions
Copy link
Contributor

github-actions bot commented Dec 9, 2024

This plugin has been deployed to Cloudflare R2 and is available for testing.
Download it at this URL: https://preview.dl.unraid.net/unraid-api/pr/973/dynamix.unraid.net.staging.plg

@github-actions
Copy link
Contributor

This plugin has been deployed to Cloudflare R2 and is available for testing.
Download it at this URL: https://preview.dl.unraid.net/unraid-api/pr/973/dynamix.unraid.net.staging.plg

@github-actions
Copy link
Contributor

This plugin has been deployed to Cloudflare R2 and is available for testing.
Download it at this URL: https://preview.dl.unraid.net/unraid-api/pr/973/dynamix.unraid.net.staging.plg

@github-actions
Copy link
Contributor

This plugin has been deployed to Cloudflare R2 and is available for testing.
Download it at this URL: https://preview.dl.unraid.net/unraid-api/pr/973/dynamix.unraid.net.staging.plg

@github-actions
Copy link
Contributor

This plugin has been deployed to Cloudflare R2 and is available for testing.
Download it at this URL: https://preview.dl.unraid.net/unraid-api/pr/973/dynamix.unraid.net.staging.plg

@github-actions
Copy link
Contributor

This plugin has been deployed to Cloudflare R2 and is available for testing.
Download it at this URL: https://preview.dl.unraid.net/unraid-api/pr/973/dynamix.unraid.net.staging.plg

@zackspear zackspear marked this pull request as ready for review December 20, 2024 21:01
elibosley
elibosley previously approved these changes Dec 30, 2024
- Added a new constant for the activation code modal hidden storage key to improve code maintainability and clarity.
- Updated the activation code store to utilize the new constant, replacing hardcoded string references.
@github-actions
Copy link
Contributor

This plugin has been deployed to Cloudflare R2 and is available for testing.
Download it at this URL: https://preview.dl.unraid.net/unraid-api/pr/973/dynamix.unraid.net.staging.plg

@zackspear zackspear requested a review from elibosley December 30, 2024 19:33
@github-actions
Copy link
Contributor

This plugin has been deployed to Cloudflare R2 and is available for testing.
Download it at this URL: https://preview.dl.unraid.net/unraid-api/pr/973/dynamix.unraid.net.staging.plg

zackspear and others added 3 commits January 8, 2025 15:55
- Added new translation strings for activating Unraid licenses and creating Unraid.net accounts to improve user onboarding experience.
- Updated the WelcomeModal and Activation Modal components to reflect new messaging and improved styling options, including the ability to disable shadows.
- Implemented a workaround in the WelcomeModal to address font-size inconsistencies between login and authenticated pages.
- Refactored the index page to correctly pass server data to the WelcomeModal component.
@github-actions
Copy link
Contributor

github-actions bot commented Jan 9, 2025

This plugin has been deployed to Cloudflare R2 and is available for testing.
Download it at this URL: https://preview.dl.unraid.net/unraid-api/pr/973/dynamix.unraid.net.staging.plg

elibosley
elibosley previously approved these changes Jan 9, 2025
- Introduced a new prop `disableOverlayClose` to the Modal component, allowing users to prevent closing the modal by clicking on the overlay.
- Updated the WelcomeModal component to utilize the new `disableOverlayClose` prop, enhancing modal behavior customization.
- Changed the activation code removal script to use a dry-run flag instead of a self-delete flag, enhancing safety during execution.
- Updated the plugin file to reflect the removal of the --delete option, ensuring consistency with the new script behavior.
@github-actions
Copy link
Contributor

github-actions bot commented Jan 9, 2025

This plugin has been deployed to Cloudflare R2 and is available for testing.
Download it at this URL: https://preview.dl.unraid.net/unraid-api/pr/973/dynamix.unraid.net.staging.plg

@elibosley elibosley merged commit 1937814 into main Jan 9, 2025
9 checks passed
@elibosley elibosley deleted the feat/oem-whitelabel branch January 9, 2025 21:06
mdatelle pushed a commit that referenced this pull request Jan 14, 2025
* feat: begin fixing dark mode in the webcomponents

* feat: lots of progress on colors

* feat: begin nuking alpha beta gamma

* feat: set background color on webcomponents

* fix: more color work

* feat: eliminate all alpha beta gamma variable usage

* feat: move variable declarations to theme.ts

* feat: begin fixing dark mode in the webcomponents

* feat: lots of progress on colors

* feat: begin nuking alpha beta gamma

* feat: set background color on webcomponents

* fix: more color work

* feat: eliminate all alpha beta gamma variable usage

* feat: download nodejs and install on legacy OS versions

* feat: do not move upgradepkg

* feat: array iteration for restoring files

* feat: separate install process

* feat: extract node to usr/local/

* feat: move variable declarations to theme.ts

* feat: remove nghttp3 and only bundle nodejs

* feat: validate entries correctly

* fix: upgradepkg

* feat: copy only needed files for nodejs

* fix: install syntax error

* fix: strip components from tar line

* feat: error when nodejs download fails

* feat(php): add OEM data extraction functionality

* feat(web): WIP add OEM activation modal and integrate OEM data handling

* refactor: replace oem etamology with activation

* feat(web): enhance activation modal with header and main title options

* refactor(web): update activation modal title to handle partner name conditionally

* feat: make partnerName optional in activation code data

* refactor: remove activationCodeStore from UserProfile component

* feat: integrate activation code data into server store

* feat: enhance activation code store to include callback actions and improve modal visibility logic

* refactor: remove unused theme reference from ColorSwitcher component

* fix: update partnerName in activationCodeData for clarity

* refactor: adjust gap spacing in Modal component for improved layout

* feat: enhance Activation Modal component with dynamic title and description, and add documentation buttons

* feat: implement localization for Activation Modal component titles and button texts

* feat: add new translations for activation prompts and welcome messages in the WebComponentTranslations class

* feat: implement key sequence to close Activation Modal and persist visibility state

* feat: update activation logic to conditionally activate or redeem based on activation code presence

* feat(plg): plg install / remove partner banner

* feat(plg): on install update config to enable display settings banner and on remove banner setting if no custom banner used

* fix(plg): plg remove, display banner no if no custom image

* feat(plg): implement partner banner handling and system model identification from activation JSON

* feat(web): add loading and error states to notification sidebar

* refactor(web): add container for loading & error states

* feat(web): add count labels to notification tabs

* refactor(web): lift notifications overview query to Sidebar from Indicator

* fix(web): refetch notifications for sidebar when new notifications arrive

* feat(web): move notification indicator icons to top-right of bell icon

previously, icons were placed next to bell icon because the status indicators
were not accessible to color-blind users. this commit replaces circular
status indicators with the icons.

* feat(web): remove notification indicator pulse

the pulse was initially added to provide visual feedback when:

1. a new notification arrived
2. an alert notification was unread

because we began using the legacy notify script, we now get a toast
on new notifications. re:2, feedback on the pulse was mixed, so i'm
removing it.

* refactor(plg): improve conditional for activation & partner setup

* feat(plg): add case model icon handling based on activation JSON

* feat(plg): enhance partner setup process with detailed logging and system identification updates and setup flag

* feat(plg): add setup flag file creation and logging for activation changes

* feat(plg): update activation setup flag checks for banner, case model icon, and system identity

* fix(plg): add error handling for invalid activation JSON and improve conditional checks for setup flags

* fix(plg): improve partner banner and case model icon setup logic with enhanced checks and comments

* fix(plg): update case model icon configuration to prevent newline issues in parsing

* fix(plg): remove unnecessary echo debug statements and improve setup flag handling for partner details

* fix(plg): remove unnecessary registration page check from activation code modal logic

* fix(plg): add overlay opacity prop to modal components for customizable background transparency

* fix(plg): enhance modal component with vertical centering option and adjust max-width

* fix(plg): enhance configuration handling by dynamically updating multiple header parameters in the config file

* fix(plg): improve comments and enhance setup flag handling for custom icons in activation logic

* fix(translations): correct capitalization and punctuation in user prompts for consistency

* fix(store): enhance activation code data structure with additional properties and correct partner URL reference

* fix(modal): enhance activation modal with dynamic partner logo and improved title handling

* fix(store): update activation code data structure with additional properties and correct partner details

* fix(index): refactor badge and button color handling with typed constants for improved maintainability

* fix(dependencies): add vue-tsc for improved TypeScript support in Vue projects

* refactor(plugin): remove unnecessary comments and clean up code structure

* refactor(plugin): remove todo comment for custom header logo

* fix(Modal): add partnerUrl handling for logo link and improve code structure

* fix(serverState): update partnerLogoPath to use a placeholder image for development

* feat(plugin): add rsync activation script for testing activation modal & installs

* refactor(activationCode): remove debug log for modal visibility check

* feat(plugin): enhance activation process by adding logo and case model handling

* refactor(activationCode): rename partnerLogoPath to partnerLogo and update handling for logo file type

* refactor(activationCode): remove debug log for partnerLogo watcher

* chore(nuxt.config): add ignore rule for webGui images directory

* refactor(plugin): rename params array to DISPLAY_PARAMS and update handling for configuration updates

* fix(web): partner logo handling for themes

* fix(plg): activation oem, custom case icon cfg handling

* fix(plugin): replace sed with awk for config file updates in DISPLAY_PARAMS handling

* fix(web): add target and rel attributes to partner logo link for security

* feat(plugin): add theme parameter to DISPLAY_PARAMS and activation code interface

* fix(plugin): replace sed with parameter expansion and awk for config file updates

* fix(plugin): reboot logic for plg install to prevent settings overwrite

* feat(plugin): streamline activation and partner setup by abstracting scripts for better maintainability

* fix(plugin): update script source paths for activation and partner setup

* fix(plugin): update script source paths for activation and partner setup to use relative paths

* fix(plugin): update script source paths for activation and partner setup to use absolute paths

* fix(plugin): add debug mode support to activation scripts and update setup flag handling

* fix(plugin): enhance activation scripts with debug mode and conditional execution for safety

* refactor(plugin): reposition execution of activation_code setup / remove scripts

* fix(plugin): add checks for activation_code_setup script existence and improve deletion logging

* fix(plugin): add option to remove setup flag after script execution

* fix(plugin): streamline activation script execution by removing unnecessary checks

* fix(plugin): remove duplicate activation_code_setup script sourcing

* feat(modal): add overlay color prop and enhance class binding for modal background

* feat(activation): update modal overlay color and opacity

* feat(plg): add WebComponentsExtractor class for managing JS file retrieval

* feat(plugin): myservers1.phpintegrate WebComponentsExtractor for dynamic script tag generation

* feat(activation): enhance getData method to support JSON output and add getDataForHtmlAttr for HTML-safe JSON

* refactor(activation): simplify getData method by removing parameters

* feat(plugin): add welcome-modal.php for displaying server state and web components

* refactor(web): activation code store rename modal visibility variables for clarity

* feat(web): add WelcomeModal component for user onboarding and server setup

* feat(plugin): activation_code setup and remove script support welcome modal

* refactor(plugin): streamline activation code setup script by removing some comments

* fix(plugin): update activation code setup script to prepend items to auth request allow list array

* feat: enhance ActivationCodeExtractor with partner logo handling and metadata extraction

- Added constants for document root and web GUI images directory.
- Introduced properties for partner name, URL, logo path, and logo file type.
- Implemented methods to retrieve partner logo path, render logo string, partner name, and URL.
- Enhanced data extraction logic to include partner-related information from JSON data.
- Added debug method for outputting internal state for troubleshooting.

* refactor: update activation-data.php to include debug output for ActivationCodeExtractor

- Removed JSON response and replaced it with a debug output wrapped in <pre> tags.
- This change allows for easier troubleshooting by displaying internal state information directly on the page.

* feat: inject partner logo into DefaultPageLayout and update JS file paths

- Modified the activation code setup script to change the path of JavaScript files to be relative to the web GUI's webroot.
- Added functionality to inject a partner logo into the DefaultPageLayout by replacing the existing logo string.
- Implemented a conditional backup mechanism for the DefaultPageLayout file before making changes.
- Included debug output to confirm successful injection or report errors during the process.

* feat: add partner logo display functionality and style adjustments

- Introduced a new file for displaying the partner logo, which retrieves the logo and URL based on the activation code.
- Added CSS styles to adjust the display properties of the partner logo in the header, ensuring proper sizing and alignment.
- Enhanced the integration of the partner logo into the existing plugin structure.

* refactor: simplify partner logo injection debug output in activation code setup script

- Removed syntax check for the DefaultPageLayout file after injecting the partner logo.
- Streamlined debug output to confirm successful injection without additional checks, enhancing clarity and reducing complexity.

* style: adjust partner logo height in myservers1.php

* style: update partner logo width in PartnerLogoImg.vue

- Changed the CSS class for the partner logo image from a max height constraint to a fixed width of 72 units, ensuring better responsiveness and alignment in the layout.

* fix: update modal title attribute for conditional close behavior

- Modified the title attribute of the modal overlay to conditionally display the close instruction based on the showCloseX property. This change improves accessibility by ensuring the title is only set when the close button is visible.

* refactor: update partner logo handling in activation code scripts and extractor

- Changed the partner logo file name to 'partner-logo.svg' in ActivationCodeExtractor.
- Simplified logo path handling by removing unnecessary file type checks and directly using the SVG file.
- Updated CSS in myservers1.php to target only the SVG logo.
- Modified activation code setup and removal scripts to consistently reference the SVG logo, improving clarity and maintainability.

* feat: enhance activation code setup script to include server name handling

- Added logic to retrieve and set the server name from the activation JSON if the current system model or comment is not set, or if the current name is "Tower".
- Improved debug output to include the partner server name, enhancing visibility during the activation process.
- Sanitized the partner server name to remove quotes and backslashes for better handling.

* feat: validate activation JSON before proceeding with setup

- Added validation for the activation JSON file to ensure it is correctly formatted before executing the setup process.
- Enhanced debug output to indicate whether the JSON is valid or not, improving troubleshooting capabilities.
- The setup will now only proceed if the activation JSON is confirmed to be valid, preventing potential errors during execution.

* fix(plg): improve warning message for invalid activation JSON in setup script

* feat: enhance activation code handling with partner logo integration

- Added a new optional property 'partnerLogo' to the ActivationCodeExtractor class and updated related interfaces to support boolean values for logo display.
- Removed the PNG logo reference from the activation code setup script, streamlining the logo handling process.
- Updated the server state to utilize the new 'partnerLogo' property, ensuring consistent logo display logic across the application.
- Adjusted computed properties in the activation code store to reflect the changes in logo handling, improving clarity and maintainability.

* fix: correct activation JSON validation in setup script

- Updated the activation code setup script to use 'jq empty' for validating the activation JSON file, ensuring proper error handling and validation.
- This change improves the robustness of the setup process by accurately checking the JSON format before proceeding.

* fix: correct comment formatting in dynamix.unraid.net.plg

- Fixed a formatting issue in the comment regarding the use of myservers.cfg values to prevent conflicts during installation. This change improves code readability and clarity.

* chore: update rsync activation script comments for clarity

- Revised comments in the rsync-activation-dir.sh script to better describe its purpose and usage.
- Enhanced documentation with an example usage to improve user understanding of the script's functionality.

* refactor: clean up activation data and extractor files

- Removed outdated copyright comments from activation-data.php and activation-code-extractor.php for improved readability.
- Simplified the debug output in activation-data.php by using short PHP tags.
- Updated the comment in the ActivationCodeExtractor class to be more concise, enhancing clarity for future developers.

* fix: remove unnecessary CSS properties in myservers1.php

- Eliminated redundant display and margin properties from the CSS in myservers1.php to streamline the styling and improve code clarity.

* refactor: streamline WebComponentsExtractor class and update method names

- Removed outdated copyright comments from web-components-extractor.php for improved readability.
- Renamed method getJsFileUrl() to getJSFileRelativePath() to enhance clarity and consistency in naming conventions.
- Adjusted indentation for better code formatting and readability.

* refactor: simplify partner logo handling in activation code script

- Removed unnecessary variable initialization and included only essential requires for improved clarity.
- Streamlined the code in partner-logo.php to focus on the core functionality of displaying the partner logo.
- Enhanced maintainability by reducing complexity in the script.

* refactor: clean up activation and server state files

- Removed outdated copyright comments and unnecessary variable initializations from activation-data.php and server-state.php for improved readability.
- Streamlined the code by eliminating redundant require statements, focusing on essential functionality.
- Enhanced maintainability and clarity by simplifying the structure of both files.

* feat: add password creation prompts to translations

- Introduced new translation strings for password creation in both PHP and JSON files.
- Enhanced user guidance by providing detailed messages about the importance of the password for system access and management.
- Improved overall user experience by ensuring clarity in the password setup process.

* refactor: update activation code setup script comments

* refactor: enhance activation code removal script functionality

- Updated the activation code removal script to delete additional related files, including PHP and setup scripts, for a more thorough cleanup.
- Improved comments for clarity on script usage and options, particularly regarding the self-delete functionality.
- Streamlined the deletion process by using an array to manage files to be removed, enhancing maintainability and readability.

* fix: update WelcomeModal to disable close button

* refactor: reorganize activation code setup and improve script clarity

- Moved the activation and partner setup section to follow the web component timestamp check to ensure correct targeting during setup.
- Updated comments for better clarity regarding the activation code setup process.
- Retained the warning message about not closing the window yet for user guidance.

* refactor: enhance activation code setup script with improved comments and logic

- Updated comments to clarify the purpose of server name, model, and description checks.
- Modified conditional logic to include additional checks for server identification.
- Added a TODO note regarding the necessity of updating the ident.cfg file, ensuring future review for potential optimizations.

* refactor: update activation code scripts to use .done flag

* refactor: introduce constant for activation modal storage key

- Added a new constant for the activation code modal hidden storage key to improve code maintainability and clarity.
- Updated the activation code store to utilize the new constant, replacing hardcoded string references.

* feat: enhance user onboarding and modal components

- Added new translation strings for activating Unraid licenses and creating Unraid.net accounts to improve user onboarding experience.
- Updated the WelcomeModal and Activation Modal components to reflect new messaging and improved styling options, including the ability to disable shadows.
- Implemented a workaround in the WelcomeModal to address font-size inconsistencies between login and authenticated pages.
- Refactored the index page to correctly pass server data to the WelcomeModal component.

* chore: comment out WelcomeModalCe component for testing

* feat: add disableOverlayClose prop to Modal and WelcomeModal components

- Introduced a new prop `disableOverlayClose` to the Modal component, allowing users to prevent closing the modal by clicking on the overlay.
- Updated the WelcomeModal component to utilize the new `disableOverlayClose` prop, enhancing modal behavior customization.

* refactor: update activation code removal script to delete by default

- Changed the activation code removal script to use a dry-run flag instead of a self-delete flag, enhancing safety during execution.
- Updated the plugin file to reflect the removal of the --delete option, ensuring consistency with the new script behavior.

---------

Co-authored-by: Eli Bosley <ekbosley@gmail.com>
Co-authored-by: Pujit Mehrotra <pujit@lime-technology.com>
mdatelle pushed a commit that referenced this pull request Jan 14, 2025
* feat: begin fixing dark mode in the webcomponents

* feat: lots of progress on colors

* feat: begin nuking alpha beta gamma

* feat: set background color on webcomponents

* fix: more color work

* feat: eliminate all alpha beta gamma variable usage

* feat: move variable declarations to theme.ts

* feat: begin fixing dark mode in the webcomponents

* feat: lots of progress on colors

* feat: begin nuking alpha beta gamma

* feat: set background color on webcomponents

* fix: more color work

* feat: eliminate all alpha beta gamma variable usage

* feat: download nodejs and install on legacy OS versions

* feat: do not move upgradepkg

* feat: array iteration for restoring files

* feat: separate install process

* feat: extract node to usr/local/

* feat: move variable declarations to theme.ts

* feat: remove nghttp3 and only bundle nodejs

* feat: validate entries correctly

* fix: upgradepkg

* feat: copy only needed files for nodejs

* fix: install syntax error

* fix: strip components from tar line

* feat: error when nodejs download fails

* feat(php): add OEM data extraction functionality

* feat(web): WIP add OEM activation modal and integrate OEM data handling

* refactor: replace oem etamology with activation

* feat(web): enhance activation modal with header and main title options

* refactor(web): update activation modal title to handle partner name conditionally

* feat: make partnerName optional in activation code data

* refactor: remove activationCodeStore from UserProfile component

* feat: integrate activation code data into server store

* feat: enhance activation code store to include callback actions and improve modal visibility logic

* refactor: remove unused theme reference from ColorSwitcher component

* fix: update partnerName in activationCodeData for clarity

* refactor: adjust gap spacing in Modal component for improved layout

* feat: enhance Activation Modal component with dynamic title and description, and add documentation buttons

* feat: implement localization for Activation Modal component titles and button texts

* feat: add new translations for activation prompts and welcome messages in the WebComponentTranslations class

* feat: implement key sequence to close Activation Modal and persist visibility state

* feat: update activation logic to conditionally activate or redeem based on activation code presence

* feat(plg): plg install / remove partner banner

* feat(plg): on install update config to enable display settings banner and on remove banner setting if no custom banner used

* fix(plg): plg remove, display banner no if no custom image

* feat(plg): implement partner banner handling and system model identification from activation JSON

* feat(web): add loading and error states to notification sidebar

* refactor(web): add container for loading & error states

* feat(web): add count labels to notification tabs

* refactor(web): lift notifications overview query to Sidebar from Indicator

* fix(web): refetch notifications for sidebar when new notifications arrive

* feat(web): move notification indicator icons to top-right of bell icon

previously, icons were placed next to bell icon because the status indicators
were not accessible to color-blind users. this commit replaces circular
status indicators with the icons.

* feat(web): remove notification indicator pulse

the pulse was initially added to provide visual feedback when:

1. a new notification arrived
2. an alert notification was unread

because we began using the legacy notify script, we now get a toast
on new notifications. re:2, feedback on the pulse was mixed, so i'm
removing it.

* refactor(plg): improve conditional for activation & partner setup

* feat(plg): add case model icon handling based on activation JSON

* feat(plg): enhance partner setup process with detailed logging and system identification updates and setup flag

* feat(plg): add setup flag file creation and logging for activation changes

* feat(plg): update activation setup flag checks for banner, case model icon, and system identity

* fix(plg): add error handling for invalid activation JSON and improve conditional checks for setup flags

* fix(plg): improve partner banner and case model icon setup logic with enhanced checks and comments

* fix(plg): update case model icon configuration to prevent newline issues in parsing

* fix(plg): remove unnecessary echo debug statements and improve setup flag handling for partner details

* fix(plg): remove unnecessary registration page check from activation code modal logic

* fix(plg): add overlay opacity prop to modal components for customizable background transparency

* fix(plg): enhance modal component with vertical centering option and adjust max-width

* fix(plg): enhance configuration handling by dynamically updating multiple header parameters in the config file

* fix(plg): improve comments and enhance setup flag handling for custom icons in activation logic

* fix(translations): correct capitalization and punctuation in user prompts for consistency

* fix(store): enhance activation code data structure with additional properties and correct partner URL reference

* fix(modal): enhance activation modal with dynamic partner logo and improved title handling

* fix(store): update activation code data structure with additional properties and correct partner details

* fix(index): refactor badge and button color handling with typed constants for improved maintainability

* fix(dependencies): add vue-tsc for improved TypeScript support in Vue projects

* refactor(plugin): remove unnecessary comments and clean up code structure

* refactor(plugin): remove todo comment for custom header logo

* fix(Modal): add partnerUrl handling for logo link and improve code structure

* fix(serverState): update partnerLogoPath to use a placeholder image for development

* feat(plugin): add rsync activation script for testing activation modal & installs

* refactor(activationCode): remove debug log for modal visibility check

* feat(plugin): enhance activation process by adding logo and case model handling

* refactor(activationCode): rename partnerLogoPath to partnerLogo and update handling for logo file type

* refactor(activationCode): remove debug log for partnerLogo watcher

* chore(nuxt.config): add ignore rule for webGui images directory

* refactor(plugin): rename params array to DISPLAY_PARAMS and update handling for configuration updates

* fix(web): partner logo handling for themes

* fix(plg): activation oem, custom case icon cfg handling

* fix(plugin): replace sed with awk for config file updates in DISPLAY_PARAMS handling

* fix(web): add target and rel attributes to partner logo link for security

* feat(plugin): add theme parameter to DISPLAY_PARAMS and activation code interface

* fix(plugin): replace sed with parameter expansion and awk for config file updates

* fix(plugin): reboot logic for plg install to prevent settings overwrite

* feat(plugin): streamline activation and partner setup by abstracting scripts for better maintainability

* fix(plugin): update script source paths for activation and partner setup

* fix(plugin): update script source paths for activation and partner setup to use relative paths

* fix(plugin): update script source paths for activation and partner setup to use absolute paths

* fix(plugin): add debug mode support to activation scripts and update setup flag handling

* fix(plugin): enhance activation scripts with debug mode and conditional execution for safety

* refactor(plugin): reposition execution of activation_code setup / remove scripts

* fix(plugin): add checks for activation_code_setup script existence and improve deletion logging

* fix(plugin): add option to remove setup flag after script execution

* fix(plugin): streamline activation script execution by removing unnecessary checks

* fix(plugin): remove duplicate activation_code_setup script sourcing

* feat(modal): add overlay color prop and enhance class binding for modal background

* feat(activation): update modal overlay color and opacity

* feat(plg): add WebComponentsExtractor class for managing JS file retrieval

* feat(plugin): myservers1.phpintegrate WebComponentsExtractor for dynamic script tag generation

* feat(activation): enhance getData method to support JSON output and add getDataForHtmlAttr for HTML-safe JSON

* refactor(activation): simplify getData method by removing parameters

* feat(plugin): add welcome-modal.php for displaying server state and web components

* refactor(web): activation code store rename modal visibility variables for clarity

* feat(web): add WelcomeModal component for user onboarding and server setup

* feat(plugin): activation_code setup and remove script support welcome modal

* refactor(plugin): streamline activation code setup script by removing some comments

* fix(plugin): update activation code setup script to prepend items to auth request allow list array

* feat: enhance ActivationCodeExtractor with partner logo handling and metadata extraction

- Added constants for document root and web GUI images directory.
- Introduced properties for partner name, URL, logo path, and logo file type.
- Implemented methods to retrieve partner logo path, render logo string, partner name, and URL.
- Enhanced data extraction logic to include partner-related information from JSON data.
- Added debug method for outputting internal state for troubleshooting.

* refactor: update activation-data.php to include debug output for ActivationCodeExtractor

- Removed JSON response and replaced it with a debug output wrapped in <pre> tags.
- This change allows for easier troubleshooting by displaying internal state information directly on the page.

* feat: inject partner logo into DefaultPageLayout and update JS file paths

- Modified the activation code setup script to change the path of JavaScript files to be relative to the web GUI's webroot.
- Added functionality to inject a partner logo into the DefaultPageLayout by replacing the existing logo string.
- Implemented a conditional backup mechanism for the DefaultPageLayout file before making changes.
- Included debug output to confirm successful injection or report errors during the process.

* feat: add partner logo display functionality and style adjustments

- Introduced a new file for displaying the partner logo, which retrieves the logo and URL based on the activation code.
- Added CSS styles to adjust the display properties of the partner logo in the header, ensuring proper sizing and alignment.
- Enhanced the integration of the partner logo into the existing plugin structure.

* refactor: simplify partner logo injection debug output in activation code setup script

- Removed syntax check for the DefaultPageLayout file after injecting the partner logo.
- Streamlined debug output to confirm successful injection without additional checks, enhancing clarity and reducing complexity.

* style: adjust partner logo height in myservers1.php

* style: update partner logo width in PartnerLogoImg.vue

- Changed the CSS class for the partner logo image from a max height constraint to a fixed width of 72 units, ensuring better responsiveness and alignment in the layout.

* fix: update modal title attribute for conditional close behavior

- Modified the title attribute of the modal overlay to conditionally display the close instruction based on the showCloseX property. This change improves accessibility by ensuring the title is only set when the close button is visible.

* refactor: update partner logo handling in activation code scripts and extractor

- Changed the partner logo file name to 'partner-logo.svg' in ActivationCodeExtractor.
- Simplified logo path handling by removing unnecessary file type checks and directly using the SVG file.
- Updated CSS in myservers1.php to target only the SVG logo.
- Modified activation code setup and removal scripts to consistently reference the SVG logo, improving clarity and maintainability.

* feat: enhance activation code setup script to include server name handling

- Added logic to retrieve and set the server name from the activation JSON if the current system model or comment is not set, or if the current name is "Tower".
- Improved debug output to include the partner server name, enhancing visibility during the activation process.
- Sanitized the partner server name to remove quotes and backslashes for better handling.

* feat: validate activation JSON before proceeding with setup

- Added validation for the activation JSON file to ensure it is correctly formatted before executing the setup process.
- Enhanced debug output to indicate whether the JSON is valid or not, improving troubleshooting capabilities.
- The setup will now only proceed if the activation JSON is confirmed to be valid, preventing potential errors during execution.

* fix(plg): improve warning message for invalid activation JSON in setup script

* feat: enhance activation code handling with partner logo integration

- Added a new optional property 'partnerLogo' to the ActivationCodeExtractor class and updated related interfaces to support boolean values for logo display.
- Removed the PNG logo reference from the activation code setup script, streamlining the logo handling process.
- Updated the server state to utilize the new 'partnerLogo' property, ensuring consistent logo display logic across the application.
- Adjusted computed properties in the activation code store to reflect the changes in logo handling, improving clarity and maintainability.

* fix: correct activation JSON validation in setup script

- Updated the activation code setup script to use 'jq empty' for validating the activation JSON file, ensuring proper error handling and validation.
- This change improves the robustness of the setup process by accurately checking the JSON format before proceeding.

* fix: correct comment formatting in dynamix.unraid.net.plg

- Fixed a formatting issue in the comment regarding the use of myservers.cfg values to prevent conflicts during installation. This change improves code readability and clarity.

* chore: update rsync activation script comments for clarity

- Revised comments in the rsync-activation-dir.sh script to better describe its purpose and usage.
- Enhanced documentation with an example usage to improve user understanding of the script's functionality.

* refactor: clean up activation data and extractor files

- Removed outdated copyright comments from activation-data.php and activation-code-extractor.php for improved readability.
- Simplified the debug output in activation-data.php by using short PHP tags.
- Updated the comment in the ActivationCodeExtractor class to be more concise, enhancing clarity for future developers.

* fix: remove unnecessary CSS properties in myservers1.php

- Eliminated redundant display and margin properties from the CSS in myservers1.php to streamline the styling and improve code clarity.

* refactor: streamline WebComponentsExtractor class and update method names

- Removed outdated copyright comments from web-components-extractor.php for improved readability.
- Renamed method getJsFileUrl() to getJSFileRelativePath() to enhance clarity and consistency in naming conventions.
- Adjusted indentation for better code formatting and readability.

* refactor: simplify partner logo handling in activation code script

- Removed unnecessary variable initialization and included only essential requires for improved clarity.
- Streamlined the code in partner-logo.php to focus on the core functionality of displaying the partner logo.
- Enhanced maintainability by reducing complexity in the script.

* refactor: clean up activation and server state files

- Removed outdated copyright comments and unnecessary variable initializations from activation-data.php and server-state.php for improved readability.
- Streamlined the code by eliminating redundant require statements, focusing on essential functionality.
- Enhanced maintainability and clarity by simplifying the structure of both files.

* feat: add password creation prompts to translations

- Introduced new translation strings for password creation in both PHP and JSON files.
- Enhanced user guidance by providing detailed messages about the importance of the password for system access and management.
- Improved overall user experience by ensuring clarity in the password setup process.

* refactor: update activation code setup script comments

* refactor: enhance activation code removal script functionality

- Updated the activation code removal script to delete additional related files, including PHP and setup scripts, for a more thorough cleanup.
- Improved comments for clarity on script usage and options, particularly regarding the self-delete functionality.
- Streamlined the deletion process by using an array to manage files to be removed, enhancing maintainability and readability.

* fix: update WelcomeModal to disable close button

* refactor: reorganize activation code setup and improve script clarity

- Moved the activation and partner setup section to follow the web component timestamp check to ensure correct targeting during setup.
- Updated comments for better clarity regarding the activation code setup process.
- Retained the warning message about not closing the window yet for user guidance.

* refactor: enhance activation code setup script with improved comments and logic

- Updated comments to clarify the purpose of server name, model, and description checks.
- Modified conditional logic to include additional checks for server identification.
- Added a TODO note regarding the necessity of updating the ident.cfg file, ensuring future review for potential optimizations.

* refactor: update activation code scripts to use .done flag

* refactor: introduce constant for activation modal storage key

- Added a new constant for the activation code modal hidden storage key to improve code maintainability and clarity.
- Updated the activation code store to utilize the new constant, replacing hardcoded string references.

* feat: enhance user onboarding and modal components

- Added new translation strings for activating Unraid licenses and creating Unraid.net accounts to improve user onboarding experience.
- Updated the WelcomeModal and Activation Modal components to reflect new messaging and improved styling options, including the ability to disable shadows.
- Implemented a workaround in the WelcomeModal to address font-size inconsistencies between login and authenticated pages.
- Refactored the index page to correctly pass server data to the WelcomeModal component.

* chore: comment out WelcomeModalCe component for testing

* feat: add disableOverlayClose prop to Modal and WelcomeModal components

- Introduced a new prop `disableOverlayClose` to the Modal component, allowing users to prevent closing the modal by clicking on the overlay.
- Updated the WelcomeModal component to utilize the new `disableOverlayClose` prop, enhancing modal behavior customization.

* refactor: update activation code removal script to delete by default

- Changed the activation code removal script to use a dry-run flag instead of a self-delete flag, enhancing safety during execution.
- Updated the plugin file to reflect the removal of the --delete option, ensuring consistency with the new script behavior.

---------

Co-authored-by: Eli Bosley <ekbosley@gmail.com>
Co-authored-by: Pujit Mehrotra <pujit@lime-technology.com>
mdatelle pushed a commit that referenced this pull request Jan 14, 2025
* feat: begin fixing dark mode in the webcomponents

* feat: lots of progress on colors

* feat: begin nuking alpha beta gamma

* feat: set background color on webcomponents

* fix: more color work

* feat: eliminate all alpha beta gamma variable usage

* feat: move variable declarations to theme.ts

* feat: begin fixing dark mode in the webcomponents

* feat: lots of progress on colors

* feat: begin nuking alpha beta gamma

* feat: set background color on webcomponents

* fix: more color work

* feat: eliminate all alpha beta gamma variable usage

* feat: download nodejs and install on legacy OS versions

* feat: do not move upgradepkg

* feat: array iteration for restoring files

* feat: separate install process

* feat: extract node to usr/local/

* feat: move variable declarations to theme.ts

* feat: remove nghttp3 and only bundle nodejs

* feat: validate entries correctly

* fix: upgradepkg

* feat: copy only needed files for nodejs

* fix: install syntax error

* fix: strip components from tar line

* feat: error when nodejs download fails

* feat(php): add OEM data extraction functionality

* feat(web): WIP add OEM activation modal and integrate OEM data handling

* refactor: replace oem etamology with activation

* feat(web): enhance activation modal with header and main title options

* refactor(web): update activation modal title to handle partner name conditionally

* feat: make partnerName optional in activation code data

* refactor: remove activationCodeStore from UserProfile component

* feat: integrate activation code data into server store

* feat: enhance activation code store to include callback actions and improve modal visibility logic

* refactor: remove unused theme reference from ColorSwitcher component

* fix: update partnerName in activationCodeData for clarity

* refactor: adjust gap spacing in Modal component for improved layout

* feat: enhance Activation Modal component with dynamic title and description, and add documentation buttons

* feat: implement localization for Activation Modal component titles and button texts

* feat: add new translations for activation prompts and welcome messages in the WebComponentTranslations class

* feat: implement key sequence to close Activation Modal and persist visibility state

* feat: update activation logic to conditionally activate or redeem based on activation code presence

* feat(plg): plg install / remove partner banner

* feat(plg): on install update config to enable display settings banner and on remove banner setting if no custom banner used

* fix(plg): plg remove, display banner no if no custom image

* feat(plg): implement partner banner handling and system model identification from activation JSON

* feat(web): add loading and error states to notification sidebar

* refactor(web): add container for loading & error states

* feat(web): add count labels to notification tabs

* refactor(web): lift notifications overview query to Sidebar from Indicator

* fix(web): refetch notifications for sidebar when new notifications arrive

* feat(web): move notification indicator icons to top-right of bell icon

previously, icons were placed next to bell icon because the status indicators
were not accessible to color-blind users. this commit replaces circular
status indicators with the icons.

* feat(web): remove notification indicator pulse

the pulse was initially added to provide visual feedback when:

1. a new notification arrived
2. an alert notification was unread

because we began using the legacy notify script, we now get a toast
on new notifications. re:2, feedback on the pulse was mixed, so i'm
removing it.

* refactor(plg): improve conditional for activation & partner setup

* feat(plg): add case model icon handling based on activation JSON

* feat(plg): enhance partner setup process with detailed logging and system identification updates and setup flag

* feat(plg): add setup flag file creation and logging for activation changes

* feat(plg): update activation setup flag checks for banner, case model icon, and system identity

* fix(plg): add error handling for invalid activation JSON and improve conditional checks for setup flags

* fix(plg): improve partner banner and case model icon setup logic with enhanced checks and comments

* fix(plg): update case model icon configuration to prevent newline issues in parsing

* fix(plg): remove unnecessary echo debug statements and improve setup flag handling for partner details

* fix(plg): remove unnecessary registration page check from activation code modal logic

* fix(plg): add overlay opacity prop to modal components for customizable background transparency

* fix(plg): enhance modal component with vertical centering option and adjust max-width

* fix(plg): enhance configuration handling by dynamically updating multiple header parameters in the config file

* fix(plg): improve comments and enhance setup flag handling for custom icons in activation logic

* fix(translations): correct capitalization and punctuation in user prompts for consistency

* fix(store): enhance activation code data structure with additional properties and correct partner URL reference

* fix(modal): enhance activation modal with dynamic partner logo and improved title handling

* fix(store): update activation code data structure with additional properties and correct partner details

* fix(index): refactor badge and button color handling with typed constants for improved maintainability

* fix(dependencies): add vue-tsc for improved TypeScript support in Vue projects

* refactor(plugin): remove unnecessary comments and clean up code structure

* refactor(plugin): remove todo comment for custom header logo

* fix(Modal): add partnerUrl handling for logo link and improve code structure

* fix(serverState): update partnerLogoPath to use a placeholder image for development

* feat(plugin): add rsync activation script for testing activation modal & installs

* refactor(activationCode): remove debug log for modal visibility check

* feat(plugin): enhance activation process by adding logo and case model handling

* refactor(activationCode): rename partnerLogoPath to partnerLogo and update handling for logo file type

* refactor(activationCode): remove debug log for partnerLogo watcher

* chore(nuxt.config): add ignore rule for webGui images directory

* refactor(plugin): rename params array to DISPLAY_PARAMS and update handling for configuration updates

* fix(web): partner logo handling for themes

* fix(plg): activation oem, custom case icon cfg handling

* fix(plugin): replace sed with awk for config file updates in DISPLAY_PARAMS handling

* fix(web): add target and rel attributes to partner logo link for security

* feat(plugin): add theme parameter to DISPLAY_PARAMS and activation code interface

* fix(plugin): replace sed with parameter expansion and awk for config file updates

* fix(plugin): reboot logic for plg install to prevent settings overwrite

* feat(plugin): streamline activation and partner setup by abstracting scripts for better maintainability

* fix(plugin): update script source paths for activation and partner setup

* fix(plugin): update script source paths for activation and partner setup to use relative paths

* fix(plugin): update script source paths for activation and partner setup to use absolute paths

* fix(plugin): add debug mode support to activation scripts and update setup flag handling

* fix(plugin): enhance activation scripts with debug mode and conditional execution for safety

* refactor(plugin): reposition execution of activation_code setup / remove scripts

* fix(plugin): add checks for activation_code_setup script existence and improve deletion logging

* fix(plugin): add option to remove setup flag after script execution

* fix(plugin): streamline activation script execution by removing unnecessary checks

* fix(plugin): remove duplicate activation_code_setup script sourcing

* feat(modal): add overlay color prop and enhance class binding for modal background

* feat(activation): update modal overlay color and opacity

* feat(plg): add WebComponentsExtractor class for managing JS file retrieval

* feat(plugin): myservers1.phpintegrate WebComponentsExtractor for dynamic script tag generation

* feat(activation): enhance getData method to support JSON output and add getDataForHtmlAttr for HTML-safe JSON

* refactor(activation): simplify getData method by removing parameters

* feat(plugin): add welcome-modal.php for displaying server state and web components

* refactor(web): activation code store rename modal visibility variables for clarity

* feat(web): add WelcomeModal component for user onboarding and server setup

* feat(plugin): activation_code setup and remove script support welcome modal

* refactor(plugin): streamline activation code setup script by removing some comments

* fix(plugin): update activation code setup script to prepend items to auth request allow list array

* feat: enhance ActivationCodeExtractor with partner logo handling and metadata extraction

- Added constants for document root and web GUI images directory.
- Introduced properties for partner name, URL, logo path, and logo file type.
- Implemented methods to retrieve partner logo path, render logo string, partner name, and URL.
- Enhanced data extraction logic to include partner-related information from JSON data.
- Added debug method for outputting internal state for troubleshooting.

* refactor: update activation-data.php to include debug output for ActivationCodeExtractor

- Removed JSON response and replaced it with a debug output wrapped in <pre> tags.
- This change allows for easier troubleshooting by displaying internal state information directly on the page.

* feat: inject partner logo into DefaultPageLayout and update JS file paths

- Modified the activation code setup script to change the path of JavaScript files to be relative to the web GUI's webroot.
- Added functionality to inject a partner logo into the DefaultPageLayout by replacing the existing logo string.
- Implemented a conditional backup mechanism for the DefaultPageLayout file before making changes.
- Included debug output to confirm successful injection or report errors during the process.

* feat: add partner logo display functionality and style adjustments

- Introduced a new file for displaying the partner logo, which retrieves the logo and URL based on the activation code.
- Added CSS styles to adjust the display properties of the partner logo in the header, ensuring proper sizing and alignment.
- Enhanced the integration of the partner logo into the existing plugin structure.

* refactor: simplify partner logo injection debug output in activation code setup script

- Removed syntax check for the DefaultPageLayout file after injecting the partner logo.
- Streamlined debug output to confirm successful injection without additional checks, enhancing clarity and reducing complexity.

* style: adjust partner logo height in myservers1.php

* style: update partner logo width in PartnerLogoImg.vue

- Changed the CSS class for the partner logo image from a max height constraint to a fixed width of 72 units, ensuring better responsiveness and alignment in the layout.

* fix: update modal title attribute for conditional close behavior

- Modified the title attribute of the modal overlay to conditionally display the close instruction based on the showCloseX property. This change improves accessibility by ensuring the title is only set when the close button is visible.

* refactor: update partner logo handling in activation code scripts and extractor

- Changed the partner logo file name to 'partner-logo.svg' in ActivationCodeExtractor.
- Simplified logo path handling by removing unnecessary file type checks and directly using the SVG file.
- Updated CSS in myservers1.php to target only the SVG logo.
- Modified activation code setup and removal scripts to consistently reference the SVG logo, improving clarity and maintainability.

* feat: enhance activation code setup script to include server name handling

- Added logic to retrieve and set the server name from the activation JSON if the current system model or comment is not set, or if the current name is "Tower".
- Improved debug output to include the partner server name, enhancing visibility during the activation process.
- Sanitized the partner server name to remove quotes and backslashes for better handling.

* feat: validate activation JSON before proceeding with setup

- Added validation for the activation JSON file to ensure it is correctly formatted before executing the setup process.
- Enhanced debug output to indicate whether the JSON is valid or not, improving troubleshooting capabilities.
- The setup will now only proceed if the activation JSON is confirmed to be valid, preventing potential errors during execution.

* fix(plg): improve warning message for invalid activation JSON in setup script

* feat: enhance activation code handling with partner logo integration

- Added a new optional property 'partnerLogo' to the ActivationCodeExtractor class and updated related interfaces to support boolean values for logo display.
- Removed the PNG logo reference from the activation code setup script, streamlining the logo handling process.
- Updated the server state to utilize the new 'partnerLogo' property, ensuring consistent logo display logic across the application.
- Adjusted computed properties in the activation code store to reflect the changes in logo handling, improving clarity and maintainability.

* fix: correct activation JSON validation in setup script

- Updated the activation code setup script to use 'jq empty' for validating the activation JSON file, ensuring proper error handling and validation.
- This change improves the robustness of the setup process by accurately checking the JSON format before proceeding.

* fix: correct comment formatting in dynamix.unraid.net.plg

- Fixed a formatting issue in the comment regarding the use of myservers.cfg values to prevent conflicts during installation. This change improves code readability and clarity.

* chore: update rsync activation script comments for clarity

- Revised comments in the rsync-activation-dir.sh script to better describe its purpose and usage.
- Enhanced documentation with an example usage to improve user understanding of the script's functionality.

* refactor: clean up activation data and extractor files

- Removed outdated copyright comments from activation-data.php and activation-code-extractor.php for improved readability.
- Simplified the debug output in activation-data.php by using short PHP tags.
- Updated the comment in the ActivationCodeExtractor class to be more concise, enhancing clarity for future developers.

* fix: remove unnecessary CSS properties in myservers1.php

- Eliminated redundant display and margin properties from the CSS in myservers1.php to streamline the styling and improve code clarity.

* refactor: streamline WebComponentsExtractor class and update method names

- Removed outdated copyright comments from web-components-extractor.php for improved readability.
- Renamed method getJsFileUrl() to getJSFileRelativePath() to enhance clarity and consistency in naming conventions.
- Adjusted indentation for better code formatting and readability.

* refactor: simplify partner logo handling in activation code script

- Removed unnecessary variable initialization and included only essential requires for improved clarity.
- Streamlined the code in partner-logo.php to focus on the core functionality of displaying the partner logo.
- Enhanced maintainability by reducing complexity in the script.

* refactor: clean up activation and server state files

- Removed outdated copyright comments and unnecessary variable initializations from activation-data.php and server-state.php for improved readability.
- Streamlined the code by eliminating redundant require statements, focusing on essential functionality.
- Enhanced maintainability and clarity by simplifying the structure of both files.

* feat: add password creation prompts to translations

- Introduced new translation strings for password creation in both PHP and JSON files.
- Enhanced user guidance by providing detailed messages about the importance of the password for system access and management.
- Improved overall user experience by ensuring clarity in the password setup process.

* refactor: update activation code setup script comments

* refactor: enhance activation code removal script functionality

- Updated the activation code removal script to delete additional related files, including PHP and setup scripts, for a more thorough cleanup.
- Improved comments for clarity on script usage and options, particularly regarding the self-delete functionality.
- Streamlined the deletion process by using an array to manage files to be removed, enhancing maintainability and readability.

* fix: update WelcomeModal to disable close button

* refactor: reorganize activation code setup and improve script clarity

- Moved the activation and partner setup section to follow the web component timestamp check to ensure correct targeting during setup.
- Updated comments for better clarity regarding the activation code setup process.
- Retained the warning message about not closing the window yet for user guidance.

* refactor: enhance activation code setup script with improved comments and logic

- Updated comments to clarify the purpose of server name, model, and description checks.
- Modified conditional logic to include additional checks for server identification.
- Added a TODO note regarding the necessity of updating the ident.cfg file, ensuring future review for potential optimizations.

* refactor: update activation code scripts to use .done flag

* refactor: introduce constant for activation modal storage key

- Added a new constant for the activation code modal hidden storage key to improve code maintainability and clarity.
- Updated the activation code store to utilize the new constant, replacing hardcoded string references.

* feat: enhance user onboarding and modal components

- Added new translation strings for activating Unraid licenses and creating Unraid.net accounts to improve user onboarding experience.
- Updated the WelcomeModal and Activation Modal components to reflect new messaging and improved styling options, including the ability to disable shadows.
- Implemented a workaround in the WelcomeModal to address font-size inconsistencies between login and authenticated pages.
- Refactored the index page to correctly pass server data to the WelcomeModal component.

* chore: comment out WelcomeModalCe component for testing

* feat: add disableOverlayClose prop to Modal and WelcomeModal components

- Introduced a new prop `disableOverlayClose` to the Modal component, allowing users to prevent closing the modal by clicking on the overlay.
- Updated the WelcomeModal component to utilize the new `disableOverlayClose` prop, enhancing modal behavior customization.

* refactor: update activation code removal script to delete by default

- Changed the activation code removal script to use a dry-run flag instead of a self-delete flag, enhancing safety during execution.
- Updated the plugin file to reflect the removal of the --delete option, ensuring consistency with the new script behavior.

---------

Co-authored-by: Eli Bosley <ekbosley@gmail.com>
Co-authored-by: Pujit Mehrotra <pujit@lime-technology.com>
mdatelle pushed a commit that referenced this pull request Jan 15, 2025
* feat: begin fixing dark mode in the webcomponents

* feat: lots of progress on colors

* feat: begin nuking alpha beta gamma

* feat: set background color on webcomponents

* fix: more color work

* feat: eliminate all alpha beta gamma variable usage

* feat: move variable declarations to theme.ts

* feat: begin fixing dark mode in the webcomponents

* feat: lots of progress on colors

* feat: begin nuking alpha beta gamma

* feat: set background color on webcomponents

* fix: more color work

* feat: eliminate all alpha beta gamma variable usage

* feat: download nodejs and install on legacy OS versions

* feat: do not move upgradepkg

* feat: array iteration for restoring files

* feat: separate install process

* feat: extract node to usr/local/

* feat: move variable declarations to theme.ts

* feat: remove nghttp3 and only bundle nodejs

* feat: validate entries correctly

* fix: upgradepkg

* feat: copy only needed files for nodejs

* fix: install syntax error

* fix: strip components from tar line

* feat: error when nodejs download fails

* feat(php): add OEM data extraction functionality

* feat(web): WIP add OEM activation modal and integrate OEM data handling

* refactor: replace oem etamology with activation

* feat(web): enhance activation modal with header and main title options

* refactor(web): update activation modal title to handle partner name conditionally

* feat: make partnerName optional in activation code data

* refactor: remove activationCodeStore from UserProfile component

* feat: integrate activation code data into server store

* feat: enhance activation code store to include callback actions and improve modal visibility logic

* refactor: remove unused theme reference from ColorSwitcher component

* fix: update partnerName in activationCodeData for clarity

* refactor: adjust gap spacing in Modal component for improved layout

* feat: enhance Activation Modal component with dynamic title and description, and add documentation buttons

* feat: implement localization for Activation Modal component titles and button texts

* feat: add new translations for activation prompts and welcome messages in the WebComponentTranslations class

* feat: implement key sequence to close Activation Modal and persist visibility state

* feat: update activation logic to conditionally activate or redeem based on activation code presence

* feat(plg): plg install / remove partner banner

* feat(plg): on install update config to enable display settings banner and on remove banner setting if no custom banner used

* fix(plg): plg remove, display banner no if no custom image

* feat(plg): implement partner banner handling and system model identification from activation JSON

* feat(web): add loading and error states to notification sidebar

* refactor(web): add container for loading & error states

* feat(web): add count labels to notification tabs

* refactor(web): lift notifications overview query to Sidebar from Indicator

* fix(web): refetch notifications for sidebar when new notifications arrive

* feat(web): move notification indicator icons to top-right of bell icon

previously, icons were placed next to bell icon because the status indicators
were not accessible to color-blind users. this commit replaces circular
status indicators with the icons.

* feat(web): remove notification indicator pulse

the pulse was initially added to provide visual feedback when:

1. a new notification arrived
2. an alert notification was unread

because we began using the legacy notify script, we now get a toast
on new notifications. re:2, feedback on the pulse was mixed, so i'm
removing it.

* refactor(plg): improve conditional for activation & partner setup

* feat(plg): add case model icon handling based on activation JSON

* feat(plg): enhance partner setup process with detailed logging and system identification updates and setup flag

* feat(plg): add setup flag file creation and logging for activation changes

* feat(plg): update activation setup flag checks for banner, case model icon, and system identity

* fix(plg): add error handling for invalid activation JSON and improve conditional checks for setup flags

* fix(plg): improve partner banner and case model icon setup logic with enhanced checks and comments

* fix(plg): update case model icon configuration to prevent newline issues in parsing

* fix(plg): remove unnecessary echo debug statements and improve setup flag handling for partner details

* fix(plg): remove unnecessary registration page check from activation code modal logic

* fix(plg): add overlay opacity prop to modal components for customizable background transparency

* fix(plg): enhance modal component with vertical centering option and adjust max-width

* fix(plg): enhance configuration handling by dynamically updating multiple header parameters in the config file

* fix(plg): improve comments and enhance setup flag handling for custom icons in activation logic

* fix(translations): correct capitalization and punctuation in user prompts for consistency

* fix(store): enhance activation code data structure with additional properties and correct partner URL reference

* fix(modal): enhance activation modal with dynamic partner logo and improved title handling

* fix(store): update activation code data structure with additional properties and correct partner details

* fix(index): refactor badge and button color handling with typed constants for improved maintainability

* fix(dependencies): add vue-tsc for improved TypeScript support in Vue projects

* refactor(plugin): remove unnecessary comments and clean up code structure

* refactor(plugin): remove todo comment for custom header logo

* fix(Modal): add partnerUrl handling for logo link and improve code structure

* fix(serverState): update partnerLogoPath to use a placeholder image for development

* feat(plugin): add rsync activation script for testing activation modal & installs

* refactor(activationCode): remove debug log for modal visibility check

* feat(plugin): enhance activation process by adding logo and case model handling

* refactor(activationCode): rename partnerLogoPath to partnerLogo and update handling for logo file type

* refactor(activationCode): remove debug log for partnerLogo watcher

* chore(nuxt.config): add ignore rule for webGui images directory

* refactor(plugin): rename params array to DISPLAY_PARAMS and update handling for configuration updates

* fix(web): partner logo handling for themes

* fix(plg): activation oem, custom case icon cfg handling

* fix(plugin): replace sed with awk for config file updates in DISPLAY_PARAMS handling

* fix(web): add target and rel attributes to partner logo link for security

* feat(plugin): add theme parameter to DISPLAY_PARAMS and activation code interface

* fix(plugin): replace sed with parameter expansion and awk for config file updates

* fix(plugin): reboot logic for plg install to prevent settings overwrite

* feat(plugin): streamline activation and partner setup by abstracting scripts for better maintainability

* fix(plugin): update script source paths for activation and partner setup

* fix(plugin): update script source paths for activation and partner setup to use relative paths

* fix(plugin): update script source paths for activation and partner setup to use absolute paths

* fix(plugin): add debug mode support to activation scripts and update setup flag handling

* fix(plugin): enhance activation scripts with debug mode and conditional execution for safety

* refactor(plugin): reposition execution of activation_code setup / remove scripts

* fix(plugin): add checks for activation_code_setup script existence and improve deletion logging

* fix(plugin): add option to remove setup flag after script execution

* fix(plugin): streamline activation script execution by removing unnecessary checks

* fix(plugin): remove duplicate activation_code_setup script sourcing

* feat(modal): add overlay color prop and enhance class binding for modal background

* feat(activation): update modal overlay color and opacity

* feat(plg): add WebComponentsExtractor class for managing JS file retrieval

* feat(plugin): myservers1.phpintegrate WebComponentsExtractor for dynamic script tag generation

* feat(activation): enhance getData method to support JSON output and add getDataForHtmlAttr for HTML-safe JSON

* refactor(activation): simplify getData method by removing parameters

* feat(plugin): add welcome-modal.php for displaying server state and web components

* refactor(web): activation code store rename modal visibility variables for clarity

* feat(web): add WelcomeModal component for user onboarding and server setup

* feat(plugin): activation_code setup and remove script support welcome modal

* refactor(plugin): streamline activation code setup script by removing some comments

* fix(plugin): update activation code setup script to prepend items to auth request allow list array

* feat: enhance ActivationCodeExtractor with partner logo handling and metadata extraction

- Added constants for document root and web GUI images directory.
- Introduced properties for partner name, URL, logo path, and logo file type.
- Implemented methods to retrieve partner logo path, render logo string, partner name, and URL.
- Enhanced data extraction logic to include partner-related information from JSON data.
- Added debug method for outputting internal state for troubleshooting.

* refactor: update activation-data.php to include debug output for ActivationCodeExtractor

- Removed JSON response and replaced it with a debug output wrapped in <pre> tags.
- This change allows for easier troubleshooting by displaying internal state information directly on the page.

* feat: inject partner logo into DefaultPageLayout and update JS file paths

- Modified the activation code setup script to change the path of JavaScript files to be relative to the web GUI's webroot.
- Added functionality to inject a partner logo into the DefaultPageLayout by replacing the existing logo string.
- Implemented a conditional backup mechanism for the DefaultPageLayout file before making changes.
- Included debug output to confirm successful injection or report errors during the process.

* feat: add partner logo display functionality and style adjustments

- Introduced a new file for displaying the partner logo, which retrieves the logo and URL based on the activation code.
- Added CSS styles to adjust the display properties of the partner logo in the header, ensuring proper sizing and alignment.
- Enhanced the integration of the partner logo into the existing plugin structure.

* refactor: simplify partner logo injection debug output in activation code setup script

- Removed syntax check for the DefaultPageLayout file after injecting the partner logo.
- Streamlined debug output to confirm successful injection without additional checks, enhancing clarity and reducing complexity.

* style: adjust partner logo height in myservers1.php

* style: update partner logo width in PartnerLogoImg.vue

- Changed the CSS class for the partner logo image from a max height constraint to a fixed width of 72 units, ensuring better responsiveness and alignment in the layout.

* fix: update modal title attribute for conditional close behavior

- Modified the title attribute of the modal overlay to conditionally display the close instruction based on the showCloseX property. This change improves accessibility by ensuring the title is only set when the close button is visible.

* refactor: update partner logo handling in activation code scripts and extractor

- Changed the partner logo file name to 'partner-logo.svg' in ActivationCodeExtractor.
- Simplified logo path handling by removing unnecessary file type checks and directly using the SVG file.
- Updated CSS in myservers1.php to target only the SVG logo.
- Modified activation code setup and removal scripts to consistently reference the SVG logo, improving clarity and maintainability.

* feat: enhance activation code setup script to include server name handling

- Added logic to retrieve and set the server name from the activation JSON if the current system model or comment is not set, or if the current name is "Tower".
- Improved debug output to include the partner server name, enhancing visibility during the activation process.
- Sanitized the partner server name to remove quotes and backslashes for better handling.

* feat: validate activation JSON before proceeding with setup

- Added validation for the activation JSON file to ensure it is correctly formatted before executing the setup process.
- Enhanced debug output to indicate whether the JSON is valid or not, improving troubleshooting capabilities.
- The setup will now only proceed if the activation JSON is confirmed to be valid, preventing potential errors during execution.

* fix(plg): improve warning message for invalid activation JSON in setup script

* feat: enhance activation code handling with partner logo integration

- Added a new optional property 'partnerLogo' to the ActivationCodeExtractor class and updated related interfaces to support boolean values for logo display.
- Removed the PNG logo reference from the activation code setup script, streamlining the logo handling process.
- Updated the server state to utilize the new 'partnerLogo' property, ensuring consistent logo display logic across the application.
- Adjusted computed properties in the activation code store to reflect the changes in logo handling, improving clarity and maintainability.

* fix: correct activation JSON validation in setup script

- Updated the activation code setup script to use 'jq empty' for validating the activation JSON file, ensuring proper error handling and validation.
- This change improves the robustness of the setup process by accurately checking the JSON format before proceeding.

* fix: correct comment formatting in dynamix.unraid.net.plg

- Fixed a formatting issue in the comment regarding the use of myservers.cfg values to prevent conflicts during installation. This change improves code readability and clarity.

* chore: update rsync activation script comments for clarity

- Revised comments in the rsync-activation-dir.sh script to better describe its purpose and usage.
- Enhanced documentation with an example usage to improve user understanding of the script's functionality.

* refactor: clean up activation data and extractor files

- Removed outdated copyright comments from activation-data.php and activation-code-extractor.php for improved readability.
- Simplified the debug output in activation-data.php by using short PHP tags.
- Updated the comment in the ActivationCodeExtractor class to be more concise, enhancing clarity for future developers.

* fix: remove unnecessary CSS properties in myservers1.php

- Eliminated redundant display and margin properties from the CSS in myservers1.php to streamline the styling and improve code clarity.

* refactor: streamline WebComponentsExtractor class and update method names

- Removed outdated copyright comments from web-components-extractor.php for improved readability.
- Renamed method getJsFileUrl() to getJSFileRelativePath() to enhance clarity and consistency in naming conventions.
- Adjusted indentation for better code formatting and readability.

* refactor: simplify partner logo handling in activation code script

- Removed unnecessary variable initialization and included only essential requires for improved clarity.
- Streamlined the code in partner-logo.php to focus on the core functionality of displaying the partner logo.
- Enhanced maintainability by reducing complexity in the script.

* refactor: clean up activation and server state files

- Removed outdated copyright comments and unnecessary variable initializations from activation-data.php and server-state.php for improved readability.
- Streamlined the code by eliminating redundant require statements, focusing on essential functionality.
- Enhanced maintainability and clarity by simplifying the structure of both files.

* feat: add password creation prompts to translations

- Introduced new translation strings for password creation in both PHP and JSON files.
- Enhanced user guidance by providing detailed messages about the importance of the password for system access and management.
- Improved overall user experience by ensuring clarity in the password setup process.

* refactor: update activation code setup script comments

* refactor: enhance activation code removal script functionality

- Updated the activation code removal script to delete additional related files, including PHP and setup scripts, for a more thorough cleanup.
- Improved comments for clarity on script usage and options, particularly regarding the self-delete functionality.
- Streamlined the deletion process by using an array to manage files to be removed, enhancing maintainability and readability.

* fix: update WelcomeModal to disable close button

* refactor: reorganize activation code setup and improve script clarity

- Moved the activation and partner setup section to follow the web component timestamp check to ensure correct targeting during setup.
- Updated comments for better clarity regarding the activation code setup process.
- Retained the warning message about not closing the window yet for user guidance.

* refactor: enhance activation code setup script with improved comments and logic

- Updated comments to clarify the purpose of server name, model, and description checks.
- Modified conditional logic to include additional checks for server identification.
- Added a TODO note regarding the necessity of updating the ident.cfg file, ensuring future review for potential optimizations.

* refactor: update activation code scripts to use .done flag

* refactor: introduce constant for activation modal storage key

- Added a new constant for the activation code modal hidden storage key to improve code maintainability and clarity.
- Updated the activation code store to utilize the new constant, replacing hardcoded string references.

* feat: enhance user onboarding and modal components

- Added new translation strings for activating Unraid licenses and creating Unraid.net accounts to improve user onboarding experience.
- Updated the WelcomeModal and Activation Modal components to reflect new messaging and improved styling options, including the ability to disable shadows.
- Implemented a workaround in the WelcomeModal to address font-size inconsistencies between login and authenticated pages.
- Refactored the index page to correctly pass server data to the WelcomeModal component.

* chore: comment out WelcomeModalCe component for testing

* feat: add disableOverlayClose prop to Modal and WelcomeModal components

- Introduced a new prop `disableOverlayClose` to the Modal component, allowing users to prevent closing the modal by clicking on the overlay.
- Updated the WelcomeModal component to utilize the new `disableOverlayClose` prop, enhancing modal behavior customization.

* refactor: update activation code removal script to delete by default

- Changed the activation code removal script to use a dry-run flag instead of a self-delete flag, enhancing safety during execution.
- Updated the plugin file to reflect the removal of the --delete option, ensuring consistency with the new script behavior.

---------

Co-authored-by: Eli Bosley <ekbosley@gmail.com>
Co-authored-by: Pujit Mehrotra <pujit@lime-technology.com>
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.

4 participants