hardcode removed
This commit is contained in:
1 parent
486547f688
commit
27dd65ccfa
3 files changed
+83
-83
No files matched your search
@@ -15,6 +15,24 @@
|
|||||||
"updatedAt": "2024-06-18T18:56:06.212Z",
|
"updatedAt": "2024-06-18T18:56:06.212Z",
|
||||||
"__v": 0,
|
"__v": 0,
|
||||||
"checks": [
|
"checks": [
|
||||||
|
{
|
||||||
|
"_id": "6671d84a9ba14f9f260eed27",
|
||||||
|
"monitorId": "6671d8469ba14f9f260eed23",
|
||||||
|
"status": true,
|
||||||
|
"responseTime": 143,
|
||||||
|
"createdAt": "2024-06-18T18:56:10.082Z",
|
||||||
|
"updatedAt": "2024-06-18T18:56:10.082Z",
|
||||||
|
"__v": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"_id": "6671d84a9ba14f9f260eed27",
|
||||||
|
"monitorId": "6671d8469ba14f9f260eed23",
|
||||||
|
"status": true,
|
||||||
|
"responseTime": 70,
|
||||||
|
"createdAt": "2024-06-18T18:56:10.082Z",
|
||||||
|
"updatedAt": "2024-06-18T18:56:10.082Z",
|
||||||
|
"__v": 0
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"_id": "6671d84a9ba14f9f260eed27",
|
"_id": "6671d84a9ba14f9f260eed27",
|
||||||
"monitorId": "6671d8469ba14f9f260eed23",
|
"monitorId": "6671d8469ba14f9f260eed23",
|
||||||
@@ -210,6 +228,26 @@
|
|||||||
"updatedAt": "2024-06-18T18:56:20.190Z",
|
"updatedAt": "2024-06-18T18:56:20.190Z",
|
||||||
"__v": 0
|
"__v": 0
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"_id": "6671d85e9ba14f9f260eed3e",
|
||||||
|
"monitorId": "6671d8529ba14f9f260eed2b",
|
||||||
|
"status": false,
|
||||||
|
"responseTime": 228,
|
||||||
|
"statusCode": 404,
|
||||||
|
"createdAt": "2024-06-18T18:56:30.279Z",
|
||||||
|
"updatedAt": "2024-06-18T18:56:30.279Z",
|
||||||
|
"__v": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"_id": "6671d8669ba14f9f260eed47",
|
||||||
|
"monitorId": "6671d8529ba14f9f260eed2b",
|
||||||
|
"status": true,
|
||||||
|
"responseTime": 112,
|
||||||
|
"statusCode": 200,
|
||||||
|
"createdAt": "2024-06-18T18:56:38.381Z",
|
||||||
|
"updatedAt": "2024-06-18T18:56:38.381Z",
|
||||||
|
"__v": 0
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"_id": "6671d8879ba14f9f260eed74",
|
"_id": "6671d8879ba14f9f260eed74",
|
||||||
"monitorId": "6671d8529ba14f9f260eed2b",
|
"monitorId": "6671d8529ba14f9f260eed2b",
|
||||||
@@ -285,6 +323,26 @@
|
|||||||
"updatedAt": "2024-06-18T18:57:48.532Z",
|
"updatedAt": "2024-06-18T18:57:48.532Z",
|
||||||
"__v": 0
|
"__v": 0
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"_id": "6671d8a59ba14f9f260eed98",
|
||||||
|
"monitorId": "6671d8529ba14f9f260eed2b",
|
||||||
|
"status": false,
|
||||||
|
"responseTime": 271,
|
||||||
|
"statusCode": 404,
|
||||||
|
"createdAt": "2024-06-18T18:57:41.421Z",
|
||||||
|
"updatedAt": "2024-06-18T18:57:41.421Z",
|
||||||
|
"__v": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"_id": "6671d8ac9ba14f9f260eeda1",
|
||||||
|
"monitorId": "6671d8529ba14f9f260eed2b",
|
||||||
|
"status": true,
|
||||||
|
"responseTime": 127,
|
||||||
|
"statusCode": 200,
|
||||||
|
"createdAt": "2024-06-18T18:57:48.532Z",
|
||||||
|
"updatedAt": "2024-06-18T18:57:48.532Z",
|
||||||
|
"__v": 0
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"_id": "6671d8b29ba14f9f260eedaa",
|
"_id": "6671d8b29ba14f9f260eedaa",
|
||||||
"monitorId": "6671d8529ba14f9f260eed2b",
|
"monitorId": "6671d8529ba14f9f260eed2b",
|
||||||
@@ -440,6 +498,26 @@
|
|||||||
"updatedAt": "2024-06-18T18:59:16.089Z",
|
"updatedAt": "2024-06-18T18:59:16.089Z",
|
||||||
"__v": 0
|
"__v": 0
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"_id": "6671d8d89ba14f9f260eede0",
|
||||||
|
"monitorId": "6671d8529ba14f9f260eed2b",
|
||||||
|
"status": false,
|
||||||
|
"responseTime": 218,
|
||||||
|
"statusCode": 404,
|
||||||
|
"createdAt": "2024-06-18T18:58:32.311Z",
|
||||||
|
"updatedAt": "2024-06-18T18:58:32.311Z",
|
||||||
|
"__v": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"_id": "6671d8df9ba14f9f260eede9",
|
||||||
|
"monitorId": "6671d8529ba14f9f260eed2b",
|
||||||
|
"status": true,
|
||||||
|
"responseTime": 138,
|
||||||
|
"statusCode": 200,
|
||||||
|
"createdAt": "2024-06-18T18:58:39.422Z",
|
||||||
|
"updatedAt": "2024-06-18T18:58:39.422Z",
|
||||||
|
"__v": 0
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"_id": "6671d9089ba14f9f260eee28",
|
"_id": "6671d9089ba14f9f260eee28",
|
||||||
"monitorId": "6671d8529ba14f9f260eed2b",
|
"monitorId": "6671d8529ba14f9f260eed2b",
|
||||||
|
|||||||
@@ -8,88 +8,10 @@ import ServerStatus from "../../Components/Charts/Servers/ServerStatus";
|
|||||||
import CurrentMonitors from "../../Components/CurrentMonitors";
|
import CurrentMonitors from "../../Components/CurrentMonitors";
|
||||||
import MockData from "../../Mock/sample_data.json";
|
import MockData from "../../Mock/sample_data.json";
|
||||||
|
|
||||||
const hardCodedMonitors = [
|
|
||||||
{
|
|
||||||
host: Host(
|
|
||||||
"Discord",
|
|
||||||
100,
|
|
||||||
"var(--env-var-color-17)",
|
|
||||||
"https://www.google.com"
|
|
||||||
),
|
|
||||||
status: HostStatus(
|
|
||||||
"var(--env-var-color-20)",
|
|
||||||
"Up",
|
|
||||||
"var(--env-var-color-17)"
|
|
||||||
),
|
|
||||||
team: <BarChart />,
|
|
||||||
actions: HostActions(),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
host: Host(
|
|
||||||
"Google",
|
|
||||||
99.9,
|
|
||||||
"var(--env-var-color-17)",
|
|
||||||
"https://www.google.com"
|
|
||||||
),
|
|
||||||
status: HostStatus(
|
|
||||||
"var(--env-var-color-20)",
|
|
||||||
"Up",
|
|
||||||
"var(--env-var-color-17)"
|
|
||||||
),
|
|
||||||
team: <BarChart />,
|
|
||||||
actions: HostActions(),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
host: Host(
|
|
||||||
"NBC",
|
|
||||||
98.1,
|
|
||||||
"var(--env-var-color-18)",
|
|
||||||
"https://www.google.com"
|
|
||||||
),
|
|
||||||
status: HostStatus(
|
|
||||||
"var(--env-var-color-20)",
|
|
||||||
"Up",
|
|
||||||
"var(--env-var-color-17)"
|
|
||||||
),
|
|
||||||
team: <BarChart />,
|
|
||||||
actions: HostActions(),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
host: Host(
|
|
||||||
"Google",
|
|
||||||
95.1,
|
|
||||||
"var(--env-var-color-19)",
|
|
||||||
"https://www.google.com"
|
|
||||||
),
|
|
||||||
status: HostStatus(
|
|
||||||
"var(--env-var-color-21)",
|
|
||||||
"Down",
|
|
||||||
"var(--env-var-color-19)"
|
|
||||||
),
|
|
||||||
team: <BarChart />,
|
|
||||||
actions: HostActions(),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
host: Host(
|
|
||||||
"NBC",
|
|
||||||
99.9,
|
|
||||||
"var(--env-var-color-17)",
|
|
||||||
"https://www.google.com"
|
|
||||||
),
|
|
||||||
status: HostStatus(
|
|
||||||
"var(--env-var-color-15)",
|
|
||||||
"Cannot resolve",
|
|
||||||
"var(--env-var-color-22)"
|
|
||||||
),
|
|
||||||
team: <BarChart />,
|
|
||||||
actions: HostActions(),
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
const CurrentStats = (mockdata = true) => {
|
const CurrentStats = (mockdata = true) => {
|
||||||
// The hardcoded part is passed as default value for the purpose of demonstration.
|
// The hardcoded part is passed as default value for the purpose of demonstration.
|
||||||
// Pass an empty array, [], before fetching the data
|
// Pass an empty array, [], before fetching the data
|
||||||
const [monitors, setMonitors] = useState(hardCodedMonitors);
|
const [monitors, setMonitors] = useState([]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (mockdata) {
|
if (mockdata) {
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
import CreateNewMonitor from "./CreateNewMonitor";
|
// import CreateNewMonitor from "./CreateNewMonitor";
|
||||||
// import CurrentStats from "./CurrentStats";
|
import CurrentStats from "./CurrentStats";
|
||||||
import "./index.css";
|
import "./index.css";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
const Monitors = () => {
|
const Monitors = () => {
|
||||||
return (
|
return (
|
||||||
<div className="monitors">
|
<div className="monitors">
|
||||||
{/* <CurrentStats /> */}
|
<CurrentStats />
|
||||||
<CreateNewMonitor />
|
{/* <CreateNewMonitor /> */}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in new issue
Block a user