fix(Bootinfo): Show additional GUIDs#2571
Conversation
🔧 PR Test Plugin AvailableA test plugin has been generated for this PR that includes the modified files. Version: 📥 Installation Instructions:Install via Unraid Web UI:
Alternative: Direct Download
|
WalkthroughThe 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
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Comment Tip CodeRabbit can generate a title for your PR based on the changes with custom instructions.Set the |
There was a problem hiding this comment.
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
📒 Files selected for processing (1)
emhttp/plugins/dynamix/BootInfo.page
| <?if ($tpmEnabled):?> | ||
| _(TPM Licensing)_: | ||
| : _(TPM licensing is available.)_ | ||
|
|
||
| _(TPM GUID)_: | ||
| : <?=htmlspecialchars($var['tpmGUID'] ?? '', ENT_QUOTES, 'UTF-8');?> | ||
| <?endif;?> |
There was a problem hiding this comment.
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');?>
+: <?=htmlspecialchars($tpmGuid, ENT_QUOTES, 'UTF-8');?>
<?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.
| <?if ($tpmEnabled):?> | |
| _(TPM Licensing)_: | |
| : _(TPM licensing is available.)_ | |
| _(TPM GUID)_: | |
| : <?=htmlspecialchars($var['tpmGUID'] ?? '', ENT_QUOTES, 'UTF-8');?> | |
| <?endif;?> | |
| <?$tpmGuid = trim((string)($var['tpmGUID'] ?? ''));?> | |
| <?if ($tpmEnabled && $tpmGuid !== ''):?> | |
| _(TPM Licensing)_: | |
| : _(TPM licensing is available.)_ | |
| _(TPM GUID)_: | |
| : <?=htmlspecialchars($tpmGuid, ENT_QUOTES, 'UTF-8');?> | |
| <?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.
Summary by CodeRabbit
New Features