Display Windows CRLF as a line break in stored script output

This commit is contained in:
2026-11-18 10:22:38 +01:00
parent a0b3aa46f5
commit 6d4f53dcae
3 changed files with 21 additions and 10 deletions
+3 -3
View File
@@ -14,7 +14,7 @@ import './style.css';
import { AdminControl, Catalog, TenantControls } from './management';
import { allowed, availableActions, parseStrictJson, powerShellApprovalBlockers, powerShellPlanJobs, rootWarning, systemWarning, systemPlanJobs, validateSensitiveInput, verifyPlanIntegrity, queryLogsApprovalBlockers, queryLogsPlanJobs, windowsMsiApprovalBlockers, windowsMsiPlanJobs, verifyWindowsMsiManifest, fullMaintenanceWarning } from './safety';
import { Login } from './login';
import { ConsoleOutput, outputText } from './console-output';
import { ConsoleOutput, visibleControls } from './console-output';
import { scriptApprovalBlockers, scriptPlanJobs, verifyScriptPlan } from './script-console';
import { agentUpdateWarning, agentUpdatePlanJobs, agentUpdateApprovalBlockers, verifyAgentUpdatePlan, verifyReleaseMetadata, releaseEnvelope, uploadAgentUpdateArtifact } from './agent-updates';
@@ -56,7 +56,7 @@ export function ScriptPlanNotice({ plan }: { plan: RecordValue }) {
{job.privilegedProfile === fullMaintenanceScriptProfile && <p className="warning">{fullMaintenanceWarning}</p>}
{job.identity === 'root' && job.privilegedProfile !== fullMaintenanceScriptProfile && <p className="warning">{rootWarning}</p>}
{job.interpreter === 'powershell' && <p>Windows PowerShell 5.1 · {job.windowsProfile === windowsPowerShellRemoteSignedProfile ? 'RemoteSigned für diesen Prozess' : 'Richtlinie des Geräts'}</p>}
<pre aria-label="Vollständiger Skripttext">{outputText(new TextEncoder().encode(job.script)).text}</pre>
<pre aria-label="Vollständiger Skripttext">{visibleControls(job.script)}</pre>
{job.arguments.length > 0 && <p>Argumente <code>{JSON.stringify(job.arguments)}</code></p>}
{job.expectedStdout !== null && <p>Erwartete Ausgabe <code>{JSON.stringify(job.expectedStdout)}</code></p>}
<details><summary>Ausführungsdetails und Prüfsummen</summary>
@@ -499,7 +499,7 @@ function OrderScript({ tenantId, operation, names }: { tenantId: string; operati
return target ? deviceName(target) : job.assetId;
}).join(', ')}</h4>}
<p className="muted">{script.revision ? 'Version ' + script.revision.version : 'Einmaliges Skript'} · {script.interpreter}</p>
<pre className="script-body" aria-label="Gespeicherter Skripttext" tabIndex={0}>{outputText(new TextEncoder().encode(script.script.replace(/\r\n/g, '\n'))).text}</pre>
<pre className="script-body" aria-label="Gespeicherter Skripttext" tabIndex={0}>{visibleControls(script.script.replace(/\r\n/g, '\n'))}</pre>
</div>;
})}
</article>;