Add Host Modal: Generate fleet installer with fleet desktop (#4522)

This commit is contained in:
RachelElysia 2022-03-09 10:49:19 -05:00 committed by GitHub
parent f99bb001c0
commit e21299c124
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 31 additions and 3 deletions

View File

@ -0,0 +1 @@
* Add ability in UI to generate a Fleet installer that includes Fleet Desktop

View File

@ -16,6 +16,8 @@ import { IEnrollSecret } from "interfaces/enroll_secret";
import Button from "components/buttons/Button";
// @ts-ignore
import InputField from "components/forms/fields/InputField";
import Checkbox from "components/forms/fields/Checkbox";
import TooltipWrapper from "components/TooltipWrapper";
import TabsWrapper from "components/TabsWrapper";
import { isValidPemCertificate } from "../../../pages/hosts/ManageHostsPage/helpers";
@ -64,6 +66,9 @@ const PlatformWrapper = ({
}: IPlatformWrapperProp): JSX.Element => {
const { config, isPreviewMode } = useContext(AppContext);
const [copyMessage, setCopyMessage] = useState<string>("");
const [includeFleetDesktop, setIncludeFleetDesktop] = useState<boolean>(
false
);
const dispatch = useDispatch();
@ -173,7 +178,9 @@ const PlatformWrapper = ({
const renderInstallerString = (platform: string) => {
return platform === "advanced"
? "osqueryd --flagfile=flagfile.txt --verbose"
: `fleetctl package --type=${platform} --fleet-url=${config?.server_url} --enroll-secret=${enrollSecret}`;
: `fleetctl package --type=${platform} ${
includeFleetDesktop ? "--fleet-desktop " : ""
}--fleet-url=${config?.server_url} --enroll-secret=${enrollSecret}`;
};
const renderLabel = (platform: string, installerString: string) => {
@ -335,6 +342,22 @@ const PlatformWrapper = ({
}
return (
<>
<Checkbox
name="include-fleet-desktop"
onChange={() => setIncludeFleetDesktop(!includeFleetDesktop)}
value={includeFleetDesktop}
>
<>
Include&nbsp;
<TooltipWrapper
tipContent={
"<p>Lightweight application that allows end users to see information about their device.</p>"
}
>
Fleet Desktop
</TooltipWrapper>
</>
</Checkbox>
<InputField
disabled
inputWrapperClass={`${baseClass}__installer-input ${baseClass}__installer-input-${platform}`}

View File

@ -28,7 +28,7 @@
}
&__info {
margin-top: $pad-small;
margin-top: $pad-medium;
}
&__cta {
@ -37,6 +37,10 @@
margin: 0;
}
.fleet-checkbox {
display: flex;
}
.form-field {
margin-bottom: $pad-small;

View File

@ -39,7 +39,7 @@
content: "";
width: 100%;
height: 0;
border-bottom: 1px solid #6a67fe;
border-bottom: 2px solid #6a67fe;
position: absolute;
bottom: 0;
left: 0;