mirror of
https://github.com/fleetdm/fleet
synced 2026-04-21 21:47:20 +00:00
* added storybook * added avatar component * added button story * added dropdown button story * removed unused ellipsis component * cleaned up modal path * reorganized enroll secrets table file * added flash story; removed unused persistent flash * added fleet ace story * added checkbox story * added dropdown story * added input story * fixed storybook build * fixed avatar * added input with icon story * added radio button story * added select targets dropdown story * added slider story * added tooltip story * added info banner story * removed unused loaders; added spinner story * added modal story * removed unused NumberPill * added pagination story * lint fixes * added documentation to run * modified documentation * fixed corelayout test * fixed format for date-fns * fixed date format that breaks tests * wait for page
60 lines
1.5 KiB
TypeScript
60 lines
1.5 KiB
TypeScript
import React from "react";
|
|
|
|
import Modal from "components/Modal";
|
|
import Button from "components/buttons/Button";
|
|
|
|
const baseClass = "delete-host-modal";
|
|
|
|
interface IDeleteHostModalProps {
|
|
selectedHostIds: number[];
|
|
onSubmit: () => void;
|
|
onCancel: () => void;
|
|
isAllMatchingHostsSelected: boolean;
|
|
}
|
|
|
|
const DeleteHostModal = ({
|
|
selectedHostIds,
|
|
onSubmit,
|
|
onCancel,
|
|
isAllMatchingHostsSelected,
|
|
}: IDeleteHostModalProps): JSX.Element => {
|
|
return (
|
|
<Modal title={"Delete host"} onExit={onCancel} className={baseClass}>
|
|
<form className={`${baseClass}__form`}>
|
|
<p>
|
|
This action will delete{" "}
|
|
<b>
|
|
{selectedHostIds.length}
|
|
{isAllMatchingHostsSelected && "+"}{" "}
|
|
{selectedHostIds.length === 1 ? "host" : "hosts"}
|
|
</b>{" "}
|
|
from your Fleet instance.
|
|
</p>
|
|
<p>If the hosts come back online, they will automatically re-enroll.</p>
|
|
<p>
|
|
To prevent re-enrollment, you can disable or uninstall osquery on
|
|
these hosts.
|
|
</p>
|
|
<div className={`${baseClass}__btn-wrap`}>
|
|
<Button
|
|
className={`${baseClass}__btn`}
|
|
type="button"
|
|
onClick={onSubmit}
|
|
variant="alert"
|
|
>
|
|
Delete
|
|
</Button>
|
|
<Button
|
|
className={`${baseClass}__btn`}
|
|
onClick={onCancel}
|
|
variant="inverse-alert"
|
|
>
|
|
Cancel
|
|
</Button>
|
|
</div>
|
|
</form>
|
|
</Modal>
|
|
);
|
|
};
|
|
|
|
export default DeleteHostModal;
|