mirror of
https://github.com/fleetdm/fleet
synced 2026-05-22 16:39:01 +00:00
for #21019 # Checklist for submitter If some of the following don't apply, delete the relevant line. <!-- Note that API documentation changes are now addressed by the product design team. --> - [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/Committing-Changes.md#changes-files) for more information. - [x] Input data is properly validated, `SELECT *` is avoided, SQL injection is prevented (using placeholders for values in statements) - [x] Added/updated tests - [x] Manual QA for all new/changed functionality
48 lines
1.2 KiB
TypeScript
48 lines
1.2 KiB
TypeScript
import React, { useContext } from "react";
|
|
|
|
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 } = 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;
|
|
|
|
const url = generateUrl(config.server_settings.server_url, enrollSecret);
|
|
|
|
return (
|
|
<div className={baseClass}>
|
|
<InputField
|
|
label="Send this to your end users:"
|
|
enableCopy
|
|
copyButtonPosition="inside"
|
|
readOnly
|
|
inputWrapperClass
|
|
name="enroll-link"
|
|
value={url}
|
|
helpText={helpText}
|
|
/>
|
|
</div>
|
|
);
|
|
};
|
|
|
|
export default IosIpadosPanel;
|