Fix raw OS values still displayed after kernel mapping introduction#3
Merged
Conversation
Agent-Logs-Url: https://github.com/cbulock/server-dashboard/sessions/c8a19244-d9de-4f8b-bc49-6a8e43cb8867 Co-authored-by: cbulock <176519+cbulock@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
cbulock
May 14, 2026 21:41
View session
Contributor
There was a problem hiding this comment.
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:
formatKernelMappedOsnow appends onlyLinux <kernelVersion>instead of the full sysDescr.formatOsaccepts adetectedTypeargument 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].detectedTypeintoformatOs.
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 forformatOsyet.
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.
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 ofUbuntu 24.04 LTS / 22.04 HWE kernel family (Linux ai 6.8.0-90-generic #91-Ubuntu SMP PREEMPT_DYNAMIC ...)formatOs: Accept a seconddetectedTypeargument 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 returnsQNAP QTS <version>.Template: Pass
stats[server.id].detectedTypetoformatOsalongsidesysDescr.