fleet/frontend/components/AddHostsModal/PlatformWrapper/IosIpadosPanel/IosIpadosPanel.tsx
Marko Lisica b233493d45
Update enrollment links font to monospaced (#37279)
<!-- Add the related story/sub-task/bug number, like Resolves #123, or
remove if NA -->
**Related issue:** Resolves #36754

# Checklist for submitter

If some of the following don't apply, delete the relevant line.

- [x] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.
See [Changes
files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/guides/committing-changes.md#changes-files)
for more information.

## Testing

- [x] QA'd all new/changed functionality manually


Screenshots:

<img width="849" height="394" alt="Screenshot 2025-12-15 at 18 03 06"
src="https://github.com/user-attachments/assets/054d0d99-59b7-4664-b682-fb68a5cccad8"
/>
<img width="882" height="421" alt="Screenshot 2025-12-15 at 18 02 42"
src="https://github.com/user-attachments/assets/87ac021e-d88a-4cbf-8b46-8f674d838d3c"
/>
2025-12-16 14:35:46 +01:00

61 lines
1.5 KiB
TypeScript

import React, { useContext } from "react";
import CustomLink from "components/CustomLink";
import PATHS from "router/paths";
import { AppContext } from "context/app";
// @ts-ignore
import InputField from "components/forms/fields/InputField";
const generateUrl = (serverUrl: string, enrollSecret: string) => {
return `${serverUrl}/enroll?enroll_secret=${encodeURIComponent(
enrollSecret
)}`;
};
const baseClass = "ios-ipados-panel";
interface IosIpadosPanelProps {
enrollSecret: string;
}
const IosIpadosPanel = ({ enrollSecret }: IosIpadosPanelProps) => {
const { config, isMacMdmEnabledAndConfigured } = useContext(AppContext);
const helpText =
"When the end user navigates to this URL, the enrollment profile " +
"will download in their browser. End users will have to install the profile " +
"to enroll to Fleet.";
if (!config) return null;
if (!isMacMdmEnabledAndConfigured) {
return (
<p>
<CustomLink
url={PATHS.ADMIN_INTEGRATIONS_MDM_APPLE}
text="Turn on Apple MDM"
/>{" "}
to enroll iOS & iPadOS hosts.
</p>
);
}
const url = generateUrl(config.server_settings.server_url, enrollSecret);
return (
<div className={baseClass}>
<InputField
label="Send this to your end users:"
enableCopy
readOnly
inputWrapperClass={`${baseClass}__enroll-link`}
name="enroll-link"
value={url}
helpText={helpText}
/>
</div>
);
};
export default IosIpadosPanel;