Skip to content

Commit d7a1c1b

Browse files
committed
Merge remote-tracking branch 'upstream/develop' into fix/fe/uptime-refactor
2 parents 3259425 + e0333af commit d7a1c1b

File tree

11 files changed

+113
-112
lines changed

11 files changed

+113
-112
lines changed

.github/pull_request_template.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
**(when sending your PR, only remove this line. Do not remove any lines below. Check all the relevant items before sending your PR)**
1+
**(Please remove this line only before submitting your PR. Ensure that all relevant items are checked before submission.)**
22

33
## Describe your changes
44

@@ -8,10 +8,10 @@ Briefly describe the changes you made and their purpose.
88

99
Mention the issue number(s) this PR addresses (e.g., #123).
1010

11-
## Please ensure all items are checked off before requesting a review:
11+
## Please ensure all items are checked off before requesting a review. "Checked off" means you need to add an "x" character between brackets so they turn into checkmarks.
1212

13-
- [ ] I deployed the application locally.
14-
- [ ] I have performed a self-review and testing of my code.
13+
- [ ] (Do not skip this or your PR will be closed) I deployed the application locally.
14+
- [ ] (Do not skip this or your PR will be closed) I have performed a self-review and testing of my code.
1515
- [ ] I have included the issue # in the PR.
1616
- [ ] I have labelled the PR correctly.
1717
- [ ] The issue I am working on is assigned to me.

Client/package-lock.json

+21-21
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Client/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
"@mui/lab": "6.0.0-beta.24",
1919
"@mui/material": "6.4.1",
2020
"@mui/x-charts": "^7.5.1",
21-
"@mui/x-data-grid": "7.24.0",
22-
"@mui/x-date-pickers": "7.24.0",
23-
"@reduxjs/toolkit": "2.5.0",
21+
"@mui/x-data-grid": "7.24.1",
22+
"@mui/x-date-pickers": "7.24.1",
23+
"@reduxjs/toolkit": "2.5.1",
2424
"axios": "^1.7.4",
2525
"dayjs": "1.11.13",
2626
"joi": "17.13.3",

Client/src/Pages/Infrastructure/Details/index.jsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -625,8 +625,7 @@ const InfrastructureDetails = () => {
625625
</ButtonGroup>
626626
</Stack>
627627
<Stack
628-
direction={"row"}
629-
height={chartContainerHeight} // FE team HELP!
628+
direction="row"
630629
gap={theme.spacing(8)} // FE team HELP!
631630
flexWrap="wrap" // //FE team HELP! Better way to do this?
632631
sx={{

Client/src/Pages/Infrastructure/index.jsx

+13-17
Original file line numberDiff line numberDiff line change
@@ -137,35 +137,31 @@ function Infrastructure() {
137137
id: "actions",
138138
content: "Actions",
139139
render: (row) => (
140-
<IconButton>
141-
<InfrastructureMenu
142-
monitor={row}
143-
isAdmin={isAdmin}
144-
updateCallback={handleActionMenuDelete}
145-
/>
146-
</IconButton>
140+
<InfrastructureMenu
141+
monitor={row}
142+
isAdmin={isAdmin}
143+
updateCallback={handleActionMenuDelete}
144+
/>
147145
),
148146
},
149147
];
150148

151149
const monitorsAsRows = monitors.map((monitor) => {
152150
const processor =
153-
((monitor.checks[0]?.cpu?.usage_frequency ?? 0) / 1000).toFixed(2) + " GHz";
151+
((monitor.checks[0]?.cpu?.frequency ?? 0) / 1000).toFixed(2) + " GHz";
154152
const cpu = (monitor?.checks[0]?.cpu.usage_percent ?? 0) * 100;
155153
const mem = (monitor?.checks[0]?.memory.usage_percent ?? 0) * 100;
156154
const disk = (monitor?.checks[0]?.disk[0]?.usage_percent ?? 0) * 100;
157155
const status = determineState(monitor);
158156
const uptimePercentage = ((monitor?.uptimePercentage ?? 0) * 100)
159157
.toFixed(2)
160158
.toString();
161-
const percentageColor =
162-
monitor.uptimePercentage < 0.25
163-
? theme.palette.error.main
164-
: monitor.uptimePercentage < 0.5
165-
? theme.palette.percentage.uptimeFair
166-
: monitor.uptimePercentage < 0.75
167-
? theme.palette.percentage.uptimeGood
168-
: theme.palette.success.lowContrast;
159+
const percentageColor = monitor.uptimePercentage < 0.25
160+
? theme.palette.error.main
161+
: monitor.uptimePercentage < 0.5
162+
? theme.palette.warning.main
163+
: theme.palette.success.main;
164+
169165
return {
170166
id: monitor._id,
171167
name: monitor.name,
@@ -243,7 +239,7 @@ function Infrastructure() {
243239
backgroundColor={theme.palette.tertiary.main}
244240
sx={{
245241
padding: ".25em .75em",
246-
borderRadius: "50%",
242+
borderRadius: "10000px",
247243
fontSize: "12px",
248244
fontWeight: 500,
249245
}}

Client/src/Pages/PageSpeed/index.jsx

+8-2
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,15 @@ const PageSpeed = () => {
106106
component="span"
107107
className="current-monitors-counter"
108108
color={theme.palette.primary.contrastText}
109-
border={1}
110-
borderColor={theme.palette.primary.lowContrast}
109+
border={2}
110+
borderColor={theme.palette.accent.main}
111111
backgroundColor={theme.palette.tertiary.main}
112+
sx={{
113+
padding: ".25em .75em",
114+
borderRadius: "10000px",
115+
fontSize: "12px",
116+
fontWeight: 500,
117+
}}
112118
>
113119
{summary?.totalMonitors ?? 0}
114120
</Box>

Client/src/Pages/Uptime/CreateUptime/index.jsx

+46-47
Original file line numberDiff line numberDiff line change
@@ -235,53 +235,6 @@ const CreateMonitor = () => {
235235
monitor
236236
</Typography>
237237
</Typography>
238-
239-
<ConfigBox>
240-
<Box>
241-
<Typography component="h2">General settings</Typography>
242-
<Typography component="p">
243-
Here you can select the URL of the host, together with the type of monitor.
244-
</Typography>
245-
</Box>
246-
<Stack gap={theme.spacing(15)}>
247-
<TextInput
248-
type={monitor.type === "http" ? "url" : "text"}
249-
id="monitor-url"
250-
startAdornment={
251-
monitor.type === "http" ? <HttpAdornment https={https} /> : null
252-
}
253-
label={monitorTypeMaps[monitor.type].label || "URL to monitor"}
254-
https={https}
255-
placeholder={monitorTypeMaps[monitor.type].placeholder || ""}
256-
value={monitor.url}
257-
onChange={(event) => handleChange(event, "url")}
258-
error={errors["url"] ? true : false}
259-
helperText={errors["url"]}
260-
/>
261-
<TextInput
262-
type="number"
263-
id="monitor-port"
264-
label="Port to monitor"
265-
placeholder="5173"
266-
value={monitor.port}
267-
onChange={(event) => handleChange(event, "port")}
268-
error={errors["port"] ? true : false}
269-
helperText={errors["port"]}
270-
hidden={monitor.type !== "port"}
271-
/>
272-
<TextInput
273-
type="text"
274-
id="monitor-name"
275-
label="Display name"
276-
isOptional={true}
277-
placeholder={monitorTypeMaps[monitor.type].namePlaceholder || ""}
278-
value={monitor.name}
279-
onChange={(event) => handleChange(event, "name")}
280-
error={errors["name"] ? true : false}
281-
helperText={errors["name"]}
282-
/>
283-
</Stack>
284-
</ConfigBox>
285238
<ConfigBox>
286239
<Box>
287240
<Typography component="h2">Checks to perform</Typography>
@@ -363,6 +316,52 @@ const CreateMonitor = () => {
363316
)}
364317
</Stack>
365318
</ConfigBox>
319+
<ConfigBox>
320+
<Box>
321+
<Typography component="h2">General settings</Typography>
322+
<Typography component="p">
323+
Here you can select the URL of the host, together with the type of monitor.
324+
</Typography>
325+
</Box>
326+
<Stack gap={theme.spacing(15)}>
327+
<TextInput
328+
type={monitor.type === "http" ? "url" : "text"}
329+
id="monitor-url"
330+
startAdornment={
331+
monitor.type === "http" ? <HttpAdornment https={https} /> : null
332+
}
333+
label={monitorTypeMaps[monitor.type].label || "URL to monitor"}
334+
https={https}
335+
placeholder={monitorTypeMaps[monitor.type].placeholder || ""}
336+
value={monitor.url}
337+
onChange={(event) => handleChange(event, "url")}
338+
error={errors["url"] ? true : false}
339+
helperText={errors["url"]}
340+
/>
341+
<TextInput
342+
type="number"
343+
id="monitor-port"
344+
label="Port to monitor"
345+
placeholder="5173"
346+
value={monitor.port}
347+
onChange={(event) => handleChange(event, "port")}
348+
error={errors["port"] ? true : false}
349+
helperText={errors["port"]}
350+
hidden={monitor.type !== "port"}
351+
/>
352+
<TextInput
353+
type="text"
354+
id="monitor-name"
355+
label="Display name"
356+
isOptional={true}
357+
placeholder={monitorTypeMaps[monitor.type].namePlaceholder || ""}
358+
value={monitor.name}
359+
onChange={(event) => handleChange(event, "name")}
360+
error={errors["name"] ? true : false}
361+
helperText={errors["name"]}
362+
/>
363+
</Stack>
364+
</ConfigBox>
366365
<ConfigBox>
367366
<Box>
368367
<Typography component="h2">Incident notifications</Typography>

Client/src/Utils/NetworkServiceProvider.jsx

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
import { useDispatch } from "react-redux";
22
import { useNavigate } from "react-router";
33
import { setNetworkService } from "./NetworkService";
4-
import NetworkService from "./NetworkService";
4+
import NetworkService, { networkService } from "./NetworkService";
55
import { store } from "../store";
66

77
const NetworkServiceProvider = ({ children }) => {
88
const dispatch = useDispatch();
99
const navigate = useNavigate();
10-
const networkService = new NetworkService(store, dispatch, navigate);
11-
setNetworkService(networkService);
10+
if (!networkService) {
11+
setNetworkService(new NetworkService(store, dispatch, navigate));
12+
}
1213
return children;
1314
};
1415

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,13 @@ If you have any questions, suggestions or comments, please use our [Discord chan
5151
- Docker monitoring
5252
- Ping monitoring
5353
- SSL monitoring
54+
- Port monitoring
5455
- Incidents at a glance
5556
- E-mail notifications
5657
- Scheduled maintenance
5758

5859
**Short term roadmap:**
5960

60-
- Port monitoring (**complete**, waiting to be deployed to stable version) https://github.com/bluewave-labs/Checkmate/issues/1476
6161
- Global (distributed) uptime checking on Solana network (**in progress**) https://github.com/bluewave-labs/Checkmate/issues/1593
6262
- Status pages (**in progress**) https://github.com/bluewave-labs/Checkmate/issues/1131
6363
- Translations (i18n) (**in progress**)

0 commit comments

Comments
 (0)