mirror of
https://github.com/fleetdm/fleet
synced 2026-04-24 15:07:29 +00:00
64 lines
1.5 KiB
TypeScript
64 lines
1.5 KiB
TypeScript
|
|
import React from "react";
|
||
|
|
import ReactTooltip from "react-tooltip";
|
||
|
|
|
||
|
|
import Icon from "components/Icon";
|
||
|
|
|
||
|
|
interface ILiveQueryIssueCellProps<T> {
|
||
|
|
displayName: string;
|
||
|
|
distributedInterval: number;
|
||
|
|
status: string;
|
||
|
|
rowId: number;
|
||
|
|
}
|
||
|
|
|
||
|
|
const LiveQueryIssueCell = ({
|
||
|
|
displayName,
|
||
|
|
distributedInterval,
|
||
|
|
status,
|
||
|
|
rowId,
|
||
|
|
}: ILiveQueryIssueCellProps<any>): JSX.Element => {
|
||
|
|
if (distributedInterval < 60 && status === "online") {
|
||
|
|
return <>{displayName}</>;
|
||
|
|
}
|
||
|
|
|
||
|
|
return (
|
||
|
|
<>
|
||
|
|
{displayName}{" "}
|
||
|
|
<span
|
||
|
|
className={`host-issue tooltip tooltip__tooltip-icon`}
|
||
|
|
data-tip
|
||
|
|
data-for={`host-issue__${rowId.toString()}`}
|
||
|
|
data-tip-disable={false}
|
||
|
|
>
|
||
|
|
<Icon
|
||
|
|
name="issue"
|
||
|
|
size="small"
|
||
|
|
color={status === "offline" ? "status-error" : "status-warning"}
|
||
|
|
/>
|
||
|
|
</span>
|
||
|
|
<ReactTooltip
|
||
|
|
place="top"
|
||
|
|
effect="solid"
|
||
|
|
backgroundColor="#3e4771"
|
||
|
|
id={`host-issue__${rowId.toString()}`}
|
||
|
|
data-html
|
||
|
|
>
|
||
|
|
<span className={`tooltip__tooltip-text`}>
|
||
|
|
{status === "offline" ? (
|
||
|
|
<>
|
||
|
|
Offline hosts will not <br />
|
||
|
|
respond to a live query.
|
||
|
|
</>
|
||
|
|
) : (
|
||
|
|
<>
|
||
|
|
This host might take up to
|
||
|
|
<br /> {distributedInterval} seconds to respond.
|
||
|
|
</>
|
||
|
|
)}
|
||
|
|
</span>
|
||
|
|
</ReactTooltip>
|
||
|
|
</>
|
||
|
|
);
|
||
|
|
};
|
||
|
|
|
||
|
|
export default LiveQueryIssueCell;
|