2021-06-28 15:20:32 +00:00
|
|
|
import React from "react";
|
|
|
|
|
import { IUser } from "interfaces/user";
|
2021-11-07 06:41:09 +00:00
|
|
|
import Modal from "components/Modal";
|
2021-06-28 15:20:32 +00:00
|
|
|
import Button from "components/buttons/Button";
|
|
|
|
|
|
|
|
|
|
const baseClass = "reset-sessions-modal";
|
|
|
|
|
|
|
|
|
|
interface IResetSessionsModal {
|
|
|
|
|
user: IUser;
|
|
|
|
|
onResetConfirm: (user: IUser) => void;
|
|
|
|
|
onResetCancel: () => void;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const ResetSessionsModal = ({
|
|
|
|
|
user,
|
|
|
|
|
onResetConfirm,
|
|
|
|
|
onResetCancel,
|
|
|
|
|
}: IResetSessionsModal): JSX.Element => {
|
|
|
|
|
return (
|
2022-08-04 15:05:11 +00:00
|
|
|
<Modal
|
|
|
|
|
title="Reset sessions"
|
|
|
|
|
onExit={onResetCancel}
|
|
|
|
|
onEnter={() => onResetConfirm(user)}
|
|
|
|
|
>
|
2021-06-28 15:20:32 +00:00
|
|
|
<div className={baseClass}>
|
|
|
|
|
<p>
|
|
|
|
|
This user will be logged out of Fleet.
|
|
|
|
|
<br />
|
|
|
|
|
This will revoke all active Fleet API tokens for this user.
|
|
|
|
|
</p>
|
2022-08-29 15:21:37 +00:00
|
|
|
<div className="modal-cta-wrap">
|
2021-06-28 15:20:32 +00:00
|
|
|
<Button
|
|
|
|
|
type="button"
|
|
|
|
|
variant="brand"
|
|
|
|
|
onClick={() => onResetConfirm(user)}
|
|
|
|
|
>
|
|
|
|
|
Confirm
|
|
|
|
|
</Button>
|
2022-08-29 15:21:37 +00:00
|
|
|
<Button onClick={onResetCancel} variant="inverse">
|
2021-06-28 15:20:32 +00:00
|
|
|
Cancel
|
|
|
|
|
</Button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</Modal>
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default ResetSessionsModal;
|