Added forgotten Host and HostStatus components
This commit is contained in:
1 parent
9b8c651736
commit
68cb5b4597
1 file changed
+23
-5
@@ -1,6 +1,7 @@
|
|||||||
import BarChart from "../Charts/BarChart/BarChart";
|
import BarChart from "../Charts/BarChart/BarChart";
|
||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
|
import Host from "../Host/";
|
||||||
|
import HostStatus from "../HostStatus";
|
||||||
/**
|
/**
|
||||||
* HostsTable displays the current status of monitor
|
* HostsTable displays the current status of monitor
|
||||||
*
|
*
|
||||||
@@ -22,12 +23,29 @@ const HostsTable = ({ monitors }) => {
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{monitors.map((monitor) => {
|
{monitors.map((monitor) => {
|
||||||
|
const host = Host(
|
||||||
|
monitor.name,
|
||||||
|
100,
|
||||||
|
"var(--env-var-color-17)",
|
||||||
|
monitor.url
|
||||||
|
);
|
||||||
|
|
||||||
|
const status = HostStatus(
|
||||||
|
monitor.checks[monitor.checks.length - 1].status === true
|
||||||
|
? "var(--env-var-color-20)"
|
||||||
|
: "var(--env-var-color-21)",
|
||||||
|
monitor.checks[monitor.checks.length - 1].status === true
|
||||||
|
? "Up"
|
||||||
|
: "Down",
|
||||||
|
monitor.checks[monitor.checks.length - 1].status === true
|
||||||
|
? "var(--env-var-color-17)"
|
||||||
|
: "var(--env-var-color-19)"
|
||||||
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<tr className="tbody-row" key={monitor._id}>
|
<tr className="tbody-row" key={monitor._id}>
|
||||||
<td className="tbody-row-cell">{monitor.url}</td>
|
<td className="tbody-row-cell">{host}</td>
|
||||||
<td className="tbody-row-cell">
|
<td className="tbody-row-cell">{status}</td>
|
||||||
{monitor.isActive ? "Active" : "Down"}
|
|
||||||
</td>
|
|
||||||
<td className="tbody-row-cell">
|
<td className="tbody-row-cell">
|
||||||
<BarChart checks={monitor.checks} />
|
<BarChart checks={monitor.checks} />
|
||||||
</td>
|
</td>
|
||||||
|
|||||||
Reference in new issue
Block a user