diff --git a/frontend/components/AddHostsModal/PlatformWrapper/PlatformWrapper.tsx b/frontend/components/AddHostsModal/PlatformWrapper/PlatformWrapper.tsx index eb230d321..3506f9100 100644 --- a/frontend/components/AddHostsModal/PlatformWrapper/PlatformWrapper.tsx +++ b/frontend/components/AddHostsModal/PlatformWrapper/PlatformWrapper.tsx @@ -219,33 +219,33 @@ const PlatformWrapper = ({ ); }; - const renderInstallerString = (platform: string) => { - return platform === "advanced" + const renderInstallerString = (packageType: string) => { + return packageType === "advanced" ? `fleetctl package --type=YOUR_TYPE --fleet-url=${config?.server_settings.server_url} --enroll-secret=${enrollSecret} --fleet-certificate=PATH_TO_YOUR_CERTIFICATE/fleet.pem` - : `fleetctl package --type=${platform} ${ + : `fleetctl package --type=${packageType} ${ includeFleetDesktop ? "--fleet-desktop " : "" }--fleet-url=${ config?.server_settings.server_url } --enroll-secret=${enrollSecret}`; }; - const renderLabel = (platform: string, installerString: string) => { + const renderLabel = (packageType: string, installerString: string) => { const onCopyInstaller = (evt: React.MouseEvent) => { evt.preventDefault(); stringToClipboard(installerString) .then(() => - setCopyMessage((prev) => ({ ...prev, [platform]: "Copied!" })) + setCopyMessage((prev) => ({ ...prev, [packageType]: "Copied!" })) ) .catch(() => - setCopyMessage((prev) => ({ ...prev, [platform]: "Copy failed" })) + setCopyMessage((prev) => ({ ...prev, [packageType]: "Copy failed" })) ); // Clear message after 1 second setTimeout( - () => setCopyMessage((prev) => ({ ...prev, [platform]: "" })), + () => setCopyMessage((prev) => ({ ...prev, [packageType]: "" })), 1000 ); @@ -254,7 +254,7 @@ const PlatformWrapper = ({ return ( <> - {platform === "plain-osquery" ? ( + {packageType === "plain-osquery" ? ( <>
With{" "} @@ -274,7 +274,7 @@ const PlatformWrapper = ({ > ) : ( - With the{" "} + Run this command with the{" "} - {copyMessage[platform] && ( + {copyMessage[packageType] && ( {`${copyMessage[platform]} `} + >{`${copyMessage[packageType]} `} )}