Verify Linux installer architecture selection and display available targets

This commit is contained in:
2026-11-18 17:59:19 +01:00
parent 247646a2ba
commit 8b5365f4bc
3 changed files with 31 additions and 5 deletions
+4 -3
View File
@@ -203,8 +203,9 @@ function DeviceEnrollment({ tenantId, auth, customerName }: { tenantId: string;
const linuxArchitectures = [
['x86_64-unknown-linux-gnu', 'x86-64'],
['aarch64-unknown-linux-gnu', 'ARM64'],
].filter(([target]) => enrollment?.platforms.includes(target)).map(([, label]) => label);
const linuxInstaller = origin && linuxArchitectures.length > 0 ? `${origin}/install/linux.sh` : null;
] as const;
const availableLinuxArchitectures = linuxArchitectures.filter(([target]) => enrollment?.platforms.includes(target)).map(([, label]) => label);
const linuxInstaller = origin && availableLinuxArchitectures.length > 0 ? `${origin}/install/linux.sh` : null;
const windowsPlatforms = ['x86_64-pc-windows-gnu', 'x86_64-pc-windows-msvc'].filter(platform => enrollment?.platforms.includes(platform));
const windowsInstaller = origin && windowsPlatforms.length > 0 ? `${origin}/install/windows.ps1` : null;
return <section aria-label="Gerät aufnehmen"><h2>Gerät aufnehmen</h2>
@@ -245,7 +246,7 @@ function DeviceEnrollment({ tenantId, auth, customerName }: { tenantId: string;
{enrollment && !origin && <p role="status">Für die Geräteaufnahme ist keine HTTPS-Downloadadresse konfiguriert.</p>}
{origin && !linuxInstaller && !windowsInstaller && <p role="status">Für diesen Kunden ist derzeit kein Linux- oder Windows-Installer verfügbar.</p>}
{linuxInstaller && <>
<h4>Linux ({linuxArchitectures.join(' und ')})</h4>
<h4>Linux ({availableLinuxArchitectures.join(' und ')})</h4>
<p>Installationsskript <a href={linuxInstaller} target="_blank" rel="noopener noreferrer">linux.sh</a></p>
<pre>{`curl --fail --show-error --silent '${linuxInstaller}' -o linux.sh && sudo sh linux.sh '${origin}'${adminScripts ? ' --enable-admin-scripts' : ''}`}</pre>
</>}