Handle PowerShell UTF-16 output and show Windows edition
This commit is contained in:
parent
459bd53693
commit
0aa474c88e
2 changed files with 49 additions and 15 deletions
|
|
@ -1092,6 +1092,20 @@ export function MachineDetails({ machine }: MachineDetailsProps) {
|
|||
return null
|
||||
}
|
||||
})()
|
||||
const osNameDisplay = useMemo(() => {
|
||||
const base = machine?.osName?.trim()
|
||||
const edition = windowsEditionLabel?.trim()
|
||||
if (edition) {
|
||||
if (base && edition.toLowerCase().includes(base.toLowerCase())) {
|
||||
return edition
|
||||
}
|
||||
if (base) {
|
||||
return `${base} ${edition}`.replace(/\s+/g, " ").trim()
|
||||
}
|
||||
return edition
|
||||
}
|
||||
return base ?? ""
|
||||
}, [machine?.osName, windowsEditionLabel])
|
||||
const linuxLsblk = linuxExt?.lsblk ?? []
|
||||
const linuxSmartEntries = linuxExt?.smart ?? []
|
||||
const normalizedHardwareGpus = Array.isArray(hardware?.gpus)
|
||||
|
|
@ -1176,7 +1190,7 @@ export function MachineDetails({ machine }: MachineDetailsProps) {
|
|||
|
||||
const summaryChips = useMemo(() => {
|
||||
const chips: Array<{ key: string; label: string; value: string; icon: ReactNode; tone?: "warning" | "muted" }> = []
|
||||
const osName = machine?.osName ?? "Sistema desconhecido"
|
||||
const osName = osNameDisplay || "Sistema desconhecido"
|
||||
const osVersion = machine?.osVersion ?? windowsVersionLabel ?? ""
|
||||
chips.push({
|
||||
key: "os",
|
||||
|
|
@ -1227,7 +1241,7 @@ export function MachineDetails({ machine }: MachineDetailsProps) {
|
|||
})
|
||||
}
|
||||
return chips
|
||||
}, [machine?.osName, machine?.osVersion, machine?.architecture, windowsVersionLabel, windowsBuildLabel, windowsActivationStatus, primaryGpu, collaborator?.email, collaborator?.name, personaLabel])
|
||||
}, [osNameDisplay, machine?.osVersion, machine?.architecture, windowsVersionLabel, windowsBuildLabel, windowsActivationStatus, primaryGpu, collaborator?.email, collaborator?.name, personaLabel, machine?.osName])
|
||||
|
||||
const companyName = (() => {
|
||||
if (!companies || !machine?.companySlug) return machine?.companySlug ?? null
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue