Skip to content

Fix raw OS values still displayed after kernel mapping introduction#3

Merged
cbulock merged 3 commits into
mainfrom
copilot/fix-os-raw-values-display
May 14, 2026
Merged

Fix raw OS values still displayed after kernel mapping introduction#3
cbulock merged 3 commits into
mainfrom
copilot/fix-os-raw-values-display

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 14, 2026

The OS field showed raw SNMP sysDescr strings in two cases: Ubuntu/Unraid mappings resolved correctly but still appended the full verbose sysDescr in parentheses; QNAP devices had no mapping at all since their sysDescr (Linux TS-X53II 5.2.7.3297) contains no recognizable OS keyword.

Changes

  • formatKernelMappedOs: Replace full sysDescr in parentheses with just the kernel version — Ubuntu 24.04 LTS / 22.04 HWE kernel family (Linux 6.8.0) instead of Ubuntu 24.04 LTS / 22.04 HWE kernel family (Linux ai 6.8.0-90-generic #91-Ubuntu SMP PREEMPT_DYNAMIC ...)

  • formatOs: Accept a second detectedType argument to use backend-resolved server type (needed for QNAP, where storage-path detection fires but sysDescr contains no "qnap" string). Add QNAP branch: extracts firmware version from trailing numeric segment and returns QNAP QTS <version>.

  • Template: Pass stats[server.id].detectedType to formatOs alongside sysDescr.

// Before
formatOs(stats[server.id].sysDescr)
// → "Linux TS-X53II 5.2.7.3297"

// After
formatOs(stats[server.id].sysDescr, stats[server.id].detectedType)
// → "QNAP QTS 5.2.7.3297"

@cbulock cbulock marked this pull request as ready for review May 14, 2026 21:42
Copilot AI review requested due to automatic review settings May 14, 2026 21:42
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes the OS display so kernel-mapped strings no longer append the full verbose sysDescr, and adds a QNAP branch driven by the backend-resolved detectedType since QNAP sysDescr strings don't contain a recognizable OS keyword.

Changes:

  • formatKernelMappedOs now appends only Linux <kernelVersion> instead of the full sysDescr.
  • formatOs accepts a detectedType argument and uses it (alongside sysDescr substring matching) to route Unraid/Ubuntu and a new QNAP case (extracts trailing version → QNAP QTS <version>).
  • Template passes stats[server.id].detectedType into formatOs.
Comments suppressed due to low confidence (1)

web/src/App.vue:455

  • The trailing-version regex /(\d+\.\d+(?:\.\d+)*)\s*$/ will pick up any trailing version-like string in the sysDescr, which for non-QTS QNAP descriptions could be a model number (e.g. TS-X53II-style with numeric suffix is filtered by hyphen, but other model variants may end in a bare version-like token). Worth adding a small unit test for the QNAP branch given the brittleness of pattern-matching here, since this file has no test coverage for formatOs yet.
  if (detectedType === "qnap") {
    const versionMatch = normalized.match(/(\d+\.\d+(?:\.\d+)*)\s*$/);
    if (versionMatch) return `QNAP QTS ${versionMatch[1]}`;
    return "QNAP";
  }

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread web/src/App.vue Outdated
Comment thread web/src/App.vue Outdated
cbulock and others added 2 commits May 14, 2026 17:45
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@cbulock cbulock merged commit 66006a0 into main May 14, 2026
2 checks passed
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.

3 participants