mirror of
https://github.com/fleetdm/fleet
synced 2026-04-21 13:37:30 +00:00
## For #31226 New features: - Dynamic header for each possible state of a batch script run: Started, Scheduled, and Finished (corresponds to tabs at `/controls/scripts/progress` - Unique tabs for each possible status of hosts targeted by a batch script run: Ran, Errored, Pending, Incompatible, Canceled. - Within each tab, sortable, paginated host results with output preview and execution time. - View script/run details, cancel a batch, view manage hosts page filtered for the script batch run and a status. - Global script batch runs activities and and Scripts progress rows now navigate to this details page. Cleanups and improvements: - Expand tab count badge options using “alert”/“pending” variants across hosts, policies, and query results. - Misc cleanups and improvements  - [x] Changes file added for user-visible changes in `changes/`, - [x] Updated automated tests - new tests tracked for follow-up work - [x] QA'd all new/changed functionality manually --------- Co-authored-by: Jacob Shandling <jacob@fleetdm.com>
58 lines
1.4 KiB
TypeScript
58 lines
1.4 KiB
TypeScript
import React from "react";
|
|
|
|
import Modal from "components/Modal";
|
|
import Button from "components/buttons/Button";
|
|
|
|
const baseClass = "cancel-script-batch-modal";
|
|
|
|
interface ICancelScriptBatchModal {
|
|
onExit: () => void;
|
|
onSubmit: () => void;
|
|
scriptName?: string;
|
|
isCanceling: boolean;
|
|
}
|
|
|
|
const CancelScriptBatchModal = ({
|
|
onSubmit,
|
|
onExit,
|
|
scriptName,
|
|
isCanceling,
|
|
}: ICancelScriptBatchModal) => {
|
|
return (
|
|
<Modal
|
|
title="Cancel script?"
|
|
onExit={onExit}
|
|
onEnter={onSubmit}
|
|
className={baseClass}
|
|
>
|
|
<>
|
|
<div className={`${baseClass}__content`}>
|
|
<p>
|
|
This will cancel any pending script runs for{" "}
|
|
{scriptName ? <b>{scriptName}</b> : "this batch"}.
|
|
</p>
|
|
<p>
|
|
If this script is currently running on a host, it will complete, but
|
|
results won’t appear in Fleet.
|
|
</p>
|
|
<p>You cannot undo this action.</p>
|
|
<div className="modal-cta-wrap">
|
|
<Button
|
|
isLoading={isCanceling}
|
|
disabled={isCanceling}
|
|
onClick={onSubmit}
|
|
variant="alert"
|
|
>
|
|
Cancel script
|
|
</Button>
|
|
<Button variant="inverse-alert" onClick={onExit}>
|
|
Back
|
|
</Button>
|
|
</div>
|
|
</div>
|
|
</>
|
|
</Modal>
|
|
);
|
|
};
|
|
|
|
export default CancelScriptBatchModal;
|