fix parsing error #2

This commit is contained in:
Oliver Kieselbach
2026-03-19 18:06:24 +01:00
parent ae3bad5543
commit 374cb002b0
3 changed files with 9 additions and 3 deletions
@@ -326,7 +326,11 @@ export default function DeviceDetailsCard({ events }: { events: EnrollmentEvent[
<DetailRow label="Boot Time" value={estimatedBootTime.toLocaleString([], { dateStyle: "short", timeStyle: "medium" })} />
)}
{uptimeUntilEnrollment && <DetailRow label="Uptime until enrollment starts" value={uptimeUntilEnrollment} />}
{agentStarted?.agentVersion && <DetailRow label="Monitor Agent Version" value={agentStarted.agentVersion.replace(/\+([0-9a-f]{7})[0-9a-f]+$/, '+$1')} />}
{agentStarted?.agentVersion && (() => {
const v = agentStarted.agentVersion;
if (typeof v !== 'string') { console.error('[DeviceDetailsCard] agentVersion is not a string:', typeof v, v); return null; }
return <DetailRow label="Monitor Agent Version" value={v.replace(/\+([0-9a-f]{7})[0-9a-f]+$/, '+$1')} />;
})()}
{imeVersion && <DetailRow label="IME Agent Version" value={imeVersion.version ?? imeVersion.agentVersion ?? "Unknown"} />}
{(deviceLocation?.country || deviceLocation?.Country) && (
<DetailRow label="Country" value={deviceLocation.country ?? deviceLocation.Country} />
@@ -363,7 +363,9 @@ function EventRow({ event, showScriptOutput }: { event: EnrollmentEvent; showScr
: null;
const hasGatherOutput = gatherOutput != null && gatherOutput !== "";
const formattedOutput = hasGatherOutput
? gatherOutput.replace(/\r\n/g, "\n").replace(/\r/g, "\n")
? (typeof gatherOutput === 'string'
? gatherOutput.replace(/\r\n/g, "\n").replace(/\r/g, "\n")
: (console.error('[EventTimeline] gatherOutput is not a string:', typeof gatherOutput, gatherOutput), null))
: null;
const copyDetailContent = async (text: string) => {
File diff suppressed because one or more lines are too long