Skip to content

fix(Bootinfo): Show additional GUIDs#2571

Closed
SimonFair wants to merge 1 commit intounraid:masterfrom
SimonFair:change-flash-name
Closed

fix(Bootinfo): Show additional GUIDs#2571
SimonFair wants to merge 1 commit intounraid:masterfrom
SimonFair:change-flash-name

Conversation

@SimonFair
Copy link
Contributor

@SimonFair SimonFair commented Mar 13, 2026

Summary by CodeRabbit

New Features

  • Added TPM detection to identify when TPM hardware is present on your system.
  • TPM Licensing and TPM GUID information now display conditionally based on TPM availability, improving system information clarity.

@github-actions
Copy link

🔧 PR Test Plugin Available

A test plugin has been generated for this PR that includes the modified files.

Version: 2026.03.13.0909
Build: View Workflow Run

📥 Installation Instructions:

Install via Unraid Web UI:

  1. Go to Plugins → Install Plugin
  2. Copy and paste this URL:
https://preview.dl.unraid.net/pr-plugins/pr-2571/webgui-pr-2571.plg
  1. Click Install

Alternative: Direct Download

⚠️ Important Notes:

  • Testing only: This plugin is for testing PR changes
  • Backup included: Original files are automatically backed up
  • Easy removal: Files are restored when plugin is removed
  • Conflicts: Remove this plugin before installing production updates

📝 Modified Files:

Click to expand file list
emhttp/plugins/dynamix/BootInfo.page

🔄 To Remove:

Navigate to Plugins → Installed Plugins and remove webgui-pr-2571, or run:

plugin remove webgui-pr-2571

🤖 This comment is automatically generated and will be updated with each new push to this PR.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 13, 2026

Walkthrough

The change introduces TPM detection in the BootInfo page template by adding a server-side variable that checks for TPM device availability, enabling conditional rendering of TPM-related information fields (Licensing and GUID) when a TPM device is present.

Changes

Cohort / File(s) Summary
TPM Detection & Conditional UI
emhttp/plugins/dynamix/BootInfo.page
Added $tpmEnabled flag via directory check for TPM device (/sys/class/tpm/tpm0). Introduced conditional block to display TPM Licensing and GUID rows only when TPM is available, using existing $var['tpmGUID'] variable.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A whisker-twitch for TPM's gleam,
Device detection, a rabbit's dream!
When hardware hops with secrets true,
The BootInfo page shows them too! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title mentions 'Show additional GUIDs' but the primary change is adding TPM detection and conditional rendering of TPM-specific fields, not broadly showing additional GUIDs. Consider revising the title to more specifically reflect the main change, such as 'Add TPM detection and conditional TPM field rendering' or 'Show TPM fields when TPM device is available'.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
📝 Coding Plan
  • Generate coding plan for human review comments

Comment @coderabbitai help to get the list of available commands and usage tips.

Tip

CodeRabbit can generate a title for your PR based on the changes with custom instructions.

Set the reviews.auto_title_instructions setting to generate a title for your PR based on the changes in the PR with custom instructions.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@emhttp/plugins/dynamix/BootInfo.page`:
- Around line 58-64: The TPM section is shown when $tpmEnabled is true even if
$var['tpmGUID'] is empty; change the guard to require a non-empty GUID (e.g.
check !empty(trim($var['tpmGUID']))) before rendering the TPM block so the "TPM
licensing is available." message and GUID label only appear when a real GUID
exists; update the conditional around the TPM block (referenced by $tpmEnabled
and $var['tpmGUID']) to include this check and leave the htmlspecialchars output
as-is.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: cbdfafd8-d762-4f04-8b77-490e5a3ac554

📥 Commits

Reviewing files that changed from the base of the PR and between e9b1f01 and 937f55a.

📒 Files selected for processing (1)
  • emhttp/plugins/dynamix/BootInfo.page

Comment on lines +58 to +64
<?if ($tpmEnabled):?>
_(TPM Licensing)_:
: _(TPM licensing is available.)_

_(TPM GUID)_:
: <?=htmlspecialchars($var['tpmGUID'] ?? '', ENT_QUOTES, 'UTF-8');?>&nbsp;
<?endif;?>
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Guard TPM messaging on actual GUID presence.

This block can currently show “TPM licensing is available.” even when tpmGUID is empty. Consider requiring a non-empty GUID before rendering the TPM section to avoid contradictory UI state.

Suggested adjustment
-<?if ($tpmEnabled):?>
+<?$tpmGuid = trim((string)($var['tpmGUID'] ?? ''));?>
+<?if ($tpmEnabled && $tpmGuid !== ''):?>
 _(TPM Licensing)_:
 : _(TPM licensing is available.)_
 
 _(TPM GUID)_:
-: <?=htmlspecialchars($var['tpmGUID'] ?? '', ENT_QUOTES, 'UTF-8');?>&nbsp;
+: <?=htmlspecialchars($tpmGuid, ENT_QUOTES, 'UTF-8');?>&nbsp;
 <?endif;?>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<?if ($tpmEnabled):?>
_(TPM Licensing)_:
: _(TPM licensing is available.)_
_(TPM GUID)_:
: <?=htmlspecialchars($var['tpmGUID'] ?? '', ENT_QUOTES, 'UTF-8');?>&nbsp;
<?endif;?>
<?$tpmGuid = trim((string)($var['tpmGUID'] ?? ''));?>
<?if ($tpmEnabled && $tpmGuid !== ''):?>
_(TPM Licensing)_:
: _(TPM licensing is available.)_
_(TPM GUID)_:
: <?=htmlspecialchars($tpmGuid, ENT_QUOTES, 'UTF-8');?>&nbsp;
<?endif;?>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@emhttp/plugins/dynamix/BootInfo.page` around lines 58 - 64, The TPM section
is shown when $tpmEnabled is true even if $var['tpmGUID'] is empty; change the
guard to require a non-empty GUID (e.g. check !empty(trim($var['tpmGUID'])))
before rendering the TPM block so the "TPM licensing is available." message and
GUID label only appear when a real GUID exists; update the conditional around
the TPM block (referenced by $tpmEnabled and $var['tpmGUID']) to include this
check and leave the htmlspecialchars output as-is.

@SimonFair SimonFair closed this Mar 16, 2026
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.

1 participant