From ecd1282c4d5ee81d21ff8168d174fdcf96f246e3 Mon Sep 17 00:00:00 2001 From: Shaikh Mohd Mudassir Hussain <84413543+Shaikh-Mudassir@users.noreply.github.com> Date: Wed, 4 Dec 2024 15:27:02 -0700 Subject: [PATCH 001/178] Added a gap between label and inputs #1270 --- .../src/Components/TabPanels/Account/PasswordPanel.jsx | 10 +++++++--- .../src/Components/TabPanels/Account/ProfilePanel.jsx | 5 ++++- Client/src/Components/TabPanels/Account/TeamPanel.jsx | 9 ++++++--- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/Client/src/Components/TabPanels/Account/PasswordPanel.jsx b/Client/src/Components/TabPanels/Account/PasswordPanel.jsx index ae322156c..0ea48138e 100644 --- a/Client/src/Components/TabPanels/Account/PasswordPanel.jsx +++ b/Client/src/Components/TabPanels/Account/PasswordPanel.jsx @@ -21,6 +21,10 @@ const PasswordPanel = () => { const theme = useTheme(); const dispatch = useDispatch(); + // Define the constant for consistent gap + const SPACING_GAP = theme.spacing(12); // EDITED: Added a constant for gap size. + + //redux state const { authToken, isLoading } = useSelector((state) => state.auth); @@ -127,7 +131,7 @@ const PasswordPanel = () => { direction="row" justifyContent={"flex-start"} alignItems={"center"} - gap={theme.spacing(8)} + gap={SPACING_GAP} // Replaced gap with SPACING_GAP constant flexWrap={"wrap"} > { { { const theme = useTheme(); const dispatch = useDispatch(); + + // Define the constant for consistent gap + const SPACING_GAP = theme.spacing(12); //redux state const { user, authToken, isLoading } = useSelector((state) => state.auth); @@ -223,7 +226,7 @@ const ProfilePanel = () => { className="edit-profile-form" noValidate spellCheck="false" - gap={theme.spacing(20)} + gap={SPACING_GAP} // Applied SPACING_GAP for consistent spacing > diff --git a/Client/src/Components/TabPanels/Account/TeamPanel.jsx b/Client/src/Components/TabPanels/Account/TeamPanel.jsx index 74fae01c6..6e2337370 100644 --- a/Client/src/Components/TabPanels/Account/TeamPanel.jsx +++ b/Client/src/Components/TabPanels/Account/TeamPanel.jsx @@ -30,6 +30,9 @@ const TeamPanel = () => { const theme = useTheme(); + // Define the constant for consistent gap + const SPACING_GAP = theme.spacing(12); + const { authToken, user } = useSelector((state) => state.auth); //TODO // const [orgStates, setOrgStates] = useState({ @@ -228,7 +231,7 @@ const TeamPanel = () => { {/* Organization name - + { component="form" noValidate spellCheck="false" - gap={theme.spacing(12)} + gap={SPACING_GAP} // Added a constant Spacing gap > Team members { theme={theme} > Date: Thu, 5 Dec 2024 07:20:38 +0530 Subject: [PATCH 002/178] feat: design corrected #1275 : Current Password Field BG color --- Client/src/Utils/Theme/globalTheme.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Client/src/Utils/Theme/globalTheme.js b/Client/src/Utils/Theme/globalTheme.js index 95f6bf578..d0ae1610a 100644 --- a/Client/src/Utils/Theme/globalTheme.js +++ b/Client/src/Utils/Theme/globalTheme.js @@ -237,6 +237,11 @@ const baseTheme = (palette) => ({ WebkitTextFillColor: "unset", }, }, + "& .MuiInputBase-input:-webkit-autofill": { + transition: "background-color 5000s ease-in-out 0s", // Long transition to override autofill background + WebkitBoxShadow: `0 0 0px 1000px ${theme.palette.background.main} inset`, // Match your theme's background color + WebkitTextFillColor: theme.palette.text.primary, // Match text color + }, "& .MuiInputBase-input.MuiOutlinedInput-input": { padding: "0 var(--env-var-spacing-1-minus) !important", }, From 09a704775a286de42a2c42bf808dd5f65d2cd5c6 Mon Sep 17 00:00:00 2001 From: Saksham Date: Thu, 5 Dec 2024 07:30:28 +0530 Subject: [PATCH 003/178] feat: design corrected #1275 : Current Password Field BG color:updated-removed comments --- Client/src/Utils/Theme/globalTheme.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Client/src/Utils/Theme/globalTheme.js b/Client/src/Utils/Theme/globalTheme.js index d0ae1610a..eafe2f859 100644 --- a/Client/src/Utils/Theme/globalTheme.js +++ b/Client/src/Utils/Theme/globalTheme.js @@ -238,9 +238,9 @@ const baseTheme = (palette) => ({ }, }, "& .MuiInputBase-input:-webkit-autofill": { - transition: "background-color 5000s ease-in-out 0s", // Long transition to override autofill background - WebkitBoxShadow: `0 0 0px 1000px ${theme.palette.background.main} inset`, // Match your theme's background color - WebkitTextFillColor: theme.palette.text.primary, // Match text color + transition: "background-color 5000s ease-in-out 0s", + WebkitBoxShadow: `0 0 0px 1000px ${theme.palette.background.main} inset`, + WebkitTextFillColor: theme.palette.text.primary, }, "& .MuiInputBase-input.MuiOutlinedInput-input": { padding: "0 var(--env-var-spacing-1-minus) !important", From 5478f64b69aab9daffda31f8118e5eed699e603e Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Thu, 5 Dec 2024 10:24:50 +0800 Subject: [PATCH 004/178] Fix API url --- Docker/prod/docker-compose.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Docker/prod/docker-compose.yaml b/Docker/prod/docker-compose.yaml index 24e6d1165..e262ef1a2 100644 --- a/Docker/prod/docker-compose.yaml +++ b/Docker/prod/docker-compose.yaml @@ -2,7 +2,7 @@ services: client: image: uptime_client:latest environment: - UPTIME_APP_API_BASE_URL: "https://uptime-demo.bluewavelabs.ca/api/v1" + UPTIME_APP_API_BASE_URL: "https://checkmate-demo.bluewavelabs.ca/api/v1" ports: - "80:80" - "443:443" From d188efa9eeb43d9c434827d946cf69670cf7b29f Mon Sep 17 00:00:00 2001 From: Gaurav Date: Thu, 5 Dec 2024 17:29:12 +0530 Subject: [PATCH 005/178] fixed issue with the alignment in JWT section --- Client/src/Components/Inputs/Select/index.jsx | 6 ++++-- Client/src/Pages/AdvancedSettings/index.jsx | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Client/src/Components/Inputs/Select/index.jsx b/Client/src/Components/Inputs/Select/index.jsx index 8517c3214..2804a76f3 100644 --- a/Client/src/Components/Inputs/Select/index.jsx +++ b/Client/src/Components/Inputs/Select/index.jsx @@ -49,6 +49,7 @@ const Select = ({ onBlur, sx, name = "", + labelControlSpacing = 2, }) => { const theme = useTheme(); const itemStyles = { @@ -57,10 +58,10 @@ const Select = ({ borderRadius: theme.shape.borderRadius, margin: theme.spacing(2), }; - + return ( {label && ( @@ -144,6 +145,7 @@ Select.propTypes = { onChange: PropTypes.func.isRequired, onBlur: PropTypes.func, sx: PropTypes.object, + labelControlSpacing:PropTypes.number, }; export default Select; diff --git a/Client/src/Pages/AdvancedSettings/index.jsx b/Client/src/Pages/AdvancedSettings/index.jsx index 35f0e4c85..90bcf21d6 100644 --- a/Client/src/Pages/AdvancedSettings/index.jsx +++ b/Client/src/Pages/AdvancedSettings/index.jsx @@ -270,6 +270,7 @@ const AdvancedSettings = ({ isAdmin }) => { onChange={handleJWTTTLUnits} onBlur={handleBlur} error={errors.jwtTTLUnits} + labelControlSpacing={0} /> Date: Thu, 5 Dec 2024 17:46:55 +0530 Subject: [PATCH 006/178] added a space before proptype --- Client/src/Components/Inputs/Select/index.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Client/src/Components/Inputs/Select/index.jsx b/Client/src/Components/Inputs/Select/index.jsx index 2804a76f3..ea9509c87 100644 --- a/Client/src/Components/Inputs/Select/index.jsx +++ b/Client/src/Components/Inputs/Select/index.jsx @@ -145,7 +145,7 @@ Select.propTypes = { onChange: PropTypes.func.isRequired, onBlur: PropTypes.func, sx: PropTypes.object, - labelControlSpacing:PropTypes.number, + labelControlSpacing: PropTypes.number, }; export default Select; From b034288c7f3c8e29c7564e8533f29485ceaa1813 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 5 Dec 2024 18:44:43 +0000 Subject: [PATCH 007/178] fix(deps): update material-ui monorepo to v7.23.1 --- Client/package-lock.json | 22 +++++++++++----------- Client/package.json | 4 ++-- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Client/package-lock.json b/Client/package-lock.json index f1de2ddb8..b1622d75f 100644 --- a/Client/package-lock.json +++ b/Client/package-lock.json @@ -15,8 +15,8 @@ "@mui/lab": "6.0.0-beta.18", "@mui/material": "6.1.10", "@mui/x-charts": "^7.5.1", - "@mui/x-data-grid": "7.23.0", - "@mui/x-date-pickers": "7.23.0", + "@mui/x-data-grid": "7.23.1", + "@mui/x-date-pickers": "7.23.1", "@reduxjs/toolkit": "2.4.0", "axios": "^1.7.4", "dayjs": "1.11.13", @@ -1378,9 +1378,9 @@ } }, "node_modules/@mui/x-charts": { - "version": "7.23.0", - "resolved": "https://registry.npmjs.org/@mui/x-charts/-/x-charts-7.23.0.tgz", - "integrity": "sha512-lXG+vRMFvisFaj93LlglZij7e5NEHptXQG0x9EshSI8uIm8HN9Xp77qIdE95xLyltImakuFCeJaEk9oaRMBTpA==", + "version": "7.23.1", + "resolved": "https://registry.npmjs.org/@mui/x-charts/-/x-charts-7.23.1.tgz", + "integrity": "sha512-hIVRitRSFxf60BHDr+T7Tarj4lLwOV8flebeIsyEPJJHvSlaFNFwr6rqYFb8SGULYU7ppKMhiESD1+YqgJSU1Q==", "license": "MIT", "dependencies": { "@babel/runtime": "^7.25.7", @@ -1436,9 +1436,9 @@ } }, "node_modules/@mui/x-data-grid": { - "version": "7.23.0", - "resolved": "https://registry.npmjs.org/@mui/x-data-grid/-/x-data-grid-7.23.0.tgz", - "integrity": "sha512-nypSz/7j0HPvW7tRPcZAlQADOiRAE4jTIcxwwJUPLtU17EPJOiw1iB29SRYtUThw4f3aXETPAeT4fzgagpuiKg==", + "version": "7.23.1", + "resolved": "https://registry.npmjs.org/@mui/x-data-grid/-/x-data-grid-7.23.1.tgz", + "integrity": "sha512-1CumfhjGA+WgNtnN3ZD3gCOw6RVf/cEy2X2gS0iyXtVsFNaE+qtyMz9KesQsIzi9u13Wj3RNuhBdH0C5qXtAhQ==", "license": "MIT", "dependencies": { "@babel/runtime": "^7.25.7", @@ -1473,9 +1473,9 @@ } }, "node_modules/@mui/x-date-pickers": { - "version": "7.23.0", - "resolved": "https://registry.npmjs.org/@mui/x-date-pickers/-/x-date-pickers-7.23.0.tgz", - "integrity": "sha512-Db9ElibVYHluXLVsRLfFwlYkL6/3NNE5AosSZiTx+Gw7uix/Z3pdjyHeA3ab65fU1tCk08XHY0PU6LQFifYB2g==", + "version": "7.23.1", + "resolved": "https://registry.npmjs.org/@mui/x-date-pickers/-/x-date-pickers-7.23.1.tgz", + "integrity": "sha512-Jr4beZ7r2lvWBaFnkIAg9BgiNFcfeJy4AUe3MbG10BBSZyB++odGqhOUAIGqkP7MpUzEGlTv4NUaaD7gYTAQPg==", "license": "MIT", "dependencies": { "@babel/runtime": "^7.25.7", diff --git a/Client/package.json b/Client/package.json index d0d4b380d..1f4480fa2 100644 --- a/Client/package.json +++ b/Client/package.json @@ -18,8 +18,8 @@ "@mui/lab": "6.0.0-beta.18", "@mui/material": "6.1.10", "@mui/x-charts": "^7.5.1", - "@mui/x-data-grid": "7.23.0", - "@mui/x-date-pickers": "7.23.0", + "@mui/x-data-grid": "7.23.1", + "@mui/x-date-pickers": "7.23.1", "@reduxjs/toolkit": "2.4.0", "axios": "^1.7.4", "dayjs": "1.11.13", From 471e4fcee99322ab56066714c47a34c315e25618 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 5 Dec 2024 18:44:50 +0000 Subject: [PATCH 008/178] chore(deps): update dependency eslint-plugin-react-hooks to v5.1.0 --- Client/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Client/package-lock.json b/Client/package-lock.json index f1de2ddb8..5ad33175d 100644 --- a/Client/package-lock.json +++ b/Client/package-lock.json @@ -3551,9 +3551,9 @@ } }, "node_modules/eslint-plugin-react-hooks": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-5.0.0.tgz", - "integrity": "sha512-hIOwI+5hYGpJEc4uPRmz2ulCjAGD/N13Lukkh8cLV0i2IRk/bdZDYjgLVHj+U9Z704kLIdIO6iueGvxNur0sgw==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-5.1.0.tgz", + "integrity": "sha512-mpJRtPgHN2tNAvZ35AMfqeB3Xqeo273QxrHJsbBEPWODRM4r0yB6jfoROqKEYrOn27UtRPpcpHc2UqyBSuUNTw==", "dev": true, "license": "MIT", "engines": { From 6f781b945674bbc94a90badc15d3aa52d1b16a8d Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 6 Dec 2024 02:00:22 +0000 Subject: [PATCH 009/178] fix(deps): update dependency express to v4.21.2 --- Server/package-lock.json | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/Server/package-lock.json b/Server/package-lock.json index 1d36128eb..3e2573f63 100644 --- a/Server/package-lock.json +++ b/Server/package-lock.json @@ -2374,9 +2374,9 @@ } }, "node_modules/express": { - "version": "4.21.1", - "resolved": "https://registry.npmjs.org/express/-/express-4.21.1.tgz", - "integrity": "sha512-YSFlK1Ee0/GC8QaO91tHcDxJiE/X4FbpAyQWkxAvG6AXCuR65YzK8ua6D9hvi/TzUfZMpc+BwuM1IPw8fmQBiQ==", + "version": "4.21.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.21.2.tgz", + "integrity": "sha512-28HqgMZAmih1Czt9ny7qr6ek2qddF4FclbMzwhCREB6OFfH+rXAnuNCwo1/wFvrtbgsQDb4kSbX9de9lFbrXnA==", "license": "MIT", "dependencies": { "accepts": "~1.3.8", @@ -2398,7 +2398,7 @@ "methods": "~1.1.2", "on-finished": "2.4.1", "parseurl": "~1.3.3", - "path-to-regexp": "0.1.10", + "path-to-regexp": "0.1.12", "proxy-addr": "~2.0.7", "qs": "6.13.0", "range-parser": "~1.2.1", @@ -2413,6 +2413,10 @@ }, "engines": { "node": ">= 0.10.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" } }, "node_modules/extend": { @@ -5119,9 +5123,9 @@ } }, "node_modules/path-to-regexp": { - "version": "0.1.10", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.10.tgz", - "integrity": "sha512-7lf7qcQidTku0Gu3YDPc8DJ1q7OOucfa/BSsIwjuh56VU7katFvuM8hULfkwB3Fns/rsVF7PwPKVw1sl5KQS9w==", + "version": "0.1.12", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.12.tgz", + "integrity": "sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ==", "license": "MIT" }, "node_modules/pathval": { From a1ee49e71805d12245673f02ba9d49901f9304c3 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 6 Dec 2024 02:00:30 +0000 Subject: [PATCH 010/178] fix(deps): update dependency mongoose to v8.8.4 --- Server/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Server/package-lock.json b/Server/package-lock.json index 1d36128eb..3f81fcfac 100644 --- a/Server/package-lock.json +++ b/Server/package-lock.json @@ -4551,9 +4551,9 @@ } }, "node_modules/mongoose": { - "version": "8.8.3", - "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-8.8.3.tgz", - "integrity": "sha512-/I4n/DcXqXyIiLRfAmUIiTjj3vXfeISke8dt4U4Y8Wfm074Wa6sXnQrXN49NFOFf2mM1kUdOXryoBvkuCnr+Qw==", + "version": "8.8.4", + "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-8.8.4.tgz", + "integrity": "sha512-yJbn695qCsqDO+xyPII29x2R7flzXhxCDv09mMZPSGllf0sm4jKw3E9s9uvQ9hjO6bL2xjU8KKowYqcY9eSTMQ==", "license": "MIT", "dependencies": { "bson": "^6.7.0", From 958904e6d5eca16f81cff6ea65857283487a2e63 Mon Sep 17 00:00:00 2001 From: "Gorkem Cetin (BWL)" <167266851+gorkem-bwl@users.noreply.github.com> Date: Thu, 5 Dec 2024 22:40:40 -0500 Subject: [PATCH 011/178] Update README.md --- README.md | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index a0367711e..dd04bbbfb 100644 --- a/README.md +++ b/README.md @@ -11,9 +11,12 @@

An open source server monitoring application

![Dashboard-dark](https://github.com/user-attachments/assets/db875138-164f-453c-a75e-889f88747578) -(yes, we have a light theme as well, but this looks better on readme.md) -Checkmate is an open source uptime manager, server & Docker monitoring tool used to track the operational status and performance of servers and websites. It regularly checks whether a server/website is accessible and performs optimally, providing real-time alerts and reports on the monitored services' availability, downtime, and response time. Checkmate also has an agent, called [Capture](https://github.com/bluewave-labs/capture), to retrieve data from remote servers. While Capture is not required to run Checkmate, it provides additional insigths about your servers' CPU, RAM, disk and temperature status. +Checkmate is an open source uptime manager, server & Docker monitoring tool used to track the operational status and performance of servers and websites. It regularly checks whether a server/website is accessible and performs optimally, providing real-time alerts and reports on the monitored services' availability, downtime, and response time. + +Checkmate also has an agent, called [Capture](https://github.com/bluewave-labs/capture), to retrieve data from remote servers. While Capture is not required to run Checkmate, it provides additional insigths about your servers' CPU, RAM, disk and temperature status. + +We **love** what we are building here, and learn a few things about Reactjs, Nodejs, MongoDB and Docker while building Checkmate. **If you would like to support us, please consider giving it a ⭐, think about contributing or providing feedback.** Please note that we do not operate a monetary donation program, make money by deploying servers, or run a SaaS business. ## πŸ“¦ Demo @@ -46,11 +49,11 @@ We've just launched our [Discussions](https://github.com/bluewave-labs/bluewave- **Short term roadmap:** -- DNS monitoring -- SSL monitoring - Status pages - Better notification options - More configuration options +- DNS monitoring +- SSL monitoring ## πŸ—οΈ Tech stack @@ -61,7 +64,7 @@ We've just launched our [Discussions](https://github.com/bluewave-labs/bluewave- ## 🀝 Contributing -We are known for our great relationship with outside contributors. Checkmate is a young project, but we already have 600+ stars and 30+ contributors from all over the world. The last thing you should do here is to be shy. +We pride ourselves on building strong connections with contributors at every level. Despite being a young project, Checkmate has already earned 600+ stars and attracted 30+ contributors from around the globe. So, don’t hold back β€” jump in, contribute and learn with us! Here's how you can contribute: From a912b6752cd8f5f0210a086bdb3c40d06c5e28f8 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 6 Dec 2024 05:01:19 +0000 Subject: [PATCH 012/178] chore(deps): update react monorepo --- Client/package-lock.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Client/package-lock.json b/Client/package-lock.json index b24ef8cad..1cd33ee81 100644 --- a/Client/package-lock.json +++ b/Client/package-lock.json @@ -2360,9 +2360,9 @@ "license": "MIT" }, "node_modules/@types/react": { - "version": "18.3.13", - "resolved": "https://registry.npmjs.org/@types/react/-/react-18.3.13.tgz", - "integrity": "sha512-ii/gswMmOievxAJed4PAHT949bpYjPKXvXo1v6cRB/kqc2ZR4n+SgyCyvyc5Fec5ez8VnUumI1Vk7j6fRyRogg==", + "version": "18.3.14", + "resolved": "https://registry.npmjs.org/@types/react/-/react-18.3.14.tgz", + "integrity": "sha512-NzahNKvjNhVjuPBQ+2G7WlxstQ+47kXZNHlUvFakDViuIEfGY926GqhMueQFZ7woG+sPiQKlF36XfrIUVSUfFg==", "license": "MIT", "dependencies": { "@types/prop-types": "*", @@ -2370,13 +2370,13 @@ } }, "node_modules/@types/react-dom": { - "version": "18.3.1", - "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.3.1.tgz", - "integrity": "sha512-qW1Mfv8taImTthu4KoXgDfLuk4bydU6Q/TkADnDWWHwi4NX4BR+LWfTp2sVmTqRrsHvyDDTelgelxJ+SsejKKQ==", + "version": "18.3.2", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.3.2.tgz", + "integrity": "sha512-Fqp+rcvem9wEnGr3RY8dYNvSQ8PoLqjZ9HLgaPUOjJJD120uDyOxOjc/39M4Kddp9JQCxpGQbnhVQF0C0ncYVg==", "dev": true, "license": "MIT", "dependencies": { - "@types/react": "*" + "@types/react": "^18" } }, "node_modules/@types/react-transition-group": { From 707a13c3c51b21c73dbef28b4f442e76acd9c6ff Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 6 Dec 2024 05:01:27 +0000 Subject: [PATCH 013/178] fix(deps): update dependency bullmq to v5.31.2 --- Server/package-lock.json | 8 ++++---- Server/package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Server/package-lock.json b/Server/package-lock.json index f2d3c7983..06ba3d77b 100644 --- a/Server/package-lock.json +++ b/Server/package-lock.json @@ -11,7 +11,7 @@ "dependencies": { "axios": "^1.7.2", "bcrypt": "^5.1.1", - "bullmq": "5.31.1", + "bullmq": "5.31.2", "cors": "^2.8.5", "dockerode": "4.0.2", "dotenv": "^16.4.5", @@ -1218,9 +1218,9 @@ } }, "node_modules/bullmq": { - "version": "5.31.1", - "resolved": "https://registry.npmjs.org/bullmq/-/bullmq-5.31.1.tgz", - "integrity": "sha512-otkHjMd0pscUgqDBTjGchdBCavB0ZQRNN/YLsJ4kKw0rf1NpXJOyORjOQVkypLffu/06IuXII3ZN+kJqD+Wo8g==", + "version": "5.31.2", + "resolved": "https://registry.npmjs.org/bullmq/-/bullmq-5.31.2.tgz", + "integrity": "sha512-MUW6j1V79NRnrGZtxKyfyTv/YJ5Ljy0IrbMElpuQNCaLXoXEcCtU6kwdGiHxso9dUi1Wp4yo3GYEGg8vyWWLsw==", "license": "MIT", "dependencies": { "cron-parser": "^4.6.0", diff --git a/Server/package.json b/Server/package.json index 2e131f0e2..bd18b3c3b 100644 --- a/Server/package.json +++ b/Server/package.json @@ -14,7 +14,7 @@ "dependencies": { "axios": "^1.7.2", "bcrypt": "^5.1.1", - "bullmq": "5.31.1", + "bullmq": "5.31.2", "cors": "^2.8.5", "dockerode": "4.0.2", "dotenv": "^16.4.5", From b4cce16931544319fdf47a1ee3e40af91b8909fc Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Fri, 6 Dec 2024 13:18:59 +0800 Subject: [PATCH 014/178] fix links in create infra monitor page --- Client/src/Pages/Infrastructure/CreateMonitor/index.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Client/src/Pages/Infrastructure/CreateMonitor/index.jsx b/Client/src/Pages/Infrastructure/CreateMonitor/index.jsx index f89e21915..f1d2d0ce2 100644 --- a/Client/src/Pages/Infrastructure/CreateMonitor/index.jsx +++ b/Client/src/Pages/Infrastructure/CreateMonitor/index.jsx @@ -210,8 +210,8 @@ const CreateInfrastructureMonitor = () => { Date: Fri, 6 Dec 2024 14:25:11 +0800 Subject: [PATCH 015/178] Refactor Create PageSpeed --- .../Pages/PageSpeed/CreatePageSpeed/index.jsx | 313 ++++++++---------- 1 file changed, 142 insertions(+), 171 deletions(-) diff --git a/Client/src/Pages/PageSpeed/CreatePageSpeed/index.jsx b/Client/src/Pages/PageSpeed/CreatePageSpeed/index.jsx index ba3a7bb4a..6823cfe21 100644 --- a/Client/src/Pages/PageSpeed/CreatePageSpeed/index.jsx +++ b/Client/src/Pages/PageSpeed/CreatePageSpeed/index.jsx @@ -1,42 +1,52 @@ +// React, Redux, Router +import { useNavigate, useParams } from "react-router-dom"; +import { useEffect } from "react"; import { useState } from "react"; -import { Box, Button, ButtonGroup, Stack, Typography } from "@mui/material"; -import LoadingButton from "@mui/lab/LoadingButton"; import { useSelector, useDispatch } from "react-redux"; + +// Utility and Network +import { logger } from "../../../Utils/Logger"; import { monitorValidation } from "../../../Validation/validation"; -import { useNavigate } from "react-router-dom"; -import { useTheme } from "@emotion/react"; import { createPageSpeed, checkEndpointResolution, } from "../../../Features/PageSpeedMonitor/pageSpeedMonitorSlice"; -import { createToast } from "../../../Utils/toastUtils"; -import { logger } from "../../../Utils/Logger"; -import { ConfigBox } from "../../Monitors/styled"; -import Radio from "../../../Components/Inputs/Radio"; +import { parseDomainName } from "../../../Utils/monitorUtils"; + +// MUI +import { useTheme } from "@emotion/react"; +import { Box, Stack, Typography, Button, ButtonGroup } from "@mui/material"; +import LoadingButton from "@mui/lab/LoadingButton"; + +//Components +import Breadcrumbs from "../../../Components/Breadcrumbs"; import TextInput from "../../../Components/Inputs/TextInput"; import { HttpAdornment } from "../../../Components/Inputs/TextInput/Adornments"; -import Select from "../../../Components/Inputs/Select"; +import { ConfigBox } from "../../Monitors/styled"; + +import { createToast } from "../../../Utils/toastUtils"; +import Radio from "../../../Components/Inputs/Radio"; import Checkbox from "../../../Components/Inputs/Checkbox"; -import Breadcrumbs from "../../../Components/Breadcrumbs"; -import { parseDomainName } from "../../../Utils/monitorUtils"; -import "./index.css"; +import Select from "../../../Components/Inputs/Select"; const CreatePageSpeed = () => { const MS_PER_MINUTE = 60000; - const { user, authToken } = useSelector((state) => state.auth); - const { isLoading } = useSelector((state) => state.pageSpeedMonitors); - const dispatch = useDispatch(); - const navigate = useNavigate(); - const theme = useTheme(); - const idMap = { - "monitor-url": "url", - "monitor-name": "name", - "monitor-checks-http": "type", - "monitor-checks-ping": "type", - "notify-email-default": "notification-email", - }; + const CRUMBS = [ + { name: "pagespeed", path: "/pagespeed" }, + { name: "create", path: `/pagespeed/create` }, + ]; + const SELECT_VALUES = [ + { _id: 3, name: "3 minutes" }, + { _id: 5, name: "5 minutes" }, + { _id: 10, name: "10 minutes" }, + { _id: 20, name: "20 minutes" }, + { _id: 60, name: "1 hour" }, + { _id: 1440, name: "1 day" }, + { _id: 10080, name: "1 week" }, + ]; + // State const [monitor, setMonitor] = useState({ url: "", name: "", @@ -44,71 +54,20 @@ const CreatePageSpeed = () => { notifications: [], interval: 3, }); + const [https, setHttps] = useState(true); const [errors, setErrors] = useState({}); + const { user, authToken } = useSelector((state) => state.auth); + const { isLoading } = useSelector((state) => state.pageSpeedMonitors); - const handleChange = (event, name) => { - const { value, id } = event.target; - if (!name) name = idMap[id]; - - if (name.includes("notification-")) { - name = name.replace("notification-", ""); - let hasNotif = monitor.notifications.some( - (notification) => notification.type === name - ); - setMonitor((prev) => { - const notifs = [...prev.notifications]; - if (hasNotif) { - return { - ...prev, - notifications: notifs.filter((notif) => notif.type !== name), - }; - } else { - return { - ...prev, - notifications: [ - ...notifs, - name === "email" - ? { type: name, address: value } - : // TODO - phone number - { type: name, phone: value }, - ], - }; - } - }); - } else { - setMonitor((prev) => ({ - ...prev, - [name]: value, - })); - - const { error } = monitorValidation.validate( - { [name]: value }, - { abortEarly: false } - ); - - setErrors((prev) => { - const updatedErrors = { ...prev }; - if (error) updatedErrors[name] = error.details[0].message; - else delete updatedErrors[name]; - return updatedErrors; - }); - } - }; - - const onUrlBlur = (event) => { - const { value } = event.target; - if (monitor.name === "") { - setMonitor((prev) => ({ - ...prev, - name: parseDomainName(value), - })); - } - }; + // Setup + const dispatch = useDispatch(); + const navigate = useNavigate(); + const theme = useTheme(); + // Handlers const handleCreateMonitor = async (event) => { event.preventDefault(); - //obj to submit let form = { url: `http${https ? "s" : ""}://` + monitor.url, name: monitor.name === "" ? monitor.url : monitor.name, @@ -126,46 +85,98 @@ const CreatePageSpeed = () => { newErrors[err.path[0]] = err.message; }); setErrors(newErrors); - createToast({ body: "Error validation data." }); - } else { - const checkEndpointAction = await dispatch( - checkEndpointResolution({ authToken, monitorURL: form.url }) - ); - if (checkEndpointAction.meta.requestStatus === "rejected") { - createToast({ - body: "The endpoint you entered doesn't resolve. Check the URL again.", - }); - setErrors({ url: "The entered URL is not reachable." }); - return; - } + createToast({ body: "Please check the form for errors." }); + return; + } - form = { - ...form, - description: form.name, - teamId: user.teamId, - userId: user._id, - notifications: monitor.notifications, - }; - const action = await dispatch(createPageSpeed({ authToken, monitor: form })); - if (action.meta.requestStatus === "fulfilled") { - createToast({ body: "Monitor created successfully!" }); - navigate("/pagespeed"); - } else { - createToast({ body: "Failed to create monitor." }); - } + const checkEndpointAction = await dispatch( + checkEndpointResolution({ authToken, monitorURL: form.url }) + ); + + if (checkEndpointAction.meta.requestStatus === "rejected") { + createToast({ + body: "The endpoint you entered doesn't resolve. Check the URL again.", + }); + setErrors({ url: "The entered URL is not reachable." }); + return; + } + + form = { + ...form, + description: form.name, + teamId: user.teamId, + userId: user._id, + notifications: monitor.notifications, + }; + + const action = await dispatch(createPageSpeed({ authToken, monitor: form })); + if (action.meta.requestStatus === "fulfilled") { + createToast({ body: "Monitor created successfully!" }); + navigate("/pagespeed"); + } else { + createToast({ body: "Failed to create monitor." }); + } + }; + + const handleChange = (event, formItemName) => { + const { value } = event.target; + setMonitor({ + ...monitor, + [formItemName]: value, + }); + + const { error } = monitorValidation.validate( + { [formItemName]: value }, + { abortEarly: false } + ); + + setErrors((prev) => ({ + ...prev, + ...(error + ? { [formItemName]: error.details[0].message } + : { [formItemName]: undefined }), + })); + }; + + const handleNotifications = (event, type) => { + const { value } = event.target; + let notifications = [...monitor.notifications]; + const notificationExists = notifications.some((notification) => { + if (notification.type === type && notification.address === value) { + return true; + } + return false; + }); + if (notificationExists) { + notifications = notifications.filter((notification) => { + if (notification.type === type && notification.address === value) { + return false; + } + return true; + }); + } else { + notifications.push({ type, address: value }); + } + + setMonitor((prev) => ({ + ...prev, + notifications, + })); + }; + + const handleBlur = (event, formItemName) => { + if (formItemName === "url") { + const { value } = event.target; + if (monitor.name !== "") { + return; + } + setMonitor((prev) => ({ + ...prev, + name: parseDomainName(value), + })); } }; - //select values - const frequencies = [ - { _id: 3, name: "3 minutes" }, - { _id: 5, name: "5 minutes" }, - { _id: 10, name: "10 minutes" }, - { _id: 20, name: "20 minutes" }, - { _id: 60, name: "1 hour" }, - { _id: 1440, name: "1 day" }, - { _id: 10080, name: "1 week" }, - ]; return ( { }, }} > - + { fontWeight="inherit" color={theme.palette.text.secondary} > - pagespeed monitor + PageSpeed monitor
@@ -224,8 +230,8 @@ const CreatePageSpeed = () => { startAdornment={} placeholder="google.com" value={monitor.url} - onChange={handleChange} - onBlur={onUrlBlur} + onChange={(event) => handleChange(event, "url")} + onBlur={(event) => handleBlur(event, "url")} error={errors["url"] ? true : false} helperText={errors["url"]} /> @@ -236,7 +242,7 @@ const CreatePageSpeed = () => { isOptional={true} placeholder="Google" value={monitor.name} - onChange={handleChange} + onChange={(event) => handleChange(event, "name")} error={errors["name"] ? true : false} helperText={errors["name"]} /> @@ -253,8 +259,8 @@ const CreatePageSpeed = () => { { HTTPS + + + { placeholder="Google" isOptional={true} value={infrastructureMonitor.name} - onBlur={handleBlur} - onChange={handleChange} + onChange={(event) => handleChange(event, "name")} error={errors["name"]} /> { id="secret" label="Authorization secret" value={infrastructureMonitor.secret} - onBlur={handleBlur} - onChange={handleChange} + onChange={(event) => handleChange(event, "secret")} error={errors["secret"] ? true : false} helperText={errors["secret"]} /> @@ -311,12 +342,11 @@ const CreateInfrastructureMonitor = () => { (notification) => notification.type === "email" )} value={user?.email} - onChange={(e) => handleChange(e)} + onChange={(event) => handleNotifications(event, "email")} onBlur={handleBlur} /> - Customize alerts @@ -326,25 +356,30 @@ const CreateInfrastructureMonitor = () => {
- {HARDWARE_MONITOR_TYPES.map((type, idx) => ( - - ))} - {alertErrKeyLen > 0 && ( + {METRICS.map((metric) => { + return ( + handleCheckboxChange(event, metric)} + isChecked={infrastructureMonitor[metric]} + fieldId={METRIC_PREFIX + metric} + fieldValue={infrastructureMonitor[METRIC_PREFIX + metric]} + onFieldChange={(event) => handleChange(event, METRIC_PREFIX + metric)} + onFieldBlur={(event) => handleBlur(event, METRIC_PREFIX + metric)} + alertUnit={metric == "temperature" ? "Β°C" : "%"} + /> + ); + })} + {/* Error text */} + {hasAlertError(errors) && ( { opacity: 0.8, }} > - { - errors[ - THRESHOLD_FIELD_PREFIX + - HARDWARE_MONITOR_TYPES.filter( - (type) => errors[THRESHOLD_FIELD_PREFIX + type] - )[0] - ] - } + {getAlertError(errors)} )} @@ -377,7 +405,7 @@ const CreateInfrastructureMonitor = () => { value={infrastructureMonitor.interval || 15} onChange={(e) => handleChange(e, "interval")} onBlur={(e) => handleBlur(e, "interval")} - items={frequencies} + items={SELECT_VALUES} /> From f42bdddb7a5a87dad284533f609827ce402645ac Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Mon, 9 Dec 2024 14:01:10 +0800 Subject: [PATCH 021/178] add deleteHardwareChecksByMonitorId --- Server/controllers/monitorController.js | 1 + Server/db/mongo/MongoDB.js | 6 +++++- Server/db/mongo/modules/hardwareCheckModule.js | 14 +++++++++++++- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/Server/controllers/monitorController.js b/Server/controllers/monitorController.js index 0866017bf..625c1a0f7 100644 --- a/Server/controllers/monitorController.js +++ b/Server/controllers/monitorController.js @@ -332,6 +332,7 @@ const deleteMonitor = async (req, res, next) => { await req.db.deleteChecks(monitor._id); await req.db.deletePageSpeedChecksByMonitorId(monitor._id); await req.db.deleteNotificationsByMonitorId(monitor._id); + await req.db.deleteHardwareChecksByMonitorId(monitor._id); } catch (error) { logger.error({ message: `Error deleting associated records for monitor ${monitor._id} with name ${monitor.name}`, diff --git a/Server/db/mongo/MongoDB.js b/Server/db/mongo/MongoDB.js index 288aa83ad..3bdde7d69 100644 --- a/Server/db/mongo/MongoDB.js +++ b/Server/db/mongo/MongoDB.js @@ -124,7 +124,10 @@ import { //**************************************** // Hardware Checks //**************************************** -import { createHardwareCheck } from "./modules/hardwareCheckModule.js"; +import { + createHardwareCheck, + deleteHardwareChecksByMonitorId, +} from "./modules/hardwareCheckModule.js"; //**************************************** // Checks @@ -213,6 +216,7 @@ export default { createPageSpeedCheck, deletePageSpeedChecksByMonitorId, createHardwareCheck, + deleteHardwareChecksByMonitorId, createMaintenanceWindow, getMaintenanceWindowsByTeamId, getMaintenanceWindowById, diff --git a/Server/db/mongo/modules/hardwareCheckModule.js b/Server/db/mongo/modules/hardwareCheckModule.js index 3eab0dfb9..9c49e831b 100644 --- a/Server/db/mongo/modules/hardwareCheckModule.js +++ b/Server/db/mongo/modules/hardwareCheckModule.js @@ -37,4 +37,16 @@ const createHardwareCheck = async (hardwareCheckData) => { } }; -export { createHardwareCheck }; +const deleteHardwareChecksByMonitorId = async (monitorId) => { + try { + const result = await HardwareCheck.deleteMany({ monitorId }); + console.log("deleted hardware checks", result); + return result.deletedCount; + } catch (error) { + error.service = SERVICE_NAME; + error.method = "deleteHardwareChecksByMonitorId"; + throw error; + } +}; + +export { createHardwareCheck, deleteHardwareChecksByMonitorId }; From 7e9383d0ebe15b6faab37dedef6b43edad3110f7 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 9 Dec 2024 10:06:23 +0000 Subject: [PATCH 022/178] fix(deps): update dependency bullmq to v5.33.0 --- Server/package-lock.json | 8 ++++---- Server/package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Server/package-lock.json b/Server/package-lock.json index 11081ae2a..fc62aa925 100644 --- a/Server/package-lock.json +++ b/Server/package-lock.json @@ -11,7 +11,7 @@ "dependencies": { "axios": "^1.7.2", "bcrypt": "^5.1.1", - "bullmq": "5.32.0", + "bullmq": "5.33.0", "cors": "^2.8.5", "dockerode": "4.0.2", "dotenv": "^16.4.5", @@ -1218,9 +1218,9 @@ } }, "node_modules/bullmq": { - "version": "5.32.0", - "resolved": "https://registry.npmjs.org/bullmq/-/bullmq-5.32.0.tgz", - "integrity": "sha512-zNf/DrbCbH+H8fgMshu33OGwrkUZP3c/CyJeFHauglEy5U6Fd9r52ujItRiT1PIODHIG6pCIdWMbpJGCf+Wuxg==", + "version": "5.33.0", + "resolved": "https://registry.npmjs.org/bullmq/-/bullmq-5.33.0.tgz", + "integrity": "sha512-dICdidv1x+umYyA0DqlnCPa1sgHjtHo6gzyww5E10OQq+k9saT2B/rIP8pQbo8HhN/fRViYjJP/+7s8594/xdw==", "license": "MIT", "dependencies": { "cron-parser": "^4.6.0", diff --git a/Server/package.json b/Server/package.json index eacbd77b1..44a02a5ae 100644 --- a/Server/package.json +++ b/Server/package.json @@ -14,7 +14,7 @@ "dependencies": { "axios": "^1.7.2", "bcrypt": "^5.1.1", - "bullmq": "5.32.0", + "bullmq": "5.33.0", "cors": "^2.8.5", "dockerode": "4.0.2", "dotenv": "^16.4.5", From d649c53249904a6e5e35d1acc690eb1c2d501b81 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 9 Dec 2024 10:06:34 +0000 Subject: [PATCH 023/178] fix(deps): update emotion monorepo to v11.14.0 --- Client/package-lock.json | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/Client/package-lock.json b/Client/package-lock.json index 1cd33ee81..14e12ccae 100644 --- a/Client/package-lock.json +++ b/Client/package-lock.json @@ -352,9 +352,9 @@ } }, "node_modules/@emotion/cache": { - "version": "11.13.5", - "resolved": "https://registry.npmjs.org/@emotion/cache/-/cache-11.13.5.tgz", - "integrity": "sha512-Z3xbtJ+UcK76eWkagZ1onvn/wAVb1GOMuR15s30Fm2wrMgC7jzpnO2JZXr4eujTTqoQFUrZIw/rT0c6Zzjca1g==", + "version": "11.14.0", + "resolved": "https://registry.npmjs.org/@emotion/cache/-/cache-11.14.0.tgz", + "integrity": "sha512-L/B1lc/TViYk4DcpGxtAVbx0ZyiKM5ktoIyafGkH6zg/tj+mA+NE//aPYKG0k8kCHSHVJrpLpcAlOBEXQ3SavA==", "license": "MIT", "dependencies": { "@emotion/memoize": "^0.9.0", @@ -386,16 +386,16 @@ "license": "MIT" }, "node_modules/@emotion/react": { - "version": "11.13.5", - "resolved": "https://registry.npmjs.org/@emotion/react/-/react-11.13.5.tgz", - "integrity": "sha512-6zeCUxUH+EPF1s+YF/2hPVODeV/7V07YU5x+2tfuRL8MdW6rv5vb2+CBEGTGwBdux0OIERcOS+RzxeK80k2DsQ==", + "version": "11.14.0", + "resolved": "https://registry.npmjs.org/@emotion/react/-/react-11.14.0.tgz", + "integrity": "sha512-O000MLDBDdk/EohJPFUqvnp4qnHeYkVP5B0xEG0D/L7cOKP9kefu2DXn8dj74cQfsEzUqh+sr1RzFqiL1o+PpA==", "license": "MIT", "dependencies": { "@babel/runtime": "^7.18.3", "@emotion/babel-plugin": "^11.13.5", - "@emotion/cache": "^11.13.5", + "@emotion/cache": "^11.14.0", "@emotion/serialize": "^1.3.3", - "@emotion/use-insertion-effect-with-fallbacks": "^1.1.0", + "@emotion/use-insertion-effect-with-fallbacks": "^1.2.0", "@emotion/utils": "^1.4.2", "@emotion/weak-memoize": "^0.4.0", "hoist-non-react-statics": "^3.3.1" @@ -429,16 +429,16 @@ "license": "MIT" }, "node_modules/@emotion/styled": { - "version": "11.13.5", - "resolved": "https://registry.npmjs.org/@emotion/styled/-/styled-11.13.5.tgz", - "integrity": "sha512-gnOQ+nGLPvDXgIx119JqGalys64lhMdnNQA9TMxhDA4K0Hq5+++OE20Zs5GxiCV9r814xQ2K5WmtofSpHVW6BQ==", + "version": "11.14.0", + "resolved": "https://registry.npmjs.org/@emotion/styled/-/styled-11.14.0.tgz", + "integrity": "sha512-XxfOnXFffatap2IyCeJyNov3kiDQWoR08gPUQxvbL7fxKryGBKUZUkG6Hz48DZwVrJSVh9sJboyV1Ds4OW6SgA==", "license": "MIT", "dependencies": { "@babel/runtime": "^7.18.3", "@emotion/babel-plugin": "^11.13.5", "@emotion/is-prop-valid": "^1.3.0", "@emotion/serialize": "^1.3.3", - "@emotion/use-insertion-effect-with-fallbacks": "^1.1.0", + "@emotion/use-insertion-effect-with-fallbacks": "^1.2.0", "@emotion/utils": "^1.4.2" }, "peerDependencies": { @@ -458,9 +458,9 @@ "license": "MIT" }, "node_modules/@emotion/use-insertion-effect-with-fallbacks": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@emotion/use-insertion-effect-with-fallbacks/-/use-insertion-effect-with-fallbacks-1.1.0.tgz", - "integrity": "sha512-+wBOcIV5snwGgI2ya3u99D7/FJquOIniQT1IKyDsBmEgwvpxMNeS65Oib7OnE2d2aY+3BU4OiH+0Wchf8yk3Hw==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@emotion/use-insertion-effect-with-fallbacks/-/use-insertion-effect-with-fallbacks-1.2.0.tgz", + "integrity": "sha512-yJMtVdH59sxi/aVJBpk9FQq+OR8ll5GT8oWd57UpeaKEVGab41JWaCFA7FRLoMLloOZF/c/wsPoe+bfGmRKgDg==", "license": "MIT", "peerDependencies": { "react": ">=16.8.0" From dc81a0e51b02a4dabc731356c9f35c8fd90b3a82 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 9 Dec 2024 20:38:33 +0000 Subject: [PATCH 024/178] chore(deps): update dependency @types/react-dom to v18.3.3 --- Client/package-lock.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Client/package-lock.json b/Client/package-lock.json index 1cd33ee81..b1da81440 100644 --- a/Client/package-lock.json +++ b/Client/package-lock.json @@ -2370,13 +2370,13 @@ } }, "node_modules/@types/react-dom": { - "version": "18.3.2", - "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.3.2.tgz", - "integrity": "sha512-Fqp+rcvem9wEnGr3RY8dYNvSQ8PoLqjZ9HLgaPUOjJJD120uDyOxOjc/39M4Kddp9JQCxpGQbnhVQF0C0ncYVg==", + "version": "18.3.3", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.3.3.tgz", + "integrity": "sha512-uTYkxTLkYp41nq/ULXyXMtkNT1vu5fXJoqad6uTNCOGat5t9cLgF4vMNLBXsTOXpdOI44XzKPY1M5RRm0bQHuw==", "dev": true, "license": "MIT", - "dependencies": { - "@types/react": "^18" + "peerDependencies": { + "@types/react": "^18.0.0" } }, "node_modules/@types/react-transition-group": { From 97b565a6ad93d7909d3409483d7daeb068ff938c Mon Sep 17 00:00:00 2001 From: "Gorkem Cetin (BWL)" <167266851+gorkem-bwl@users.noreply.github.com> Date: Mon, 9 Dec 2024 16:20:18 -0500 Subject: [PATCH 025/178] Update README.md --- README.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index dd04bbbfb..5d6ec2922 100644 --- a/README.md +++ b/README.md @@ -68,11 +68,12 @@ We pride ourselves on building strong connections with contributors at every lev Here's how you can contribute: -- Check [Contributor's guideline](https://github.com/bluewave-labs/bluewave-uptime/blob/master/CONTRIBUTING.md). -- Have a look at our Figma designs [here](https://www.figma.com/design/RPSfaw66HjzSwzntKcgDUV/Uptime-Genie?node-id=0-1&t=WqOFv9jqNTFGItpL-1). We encourage you to copy to your own Figma page, then work on it as it is read-only. -- Open an issue if you believe you've encountered a bug -- Check for good-first-issue's if you are a newcomer -- Make a pull request to add new features/make quality-of-life improvements/fix bugs. +0. Star this repo :) +1. Check [Contributor's guideline](https://github.com/bluewave-labs/bluewave-uptime/blob/master/CONTRIBUTING.md). +2. Have a look at our Figma designs [here](https://www.figma.com/design/RPSfaw66HjzSwzntKcgDUV/Uptime-Genie?node-id=0-1&t=WqOFv9jqNTFGItpL-1). We encourage you to copy to your own Figma page, then work on it as it is read-only. +3. Open an issue if you believe you've encountered a bug +4. Check for good-first-issue's if you are a newcomer +5. Make a pull request to add new features/make quality-of-life improvements/fix bugs. From 1622e48fc0c3f0058fddfcb6f020eab9ba6a8610 Mon Sep 17 00:00:00 2001 From: Rishistav Date: Mon, 9 Dec 2024 16:31:36 -0500 Subject: [PATCH 026/178] Fix Sidebar height to occupy viewport height --- Client/src/Components/Sidebar/index.jsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Client/src/Components/Sidebar/index.jsx b/Client/src/Components/Sidebar/index.jsx index 4c274409b..00a32a8d3 100644 --- a/Client/src/Components/Sidebar/index.jsx +++ b/Client/src/Components/Sidebar/index.jsx @@ -262,7 +262,11 @@ function Sidebar() { Menu } - sx={{ px: theme.spacing(6) }} + sx={{ + px: theme.spacing(6), + height: "100%", + overflow: "hidden" + }} > {menu.map((item) => item.path ? ( From b306a4ac7b97c9adede6501775d51b99753beba4 Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Tue, 10 Dec 2024 11:17:17 +0800 Subject: [PATCH 027/178] Add name to all inputs, use event.target.name instead of passing extra variable --- .../Pages/PageSpeed/CreatePageSpeed/index.jsx | 66 +++++++++---------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/Client/src/Pages/PageSpeed/CreatePageSpeed/index.jsx b/Client/src/Pages/PageSpeed/CreatePageSpeed/index.jsx index 6823cfe21..ccab3442f 100644 --- a/Client/src/Pages/PageSpeed/CreatePageSpeed/index.jsx +++ b/Client/src/Pages/PageSpeed/CreatePageSpeed/index.jsx @@ -1,11 +1,9 @@ // React, Redux, Router -import { useNavigate, useParams } from "react-router-dom"; -import { useEffect } from "react"; +import { useNavigate } from "react-router-dom"; import { useState } from "react"; import { useSelector, useDispatch } from "react-redux"; // Utility and Network -import { logger } from "../../../Utils/Logger"; import { monitorValidation } from "../../../Validation/validation"; import { createPageSpeed, @@ -29,23 +27,24 @@ import Radio from "../../../Components/Inputs/Radio"; import Checkbox from "../../../Components/Inputs/Checkbox"; import Select from "../../../Components/Inputs/Select"; +const MS_PER_MINUTE = 60000; + +const CRUMBS = [ + { name: "pagespeed", path: "/pagespeed" }, + { name: "create", path: `/pagespeed/create` }, +]; + +const SELECT_VALUES = [ + { _id: 3, name: "3 minutes" }, + { _id: 5, name: "5 minutes" }, + { _id: 10, name: "10 minutes" }, + { _id: 20, name: "20 minutes" }, + { _id: 60, name: "1 hour" }, + { _id: 1440, name: "1 day" }, + { _id: 10080, name: "1 week" }, +]; + const CreatePageSpeed = () => { - const MS_PER_MINUTE = 60000; - - const CRUMBS = [ - { name: "pagespeed", path: "/pagespeed" }, - { name: "create", path: `/pagespeed/create` }, - ]; - - const SELECT_VALUES = [ - { _id: 3, name: "3 minutes" }, - { _id: 5, name: "5 minutes" }, - { _id: 10, name: "10 minutes" }, - { _id: 20, name: "20 minutes" }, - { _id: 60, name: "1 hour" }, - { _id: 1440, name: "1 day" }, - { _id: 10080, name: "1 week" }, - ]; // State const [monitor, setMonitor] = useState({ url: "", @@ -118,23 +117,21 @@ const CreatePageSpeed = () => { } }; - const handleChange = (event, formItemName) => { - const { value } = event.target; + const handleChange = (event) => { + const { value, name } = event.target; setMonitor({ ...monitor, - [formItemName]: value, + [name]: value, }); const { error } = monitorValidation.validate( - { [formItemName]: value }, + { [name]: value }, { abortEarly: false } ); setErrors((prev) => ({ ...prev, - ...(error - ? { [formItemName]: error.details[0].message } - : { [formItemName]: undefined }), + ...(error ? { [name]: error.details[0].message } : { [name]: undefined }), })); }; @@ -164,8 +161,9 @@ const CreatePageSpeed = () => { })); }; - const handleBlur = (event, formItemName) => { - if (formItemName === "url") { + const handleBlur = (event) => { + const { name } = event.target; + if (name === "url") { const { value } = event.target; if (monitor.name !== "") { return; @@ -225,24 +223,26 @@ const CreatePageSpeed = () => { } placeholder="google.com" value={monitor.url} - onChange={(event) => handleChange(event, "url")} - onBlur={(event) => handleBlur(event, "url")} + onChange={handleChange} + onBlur={handleBlur} error={errors["url"] ? true : false} helperText={errors["url"]} /> handleChange(event, "name")} + onChange={handleChange} error={errors["name"] ? true : false} helperText={errors["name"]} /> @@ -264,7 +264,6 @@ const CreatePageSpeed = () => { size="small" value="http" checked={monitor.type === "pagespeed"} - onChange={(event) => handleChange(event)} /> - + {isAdmin && ( + + )} + + Date: Tue, 10 Dec 2024 14:00:45 +0800 Subject: [PATCH 034/178] Add monitor count to PageSpeed page --- Client/src/Pages/PageSpeed/index.jsx | 33 +++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/Client/src/Pages/PageSpeed/index.jsx b/Client/src/Pages/PageSpeed/index.jsx index 8e0f111bb..b4056ffce 100644 --- a/Client/src/Pages/PageSpeed/index.jsx +++ b/Client/src/Pages/PageSpeed/index.jsx @@ -11,7 +11,7 @@ import Breadcrumbs from "../../Components/Breadcrumbs"; import SkeletonLayout from "./skeleton"; import Card from "./card"; import { networkService } from "../../main"; - +import { Heading } from "../../Components/Heading"; const PageSpeed = ({ isAdmin }) => { const theme = useTheme(); const dispatch = useDispatch(); @@ -20,6 +20,7 @@ const PageSpeed = ({ isAdmin }) => { const { user, authToken } = useSelector((state) => state.auth); const [isLoading, setIsLoading] = useState(true); const [monitors, setMonitors] = useState([]); + const [monitorCount, setMonitorCount] = useState(0); useEffect(() => { dispatch(getPageSpeedByTeamId(authToken)); }, [authToken, dispatch]); @@ -44,6 +45,7 @@ const PageSpeed = ({ isAdmin }) => { }); if (res?.data?.data?.monitors) { setMonitors(res.data.data.monitors); + setMonitorCount(res.data.data.monitorCount); } } catch (error) { console.log(error); @@ -53,7 +55,7 @@ const PageSpeed = ({ isAdmin }) => { }; fetchMonitors(); - }, []); + }, [authToken, user.teamId]); // will show skeletons only on initial load // since monitor state is being added to redux persist, there's no reason to display skeletons on every render @@ -76,8 +78,8 @@ const PageSpeed = ({ isAdmin }) => { {isActuallyLoading ? ( ) : monitors?.length !== 0 ? ( - - + + { )} + + PageSpeed monitors + {/* TODO Correct the class current-monitors-counter, there are some unnecessary things there */} + + {monitorCount} + + { /> ))} - + ) : ( Date: Tue, 10 Dec 2024 14:23:46 +0800 Subject: [PATCH 035/178] Monitors -> Uptime --- Client/src/App.jsx | 26 +++--- Client/src/Components/Sidebar/index.jsx | 6 +- Client/src/Pages/Auth/Login.jsx | 4 +- Client/src/Pages/Auth/Register/Register.jsx | 2 +- .../Infrastructure/CreateMonitor/index.jsx | 2 +- .../Pages/Infrastructure/Details/index.jsx | 2 +- .../Infrastructure/components/Menu/index.jsx | 82 ------------------- Client/src/Pages/Infrastructure/index.jsx | 4 +- .../src/Pages/PageSpeed/Configure/index.jsx | 4 +- .../Pages/PageSpeed/CreatePageSpeed/index.jsx | 2 +- Client/src/Pages/PageSpeed/Details/index.jsx | 2 +- Client/src/Pages/PageSpeed/card.jsx | 2 +- .../{Monitors => Uptime}/Configure/index.css | 0 .../{Monitors => Uptime}/Configure/index.jsx | 8 +- .../Configure/skeleton.jsx | 0 .../CreateUptime}/index.css | 0 .../CreateUptime}/index.jsx | 6 +- .../Details/Charts/index.jsx | 0 .../Details/PaginationTable/index.jsx | 0 .../{Monitors => Uptime}/Details/index.css | 0 .../{Monitors => Uptime}/Details/index.jsx | 15 ++-- .../{Monitors => Uptime}/Details/skeleton.jsx | 0 .../{Monitors => Uptime}/Details/styled.jsx | 0 .../Home/CurrentMonitoring/index.jsx | 4 +- .../{Monitors => Uptime}/Home/StatusBox.jsx | 0 .../Home/UptimeTable}/Skeleton/index.jsx | 0 .../Home/UptimeTable}/index.jsx | 2 +- .../{Monitors => Uptime}/Home/actionsMenu.jsx | 6 +- .../{Monitors => Uptime}/Home/fallback.jsx | 0 .../Pages/{Monitors => Uptime}/Home/host.jsx | 0 .../Pages/{Monitors => Uptime}/Home/index.css | 0 .../Pages/{Monitors => Uptime}/Home/index.jsx | 32 ++++---- .../{Monitors => Uptime}/Home/skeleton.jsx | 0 .../src/Pages/{Monitors => Uptime}/styled.jsx | 0 .../src/Pages/{Monitors => Uptime}/utils.jsx | 0 35 files changed, 65 insertions(+), 146 deletions(-) rename Client/src/Pages/{Monitors => Uptime}/Configure/index.css (100%) rename Client/src/Pages/{Monitors => Uptime}/Configure/index.jsx (98%) rename Client/src/Pages/{Monitors => Uptime}/Configure/skeleton.jsx (100%) rename Client/src/Pages/{Monitors/CreateMonitor => Uptime/CreateUptime}/index.css (100%) rename Client/src/Pages/{Monitors/CreateMonitor => Uptime/CreateUptime}/index.jsx (98%) rename Client/src/Pages/{Monitors => Uptime}/Details/Charts/index.jsx (100%) rename Client/src/Pages/{Monitors => Uptime}/Details/PaginationTable/index.jsx (100%) rename Client/src/Pages/{Monitors => Uptime}/Details/index.css (100%) rename Client/src/Pages/{Monitors => Uptime}/Details/index.jsx (97%) rename Client/src/Pages/{Monitors => Uptime}/Details/skeleton.jsx (100%) rename Client/src/Pages/{Monitors => Uptime}/Details/styled.jsx (100%) rename Client/src/Pages/{Monitors => Uptime}/Home/CurrentMonitoring/index.jsx (93%) rename Client/src/Pages/{Monitors => Uptime}/Home/StatusBox.jsx (100%) rename Client/src/Pages/{Monitors/Home/MonitorTable => Uptime/Home/UptimeTable}/Skeleton/index.jsx (100%) rename Client/src/Pages/{Monitors/Home/MonitorTable => Uptime/Home/UptimeTable}/index.jsx (99%) rename Client/src/Pages/{Monitors => Uptime}/Home/actionsMenu.jsx (97%) rename Client/src/Pages/{Monitors => Uptime}/Home/fallback.jsx (100%) rename Client/src/Pages/{Monitors => Uptime}/Home/host.jsx (100%) rename Client/src/Pages/{Monitors => Uptime}/Home/index.css (100%) rename Client/src/Pages/{Monitors => Uptime}/Home/index.jsx (73%) rename Client/src/Pages/{Monitors => Uptime}/Home/skeleton.jsx (100%) rename Client/src/Pages/{Monitors => Uptime}/styled.jsx (100%) rename Client/src/Pages/{Monitors => Uptime}/utils.jsx (100%) diff --git a/Client/src/App.jsx b/Client/src/App.jsx index 82c8203a8..5e7ab4e97 100644 --- a/Client/src/App.jsx +++ b/Client/src/App.jsx @@ -8,8 +8,8 @@ import NotFound from "./Pages/NotFound"; import Login from "./Pages/Auth/Login"; import Register from "./Pages/Auth/Register/Register"; import Account from "./Pages/Account"; -import Monitors from "./Pages/Monitors/Home"; -import CreateMonitor from "./Pages/Monitors/CreateMonitor"; +import Uptime from "./Pages/Uptime/Home"; +import CreateMonitor from "./Pages/Uptime/CreateUptime"; import CreateInfrastructureMonitor from "./Pages/Infrastructure/CreateMonitor"; import Incidents from "./Pages/Incidents"; import Status from "./Pages/Status"; @@ -20,10 +20,10 @@ import CheckEmail from "./Pages/Auth/CheckEmail"; import SetNewPassword from "./Pages/Auth/SetNewPassword"; import NewPasswordConfirmed from "./Pages/Auth/NewPasswordConfirmed"; import ProtectedRoute from "./Components/ProtectedRoute"; -import Details from "./Pages/Monitors/Details"; +import UptimeDetails from "./Pages/Uptime/Details"; import AdvancedSettings from "./Pages/AdvancedSettings"; import Maintenance from "./Pages/Maintenance"; -import Configure from "./Pages/Monitors/Configure"; +import Configure from "./Pages/Uptime/Configure"; import PageSpeed from "./Pages/PageSpeed"; import CreatePageSpeed from "./Pages/PageSpeed/CreatePageSpeed"; import CreateNewMaintenanceWindow from "./Pages/Maintenance/CreateMaintenance"; @@ -43,8 +43,8 @@ import { Infrastructure } from "./Pages/Infrastructure"; import InfrastructureDetails from "./Pages/Infrastructure/Details"; function App() { const AdminCheckedRegister = withAdminCheck(Register); - const MonitorsWithAdminProp = withAdminProp(Monitors); - const MonitorDetailsWithAdminProp = withAdminProp(Details); + const UptimeWithAdminProp = withAdminProp(Uptime); + const UptimeDetailsWithAdminProp = withAdminProp(UptimeDetails); const PageSpeedWithAdminProp = withAdminProp(PageSpeed); const PageSpeedDetailsWithAdminProp = withAdminProp(PageSpeedDetails); const MaintenanceWithAdminProp = withAdminProp(Maintenance); @@ -92,22 +92,22 @@ function App() { } + element={} /> } + path="/uptime" + element={} /> } /> } + path="/uptime/:monitorId/" + element={} /> } /> }, + { name: "Uptime", path: "uptime", icon: }, { name: "Pagespeed", path: "pagespeed", icon: }, { name: "Infrastructure", path: "infrastructure", icon: }, { name: "Incidents", path: "incidents", icon: }, @@ -262,10 +262,10 @@ function Sidebar() { Menu } - sx={{ + sx={{ px: theme.spacing(6), height: "100%", - overflow: "hidden" + overflow: "hidden", }} > {menu.map((item) => diff --git a/Client/src/Pages/Auth/Login.jsx b/Client/src/Pages/Auth/Login.jsx index 6329835ef..a7554a7c1 100644 --- a/Client/src/Pages/Auth/Login.jsx +++ b/Client/src/Pages/Auth/Login.jsx @@ -388,7 +388,7 @@ const Login = () => { useEffect(() => { if (authToken) { - navigate("/monitors"); + navigate("/uptime"); return; } networkService @@ -454,7 +454,7 @@ const Login = () => { } else { const action = await dispatch(login(form)); if (action.payload.success) { - navigate("/monitors"); + navigate("/uptime"); createToast({ body: "Welcome back! You're successfully logged in.", }); diff --git a/Client/src/Pages/Auth/Register/Register.jsx b/Client/src/Pages/Auth/Register/Register.jsx index 2f4c26040..65c20ca40 100644 --- a/Client/src/Pages/Auth/Register/Register.jsx +++ b/Client/src/Pages/Auth/Register/Register.jsx @@ -237,7 +237,7 @@ const Register = ({ isSuperAdmin }) => { if (action.payload.success) { const authToken = action.payload.data; localStorage.setItem("token", authToken); - navigate("/monitors"); + navigate("/uptime"); createToast({ body: "Welcome! Your account was created successfully.", }); diff --git a/Client/src/Pages/Infrastructure/CreateMonitor/index.jsx b/Client/src/Pages/Infrastructure/CreateMonitor/index.jsx index f1d2d0ce2..1e4b64f48 100644 --- a/Client/src/Pages/Infrastructure/CreateMonitor/index.jsx +++ b/Client/src/Pages/Infrastructure/CreateMonitor/index.jsx @@ -12,7 +12,7 @@ import { useNavigate } from "react-router-dom"; import { useTheme } from "@emotion/react"; import { createToast } from "../../../Utils/toastUtils"; import Link from "../../../Components/Link"; -import { ConfigBox } from "../../Monitors/styled"; +import { ConfigBox } from "../../Uptime/styled"; import TextInput from "../../../Components/Inputs/TextInput"; import Select from "../../../Components/Inputs/Select"; import Checkbox from "../../../Components/Inputs/Checkbox"; diff --git a/Client/src/Pages/Infrastructure/Details/index.jsx b/Client/src/Pages/Infrastructure/Details/index.jsx index 06fb1296a..60dcf68ee 100644 --- a/Client/src/Pages/Infrastructure/Details/index.jsx +++ b/Client/src/Pages/Infrastructure/Details/index.jsx @@ -8,7 +8,7 @@ import AreaChart from "../../../Components/Charts/AreaChart"; import { useSelector } from "react-redux"; import { networkService } from "../../../main"; import PulseDot from "../../../Components/Animated/PulseDot"; -import useUtils from "../../Monitors/utils"; +import useUtils from "../../Uptime/utils"; import { useNavigate } from "react-router-dom"; import Empty from "./empty"; import { logger } from "../../../Utils/Logger"; diff --git a/Client/src/Pages/Infrastructure/components/Menu/index.jsx b/Client/src/Pages/Infrastructure/components/Menu/index.jsx index 9794a34d9..98b3f9878 100644 --- a/Client/src/Pages/Infrastructure/components/Menu/index.jsx +++ b/Client/src/Pages/Infrastructure/components/Menu/index.jsx @@ -109,88 +109,6 @@ const InfrastructureMenu = ({ monitor, isAdmin, updateCallback }) => { }, }} > - {/* - Open site action. Not necessary for infrastructure? - - {actions.url !== null ? ( - { - closeMenu(e); - e.stopPropagation(); - window.open(actions.url, "_blank", "noreferrer"); - }} - > - Open site - - ) : ( - "" - )} - */} - openDetails(monitor.id)}>Details - {/* - Incidents. Necessary? - { - e.stopPropagation(); - navigate(`/incidents/${actions.id}`); - }} - > - Incidents - */} - {/* - Configure. Necessary? - {isAdmin && ( - { - e.stopPropagation(); - - navigate(`/monitors/configure/${actions.id}`); - }} - > - Configure - - )} */} - {/* - Clone. Necessary? - {isAdmin && ( - { - e.stopPropagation(); - navigate(`/monitors/create/${actions.id}`); - }} - > - Clone - - )} */} - {/* - Pause. Necessary? - const handlePause = async () => { - try { - const action = await dispatch( - pauseUptimeMonitor({ authToken, monitorId: monitor._id }) - ); - if (pauseUptimeMonitor.fulfilled.match(action)) { - updateCallback(); - const state = action?.payload?.data.isActive === false ? "paused" : "resumed"; - createToast({ body: `Monitor ${state} successfully.` }); - } else { - throw new Error(action?.error?.message ?? "Failed to pause monitor."); - } - } catch (error) { - logger.error("Error pausing monitor:", monitor._id, error); - createToast({ body: "Failed to pause monitor." }); - } - }; - {isAdmin && ( - { - e.stopPropagation(); - handlePause(e); - }} - > - {monitor?.isActive === true ? "Pause" : "Resume"} - - )} */} {isAdmin && Remove} { diff --git a/Client/src/Pages/PageSpeed/card.jsx b/Client/src/Pages/PageSpeed/card.jsx index ba694bae2..56ba62346 100644 --- a/Client/src/Pages/PageSpeed/card.jsx +++ b/Client/src/Pages/PageSpeed/card.jsx @@ -8,7 +8,7 @@ import { IconBox } from "./Details/styled"; import { Area, AreaChart, CartesianGrid, ResponsiveContainer, Tooltip } from "recharts"; import { useSelector } from "react-redux"; import { formatDateWithTz, formatDurationSplit } from "../../Utils/timeUtils"; -import useUtils from "../Monitors/utils"; +import useUtils from "../Uptime/utils"; import { useState } from "react"; /** diff --git a/Client/src/Pages/Monitors/Configure/index.css b/Client/src/Pages/Uptime/Configure/index.css similarity index 100% rename from Client/src/Pages/Monitors/Configure/index.css rename to Client/src/Pages/Uptime/Configure/index.css diff --git a/Client/src/Pages/Monitors/Configure/index.jsx b/Client/src/Pages/Uptime/Configure/index.jsx similarity index 98% rename from Client/src/Pages/Monitors/Configure/index.jsx rename to Client/src/Pages/Uptime/Configure/index.jsx index ba23c5634..1c7fc762c 100644 --- a/Client/src/Pages/Monitors/Configure/index.jsx +++ b/Client/src/Pages/Uptime/Configure/index.jsx @@ -166,7 +166,7 @@ const Configure = () => { event.preventDefault(); const action = await dispatch(deleteUptimeMonitor({ authToken, monitor })); if (action.meta.requestStatus === "fulfilled") { - navigate("/monitors"); + navigate("/uptime"); } else { createToast({ body: "Failed to delete monitor." }); } @@ -207,9 +207,9 @@ const Configure = () => { <> { const theme = useTheme(); const { monitorId } = useParams(); const crumbs = [ - { name: "monitors", path: "/monitors" }, - { name: "create", path: `/monitors/create` }, + { name: "uptime", path: "/uptime" }, + { name: "create", path: `/uptime/create` }, ]; // State @@ -125,7 +125,7 @@ const CreateMonitor = () => { const action = await dispatch(createUptimeMonitor({ authToken, monitor: form })); if (action.meta.requestStatus === "fulfilled") { createToast({ body: "Monitor created successfully!" }); - navigate("/monitors"); + navigate("/uptime"); } else { createToast({ body: "Failed to create monitor." }); } diff --git a/Client/src/Pages/Monitors/Details/Charts/index.jsx b/Client/src/Pages/Uptime/Details/Charts/index.jsx similarity index 100% rename from Client/src/Pages/Monitors/Details/Charts/index.jsx rename to Client/src/Pages/Uptime/Details/Charts/index.jsx diff --git a/Client/src/Pages/Monitors/Details/PaginationTable/index.jsx b/Client/src/Pages/Uptime/Details/PaginationTable/index.jsx similarity index 100% rename from Client/src/Pages/Monitors/Details/PaginationTable/index.jsx rename to Client/src/Pages/Uptime/Details/PaginationTable/index.jsx diff --git a/Client/src/Pages/Monitors/Details/index.css b/Client/src/Pages/Uptime/Details/index.css similarity index 100% rename from Client/src/Pages/Monitors/Details/index.css rename to Client/src/Pages/Uptime/Details/index.css diff --git a/Client/src/Pages/Monitors/Details/index.jsx b/Client/src/Pages/Uptime/Details/index.jsx similarity index 97% rename from Client/src/Pages/Monitors/Details/index.jsx rename to Client/src/Pages/Uptime/Details/index.jsx index ebb664b79..60b67fdc8 100644 --- a/Client/src/Pages/Monitors/Details/index.jsx +++ b/Client/src/Pages/Uptime/Details/index.jsx @@ -100,7 +100,7 @@ const DetailsPage = ({ isAdmin }) => { } }; fetchCertificate(); - }, [authToken, monitorId, monitor]); + }, [authToken, monitorId, monitor, dateRange, uiTimezone, dateFormat]); const splitDuration = (duration) => { const { time, format } = formatDurationSplit(duration); @@ -117,18 +117,17 @@ const DetailsPage = ({ isAdmin }) => { const [hoveredUptimeData, setHoveredUptimeData] = useState(null); const [hoveredIncidentsData, setHoveredIncidentsData] = useState(null); + const BREADCRUMBS = [ + { name: "uptime", path: "/uptime" }, + { name: "details", path: `/uptime/${monitorId}` }, + ]; return ( {loading ? ( ) : ( <> - + { )} + {noMonitors && } {loading ? ( @@ -77,20 +79,20 @@ const Monitors = ({ isAdmin }) => { > @@ -101,7 +103,7 @@ const Monitors = ({ isAdmin }) => { ); }; -Monitors.propTypes = { +UptimeMonitors.propTypes = { isAdmin: PropTypes.bool, }; -export default Monitors; +export default UptimeMonitors; diff --git a/Client/src/Pages/Monitors/Home/skeleton.jsx b/Client/src/Pages/Uptime/Home/skeleton.jsx similarity index 100% rename from Client/src/Pages/Monitors/Home/skeleton.jsx rename to Client/src/Pages/Uptime/Home/skeleton.jsx diff --git a/Client/src/Pages/Monitors/styled.jsx b/Client/src/Pages/Uptime/styled.jsx similarity index 100% rename from Client/src/Pages/Monitors/styled.jsx rename to Client/src/Pages/Uptime/styled.jsx diff --git a/Client/src/Pages/Monitors/utils.jsx b/Client/src/Pages/Uptime/utils.jsx similarity index 100% rename from Client/src/Pages/Monitors/utils.jsx rename to Client/src/Pages/Uptime/utils.jsx From 151500def6940b92ec13f58021a737f077ddd07c Mon Sep 17 00:00:00 2001 From: "Gorkem Cetin (BWL)" <167266851+gorkem-bwl@users.noreply.github.com> Date: Tue, 10 Dec 2024 01:31:40 -0500 Subject: [PATCH 036/178] Add screenshots --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 5d6ec2922..aec89be80 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,14 @@ We've just launched our [Discussions](https://github.com/bluewave-labs/bluewave- - DNS monitoring - SSL monitoring +## πŸ—οΈ Screenshots + +![Group 3765](https://github.com/user-attachments/assets/8e8144f2-a769-4707-8ea1-99cf758284a8) + +![Group 3768](https://github.com/user-attachments/assets/05aed2f2-2cf7-487f-879b-cf8bfb0e9241) + +![Group 3768-1](https://github.com/user-attachments/assets/d4ee4bcf-4d69-4e4a-9bce-fd3541129c24) + ## πŸ—οΈ Tech stack - [ReactJs](https://react.dev/) From f26c0a057589b65b7518a8a16b2da8cae9fc8d23 Mon Sep 17 00:00:00 2001 From: Peter Carl Pardo Date: Tue, 10 Dec 2024 20:45:45 +0800 Subject: [PATCH 037/178] fix: removing padding Y of search bar --- Client/src/Components/Inputs/Search/index.jsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Client/src/Components/Inputs/Search/index.jsx b/Client/src/Components/Inputs/Search/index.jsx index 100b826b4..c944955b9 100644 --- a/Client/src/Components/Inputs/Search/index.jsx +++ b/Client/src/Components/Inputs/Search/index.jsx @@ -93,6 +93,9 @@ const Search = ({ { borderColor: theme.palette.border.light, }, + "& .MuiOutlinedInput-root": { + paddingY: 0, + }, }} /> {error && ( From b02044ae7fa1dbac089d1c7f490c2ac8da2fb8f1 Mon Sep 17 00:00:00 2001 From: Shemy Gan Date: Tue, 10 Dec 2024 10:16:04 -0500 Subject: [PATCH 038/178] - Remove disabled notifications --- .../Pages/PageSpeed/CreatePageSpeed/index.jsx | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/Client/src/Pages/PageSpeed/CreatePageSpeed/index.jsx b/Client/src/Pages/PageSpeed/CreatePageSpeed/index.jsx index ba3a7bb4a..87eb8c577 100644 --- a/Client/src/Pages/PageSpeed/CreatePageSpeed/index.jsx +++ b/Client/src/Pages/PageSpeed/CreatePageSpeed/index.jsx @@ -301,14 +301,6 @@ const CreatePageSpeed = () => { When there is a new incident, - logger.warn("disabled")} - isDisabled={true} - /> { value={user?.email} onChange={(event) => handleChange(event)} /> - logger.warn("disabled")} - isDisabled={true} - /> {monitor.notifications.some( (notification) => notification.type === "emails" ) ? ( From 79dd781386ae8c96f5f9993b86a7ab5044f7b0ef Mon Sep 17 00:00:00 2001 From: Peter Carl Pardo Date: Wed, 11 Dec 2024 00:03:36 +0800 Subject: [PATCH 039/178] fix: update red palette colors --- Client/src/Utils/Theme/constants.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Client/src/Utils/Theme/constants.js b/Client/src/Utils/Theme/constants.js index df9b5da93..422648028 100644 --- a/Client/src/Utils/Theme/constants.js +++ b/Client/src/Utils/Theme/constants.js @@ -51,7 +51,8 @@ const paletteColors = { red50: "#F9ECED", red100: "#FBD1D1", red200: "#F04438", - red300: "#D32F2F", + red300: "#EBA8A9", + red400: "#D32F2F", red700: "#542426", red800: "#301A1F", orange50: "#FEF8EA", @@ -109,12 +110,12 @@ const semanticColors = { }, error: { main: { - light: paletteColors.red300, - dark: paletteColors.red300, + light: paletteColors.red400, + dark: paletteColors.red400, }, contrastText: { - light: paletteColors.gray50, - dark: paletteColors.gray50, + light: paletteColors.red300, + dark: paletteColors.red300, }, light: { light: paletteColors.red100, From 5e22401df42781df91b91ef6570704fbbe66bd47 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 10 Dec 2024 16:08:52 +0000 Subject: [PATCH 040/178] fix(deps): update dependency bullmq to v5.34.0 --- Server/package-lock.json | 8 ++++---- Server/package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Server/package-lock.json b/Server/package-lock.json index fc62aa925..864ce9ac0 100644 --- a/Server/package-lock.json +++ b/Server/package-lock.json @@ -11,7 +11,7 @@ "dependencies": { "axios": "^1.7.2", "bcrypt": "^5.1.1", - "bullmq": "5.33.0", + "bullmq": "5.34.0", "cors": "^2.8.5", "dockerode": "4.0.2", "dotenv": "^16.4.5", @@ -1218,9 +1218,9 @@ } }, "node_modules/bullmq": { - "version": "5.33.0", - "resolved": "https://registry.npmjs.org/bullmq/-/bullmq-5.33.0.tgz", - "integrity": "sha512-dICdidv1x+umYyA0DqlnCPa1sgHjtHo6gzyww5E10OQq+k9saT2B/rIP8pQbo8HhN/fRViYjJP/+7s8594/xdw==", + "version": "5.34.0", + "resolved": "https://registry.npmjs.org/bullmq/-/bullmq-5.34.0.tgz", + "integrity": "sha512-TyzeYDkIGkooYUn/P1CeiJW3Am1TboC3unwhlg1cJIwKksoyuRp97TkHyCZcwLchXbYCUtsGBZFUYf/lTAhdSg==", "license": "MIT", "dependencies": { "cron-parser": "^4.6.0", diff --git a/Server/package.json b/Server/package.json index 44a02a5ae..e8d5bd492 100644 --- a/Server/package.json +++ b/Server/package.json @@ -14,7 +14,7 @@ "dependencies": { "axios": "^1.7.2", "bcrypt": "^5.1.1", - "bullmq": "5.33.0", + "bullmq": "5.34.0", "cors": "^2.8.5", "dockerode": "4.0.2", "dotenv": "^16.4.5", From cb7f596b0db4b5b8fc7632450072cbd7ca551b9e Mon Sep 17 00:00:00 2001 From: Shemy Gan Date: Tue, 10 Dec 2024 11:21:59 -0500 Subject: [PATCH 041/178] - Remove the login landing page - Remove the back button as it is not needed anymore - Adjust layout due to the removal of backbutton and remove the propTypes requirement for onBack function --- Client/src/Pages/Auth/Login.jsx | 121 +------------------------------- 1 file changed, 3 insertions(+), 118 deletions(-) diff --git a/Client/src/Pages/Auth/Login.jsx b/Client/src/Pages/Auth/Login.jsx index 6329835ef..c75f38951 100644 --- a/Client/src/Pages/Auth/Login.jsx +++ b/Client/src/Pages/Auth/Login.jsx @@ -19,99 +19,6 @@ import { logger } from "../../Utils/Logger"; import "./index.css"; const DEMO = import.meta.env.VITE_APP_DEMO; -/** - * Displays the initial landing page. - * - * @param {Object} props - * @param {Function} props.onContinue - Callback function to handle "Continue with Email" button click. - * @returns {JSX.Element} - */ -const LandingPage = ({ onContinue }) => { - const theme = useTheme(); - - return ( - <> - - - Log In - We are pleased to see you again! - - - - - - - By continuing, you agree to our{" "} - { - window.open( - "https://bluewavelabs.ca/terms-of-service-open-source", - "_blank", - "noreferrer" - ); - }} - sx={{ - "&:hover": { - color: theme.palette.text.tertiary, - }, - }} - > - Terms of Service - {" "} - and{" "} - { - window.open( - "https://bluewavelabs.ca/privacy-policy-open-source", - "_blank", - "noreferrer" - ); - }} - sx={{ - "&:hover": { - color: theme.palette.text.tertiary, - }, - }} - > - Privacy Policy. - - - - - - ); -}; - -LandingPage.propTypes = { - onContinue: PropTypes.func.isRequired, -}; - /** * Renders the first step of the login process. * @@ -168,26 +75,8 @@ const StepOne = ({ form, errors, onSubmit, onChange, onBack }) => { /> - diff --git a/Client/src/Pages/Monitors/Home/index.jsx b/Client/src/Pages/Monitors/Home/index.jsx index 4c48bde3a..167fd1e67 100644 --- a/Client/src/Pages/Monitors/Home/index.jsx +++ b/Client/src/Pages/Monitors/Home/index.jsx @@ -61,7 +61,7 @@ const Monitors = ({ isAdmin }) => { onClick={() => { navigate("/monitors/create"); }} - sx={{ fontWeight: 500 }} + sx={{ fontWeight: 500, whiteSpace: "nowrap" }} > Create monitor diff --git a/Client/src/Pages/PageSpeed/index.jsx b/Client/src/Pages/PageSpeed/index.jsx index b4056ffce..9b84b0286 100644 --- a/Client/src/Pages/PageSpeed/index.jsx +++ b/Client/src/Pages/PageSpeed/index.jsx @@ -92,7 +92,7 @@ const PageSpeed = ({ isAdmin }) => { variant="contained" color="primary" onClick={() => navigate("/pagespeed/create")} - sx={{ whiteSpace: "nowrap" }} + sx={{ fontWeight: 500, whiteSpace: "nowrap" }} > Create new From f57b9a0fa1d43578724f5aa3aba3aa5b049d2870 Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Thu, 12 Dec 2024 12:26:24 +0800 Subject: [PATCH 060/178] remove daterange from dependency array --- Client/src/Pages/Uptime/Details/index.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Client/src/Pages/Uptime/Details/index.jsx b/Client/src/Pages/Uptime/Details/index.jsx index 60b67fdc8..ac89041ec 100644 --- a/Client/src/Pages/Uptime/Details/index.jsx +++ b/Client/src/Pages/Uptime/Details/index.jsx @@ -100,7 +100,7 @@ const DetailsPage = ({ isAdmin }) => { } }; fetchCertificate(); - }, [authToken, monitorId, monitor, dateRange, uiTimezone, dateFormat]); + }, [authToken, monitorId, monitor, uiTimezone, dateFormat]); const splitDuration = (duration) => { const { time, format } = formatDurationSplit(duration); From 3840b3ec2dfbb19f157fe30b1a170235e20d4a72 Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Thu, 12 Dec 2024 12:38:43 +0800 Subject: [PATCH 061/178] remove log statement --- Client/src/Pages/Infrastructure/CreateMonitor/index.jsx | 2 -- 1 file changed, 2 deletions(-) diff --git a/Client/src/Pages/Infrastructure/CreateMonitor/index.jsx b/Client/src/Pages/Infrastructure/CreateMonitor/index.jsx index ff05b9ef2..74c257bae 100644 --- a/Client/src/Pages/Infrastructure/CreateMonitor/index.jsx +++ b/Client/src/Pages/Infrastructure/CreateMonitor/index.jsx @@ -148,8 +148,6 @@ const CreateInfrastructureMonitor = () => { thresholds, }; - console.log(form); - const action = await dispatch( createInfrastructureMonitor({ authToken, monitor: form }) ); From e33091f1821db8b5a8fe1a3cdc2e45f8775fffbd Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Thu, 12 Dec 2024 12:42:32 +0800 Subject: [PATCH 062/178] remove --- Client/src/Pages/Infrastructure/CreateMonitor/index.jsx | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/Client/src/Pages/Infrastructure/CreateMonitor/index.jsx b/Client/src/Pages/Infrastructure/CreateMonitor/index.jsx index 74c257bae..39a07c530 100644 --- a/Client/src/Pages/Infrastructure/CreateMonitor/index.jsx +++ b/Client/src/Pages/Infrastructure/CreateMonitor/index.jsx @@ -185,10 +185,6 @@ const CreateInfrastructureMonitor = () => { }); }; - const handleBlur = (event) => { - console.log("handleBlur", event); - }; - const handleNotifications = (event, type) => { const { value } = event.target; let notifications = [...infrastructureMonitor.notifications]; @@ -340,7 +336,6 @@ const CreateInfrastructureMonitor = () => { )} value={user?.email} onChange={(event) => handleNotifications(event, "email")} - onBlur={handleBlur} /> @@ -372,7 +367,6 @@ const CreateInfrastructureMonitor = () => { fieldName={METRIC_PREFIX + metric} fieldValue={infrastructureMonitor[METRIC_PREFIX + metric]} onFieldChange={handleChange} - onFieldBlur={handleBlur} alertUnit={metric == "temperature" ? "Β°C" : "%"} /> ); @@ -404,7 +398,7 @@ const CreateInfrastructureMonitor = () => { label="Check frequency" value={infrastructureMonitor.interval || 15} onChange={handleChange} - onBlur={handleBlur} + onBlur={} items={SELECT_VALUES} /> From 66dc6dbc1a8a52ceb39f427bb05845cb40ba5c26 Mon Sep 17 00:00:00 2001 From: Caio Cabral Date: Thu, 12 Dec 2024 00:09:41 -0500 Subject: [PATCH 063/178] refactor: extracting routes to own component --- Client/src/App.jsx | 199 +--------------------------------- Client/src/Routes/index.jsx | 209 ++++++++++++++++++++++++++++++++++++ 2 files changed, 213 insertions(+), 195 deletions(-) create mode 100644 Client/src/Routes/index.jsx diff --git a/Client/src/App.jsx b/Client/src/App.jsx index 82c8203a8..b27373071 100644 --- a/Client/src/App.jsx +++ b/Client/src/App.jsx @@ -1,37 +1,9 @@ import { useEffect } from "react"; -import { Routes, Route, Navigate } from "react-router-dom"; import { useSelector } from "react-redux"; import { useDispatch } from "react-redux"; import "react-toastify/dist/ReactToastify.css"; import { ToastContainer } from "react-toastify"; -import NotFound from "./Pages/NotFound"; -import Login from "./Pages/Auth/Login"; -import Register from "./Pages/Auth/Register/Register"; -import Account from "./Pages/Account"; -import Monitors from "./Pages/Monitors/Home"; -import CreateMonitor from "./Pages/Monitors/CreateMonitor"; -import CreateInfrastructureMonitor from "./Pages/Infrastructure/CreateMonitor"; -import Incidents from "./Pages/Incidents"; -import Status from "./Pages/Status"; -import Integrations from "./Pages/Integrations"; -import Settings from "./Pages/Settings"; -import ForgotPassword from "./Pages/Auth/ForgotPassword"; -import CheckEmail from "./Pages/Auth/CheckEmail"; -import SetNewPassword from "./Pages/Auth/SetNewPassword"; -import NewPasswordConfirmed from "./Pages/Auth/NewPasswordConfirmed"; -import ProtectedRoute from "./Components/ProtectedRoute"; -import Details from "./Pages/Monitors/Details"; -import AdvancedSettings from "./Pages/AdvancedSettings"; -import Maintenance from "./Pages/Maintenance"; -import Configure from "./Pages/Monitors/Configure"; -import PageSpeed from "./Pages/PageSpeed"; -import CreatePageSpeed from "./Pages/PageSpeed/CreatePageSpeed"; -import CreateNewMaintenanceWindow from "./Pages/Maintenance/CreateMaintenance"; -import PageSpeedDetails from "./Pages/PageSpeed/Details"; -import PageSpeedConfigure from "./Pages/PageSpeed/Configure"; -import HomeLayout from "./Components/Layouts/HomeLayout"; -import withAdminCheck from "./Components/HOC/withAdminCheck"; -import withAdminProp from "./Components/HOC/withAdminProp"; + import { ThemeProvider } from "@emotion/react"; import lightTheme from "./Utils/Theme/lightTheme"; import darkTheme from "./Utils/Theme/darkTheme"; @@ -39,18 +11,9 @@ import { CssBaseline, GlobalStyles } from "@mui/material"; import { getAppSettings } from "./Features/Settings/settingsSlice"; import { logger } from "./Utils/Logger"; // Import the logger import { networkService } from "./main"; -import { Infrastructure } from "./Pages/Infrastructure"; -import InfrastructureDetails from "./Pages/Infrastructure/Details"; +import { Routes } from "./Routes"; + function App() { - const AdminCheckedRegister = withAdminCheck(Register); - const MonitorsWithAdminProp = withAdminProp(Monitors); - const MonitorDetailsWithAdminProp = withAdminProp(Details); - const PageSpeedWithAdminProp = withAdminProp(PageSpeed); - const PageSpeedDetailsWithAdminProp = withAdminProp(PageSpeedDetails); - const MaintenanceWithAdminProp = withAdminProp(Maintenance); - const SettingsWithAdminProp = withAdminProp(Settings); - const AdvancedSettingsWithAdminProp = withAdminProp(AdvancedSettings); - const InfrastructureDetailsWithAdminProp = withAdminProp(InfrastructureDetails); const mode = useSelector((state) => state.ui.mode); const { authToken } = useSelector((state) => state.auth); const dispatch = useDispatch(); @@ -82,161 +45,7 @@ function App() { }; }} /> - {/* Extract Routes to Routes */} - - } - > - } - /> - } - /> - } - /> - } - /> - } - /> - } - /> - } - /> - } - /> - } - /> - } - /> - } - /> - } - /> - - } - /> - - } - /> - } - /> - } - /> - } - /> - } - /> - } - /> - - } - /> - - } - /> - - } - /> - - - } - /> - - } - /> - - } - /> - - } - /> - - } - /> - } - /> - } - /> - } - /> - + ); diff --git a/Client/src/Routes/index.jsx b/Client/src/Routes/index.jsx new file mode 100644 index 000000000..8397729ca --- /dev/null +++ b/Client/src/Routes/index.jsx @@ -0,0 +1,209 @@ +import { Navigate, Route, Routes as LibRoutes } from "react-router"; +import HomeLayout from "../Components/Layouts/HomeLayout"; +import { Infrastructure } from "../Pages/Infrastructure"; +import InfrastructureDetails from "../Pages/Infrastructure/Details"; +import NotFound from "../Pages/NotFound"; +import Login from "../Pages/Auth/Login"; +import Register from "../Pages/Auth/Register/Register"; +import Account from "../Pages/Account"; +import Monitors from "../Pages/Monitors/Home"; +import CreateMonitor from "../Pages/Monitors/CreateMonitor"; +import CreateInfrastructureMonitor from "../Pages/Infrastructure/CreateMonitor"; +import Incidents from "../Pages/Incidents"; +import Status from "../Pages/Status"; +import Integrations from "../Pages/Integrations"; +import Settings from "../Pages/Settings"; +import ForgotPassword from "../Pages/Auth/ForgotPassword"; +import CheckEmail from "../Pages/Auth/CheckEmail"; +import SetNewPassword from "../Pages/Auth/SetNewPassword"; +import NewPasswordConfirmed from "../Pages/Auth/NewPasswordConfirmed"; +import ProtectedRoute from "../Components/ProtectedRoute"; +import Details from "../Pages/Monitors/Details"; +import AdvancedSettings from "../Pages/AdvancedSettings"; +import Maintenance from "../Pages/Maintenance"; +import Configure from "../Pages/Monitors/Configure"; +import PageSpeed from "../Pages/PageSpeed"; +import CreatePageSpeed from "../Pages/PageSpeed/CreatePageSpeed"; +import CreateNewMaintenanceWindow from "../Pages/Maintenance/CreateMaintenance"; +import PageSpeedDetails from "../Pages/PageSpeed/Details"; +import PageSpeedConfigure from "../Pages/PageSpeed/Configure"; +import withAdminCheck from "../Components/HOC/withAdminCheck"; +import withAdminProp from "../Components/HOC/withAdminProp"; + +const Routes = () => { + const AdminCheckedRegister = withAdminCheck(Register); + const MonitorsWithAdminProp = withAdminProp(Monitors); + const MonitorDetailsWithAdminProp = withAdminProp(Details); + const PageSpeedWithAdminProp = withAdminProp(PageSpeed); + const PageSpeedDetailsWithAdminProp = withAdminProp(PageSpeedDetails); + const MaintenanceWithAdminProp = withAdminProp(Maintenance); + const SettingsWithAdminProp = withAdminProp(Settings); + const AdvancedSettingsWithAdminProp = withAdminProp(AdvancedSettings); + const InfrastructureDetailsWithAdminProp = withAdminProp(InfrastructureDetails); + return ( + + } + > + } + /> + } + /> + } + /> + } + /> + } + /> + } + /> + } + /> + } + /> + } + /> + } + /> + } + /> + } + /> + + } + /> + + } + /> + } + /> + } + /> + } + /> + } + /> + } + /> + + } + /> + + } + /> + + } + /> + + + } + /> + + } + /> + + } + /> + + } + /> + + } + /> + } + /> + } + /> + } + /> + + ); +}; + +export { Routes }; + +/* import { createBrowserRouter } from "react-router-dom"; + +const router = createBrowserRouter({ + { + path: "/", + } +}); + +export { router }; */ From 2145be5160cd1cb33a5f93a7befa2e5c4753a64f Mon Sep 17 00:00:00 2001 From: "Gorkem Cetin (BWL)" <167266851+gorkem-bwl@users.noreply.github.com> Date: Thu, 12 Dec 2024 00:13:10 -0500 Subject: [PATCH 064/178] Minor update to pull_request_template.md --- .github/PULL_REQUEST_TEMPLATE/pull_request_template.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md b/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md index 3d9b31e2d..d54352dac 100644 --- a/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md +++ b/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md @@ -1,6 +1,6 @@ ## Describe your changes -Provide a brief description of the changes you’ve made and their purpose. +Briefly describe the changes you made and their purpose. ## Issue number @@ -11,4 +11,10 @@ Mention the issue number(s) this PR addresses (e.g., #123). - [ ] I have performed a self-review of my code. - [ ] I have included the issue # in the PR. - [ ] I have labelled the PR correctly. -- [ ] My PR is granular and targeted to one specific feature only. +- [ ] I didn't use any hardcoded values (otherwise it will not scale, and will make it difficult to maintain consistency across the application). +- [ ] I made sure font sizes, color choices etc are all referenced from the theme. +- [ ] My PR is granular and targeted to one specific feature. +- [ ] I took a screenshot or a video and attached to this PR if there is a UI change. + + + From 52234531db69ed2ae544158f2a39b824544c82ba Mon Sep 17 00:00:00 2001 From: "Gorkem Cetin (BWL)" <167266851+gorkem-bwl@users.noreply.github.com> Date: Thu, 12 Dec 2024 00:17:25 -0500 Subject: [PATCH 065/178] Update pull_request_template.md --- .github/PULL_REQUEST_TEMPLATE/pull_request_template.md | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md b/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md index d54352dac..55d456545 100644 --- a/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md +++ b/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md @@ -11,6 +11,7 @@ Mention the issue number(s) this PR addresses (e.g., #123). - [ ] I have performed a self-review of my code. - [ ] I have included the issue # in the PR. - [ ] I have labelled the PR correctly. +- [ ] The issue I am working on is assigned to me. - [ ] I didn't use any hardcoded values (otherwise it will not scale, and will make it difficult to maintain consistency across the application). - [ ] I made sure font sizes, color choices etc are all referenced from the theme. - [ ] My PR is granular and targeted to one specific feature. From 7d33ac11b5588568d28a634fbe6c297310a9cafa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=20D=C3=B6rr?= Date: Thu, 12 Dec 2024 06:33:32 +0100 Subject: [PATCH 066/178] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index aec89be80..ca3c19c95 100644 --- a/README.md +++ b/README.md @@ -72,7 +72,7 @@ We've just launched our [Discussions](https://github.com/bluewave-labs/bluewave- ## 🀝 Contributing -We pride ourselves on building strong connections with contributors at every level. Despite being a young project, Checkmate has already earned 600+ stars and attracted 30+ contributors from around the globe. So, don’t hold back β€” jump in, contribute and learn with us! +We pride ourselves on building strong connections with contributors at every level. Despite being a young project, Checkmate has already earned 1300+ stars and attracted 30+ contributors from around the globe. So, don’t hold back β€” jump in, contribute and learn with us! Here's how you can contribute: From a70e96f1f3f32513ca0829c504f146d392e19693 Mon Sep 17 00:00:00 2001 From: Caio Cabral Date: Thu, 12 Dec 2024 08:24:10 -0500 Subject: [PATCH 067/178] refactor: avoid repetition of the protected routes component --- .../src/Components/ProtectedRoute/index.jsx | 2 +- Client/src/Pages/Auth/Login.jsx | 1 + Client/src/Routes/index.jsx | 55 ++++++++----------- 3 files changed, 26 insertions(+), 32 deletions(-) diff --git a/Client/src/Components/ProtectedRoute/index.jsx b/Client/src/Components/ProtectedRoute/index.jsx index 5b1032ab8..c10ebba7f 100644 --- a/Client/src/Components/ProtectedRoute/index.jsx +++ b/Client/src/Components/ProtectedRoute/index.jsx @@ -15,7 +15,7 @@ import PropTypes from "prop-types"; const ProtectedRoute = ({ Component, ...rest }) => { const authState = useSelector((state) => state.auth); - + console.log("Protected"); return authState.authToken ? ( ) : ( diff --git a/Client/src/Pages/Auth/Login.jsx b/Client/src/Pages/Auth/Login.jsx index 6329835ef..89992b109 100644 --- a/Client/src/Pages/Auth/Login.jsx +++ b/Client/src/Pages/Auth/Login.jsx @@ -367,6 +367,7 @@ StepTwo.propTypes = { }; const Login = () => { + console.log("login"); const dispatch = useDispatch(); const navigate = useNavigate(); const theme = useTheme(); diff --git a/Client/src/Routes/index.jsx b/Client/src/Routes/index.jsx index 8397729ca..76c90784e 100644 --- a/Client/src/Routes/index.jsx +++ b/Client/src/Routes/index.jsx @@ -44,7 +44,7 @@ const Routes = () => { } + element={} > { /> } + element={} /> } + element={} /> } + element={} /> } + element={} /> } + element={} /> } + element={} /> } + element={} /> } + element={} /> } + element={} /> } + element={} /> } + element={} /> } + element={} /> } + element={} /> } + element={} /> } + element={} /> { /> } + element={} /> } + element={} /> - } + element={} /> { } /> } /> @@ -171,11 +164,6 @@ const Routes = () => { element={} /> - } - /> - } @@ -192,6 +180,11 @@ const Routes = () => { path="/new-password-confirmed" element={} /> + + } + /> ); }; From 910080820bf339290dcc7c9c43cdb0c7e38cb840 Mon Sep 17 00:00:00 2001 From: Caio Cabral Date: Thu, 12 Dec 2024 09:07:11 -0500 Subject: [PATCH 068/178] refactor: removed withAdminProps HOC and changed for custom hook reducing component wrapping --- Client/src/Components/HOC/withAdminProp.jsx | 25 ---------- .../src/Components/ProtectedRoute/index.jsx | 1 - Client/src/Pages/AdvancedSettings/index.jsx | 5 +- Client/src/Pages/Maintenance/index.jsx | 7 +-- Client/src/Pages/Monitors/Details/index.jsx | 4 +- Client/src/Pages/Monitors/Home/index.jsx | 4 +- Client/src/Pages/PageSpeed/Details/index.jsx | 4 +- Client/src/Pages/PageSpeed/index.jsx | 5 +- Client/src/Pages/Settings/index.jsx | 4 +- Client/src/Routes/index.jsx | 50 ++++--------------- 10 files changed, 32 insertions(+), 77 deletions(-) delete mode 100644 Client/src/Components/HOC/withAdminProp.jsx diff --git a/Client/src/Components/HOC/withAdminProp.jsx b/Client/src/Components/HOC/withAdminProp.jsx deleted file mode 100644 index b55893119..000000000 --- a/Client/src/Components/HOC/withAdminProp.jsx +++ /dev/null @@ -1,25 +0,0 @@ -import { useSelector } from "react-redux"; - -const withAdminProp = (WrappedComponent) => { - const WithAdminProp = (props) => { - const { user } = useSelector((state) => state.auth); - const isAdmin = - (user?.role?.includes("admin") ?? false) || - (user?.role?.includes("superadmin") ?? false); - - return ( - - ); - }; - - const wrappedComponentName = - WrappedComponent.displayName || WrappedComponent.name || "Component"; - WithAdminProp.displayName = `WithAdminProp(${wrappedComponentName})`; - - return WithAdminProp; -}; - -export default withAdminProp; diff --git a/Client/src/Components/ProtectedRoute/index.jsx b/Client/src/Components/ProtectedRoute/index.jsx index c10ebba7f..1a8cf9aa0 100644 --- a/Client/src/Components/ProtectedRoute/index.jsx +++ b/Client/src/Components/ProtectedRoute/index.jsx @@ -15,7 +15,6 @@ import PropTypes from "prop-types"; const ProtectedRoute = ({ Component, ...rest }) => { const authState = useSelector((state) => state.auth); - console.log("Protected"); return authState.authToken ? ( ) : ( diff --git a/Client/src/Pages/AdvancedSettings/index.jsx b/Client/src/Pages/AdvancedSettings/index.jsx index 90bcf21d6..14ecb6f8f 100644 --- a/Client/src/Pages/AdvancedSettings/index.jsx +++ b/Client/src/Pages/AdvancedSettings/index.jsx @@ -14,10 +14,11 @@ import { useState, useEffect } from "react"; import Select from "../../Components/Inputs/Select"; import { advancedSettingsValidation } from "../../Validation/validation"; import { buildErrors, hasValidationErrors } from "../../Validation/error"; +import { useIsAdmin } from "../../Hooks/useIsAdmin"; -const AdvancedSettings = ({ isAdmin }) => { +const AdvancedSettings = () => { const navigate = useNavigate(); - + const isAdmin = useIsAdmin; useEffect(() => { if (!isAdmin) { navigate("/"); diff --git a/Client/src/Pages/Maintenance/index.jsx b/Client/src/Pages/Maintenance/index.jsx index fd0d7edc3..5c2930294 100644 --- a/Client/src/Pages/Maintenance/index.jsx +++ b/Client/src/Pages/Maintenance/index.jsx @@ -8,13 +8,14 @@ import { useSelector } from "react-redux"; import { networkService } from "../../main"; import Breadcrumbs from "../../Components/Breadcrumbs"; import { useNavigate } from "react-router-dom"; +import { useIsAdmin } from "../../Hooks/useIsAdmin"; -const Maintenance = ({ isAdmin }) => { +const Maintenance = () => { const theme = useTheme(); const navigate = useNavigate(); const { authToken } = useSelector((state) => state.auth); const { rowsPerPage } = useSelector((state) => state.ui.maintenance); - + const isAdmin = useIsAdmin(); const [maintenanceWindows, setMaintenanceWindows] = useState([]); const [maintenanceWindowCount, setMaintenanceWindowCount] = useState(0); const [page, setPage] = useState(0); @@ -99,7 +100,7 @@ const Maintenance = ({ isAdmin }) => { "Stop sending alerts in maintenance windows", ]} link="/maintenance/create" - isAdmin={true} + isAdmin={isAdmin} /> )} diff --git a/Client/src/Pages/Monitors/Details/index.jsx b/Client/src/Pages/Monitors/Details/index.jsx index ebb664b79..68d21903c 100644 --- a/Client/src/Pages/Monitors/Details/index.jsx +++ b/Client/src/Pages/Monitors/Details/index.jsx @@ -32,14 +32,16 @@ import SkeletonLayout from "./skeleton"; import "./index.css"; import useUtils from "../utils"; import { formatDateWithTz } from "../../../Utils/timeUtils"; +import { useIsAdmin } from "../../../Hooks/useIsAdmin"; /** * Details page component displaying monitor details and related information. * @component */ -const DetailsPage = ({ isAdmin }) => { +const DetailsPage = () => { const theme = useTheme(); const { statusColor, statusStyles, statusMsg, determineState } = useUtils(); + const isAdmin = useIsAdmin(); const [monitor, setMonitor] = useState({}); const { monitorId } = useParams(); const { authToken } = useSelector((state) => state.auth); diff --git a/Client/src/Pages/Monitors/Home/index.jsx b/Client/src/Pages/Monitors/Home/index.jsx index 167fd1e67..15dc814df 100644 --- a/Client/src/Pages/Monitors/Home/index.jsx +++ b/Client/src/Pages/Monitors/Home/index.jsx @@ -12,10 +12,12 @@ import StatusBox from "./StatusBox"; import Breadcrumbs from "../../../Components/Breadcrumbs"; import Greeting from "../../../Utils/greeting"; import { CurrentMonitoring } from "./CurrentMonitoring"; +import { useIsAdmin } from "../../../Hooks/useIsAdmin"; -const Monitors = ({ isAdmin }) => { +const Monitors = () => { const theme = useTheme(); const navigate = useNavigate(); + const isAdmin = useIsAdmin(); const monitorState = useSelector((state) => state.uptimeMonitors); const authState = useSelector((state) => state.auth); const dispatch = useDispatch({}); diff --git a/Client/src/Pages/PageSpeed/Details/index.jsx b/Client/src/Pages/PageSpeed/Details/index.jsx index ca852e124..d25848ff2 100644 --- a/Client/src/Pages/PageSpeed/Details/index.jsx +++ b/Client/src/Pages/PageSpeed/Details/index.jsx @@ -21,10 +21,12 @@ import Checkbox from "../../../Components/Inputs/Checkbox"; import PieChart from "./Charts/PieChart"; import useUtils from "../../Monitors/utils"; import "./index.css"; +import { useIsAdmin } from "../../../Hooks/useIsAdmin"; -const PageSpeedDetails = ({ isAdmin }) => { +const PageSpeedDetails = () => { const theme = useTheme(); const navigate = useNavigate(); + const isAdmin = useIsAdmin(); const { statusColor, pagespeedStatusMsg, determineState } = useUtils(); const [monitor, setMonitor] = useState({}); const [audits, setAudits] = useState({}); diff --git a/Client/src/Pages/PageSpeed/index.jsx b/Client/src/Pages/PageSpeed/index.jsx index 9b84b0286..b18148aa8 100644 --- a/Client/src/Pages/PageSpeed/index.jsx +++ b/Client/src/Pages/PageSpeed/index.jsx @@ -12,11 +12,12 @@ import SkeletonLayout from "./skeleton"; import Card from "./card"; import { networkService } from "../../main"; import { Heading } from "../../Components/Heading"; -const PageSpeed = ({ isAdmin }) => { +import { useIsAdmin } from "../../Hooks/useIsAdmin"; +const PageSpeed = () => { const theme = useTheme(); const dispatch = useDispatch(); const navigate = useNavigate(); - + const isAdmin = useIsAdmin(); const { user, authToken } = useSelector((state) => state.auth); const [isLoading, setIsLoading] = useState(true); const [monitors, setMonitors] = useState([]); diff --git a/Client/src/Pages/Settings/index.jsx b/Client/src/Pages/Settings/index.jsx index 8a5e73bc3..aab9fa537 100644 --- a/Client/src/Pages/Settings/index.jsx +++ b/Client/src/Pages/Settings/index.jsx @@ -23,11 +23,13 @@ import { networkService } from "../../main"; import { settingsValidation } from "../../Validation/validation"; import { useNavigate } from "react-router"; import Dialog from "../../Components/Dialog"; +import { useIsAdmin } from "../../Hooks/useIsAdmin"; const SECONDS_PER_DAY = 86400; -const Settings = ({ isAdmin }) => { +const Settings = () => { const theme = useTheme(); + const isAdmin = useIsAdmin(); const { user, authToken } = useSelector((state) => state.auth); const { checkTTL } = user; const { isLoading } = useSelector((state) => state.uptimeMonitors); diff --git a/Client/src/Routes/index.jsx b/Client/src/Routes/index.jsx index 76c90784e..d3e14a02d 100644 --- a/Client/src/Routes/index.jsx +++ b/Client/src/Routes/index.jsx @@ -28,18 +28,9 @@ import CreateNewMaintenanceWindow from "../Pages/Maintenance/CreateMaintenance"; import PageSpeedDetails from "../Pages/PageSpeed/Details"; import PageSpeedConfigure from "../Pages/PageSpeed/Configure"; import withAdminCheck from "../Components/HOC/withAdminCheck"; -import withAdminProp from "../Components/HOC/withAdminProp"; const Routes = () => { const AdminCheckedRegister = withAdminCheck(Register); - const MonitorsWithAdminProp = withAdminProp(Monitors); - const MonitorDetailsWithAdminProp = withAdminProp(Details); - const PageSpeedWithAdminProp = withAdminProp(PageSpeed); - const PageSpeedDetailsWithAdminProp = withAdminProp(PageSpeedDetails); - const MaintenanceWithAdminProp = withAdminProp(Maintenance); - const SettingsWithAdminProp = withAdminProp(Settings); - const AdvancedSettingsWithAdminProp = withAdminProp(AdvancedSettings); - const InfrastructureDetailsWithAdminProp = withAdminProp(InfrastructureDetails); return ( { /> } + element={} /> { /> } + element={
} /> { /> } + element={} /> { /> } + element={} /> { /> } + element={} /> - } @@ -110,7 +100,7 @@ const Routes = () => { /> } + element={} /> { /> } + element={} /> } + element={} /> { /> - } + element={} /> - } + element={} /> @@ -190,13 +170,3 @@ const Routes = () => { }; export { Routes }; - -/* import { createBrowserRouter } from "react-router-dom"; - -const router = createBrowserRouter({ - { - path: "/", - } -}); - -export { router }; */ From cce1ed610c92b1b1ec4c09c14f92166d7da4ef6e Mon Sep 17 00:00:00 2001 From: Caio Cabral Date: Thu, 12 Dec 2024 09:11:08 -0500 Subject: [PATCH 069/178] chore: delete console --- Client/src/Pages/Auth/Login.jsx | 1 - 1 file changed, 1 deletion(-) diff --git a/Client/src/Pages/Auth/Login.jsx b/Client/src/Pages/Auth/Login.jsx index 89992b109..6329835ef 100644 --- a/Client/src/Pages/Auth/Login.jsx +++ b/Client/src/Pages/Auth/Login.jsx @@ -367,7 +367,6 @@ StepTwo.propTypes = { }; const Login = () => { - console.log("login"); const dispatch = useDispatch(); const navigate = useNavigate(); const theme = useTheme(); From ee4ef158748aacd62738cfa4f5f3155fc75cff42 Mon Sep 17 00:00:00 2001 From: Caio Cabral Date: Thu, 12 Dec 2024 09:20:24 -0500 Subject: [PATCH 070/178] resolving conflicts --- .../Infrastructure/CreateMonitor/index.jsx | 1 - .../Pages/PageSpeed/CreatePageSpeed/index.jsx | 2 +- Client/src/Routes/index.jsx | 18 +++++++++--------- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/Client/src/Pages/Infrastructure/CreateMonitor/index.jsx b/Client/src/Pages/Infrastructure/CreateMonitor/index.jsx index df7829930..56162d2a5 100644 --- a/Client/src/Pages/Infrastructure/CreateMonitor/index.jsx +++ b/Client/src/Pages/Infrastructure/CreateMonitor/index.jsx @@ -397,7 +397,6 @@ const CreateInfrastructureMonitor = () => { label="Check frequency" value={infrastructureMonitor.interval || 15} onChange={handleChange} - onBlur={} items={SELECT_VALUES} /> diff --git a/Client/src/Pages/PageSpeed/CreatePageSpeed/index.jsx b/Client/src/Pages/PageSpeed/CreatePageSpeed/index.jsx index ccab3442f..30592e2eb 100644 --- a/Client/src/Pages/PageSpeed/CreatePageSpeed/index.jsx +++ b/Client/src/Pages/PageSpeed/CreatePageSpeed/index.jsx @@ -20,7 +20,7 @@ import LoadingButton from "@mui/lab/LoadingButton"; import Breadcrumbs from "../../../Components/Breadcrumbs"; import TextInput from "../../../Components/Inputs/TextInput"; import { HttpAdornment } from "../../../Components/Inputs/TextInput/Adornments"; -import { ConfigBox } from "../../Monitors/styled"; +import { ConfigBox } from "../../Uptime/styled"; import { createToast } from "../../../Utils/toastUtils"; import Radio from "../../../Components/Inputs/Radio"; diff --git a/Client/src/Routes/index.jsx b/Client/src/Routes/index.jsx index d3e14a02d..ba7822fa7 100644 --- a/Client/src/Routes/index.jsx +++ b/Client/src/Routes/index.jsx @@ -6,8 +6,8 @@ import NotFound from "../Pages/NotFound"; import Login from "../Pages/Auth/Login"; import Register from "../Pages/Auth/Register/Register"; import Account from "../Pages/Account"; -import Monitors from "../Pages/Monitors/Home"; -import CreateMonitor from "../Pages/Monitors/CreateMonitor"; +import Monitors from "../Pages/Uptime/Home"; +import CreateMonitor from "../Pages/Uptime/CreateUptime"; import CreateInfrastructureMonitor from "../Pages/Infrastructure/CreateMonitor"; import Incidents from "../Pages/Incidents"; import Status from "../Pages/Status"; @@ -18,10 +18,10 @@ import CheckEmail from "../Pages/Auth/CheckEmail"; import SetNewPassword from "../Pages/Auth/SetNewPassword"; import NewPasswordConfirmed from "../Pages/Auth/NewPasswordConfirmed"; import ProtectedRoute from "../Components/ProtectedRoute"; -import Details from "../Pages/Monitors/Details"; +import Details from "../Pages/Uptime/Details"; import AdvancedSettings from "../Pages/AdvancedSettings"; import Maintenance from "../Pages/Maintenance"; -import Configure from "../Pages/Monitors/Configure"; +import Configure from "../Pages/Uptime/Configure"; import PageSpeed from "../Pages/PageSpeed"; import CreatePageSpeed from "../Pages/PageSpeed/CreatePageSpeed"; import CreateNewMaintenanceWindow from "../Pages/Maintenance/CreateMaintenance"; @@ -39,22 +39,22 @@ const Routes = () => { > } + element={} /> } /> } /> } /> } /> Date: Thu, 12 Dec 2024 22:39:42 +0800 Subject: [PATCH 071/178] Revert "fix: update red palette colors" This reverts commit 79dd781386ae8c96f5f9993b86a7ab5044f7b0ef. --- Client/src/Utils/Theme/constants.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Client/src/Utils/Theme/constants.js b/Client/src/Utils/Theme/constants.js index 422648028..df9b5da93 100644 --- a/Client/src/Utils/Theme/constants.js +++ b/Client/src/Utils/Theme/constants.js @@ -51,8 +51,7 @@ const paletteColors = { red50: "#F9ECED", red100: "#FBD1D1", red200: "#F04438", - red300: "#EBA8A9", - red400: "#D32F2F", + red300: "#D32F2F", red700: "#542426", red800: "#301A1F", orange50: "#FEF8EA", @@ -110,13 +109,13 @@ const semanticColors = { }, error: { main: { - light: paletteColors.red400, - dark: paletteColors.red400, - }, - contrastText: { light: paletteColors.red300, dark: paletteColors.red300, }, + contrastText: { + light: paletteColors.gray50, + dark: paletteColors.gray50, + }, light: { light: paletteColors.red100, dark: paletteColors.red700, From dc46a0c2b245eba1f4717e81b9753e7801121b8d Mon Sep 17 00:00:00 2001 From: Caio Cabral Date: Thu, 12 Dec 2024 10:23:36 -0500 Subject: [PATCH 072/178] hotfix: imports --- Client/src/Pages/Infrastructure/CreateMonitor/index.jsx | 1 - Client/src/Pages/PageSpeed/CreatePageSpeed/index.jsx | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/Client/src/Pages/Infrastructure/CreateMonitor/index.jsx b/Client/src/Pages/Infrastructure/CreateMonitor/index.jsx index df7829930..56162d2a5 100644 --- a/Client/src/Pages/Infrastructure/CreateMonitor/index.jsx +++ b/Client/src/Pages/Infrastructure/CreateMonitor/index.jsx @@ -397,7 +397,6 @@ const CreateInfrastructureMonitor = () => { label="Check frequency" value={infrastructureMonitor.interval || 15} onChange={handleChange} - onBlur={} items={SELECT_VALUES} /> diff --git a/Client/src/Pages/PageSpeed/CreatePageSpeed/index.jsx b/Client/src/Pages/PageSpeed/CreatePageSpeed/index.jsx index ccab3442f..30592e2eb 100644 --- a/Client/src/Pages/PageSpeed/CreatePageSpeed/index.jsx +++ b/Client/src/Pages/PageSpeed/CreatePageSpeed/index.jsx @@ -20,7 +20,7 @@ import LoadingButton from "@mui/lab/LoadingButton"; import Breadcrumbs from "../../../Components/Breadcrumbs"; import TextInput from "../../../Components/Inputs/TextInput"; import { HttpAdornment } from "../../../Components/Inputs/TextInput/Adornments"; -import { ConfigBox } from "../../Monitors/styled"; +import { ConfigBox } from "../../Uptime/styled"; import { createToast } from "../../../Utils/toastUtils"; import Radio from "../../../Components/Inputs/Radio"; From 1a856ed463723292d908069c0dbe9787c9fb77d1 Mon Sep 17 00:00:00 2001 From: Peter Carl Pardo Date: Fri, 13 Dec 2024 00:47:09 +0800 Subject: [PATCH 073/178] fix: Update chart color for "Poor" category --- Client/src/Pages/Monitors/Details/Charts/index.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Client/src/Pages/Monitors/Details/Charts/index.jsx b/Client/src/Pages/Monitors/Details/Charts/index.jsx index fc01fbfc9..7c5adc9e2 100644 --- a/Client/src/Pages/Monitors/Details/Charts/index.jsx +++ b/Client/src/Pages/Monitors/Details/Charts/index.jsx @@ -262,7 +262,7 @@ const ResponseGaugeChart = ({ data }) => { } : { category: "Poor", - main: theme.palette.error.contrastText, + main: theme.palette.error.light, bg: theme.palette.error.dark, }; From 4f2a1b7342e40b1fc697951da653782ab02b72b1 Mon Sep 17 00:00:00 2001 From: "Gorkem Cetin (BWL)" <167266851+gorkem-bwl@users.noreply.github.com> Date: Thu, 12 Dec 2024 14:03:26 -0500 Subject: [PATCH 074/178] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ca3c19c95..b9565dece 100644 --- a/README.md +++ b/README.md @@ -72,7 +72,7 @@ We've just launched our [Discussions](https://github.com/bluewave-labs/bluewave- ## 🀝 Contributing -We pride ourselves on building strong connections with contributors at every level. Despite being a young project, Checkmate has already earned 1300+ stars and attracted 30+ contributors from around the globe. So, don’t hold back β€” jump in, contribute and learn with us! +We pride ourselves on building strong connections with contributors at every level. Despite being a young project, Checkmate has already earned 1500 stars and attracted 35+ contributors from around the globe. So, don’t hold back β€” jump in, contribute and learn with us! Here's how you can contribute: From 1aa05eb438def3027de13f0c98f16081a2b421ce Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 12 Dec 2024 19:05:54 +0000 Subject: [PATCH 075/178] fix(deps): update material-ui monorepo to v7.23.2 --- Client/package-lock.json | 22 +++++++++++----------- Client/package.json | 4 ++-- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Client/package-lock.json b/Client/package-lock.json index d60225e07..f4779d7d7 100644 --- a/Client/package-lock.json +++ b/Client/package-lock.json @@ -15,8 +15,8 @@ "@mui/lab": "6.0.0-beta.19", "@mui/material": "6.2.0", "@mui/x-charts": "^7.5.1", - "@mui/x-data-grid": "7.23.1", - "@mui/x-date-pickers": "7.23.1", + "@mui/x-data-grid": "7.23.2", + "@mui/x-date-pickers": "7.23.2", "@reduxjs/toolkit": "2.5.0", "axios": "^1.7.4", "dayjs": "1.11.13", @@ -1390,9 +1390,9 @@ "license": "MIT" }, "node_modules/@mui/x-charts": { - "version": "7.23.1", - "resolved": "https://registry.npmjs.org/@mui/x-charts/-/x-charts-7.23.1.tgz", - "integrity": "sha512-hIVRitRSFxf60BHDr+T7Tarj4lLwOV8flebeIsyEPJJHvSlaFNFwr6rqYFb8SGULYU7ppKMhiESD1+YqgJSU1Q==", + "version": "7.23.2", + "resolved": "https://registry.npmjs.org/@mui/x-charts/-/x-charts-7.23.2.tgz", + "integrity": "sha512-wLeogvQZZtyrAOdG06mDzIQSHBSAB09Uy16AYRUcMxVObi7Fs0i3TJUMpQHMYz1/1DvE1u8zstDgVpVfk8/iCA==", "license": "MIT", "dependencies": { "@babel/runtime": "^7.25.7", @@ -1448,9 +1448,9 @@ } }, "node_modules/@mui/x-data-grid": { - "version": "7.23.1", - "resolved": "https://registry.npmjs.org/@mui/x-data-grid/-/x-data-grid-7.23.1.tgz", - "integrity": "sha512-1CumfhjGA+WgNtnN3ZD3gCOw6RVf/cEy2X2gS0iyXtVsFNaE+qtyMz9KesQsIzi9u13Wj3RNuhBdH0C5qXtAhQ==", + "version": "7.23.2", + "resolved": "https://registry.npmjs.org/@mui/x-data-grid/-/x-data-grid-7.23.2.tgz", + "integrity": "sha512-Xhm4Bh+WiU5MSLFIZ8mE1egHoS0xPEVlwvjYvairPIkxNPubB7f+gtLkuAJ2+m+BYbgO7yDte+Pp7dfjkU+vOA==", "license": "MIT", "dependencies": { "@babel/runtime": "^7.25.7", @@ -1485,9 +1485,9 @@ } }, "node_modules/@mui/x-date-pickers": { - "version": "7.23.1", - "resolved": "https://registry.npmjs.org/@mui/x-date-pickers/-/x-date-pickers-7.23.1.tgz", - "integrity": "sha512-Jr4beZ7r2lvWBaFnkIAg9BgiNFcfeJy4AUe3MbG10BBSZyB++odGqhOUAIGqkP7MpUzEGlTv4NUaaD7gYTAQPg==", + "version": "7.23.2", + "resolved": "https://registry.npmjs.org/@mui/x-date-pickers/-/x-date-pickers-7.23.2.tgz", + "integrity": "sha512-Kt9VsEnShaBKiaastTYku66UIWptgc9UMA16d0G/0TkfIsvZrAD3iacQR6HHAXWspaFshdfsRmW2JAoFhzKZsg==", "license": "MIT", "dependencies": { "@babel/runtime": "^7.25.7", diff --git a/Client/package.json b/Client/package.json index a6645fff1..62f2c7eb6 100644 --- a/Client/package.json +++ b/Client/package.json @@ -18,8 +18,8 @@ "@mui/lab": "6.0.0-beta.19", "@mui/material": "6.2.0", "@mui/x-charts": "^7.5.1", - "@mui/x-data-grid": "7.23.1", - "@mui/x-date-pickers": "7.23.1", + "@mui/x-data-grid": "7.23.2", + "@mui/x-date-pickers": "7.23.2", "@reduxjs/toolkit": "2.5.0", "axios": "^1.7.4", "dayjs": "1.11.13", From a8a8664fc670cde4f0ba6fc47787f2b92937ea37 Mon Sep 17 00:00:00 2001 From: Caio Cabral Date: Thu, 12 Dec 2024 14:43:57 -0500 Subject: [PATCH 076/178] refactor: simplify protected route component --- Client/src/Components/ProtectedRoute/index.jsx | 18 +++++++++--------- Client/src/Routes/index.jsx | 6 +++++- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/Client/src/Components/ProtectedRoute/index.jsx b/Client/src/Components/ProtectedRoute/index.jsx index 1a8cf9aa0..7a71aef7e 100644 --- a/Client/src/Components/ProtectedRoute/index.jsx +++ b/Client/src/Components/ProtectedRoute/index.jsx @@ -3,20 +3,20 @@ import { useSelector } from "react-redux"; import PropTypes from "prop-types"; /** - * ProtectedRoute is a higher-order component that wraps the `Route` component from `react-router-dom` - * to create a protected route. It uses Redux to check if the user is authenticated. If the user is - * authenticated, it renders the component passed to it; otherwise, it redirects the user to the login page. + * ProtectedRoute is a wrapper component that ensures only authenticated users + * can access the wrapped content. It checks authentication status (e.g., from Redux or Context). + * If the user is authenticated, it renders the children; otherwise, it redirects to the login page. * * @param {Object} props - The props passed to the ProtectedRoute component. - * @param {React.ComponentType} props.Component - The component to render if the user is authenticated. - * @param {Object} rest - The remaining props passed to the Route component. - * @returns {React.ReactElement} A Route component that conditionally renders the passed Component or redirects to the login page. + * @param {React.ReactNode} props.children - The children to render if the user is authenticated. + * @returns {React.ReactElement} The children wrapped in a protected route or a redirect to the login page. */ -const ProtectedRoute = ({ Component, ...rest }) => { +const ProtectedRoute = ({ children }) => { const authState = useSelector((state) => state.auth); + return authState.authToken ? ( - + children ) : ( { }; ProtectedRoute.propTypes = { - Component: PropTypes.elementType.isRequired, + children: PropTypes.elementType.isRequired, }; export default ProtectedRoute; diff --git a/Client/src/Routes/index.jsx b/Client/src/Routes/index.jsx index ba7822fa7..5fc764b6a 100644 --- a/Client/src/Routes/index.jsx +++ b/Client/src/Routes/index.jsx @@ -35,7 +35,11 @@ const Routes = () => { } + element={ + + + + } > Date: Thu, 12 Dec 2024 22:43:46 +0000 Subject: [PATCH 077/178] fix(deps): update dependency recharts to v2.15.0 --- Client/package-lock.json | 12 ++++++------ Client/package.json | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Client/package-lock.json b/Client/package-lock.json index d60225e07..873588451 100644 --- a/Client/package-lock.json +++ b/Client/package-lock.json @@ -28,7 +28,7 @@ "react-router": "^6.23.0", "react-router-dom": "^6.23.1", "react-toastify": "^10.0.5", - "recharts": "2.14.1", + "recharts": "2.15.0", "redux-persist": "6.0.0", "vite-plugin-svgr": "^4.2.0" }, @@ -5454,9 +5454,9 @@ } }, "node_modules/recharts": { - "version": "2.14.1", - "resolved": "https://registry.npmjs.org/recharts/-/recharts-2.14.1.tgz", - "integrity": "sha512-xtWulflkA+/xu4/QClBdtZYN30dbvTHjxjkh5XTMrH/CQ3WGDDPHHa/LLKCbgoqz0z3UaSH2/blV1i6VNMeh1g==", + "version": "2.15.0", + "resolved": "https://registry.npmjs.org/recharts/-/recharts-2.15.0.tgz", + "integrity": "sha512-cIvMxDfpAmqAmVgc4yb7pgm/O1tmmkl/CjrvXuW+62/+7jj/iF9Ykm+hb/UJt42TREHMyd3gb+pkgoa2MxgDIw==", "license": "MIT", "dependencies": { "clsx": "^2.0.0", @@ -5472,8 +5472,8 @@ "node": ">=14" }, "peerDependencies": { - "react": "^16.0.0 || ^17.0.0 || ^18.0.0", - "react-dom": "^16.0.0 || ^17.0.0 || ^18.0.0" + "react": "^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", + "react-dom": "^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, "node_modules/recharts-scale": { diff --git a/Client/package.json b/Client/package.json index a6645fff1..3898b158f 100644 --- a/Client/package.json +++ b/Client/package.json @@ -31,7 +31,7 @@ "react-router": "^6.23.0", "react-router-dom": "^6.23.1", "react-toastify": "^10.0.5", - "recharts": "2.14.1", + "recharts": "2.15.0", "redux-persist": "6.0.0", "vite-plugin-svgr": "^4.2.0" }, From 265f2a7e4a861bb8abd40b0071dd2eb9373f9bd8 Mon Sep 17 00:00:00 2001 From: "Gorkem Cetin (BWL)" <167266851+gorkem-bwl@users.noreply.github.com> Date: Thu, 12 Dec 2024 20:17:18 -0500 Subject: [PATCH 078/178] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index b9565dece..62fea1f77 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +**Need support or have a suggestion? Check our [Discord channel](https://discord.gg/NAb6H3UTjK)** + ![](https://img.shields.io/github/license/bluewave-labs/bluewave-uptime) ![](https://img.shields.io/github/repo-size/bluewave-labs/bluewave-uptime) ![](https://img.shields.io/github/commit-activity/w/bluewave-labs/bluewave-uptime) From ab0c509c92be5e11b20838625a46c36864268116 Mon Sep 17 00:00:00 2001 From: "Gorkem Cetin (BWL)" <167266851+gorkem-bwl@users.noreply.github.com> Date: Thu, 12 Dec 2024 20:23:21 -0500 Subject: [PATCH 079/178] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 62fea1f77..d8bc39703 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ See installation instructions in [Checkmate documentation portal](https://bluewa ## πŸ’š Questions & ideas -We've just launched our [Discussions](https://github.com/bluewave-labs/bluewave-uptime/discussions) page! Feel free to ask questions or share your ideasβ€”we'd love to hear from you! +If you have any questions, suggestions or comments, please use our [Discord channel](https://discord.gg/NAb6H3UTjK). We've also launched our [Discussions](https://github.com/bluewave-labs/bluewave-uptime/discussions) page! Feel free to ask questions or share your ideasβ€”we'd love to hear from you! ## 🧩 Features From b651d097699af1a3c3c025f626bcc64eca0798a5 Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Fri, 13 Dec 2024 11:20:09 +0800 Subject: [PATCH 080/178] Fix fallback link --- Client/src/Pages/Uptime/Home/fallback.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Client/src/Pages/Uptime/Home/fallback.jsx b/Client/src/Pages/Uptime/Home/fallback.jsx index 3653160dc..163921501 100644 --- a/Client/src/Pages/Uptime/Home/fallback.jsx +++ b/Client/src/Pages/Uptime/Home/fallback.jsx @@ -41,7 +41,7 @@ const Fallback = ({ isAdmin }) => { variant="contained" color="primary" onClick={() => { - navigate("/monitors/create"); + navigate("/uptime/create"); }} sx={{ mt: theme.spacing(12) }} > From daf5ccb3429a37e65d4ec1c0d78c33381d754920 Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Fri, 13 Dec 2024 11:45:41 +0800 Subject: [PATCH 081/178] Fix invite route --- Server/routes/inviteRoute.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Server/routes/inviteRoute.js b/Server/routes/inviteRoute.js index f1f8a20e1..36d30de5a 100644 --- a/Server/routes/inviteRoute.js +++ b/Server/routes/inviteRoute.js @@ -9,6 +9,6 @@ import { const router = Router(); router.post("/", isAllowed(["admin", "superadmin"]), verifyJWT, issueInvitation); -router.post("/verify", issueInvitation); +router.post("/verify", inviteVerifyController); export default router; From 35dcf19169949a94215680a7fc3ff457c831bc27 Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Fri, 13 Dec 2024 11:52:49 +0800 Subject: [PATCH 082/178] clicking on logo redirects to --- Client/src/Components/Sidebar/index.jsx | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/Client/src/Components/Sidebar/index.jsx b/Client/src/Components/Sidebar/index.jsx index 95abe1d20..18ae19dc8 100644 --- a/Client/src/Components/Sidebar/index.jsx +++ b/Client/src/Components/Sidebar/index.jsx @@ -27,7 +27,6 @@ import UserSvg from "../../assets/icons/user.svg?react"; import TeamSvg from "../../assets/icons/user-two.svg?react"; import LogoutSvg from "../../assets/icons/logout.svg?react"; import Support from "../../assets/icons/support.svg?react"; -import Dashboard from "../../assets/icons/dashboard.svg?react"; import Account from "../../assets/icons/user-edit.svg?react"; import Maintenance from "../../assets/icons/maintenance.svg?react"; import Monitors from "../../assets/icons/monitors.svg?react"; @@ -177,13 +176,7 @@ function Sidebar() { direction="row" alignItems="center" gap={theme.spacing(4)} - onClick={() => - window.open( - "https://github.com/bluewave-labs/bluewave-uptime", - "_blank", - "noreferrer" - ) - } + onClick={() => navigate("/")} sx={{ cursor: "pointer" }} > Date: Thu, 12 Dec 2024 23:52:35 -0500 Subject: [PATCH 083/178] Fix wording --- Client/src/Components/TabPanels/Account/ProfilePanel.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Client/src/Components/TabPanels/Account/ProfilePanel.jsx b/Client/src/Components/TabPanels/Account/ProfilePanel.jsx index 13b16df00..9e7953128 100644 --- a/Client/src/Components/TabPanels/Account/ProfilePanel.jsx +++ b/Client/src/Components/TabPanels/Account/ProfilePanel.jsx @@ -363,7 +363,7 @@ const ProfilePanel = () => { component="p" sx={{ opacity: 0.6 }} > - Note that deleting your account will remove all data from our system. This + Note that deleting your account will remove all data from the server. This is permanent and non-recoverable. From 4b47d43cd1b54467a2e96e93dd3eb107a7ffad1e Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Fri, 13 Dec 2024 13:12:38 +0800 Subject: [PATCH 084/178] Add pause toast to PageSpeed and Uptime configure pages --- Client/src/Pages/PageSpeed/Configure/index.jsx | 2 ++ Client/src/Pages/Uptime/Configure/index.jsx | 2 ++ 2 files changed, 4 insertions(+) diff --git a/Client/src/Pages/PageSpeed/Configure/index.jsx b/Client/src/Pages/PageSpeed/Configure/index.jsx index 47d847394..0c94678d2 100644 --- a/Client/src/Pages/PageSpeed/Configure/index.jsx +++ b/Client/src/Pages/PageSpeed/Configure/index.jsx @@ -135,6 +135,8 @@ const PageSpeedConfigure = () => { if (pausePageSpeed.fulfilled.match(action)) { const monitor = action.payload.data; setMonitor(monitor); + const state = action?.payload?.data.isActive === false ? "paused" : "resumed"; + createToast({ body: `Monitor ${state} successfully.` }); } else if (pausePageSpeed.rejected.match(action)) { throw new Error(action.error.message); } diff --git a/Client/src/Pages/Uptime/Configure/index.jsx b/Client/src/Pages/Uptime/Configure/index.jsx index 95af3ad76..0d7388d14 100644 --- a/Client/src/Pages/Uptime/Configure/index.jsx +++ b/Client/src/Pages/Uptime/Configure/index.jsx @@ -141,6 +141,8 @@ const Configure = () => { if (pauseUptimeMonitor.fulfilled.match(action)) { const monitor = action.payload.data; setMonitor(monitor); + const state = action?.payload?.data.isActive === false ? "paused" : "resumed"; + createToast({ body: `Monitor ${state} successfully.` }); } else if (pauseUptimeMonitor.rejected.match(action)) { throw new Error(action.error.message); } From b2f8961bac46112208c112e0cdd863f5c356555d Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 13 Dec 2024 13:19:47 +0000 Subject: [PATCH 085/178] chore(deps): update dependency nodemon to v3.1.9 --- Server/package-lock.json | 14 +++++++------- Server/package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Server/package-lock.json b/Server/package-lock.json index b07bda668..fc10b69f6 100644 --- a/Server/package-lock.json +++ b/Server/package-lock.json @@ -36,7 +36,7 @@ "chai": "5.1.2", "esm": "3.2.25", "mocha": "11.0.1", - "nodemon": "3.1.7", + "nodemon": "3.1.9", "prettier": "^3.3.3", "sinon": "19.0.2" } @@ -4758,9 +4758,9 @@ } }, "node_modules/nodemon": { - "version": "3.1.7", - "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-3.1.7.tgz", - "integrity": "sha512-hLj7fuMow6f0lbB0cD14Lz2xNjwsyruH251Pk4t/yIitCFJbmY1myuLlHm/q06aST4jg6EgAh74PIBBrRqpVAQ==", + "version": "3.1.9", + "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-3.1.9.tgz", + "integrity": "sha512-hdr1oIb2p6ZSxu3PB2JWWYS7ZQ0qvaZsc3hK8DR8f02kRzc8rjYmxAIvdz+aYC+8F2IjNaB7HMcSDg8nQpJxyg==", "dev": true, "license": "MIT", "dependencies": { @@ -4787,9 +4787,9 @@ } }, "node_modules/nodemon/node_modules/debug": { - "version": "4.3.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", - "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", "dev": true, "license": "MIT", "dependencies": { diff --git a/Server/package.json b/Server/package.json index 154f67437..f8a8b5f1a 100644 --- a/Server/package.json +++ b/Server/package.json @@ -39,7 +39,7 @@ "chai": "5.1.2", "esm": "3.2.25", "mocha": "11.0.1", - "nodemon": "3.1.7", + "nodemon": "3.1.9", "prettier": "^3.3.3", "sinon": "19.0.2" } From c72334253d9bc4db2cf4daf900c975b884984e9e Mon Sep 17 00:00:00 2001 From: Shemy Gan Date: Fri, 13 Dec 2024 10:50:36 -0500 Subject: [PATCH 086/178] - Refactor out/Rename the StepOne and StepTwo components --- Client/src/App.jsx | 2 +- Client/src/Pages/Auth/Login.jsx | 446 ------------------ .../Pages/Auth/Login/Components/EmailStep.jsx | 95 ++++ .../Auth/Login/Components/PasswordStep.jsx | 159 +++++++ Client/src/Pages/Auth/Login/Login.jsx | 213 +++++++++ 5 files changed, 468 insertions(+), 447 deletions(-) delete mode 100644 Client/src/Pages/Auth/Login.jsx create mode 100644 Client/src/Pages/Auth/Login/Components/EmailStep.jsx create mode 100644 Client/src/Pages/Auth/Login/Components/PasswordStep.jsx create mode 100644 Client/src/Pages/Auth/Login/Login.jsx diff --git a/Client/src/App.jsx b/Client/src/App.jsx index 82c8203a8..a248dd5b0 100644 --- a/Client/src/App.jsx +++ b/Client/src/App.jsx @@ -5,7 +5,7 @@ import { useDispatch } from "react-redux"; import "react-toastify/dist/ReactToastify.css"; import { ToastContainer } from "react-toastify"; import NotFound from "./Pages/NotFound"; -import Login from "./Pages/Auth/Login"; +import Login from "./Pages/Auth/Login/Login"; import Register from "./Pages/Auth/Register/Register"; import Account from "./Pages/Account"; import Monitors from "./Pages/Monitors/Home"; diff --git a/Client/src/Pages/Auth/Login.jsx b/Client/src/Pages/Auth/Login.jsx deleted file mode 100644 index 677637302..000000000 --- a/Client/src/Pages/Auth/Login.jsx +++ /dev/null @@ -1,446 +0,0 @@ -import { useState, useEffect, useRef } from "react"; -import { useNavigate } from "react-router-dom"; -import { Box, Button, Stack, Typography } from "@mui/material"; -import { useTheme } from "@emotion/react"; -import { credentials } from "../../Validation/validation"; -import { login } from "../../Features/Auth/authSlice"; -import LoadingButton from "@mui/lab/LoadingButton"; -import { useDispatch, useSelector } from "react-redux"; -import { createToast } from "../../Utils/toastUtils"; -import { networkService } from "../../main"; -import TextInput from "../../Components/Inputs/TextInput"; -import { PasswordEndAdornment } from "../../Components/Inputs/TextInput/Adornments"; -import Background from "../../assets/Images/background-grid.svg?react"; -import Logo from "../../assets/icons/bwu-icon.svg?react"; -import ArrowBackRoundedIcon from "@mui/icons-material/ArrowBackRounded"; -import PropTypes from "prop-types"; -import { logger } from "../../Utils/Logger"; -import "./index.css"; -const DEMO = import.meta.env.VITE_APP_DEMO; - -/** - * Renders the first step of the login process. - * - * @param {Object} props - * @param {Object} props.form - Form state object. - * @param {Object} props.errors - Object containing form validation errors. - * @param {Function} props.onSubmit - Callback function to handle form submission. - * @param {Function} props.onChange - Callback function to handle form input changes. - * @param {Function} props.onBack - Callback function to handle "Back" button click. - * @returns {JSX.Element} - */ -const StepOne = ({ form, errors, onSubmit, onChange }) => { - const theme = useTheme(); - const inputRef = useRef(null); - - useEffect(() => { - if (inputRef.current) { - inputRef.current.focus(); - } - }, []); - - return ( - <> - - - Log In - Enter your email address - - - (e.target.value = e.target.value.toLowerCase())} - onChange={onChange} - error={errors.email ? true : false} - helperText={errors.email} - ref={inputRef} - /> - - - - - - - ); -}; - -StepOne.propTypes = { - form: PropTypes.object.isRequired, - errors: PropTypes.object.isRequired, - onSubmit: PropTypes.func.isRequired, - onChange: PropTypes.func.isRequired, -}; - -/** - * Renders the second step of the login process, including a password input field. - * - * @param {Object} props - * @param {Object} props.form - Form state object. - * @param {Object} props.errors - Object containing form validation errors. - * @param {Function} props.onSubmit - Callback function to handle form submission. - * @param {Function} props.onChange - Callback function to handle form input changes. - * @param {Function} props.onBack - Callback function to handle "Back" button click. - * @returns {JSX.Element} - */ -const StepTwo = ({ form, errors, onSubmit, onChange, onBack }) => { - const theme = useTheme(); - const navigate = useNavigate(); - const inputRef = useRef(null); - const authState = useSelector((state) => state.auth); - - useEffect(() => { - if (inputRef.current) { - inputRef.current.focus(); - } - }, []); - - const handleNavigate = () => { - if (form.email !== "" && !errors.email) { - sessionStorage.setItem("email", form.email); - } - navigate("/forgot-password"); - }; - - return ( - <> - - - Log In - Enter your password - - - } - /> - - - - Continue - - - - - - Forgot password? - - - Reset password - - - - - ); -}; - -StepTwo.propTypes = { - form: PropTypes.object.isRequired, - errors: PropTypes.object.isRequired, - onSubmit: PropTypes.func.isRequired, - onChange: PropTypes.func.isRequired, - onBack: PropTypes.func.isRequired, -}; - -const Login = () => { - const dispatch = useDispatch(); - const navigate = useNavigate(); - const theme = useTheme(); - - const authState = useSelector((state) => state.auth); - const { authToken } = authState; - - const idMap = { - "login-email-input": "email", - "login-password-input": "password", - }; - - const [form, setForm] = useState({ - email: DEMO !== undefined ? "uptimedemo@demo.com" : "", - password: DEMO !== undefined ? "Demouser1!" : "", - }); - const [errors, setErrors] = useState({}); - const [step, setStep] = useState(0); - - useEffect(() => { - if (authToken) { - navigate("/monitors"); - return; - } - networkService - .doesSuperAdminExist() - .then((response) => { - if (response.data.data === false) { - navigate("/register"); - } - }) - .catch((error) => { - logger.error(error); - }); - }, [authToken, navigate]); - - const handleChange = (event) => { - const { value, id } = event.target; - const name = idMap[id]; - setForm((prev) => ({ - ...prev, - [name]: value, - })); - - const { error } = credentials.validate({ [name]: value }, { abortEarly: false }); - - setErrors((prev) => { - const prevErrors = { ...prev }; - if (error) prevErrors[name] = error.details[0].message; - else delete prevErrors[name]; - return prevErrors; - }); - }; - - const handleSubmit = async (event) => { - event.preventDefault(); - - if (step === 0) { - const { error } = credentials.validate( - { email: form.email }, - { abortEarly: false } - ); - if (error) { - setErrors((prev) => ({ ...prev, email: error.details[0].message })); - createToast({ body: error.details[0].message }); - } else { - setStep(1); - } - } else if (step === 1) { - const { error } = credentials.validate(form, { abortEarly: false }); - - if (error) { - // validation errors - const newErrors = {}; - error.details.forEach((err) => { - newErrors[err.path[0]] = err.message; - }); - setErrors(newErrors); - createToast({ - body: - error.details && error.details.length > 0 - ? error.details[0].message - : "Error validating data.", - }); - } else { - const action = await dispatch(login(form)); - if (action.payload.success) { - navigate("/monitors"); - createToast({ - body: "Welcome back! You're successfully logged in.", - }); - } else { - if (action.payload) { - if (action.payload.msg === "Incorrect password") - setErrors({ - password: "The password you provided does not match our records", - }); - // dispatch errors - createToast({ - body: action.payload.msg, - }); - } else { - // unknown errors - createToast({ - body: "Unknown error.", - }); - } - } - } - } - }; - - return ( - - - - - - - BlueWave Uptime - - .MuiStack-root": { - border: 1, - borderRadius: theme.spacing(5), - borderColor: theme.palette.border.light, - backgroundColor: theme.palette.background.main, - padding: { - xs: theme.spacing(12), - sm: theme.spacing(20), - }, - }, - }} - > - {step === 0 ? ( - - ) : ( - step === 1 && ( - setStep(0)} - /> - ) - )} - - - ); -}; - -export default Login; diff --git a/Client/src/Pages/Auth/Login/Components/EmailStep.jsx b/Client/src/Pages/Auth/Login/Components/EmailStep.jsx new file mode 100644 index 000000000..f78193186 --- /dev/null +++ b/Client/src/Pages/Auth/Login/Components/EmailStep.jsx @@ -0,0 +1,95 @@ +import { useRef, useEffect } from "react"; +import { Box, Button, Stack, Typography } from "@mui/material"; +import { useTheme } from "@emotion/react"; +import TextInput from "../../../../Components/Inputs/TextInput"; +import PropTypes from "prop-types"; + +/** + * Renders the email step of the login process which includes an email field. + * + * @param {Object} props + * @param {Object} props.form - Form state object. + * @param {Object} props.errors - Object containing form validation errors. + * @param {Function} props.onSubmit - Callback function to handle form submission. + * @param {Function} props.onChange - Callback function to handle form input changes. + * @param {Function} props.onBack - Callback function to handle "Back" button click. + * @returns {JSX.Element} + */ +const EmailStep = ({ form, errors, onSubmit, onChange }) => { + const theme = useTheme(); + const inputRef = useRef(null); + + useEffect(() => { + if (inputRef.current) { + inputRef.current.focus(); + } + }, []); + + return ( + <> + + + Log In + Enter your email address + + + (e.target.value = e.target.value.toLowerCase())} + onChange={onChange} + error={errors.email ? true : false} + helperText={errors.email} + ref={inputRef} + /> + + + + + + + ); +}; + +EmailStep.propTypes = { + form: PropTypes.object.isRequired, + errors: PropTypes.object.isRequired, + onSubmit: PropTypes.func.isRequired, + onChange: PropTypes.func.isRequired, +}; + +export default EmailStep; \ No newline at end of file diff --git a/Client/src/Pages/Auth/Login/Components/PasswordStep.jsx b/Client/src/Pages/Auth/Login/Components/PasswordStep.jsx new file mode 100644 index 000000000..34df4959d --- /dev/null +++ b/Client/src/Pages/Auth/Login/Components/PasswordStep.jsx @@ -0,0 +1,159 @@ +import { useRef, useEffect } from "react"; +import { useNavigate } from "react-router-dom"; +import { Box, Button, Stack, Typography } from "@mui/material"; +import { useTheme } from "@emotion/react"; +import LoadingButton from "@mui/lab/LoadingButton"; +import { useSelector } from "react-redux"; +import TextInput from "../../../../Components/Inputs/TextInput"; +import { PasswordEndAdornment } from "../../../../Components/Inputs/TextInput/Adornments"; +import ArrowBackRoundedIcon from "@mui/icons-material/ArrowBackRounded"; +import PropTypes from "prop-types"; + +/** + * Renders the password step of the login process, including a password input field. + * + * @param {Object} props + * @param {Object} props.form - Form state object. + * @param {Object} props.errors - Object containing form validation errors. + * @param {Function} props.onSubmit - Callback function to handle form submission. + * @param {Function} props.onChange - Callback function to handle form input changes. + * @param {Function} props.onBack - Callback function to handle "Back" button click. + * @returns {JSX.Element} + */ +const PasswordStep = ({ form, errors, onSubmit, onChange, onBack }) => { + const theme = useTheme(); + const navigate = useNavigate(); + const inputRef = useRef(null); + const authState = useSelector((state) => state.auth); + + useEffect(() => { + if (inputRef.current) { + inputRef.current.focus(); + } + }, []); + + const handleNavigate = () => { + if (form.email !== "" && !errors.email) { + sessionStorage.setItem("email", form.email); + } + navigate("/forgot-password"); + }; + + return ( + <> + + + Log In + Enter your password + + + } + /> + + + + Continue + + + + + + Forgot password? + + + Reset password + + + + + ); +}; + +PasswordStep.propTypes = { + form: PropTypes.object.isRequired, + errors: PropTypes.object.isRequired, + onSubmit: PropTypes.func.isRequired, + onChange: PropTypes.func.isRequired, + onBack: PropTypes.func.isRequired, +}; + +export default PasswordStep \ No newline at end of file diff --git a/Client/src/Pages/Auth/Login/Login.jsx b/Client/src/Pages/Auth/Login/Login.jsx new file mode 100644 index 000000000..1b3a420ea --- /dev/null +++ b/Client/src/Pages/Auth/Login/Login.jsx @@ -0,0 +1,213 @@ +import { useState, useEffect } from "react"; +import { useNavigate } from "react-router-dom"; +import { Box, Stack, Typography } from "@mui/material"; +import { useTheme } from "@emotion/react"; +import { credentials } from "../../../Validation/validation"; +import { login } from "../../../Features/Auth/authSlice"; +import { useDispatch, useSelector } from "react-redux"; +import { createToast } from "../../../Utils/toastUtils"; +import { networkService } from "../../../main"; +import Background from "../../../assets/Images/background-grid.svg?react"; +import Logo from "../../../assets/icons/bwu-icon.svg?react"; +import { logger } from "../../../Utils/Logger"; +import "../index.css"; +import EmailStep from "./Components/EmailStep"; +import PasswordStep from "./Components/PasswordStep"; + +const DEMO = import.meta.env.VITE_APP_DEMO; + +/** + * Displays the login page. + */ + +const Login = () => { + const dispatch = useDispatch(); + const navigate = useNavigate(); + const theme = useTheme(); + + const authState = useSelector((state) => state.auth); + const { authToken } = authState; + + const idMap = { + "login-email-input": "email", + "login-password-input": "password", + }; + + const [form, setForm] = useState({ + email: DEMO !== undefined ? "uptimedemo@demo.com" : "", + password: DEMO !== undefined ? "Demouser1!" : "", + }); + const [errors, setErrors] = useState({}); + const [step, setStep] = useState(0); + + useEffect(() => { + if (authToken) { + navigate("/monitors"); + return; + } + networkService + .doesSuperAdminExist() + .then((response) => { + if (response.data.data === false) { + navigate("/register"); + } + }) + .catch((error) => { + logger.error(error); + }); + }, [authToken, navigate]); + + const handleChange = (event) => { + const { value, id } = event.target; + const name = idMap[id]; + setForm((prev) => ({ + ...prev, + [name]: value, + })); + + const { error } = credentials.validate({ [name]: value }, { abortEarly: false }); + + setErrors((prev) => { + const prevErrors = { ...prev }; + if (error) prevErrors[name] = error.details[0].message; + else delete prevErrors[name]; + return prevErrors; + }); + }; + + const handleSubmit = async (event) => { + event.preventDefault(); + + if (step === 0) { + const { error } = credentials.validate( + { email: form.email }, + { abortEarly: false } + ); + if (error) { + setErrors((prev) => ({ ...prev, email: error.details[0].message })); + createToast({ body: error.details[0].message }); + } else { + setStep(1); + } + } else if (step === 1) { + const { error } = credentials.validate(form, { abortEarly: false }); + + if (error) { + // validation errors + const newErrors = {}; + error.details.forEach((err) => { + newErrors[err.path[0]] = err.message; + }); + setErrors(newErrors); + createToast({ + body: + error.details && error.details.length > 0 + ? error.details[0].message + : "Error validating data.", + }); + } else { + const action = await dispatch(login(form)); + if (action.payload.success) { + navigate("/monitors"); + createToast({ + body: "Welcome back! You're successfully logged in.", + }); + } else { + if (action.payload) { + if (action.payload.msg === "Incorrect password") + setErrors({ + password: "The password you provided does not match our records", + }); + // dispatch errors + createToast({ + body: action.payload.msg, + }); + } else { + // unknown errors + createToast({ + body: "Unknown error.", + }); + } + } + } + } + }; + + return ( + + + + + + + BlueWave Uptime + + .MuiStack-root": { + border: 1, + borderRadius: theme.spacing(5), + borderColor: theme.palette.border.light, + backgroundColor: theme.palette.background.main, + padding: { + xs: theme.spacing(12), + sm: theme.spacing(20), + }, + }, + }} + > + {step === 0 ? ( + + ) : ( + step === 1 && ( + setStep(0)} + /> + ) + )} + + + ); +}; + +export default Login; From 7bef37f8c8a51076a5b940fdd05483043d30c1ad Mon Sep 17 00:00:00 2001 From: "Gorkem Cetin (BWL)" <167266851+gorkem-bwl@users.noreply.github.com> Date: Fri, 13 Dec 2024 11:11:40 -0500 Subject: [PATCH 087/178] Add coolify option --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d8bc39703..1ad7c6672 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ Usage instructions can be found [here](https://bluewavelabs.gitbook.io/checkmate ## πŸ› οΈ Installation -See installation instructions in [Checkmate documentation portal](https://bluewavelabs.gitbook.io/checkmate/quickstart). +See installation instructions in [Checkmate documentation portal](https://bluewavelabs.gitbook.io/checkmate/quickstart). Alternatively, you can also use [Coolify](https://coolify.io/) for a one click Docker deployment. ## πŸ’š Questions & ideas From fb127f5ba280dd8127cbeb9734e7ac4435e7a739 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 13 Dec 2024 17:31:01 +0000 Subject: [PATCH 088/178] fix(deps): update dependency mongoose to v8.9.0 --- Server/package-lock.json | 40 ++++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/Server/package-lock.json b/Server/package-lock.json index b07bda668..f1651cb87 100644 --- a/Server/package-lock.json +++ b/Server/package-lock.json @@ -660,9 +660,10 @@ } }, "node_modules/@mongodb-js/saslprep": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/@mongodb-js/saslprep/-/saslprep-1.1.7.tgz", - "integrity": "sha512-dCHW/oEX0KJ4NjDULBo3JiOaK5+6axtpBbS+ao2ZInoAL9/YRQLhXzSNAFz7hP4nzLkIqsfYAK/PDE3+XHny0Q==", + "version": "1.1.9", + "resolved": "https://registry.npmjs.org/@mongodb-js/saslprep/-/saslprep-1.1.9.tgz", + "integrity": "sha512-tVkljjeEaAhCqTzajSdgbQ6gE6f3oneVwa3iXR6csiEwXXOFsiC6Uh9iAjAhXPtqa/XMDHWjjeNH/77m/Yq2dw==", + "license": "MIT", "dependencies": { "sparse-bitfield": "^3.0.3" } @@ -1169,9 +1170,10 @@ } }, "node_modules/bson": { - "version": "6.7.0", - "resolved": "https://registry.npmjs.org/bson/-/bson-6.7.0.tgz", - "integrity": "sha512-w2IquM5mYzYZv6rs3uN2DZTOBe2a0zXLj53TGDqwF4l6Sz/XsISrisXOJihArF9+BZ6Cq/GjVht7Sjfmri7ytQ==", + "version": "6.10.1", + "resolved": "https://registry.npmjs.org/bson/-/bson-6.10.1.tgz", + "integrity": "sha512-P92xmHDQjSKPLHqFxefqMxASNq/aWJMEZugpCjf+AF/pgcUpMMQCg7t7+ewko0/u8AapvF3luf/FoehddEK+sA==", + "license": "Apache-2.0", "engines": { "node": ">=16.20.1" } @@ -3641,7 +3643,8 @@ "node_modules/memory-pager": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/memory-pager/-/memory-pager-1.5.0.tgz", - "integrity": "sha512-ZS4Bp4r/Zoeq6+NLJpP+0Zzm0pR8whtGPf1XExKLJBAczGMnSi3It14OiNCStjQjM6NU1okjQGSxgEZN8eBYKg==" + "integrity": "sha512-ZS4Bp4r/Zoeq6+NLJpP+0Zzm0pR8whtGPf1XExKLJBAczGMnSi3It14OiNCStjQjM6NU1okjQGSxgEZN8eBYKg==", + "license": "MIT" }, "node_modules/mensch": { "version": "0.3.4", @@ -4431,13 +4434,13 @@ } }, "node_modules/mongodb": { - "version": "6.10.0", - "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-6.10.0.tgz", - "integrity": "sha512-gP9vduuYWb9ZkDM546M+MP2qKVk5ZG2wPF63OvSRuUbqCR+11ZCAE1mOfllhlAG0wcoJY5yDL/rV3OmYEwXIzg==", + "version": "6.12.0", + "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-6.12.0.tgz", + "integrity": "sha512-RM7AHlvYfS7jv7+BXund/kR64DryVI+cHbVAy9P61fnb1RcWZqOW1/Wj2YhqMCx+MuYhqTRGv7AwHBzmsCKBfA==", "license": "Apache-2.0", "dependencies": { - "@mongodb-js/saslprep": "^1.1.5", - "bson": "^6.7.0", + "@mongodb-js/saslprep": "^1.1.9", + "bson": "^6.10.1", "mongodb-connection-string-url": "^3.0.0" }, "engines": { @@ -4445,7 +4448,7 @@ }, "peerDependencies": { "@aws-sdk/credential-providers": "^3.188.0", - "@mongodb-js/zstd": "^1.1.0", + "@mongodb-js/zstd": "^1.1.0 || ^2.0.0", "gcp-metadata": "^5.2.0", "kerberos": "^2.0.1", "mongodb-client-encryption": ">=6.0.0 <7", @@ -4486,14 +4489,14 @@ } }, "node_modules/mongoose": { - "version": "8.8.4", - "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-8.8.4.tgz", - "integrity": "sha512-yJbn695qCsqDO+xyPII29x2R7flzXhxCDv09mMZPSGllf0sm4jKw3E9s9uvQ9hjO6bL2xjU8KKowYqcY9eSTMQ==", + "version": "8.9.0", + "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-8.9.0.tgz", + "integrity": "sha512-b58zY3PLNBcoz6ZXFckr0leJcVVBMAOBvD+7Bj2ZjghAwntXmNnqwlDixTKQU3UYoQIGTv+AQx/0ThsvaeVrCA==", "license": "MIT", "dependencies": { - "bson": "^6.7.0", + "bson": "^6.10.1", "kareem": "2.6.3", - "mongodb": "~6.10.0", + "mongodb": "~6.12.0", "mpath": "0.9.0", "mquery": "5.0.0", "ms": "2.1.3", @@ -6175,6 +6178,7 @@ "version": "3.0.3", "resolved": "https://registry.npmjs.org/sparse-bitfield/-/sparse-bitfield-3.0.3.tgz", "integrity": "sha512-kvzhi7vqKTfkh0PZU+2D2PIllw2ymqJKujUcyPMd9Y75Nv4nPbGJZXNhxsgdQab2BmlDct1YnfQCguEvHr7VsQ==", + "license": "MIT", "dependencies": { "memory-pager": "^1.0.2" } From 0cfb08d03a51d2dc406db338ada61070bdbf59e1 Mon Sep 17 00:00:00 2001 From: "Gorkem Cetin (BWL)" <167266851+gorkem-bwl@users.noreply.github.com> Date: Fri, 13 Dec 2024 13:20:33 -0500 Subject: [PATCH 089/178] Mention good-first-issue --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1ad7c6672..080efe0d3 100644 --- a/README.md +++ b/README.md @@ -79,7 +79,7 @@ We pride ourselves on building strong connections with contributors at every lev Here's how you can contribute: 0. Star this repo :) -1. Check [Contributor's guideline](https://github.com/bluewave-labs/bluewave-uptime/blob/master/CONTRIBUTING.md). +1. Check [Contributor's guideline](https://github.com/bluewave-labs/bluewave-uptime/blob/master/CONTRIBUTING.md). First timers are encouraged to check `good-first-issue` tag. 2. Have a look at our Figma designs [here](https://www.figma.com/design/RPSfaw66HjzSwzntKcgDUV/Uptime-Genie?node-id=0-1&t=WqOFv9jqNTFGItpL-1). We encourage you to copy to your own Figma page, then work on it as it is read-only. 3. Open an issue if you believe you've encountered a bug 4. Check for good-first-issue's if you are a newcomer From 2e970f6f845427915667068538e6700d52766dca Mon Sep 17 00:00:00 2001 From: "Gorkem Cetin (BWL)" <167266851+gorkem-bwl@users.noreply.github.com> Date: Fri, 13 Dec 2024 15:18:23 -0500 Subject: [PATCH 090/178] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 080efe0d3..34f408182 100644 --- a/README.md +++ b/README.md @@ -74,7 +74,7 @@ If you have any questions, suggestions or comments, please use our [Discord chan ## 🀝 Contributing -We pride ourselves on building strong connections with contributors at every level. Despite being a young project, Checkmate has already earned 1500 stars and attracted 35+ contributors from around the globe. So, don’t hold back β€” jump in, contribute and learn with us! +We pride ourselves on building strong connections with contributors at every level. Despite being a young project, Checkmate has already earned 1900 stars and attracted 35+ contributors from around the globe. So, don’t hold back β€” jump in, contribute and learn with us! Here's how you can contribute: From 946e74aeab8d4dc53a38e6329e86d1049936ae5d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 13 Dec 2024 21:15:02 +0000 Subject: [PATCH 091/178] chore(deps): bump nanoid from 3.3.7 to 3.3.8 in /Server Bumps [nanoid](https://github.com/ai/nanoid) from 3.3.7 to 3.3.8. - [Release notes](https://github.com/ai/nanoid/releases) - [Changelog](https://github.com/ai/nanoid/blob/main/CHANGELOG.md) - [Commits](https://github.com/ai/nanoid/compare/3.3.7...3.3.8) --- updated-dependencies: - dependency-name: nanoid dependency-type: indirect ... Signed-off-by: dependabot[bot] --- Server/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Server/package-lock.json b/Server/package-lock.json index b07bda668..60f5718ff 100644 --- a/Server/package-lock.json +++ b/Server/package-lock.json @@ -4627,9 +4627,9 @@ "optional": true }, "node_modules/nanoid": { - "version": "3.3.7", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", - "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==", + "version": "3.3.8", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.8.tgz", + "integrity": "sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w==", "funding": [ { "type": "github", From 2628f2ae3280fd40dce37158206d1df61d68489e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mert=20=C5=9Ei=C5=9Fmano=C4=9Flu?= Date: Sat, 14 Dec 2024 00:27:26 +0300 Subject: [PATCH 092/178] chore(renovate): Add 'labels' to renovate.json for adding 'dependencies' label on automated PRs --- renovate.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/renovate.json b/renovate.json index 5db72dd6a..adfd80a40 100644 --- a/renovate.json +++ b/renovate.json @@ -2,5 +2,6 @@ "$schema": "https://docs.renovatebot.com/renovate-schema.json", "extends": [ "config:recommended" - ] + ], + "labels": ["dependencies"] } From 7d7c616a739b6e11305fffae052f34064ce03585 Mon Sep 17 00:00:00 2001 From: Caio Cabral Date: Fri, 13 Dec 2024 17:56:37 -0500 Subject: [PATCH 093/178] fix: function not called --- Client/src/Pages/AdvancedSettings/index.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Client/src/Pages/AdvancedSettings/index.jsx b/Client/src/Pages/AdvancedSettings/index.jsx index 14ecb6f8f..433829f28 100644 --- a/Client/src/Pages/AdvancedSettings/index.jsx +++ b/Client/src/Pages/AdvancedSettings/index.jsx @@ -18,7 +18,7 @@ import { useIsAdmin } from "../../Hooks/useIsAdmin"; const AdvancedSettings = () => { const navigate = useNavigate(); - const isAdmin = useIsAdmin; + const isAdmin = useIsAdmin(); useEffect(() => { if (!isAdmin) { navigate("/"); From 528bc0b1e0dbc4b9252cb40b9a06dcfac52fec40 Mon Sep 17 00:00:00 2001 From: "Gorkem Cetin (BWL)" <167266851+gorkem-bwl@users.noreply.github.com> Date: Fri, 13 Dec 2024 19:04:29 -0500 Subject: [PATCH 094/178] Update pull_request_template.md --- .github/PULL_REQUEST_TEMPLATE/pull_request_template.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md b/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md index 55d456545..c6383fbe2 100644 --- a/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md +++ b/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md @@ -8,7 +8,8 @@ Mention the issue number(s) this PR addresses (e.g., #123). ## Please ensure all items are checked off before requesting a review: -- [ ] I have performed a self-review of my code. +- [ ] I deployed the application locally. +- [ ] I have performed a self-review and testing of my code. - [ ] I have included the issue # in the PR. - [ ] I have labelled the PR correctly. - [ ] The issue I am working on is assigned to me. @@ -17,5 +18,3 @@ Mention the issue number(s) this PR addresses (e.g., #123). - [ ] My PR is granular and targeted to one specific feature. - [ ] I took a screenshot or a video and attached to this PR if there is a UI change. - - From ab0d1ab469eb3c91da5d77aee8d09a13f80f5e40 Mon Sep 17 00:00:00 2001 From: "Gorkem Cetin (BWL)" <167266851+gorkem-bwl@users.noreply.github.com> Date: Fri, 13 Dec 2024 21:04:21 -0500 Subject: [PATCH 095/178] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 34f408182..868689af8 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ **Need support or have a suggestion? Check our [Discord channel](https://discord.gg/NAb6H3UTjK)** +**Checkmate is on [GitHub trending](https://github.com/trending) and #1 trending for JavaScript apps on Fri Dec 13!** + ![](https://img.shields.io/github/license/bluewave-labs/bluewave-uptime) ![](https://img.shields.io/github/repo-size/bluewave-labs/bluewave-uptime) ![](https://img.shields.io/github/commit-activity/w/bluewave-labs/bluewave-uptime) From 09644dfcfeafa17faeca8223c9798cfb9c8b1675 Mon Sep 17 00:00:00 2001 From: "Gorkem Cetin (BWL)" <167266851+gorkem-bwl@users.noreply.github.com> Date: Fri, 13 Dec 2024 22:45:50 -0500 Subject: [PATCH 096/178] Add links to 2 documents for contributors --- README.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 868689af8..1371e203d 100644 --- a/README.md +++ b/README.md @@ -82,10 +82,11 @@ Here's how you can contribute: 0. Star this repo :) 1. Check [Contributor's guideline](https://github.com/bluewave-labs/bluewave-uptime/blob/master/CONTRIBUTING.md). First timers are encouraged to check `good-first-issue` tag. -2. Have a look at our Figma designs [here](https://www.figma.com/design/RPSfaw66HjzSwzntKcgDUV/Uptime-Genie?node-id=0-1&t=WqOFv9jqNTFGItpL-1). We encourage you to copy to your own Figma page, then work on it as it is read-only. -3. Open an issue if you believe you've encountered a bug -4. Check for good-first-issue's if you are a newcomer -5. Make a pull request to add new features/make quality-of-life improvements/fix bugs. +2. Optionally, read [project structure](https://bluewavelabs.gitbook.io/checkmate/developers-guide/general-project-structure) and [high level overview](https://bluewavelabs.gitbook.io/checkmate/developers-guide/high-level-overview). +3. Have a look at our Figma designs [here](https://www.figma.com/design/RPSfaw66HjzSwzntKcgDUV/Uptime-Genie?node-id=0-1&t=WqOFv9jqNTFGItpL-1) if you are going to use one of our designs. We encourage you to copy to your own Figma page, then work on it as it is read-only. +4. Open an issue if you believe you've encountered a bug. +5. Check for good-first-issue's if you are a newcomer. +6. Make a pull request to add new features/make quality-of-life improvements/fix bugs. From 425358e1e3477f4545658e41ca5aefd6decc83d1 Mon Sep 17 00:00:00 2001 From: "Gorkem Cetin (BWL)" <167266851+gorkem-bwl@users.noreply.github.com> Date: Sat, 14 Dec 2024 10:12:22 -0500 Subject: [PATCH 097/178] Thank you for 2000 stars! --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 1371e203d..5435b3429 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,9 @@ **Checkmate is on [GitHub trending](https://github.com/trending) and #1 trending for JavaScript apps on Fri Dec 13!** +![1](https://github.com/user-attachments/assets/a4f9842e-c9d9-4672-badb-79a5eccbbf3a) + + ![](https://img.shields.io/github/license/bluewave-labs/bluewave-uptime) ![](https://img.shields.io/github/repo-size/bluewave-labs/bluewave-uptime) ![](https://img.shields.io/github/commit-activity/w/bluewave-labs/bluewave-uptime) From c6ce6274957a80f9de5acd3491d2edd8b7c933ce Mon Sep 17 00:00:00 2001 From: "Gorkem Cetin (BWL)" <167266851+gorkem-bwl@users.noreply.github.com> Date: Sat, 14 Dec 2024 11:53:53 -0500 Subject: [PATCH 098/178] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5435b3429..8ef740dbb 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -**Need support or have a suggestion? Check our [Discord channel](https://discord.gg/NAb6H3UTjK)** +**Need support or have a suggestion? Check our [Discord channel](https://discord.gg/NAb6H3UTjK) or [Discussions](https://github.com/bluewave-labs/checkmate/discussions) forum.** **Checkmate is on [GitHub trending](https://github.com/trending) and #1 trending for JavaScript apps on Fri Dec 13!** From 1b0e7ddd500ce43b402aa8af16af57c7f9d18280 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Sat, 14 Dec 2024 21:10:32 +0000 Subject: [PATCH 099/178] fix(deps): update dependency bullmq to v5.34.2 --- Server/package-lock.json | 8 ++++---- Server/package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Server/package-lock.json b/Server/package-lock.json index b07bda668..4637f5c81 100644 --- a/Server/package-lock.json +++ b/Server/package-lock.json @@ -11,7 +11,7 @@ "dependencies": { "axios": "^1.7.2", "bcrypt": "^5.1.1", - "bullmq": "5.34.0", + "bullmq": "5.34.2", "cors": "^2.8.5", "dockerode": "4.0.2", "dotenv": "^16.4.5", @@ -1221,9 +1221,9 @@ } }, "node_modules/bullmq": { - "version": "5.34.0", - "resolved": "https://registry.npmjs.org/bullmq/-/bullmq-5.34.0.tgz", - "integrity": "sha512-TyzeYDkIGkooYUn/P1CeiJW3Am1TboC3unwhlg1cJIwKksoyuRp97TkHyCZcwLchXbYCUtsGBZFUYf/lTAhdSg==", + "version": "5.34.2", + "resolved": "https://registry.npmjs.org/bullmq/-/bullmq-5.34.2.tgz", + "integrity": "sha512-eUzeCswrKbQDE1WY8h4ZTBtynOzCU5qx9felFdYOmIJrsy0warDahHKUiCZ6dUCs6ZxYMGtcaciIMcAf1L54yw==", "license": "MIT", "dependencies": { "cron-parser": "^4.6.0", diff --git a/Server/package.json b/Server/package.json index 154f67437..b1fbe27ea 100644 --- a/Server/package.json +++ b/Server/package.json @@ -14,7 +14,7 @@ "dependencies": { "axios": "^1.7.2", "bcrypt": "^5.1.1", - "bullmq": "5.34.0", + "bullmq": "5.34.2", "cors": "^2.8.5", "dockerode": "4.0.2", "dotenv": "^16.4.5", From cd2076ff16dc211fbb1f1956684aaad618fd7855 Mon Sep 17 00:00:00 2001 From: "Gorkem Cetin (BWL)" <167266851+gorkem-bwl@users.noreply.github.com> Date: Sat, 14 Dec 2024 20:50:03 -0500 Subject: [PATCH 100/178] Update: stress testing for 1000+ servers at the same time --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8ef740dbb..1462bbd3a 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,9 @@ Checkmate is an open source uptime manager, server & Docker monitoring tool used to track the operational status and performance of servers and websites. It regularly checks whether a server/website is accessible and performs optimally, providing real-time alerts and reports on the monitored services' availability, downtime, and response time. -Checkmate also has an agent, called [Capture](https://github.com/bluewave-labs/capture), to retrieve data from remote servers. While Capture is not required to run Checkmate, it provides additional insigths about your servers' CPU, RAM, disk and temperature status. +Checkmate also has an agent, called [Capture](https://github.com/bluewave-labs/capture), to retrieve data from remote servers. While Capture is not required to run Checkmate, it provides additional insigths about your servers' CPU, RAM, disk and temperature status. + +We've run stress tests with 1000+ active monitors without any particular issues or performance bottlenecks. We **love** what we are building here, and learn a few things about Reactjs, Nodejs, MongoDB and Docker while building Checkmate. **If you would like to support us, please consider giving it a ⭐, think about contributing or providing feedback.** Please note that we do not operate a monetary donation program, make money by deploying servers, or run a SaaS business. From a0289d1893fee018fbe6a06d0b56b75d3bc2f0a8 Mon Sep 17 00:00:00 2001 From: "Gorkem Cetin (BWL)" <167266851+gorkem-bwl@users.noreply.github.com> Date: Sat, 14 Dec 2024 20:55:51 -0500 Subject: [PATCH 101/178] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 1462bbd3a..92866185f 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,7 @@ If you have any questions, suggestions or comments, please use our [Discord chan - Incidents at a glance - E-mail notifications - Scheduled maintenance +- Can monitor 1000+ servers at the same time on a moderate server **Short term roadmap:** From 55225ad2212df49e25f8cb7fb83d83b318386fcf Mon Sep 17 00:00:00 2001 From: Peter Carl Pardo Date: Sun, 15 Dec 2024 23:11:50 +0800 Subject: [PATCH 102/178] feat: initial dark theme switch component --- .../Components/ThemeSwitch/SunAndMoonIcon.jsx | 95 +++++++++++++++++++ Client/src/Components/ThemeSwitch/index.css | 77 +++++++++++++++ Client/src/Components/ThemeSwitch/index.jsx | 49 ++++++++++ Client/src/index.css | 1 + 4 files changed, 222 insertions(+) create mode 100644 Client/src/Components/ThemeSwitch/SunAndMoonIcon.jsx create mode 100644 Client/src/Components/ThemeSwitch/index.css create mode 100644 Client/src/Components/ThemeSwitch/index.jsx diff --git a/Client/src/Components/ThemeSwitch/SunAndMoonIcon.jsx b/Client/src/Components/ThemeSwitch/SunAndMoonIcon.jsx new file mode 100644 index 000000000..91d54df22 --- /dev/null +++ b/Client/src/Components/ThemeSwitch/SunAndMoonIcon.jsx @@ -0,0 +1,95 @@ +import "./index.css"; + +const SunAndMoonIcon = () => { + return ( + + ); +}; + +export default SunAndMoonIcon; diff --git a/Client/src/Components/ThemeSwitch/index.css b/Client/src/Components/ThemeSwitch/index.css new file mode 100644 index 000000000..23a76bc2c --- /dev/null +++ b/Client/src/Components/ThemeSwitch/index.css @@ -0,0 +1,77 @@ +.sun-and-moon > :is(.moon, .sun, .sun-beams) { + transform-origin: center; +} + +.sun-and-moon > :is(.moon, .sun) { + fill: var(--icon-fill); +} + +.theme-toggle:is(:hover, :focus-visible) > .sun-and-moon > :is(.moon, .sun) { + fill: var(--icon-fill-hover); +} + +.sun-and-moon > .sun-beams { + stroke: var(--icon-fill); + stroke-width: 2px; +} + +.theme-toggle:is(:hover, :focus-visible) .sun-and-moon > .sun-beams { + stroke: var(--icon-fill-hover); +} + +[data-theme="dark"] .sun-and-moon > .sun { + transform: scale(1.75); +} + +[data-theme="dark"] .sun-and-moon > .sun-beams { + opacity: 0; +} + +[data-theme="dark"] .sun-and-moon > .moon > circle { + transform: translateX(-7px); +} + +@supports (cx: 1) { + [data-theme="dark"] .sun-and-moon > .moon > circle { + cx: 17; + transform: translateX(0); + } +} + +@media (prefers-reduced-motion: no-preference) { + .sun-and-moon > .sun { + transition: transform 0.5s var(--ease-elastic-3); + } + + .sun-and-moon > .sun-beams { + transition: + transform 0.5s var(--ease-elastic-4), + opacity 0.5s var(--ease-3); + } + + .sun-and-moon .moon > circle { + transition: transform 0.25s var(--ease-out-5); + } + + @supports (cx: 1) { + .sun-and-moon .moon > circle { + transition: cx 0.25s var(--ease-out-5); + } + } + + [data-theme="dark"] .sun-and-moon > .sun { + transition-timing-function: var(--ease-3); + transition-duration: 0.25s; + transform: scale(1.75); + } + + [data-theme="dark"] .sun-and-moon > .sun-beams { + transition-duration: 0.15s; + transform: rotateZ(-25deg); + } + + [data-theme="dark"] .sun-and-moon > .moon > circle { + transition-duration: 0.5s; + transition-delay: 0.25s; + } +} diff --git a/Client/src/Components/ThemeSwitch/index.jsx b/Client/src/Components/ThemeSwitch/index.jsx new file mode 100644 index 000000000..b25b72218 --- /dev/null +++ b/Client/src/Components/ThemeSwitch/index.jsx @@ -0,0 +1,49 @@ +import React, { useEffect, useState } from "react"; +// import "./index.css"; +import { IconButton } from "@mui/material"; +import SunAndMoonIcon from "./SunAndMoonIcon"; +// import SunAndMoonIcon from "./SunAndMoonIcon"; + +const ThemeSwitch = () => { + const [currentTheme, setCurrentTheme] = useState("light"); + const toggleTheme = () => + setCurrentTheme((prevState) => (prevState === "light" ? "dark" : "light")); + + useEffect(() => { + document.body.setAttribute("data-theme", currentTheme); + console.log(currentTheme); + }, [currentTheme]); + + return ( + circle": { + // transform: currentTheme === "dark" ? "translateX(-7px)" : "none", + // transition: "transform 0.25s ease", + // }, + }} + > + + + ); +}; + +export default ThemeSwitch; diff --git a/Client/src/index.css b/Client/src/index.css index 173551ba6..f821df6ee 100644 --- a/Client/src/index.css +++ b/Client/src/index.css @@ -1,4 +1,5 @@ @import url("https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap"); +@import "https://unpkg.com/open-props/easings.min.css"; * { box-sizing: border-box; From 6d6a13a833be75c11557be54f7c0fd55709c331f Mon Sep 17 00:00:00 2001 From: Peter Carl Pardo Date: Sun, 15 Dec 2024 23:46:16 +0800 Subject: [PATCH 103/178] feat: fix sun beams icon bug --- Client/src/Components/ThemeSwitch/index.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Client/src/Components/ThemeSwitch/index.css b/Client/src/Components/ThemeSwitch/index.css index 23a76bc2c..2f3814702 100644 --- a/Client/src/Components/ThemeSwitch/index.css +++ b/Client/src/Components/ThemeSwitch/index.css @@ -10,7 +10,7 @@ fill: var(--icon-fill-hover); } -.sun-and-moon > .sun-beams { +.theme-toggle .sun-and-moon > .sun-beams { stroke: var(--icon-fill); stroke-width: 2px; } From dd488fecb42c35e1153e552db1fc2c724856f298 Mon Sep 17 00:00:00 2001 From: Peter Carl Pardo Date: Sun, 15 Dec 2024 23:50:48 +0800 Subject: [PATCH 104/178] feat: cleanup --- Client/src/Components/ThemeSwitch/index.jsx | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/Client/src/Components/ThemeSwitch/index.jsx b/Client/src/Components/ThemeSwitch/index.jsx index b25b72218..533b026b2 100644 --- a/Client/src/Components/ThemeSwitch/index.jsx +++ b/Client/src/Components/ThemeSwitch/index.jsx @@ -1,8 +1,7 @@ import React, { useEffect, useState } from "react"; -// import "./index.css"; +import "./index.css"; import { IconButton } from "@mui/material"; import SunAndMoonIcon from "./SunAndMoonIcon"; -// import SunAndMoonIcon from "./SunAndMoonIcon"; const ThemeSwitch = () => { const [currentTheme, setCurrentTheme] = useState("light"); @@ -11,7 +10,6 @@ const ThemeSwitch = () => { useEffect(() => { document.body.setAttribute("data-theme", currentTheme); - console.log(currentTheme); }, [currentTheme]); return ( @@ -27,18 +25,6 @@ const ThemeSwitch = () => { display: "flex", alignItems: "center", justifyContent: "center", - // "& .sun-and-moon": { - // transformOrigin: "center", - // }, - // "& .sun": { - // fill: "var(--icon-fill)", - // transition: "transform 0.5s ease", - // ...(currentTheme === "dark" && { transform: "scale(1.75)" }), - // }, - // "& .moon > circle": { - // transform: currentTheme === "dark" ? "translateX(-7px)" : "none", - // transition: "transform 0.25s ease", - // }, }} > From efa106f732878917d54dae7ea2620154ffdeb321 Mon Sep 17 00:00:00 2001 From: Peter Carl Pardo Date: Sun, 15 Dec 2024 23:51:53 +0800 Subject: [PATCH 105/178] feat: add comment for temporary theme logic --- Client/src/Components/ThemeSwitch/index.jsx | 1 + 1 file changed, 1 insertion(+) diff --git a/Client/src/Components/ThemeSwitch/index.jsx b/Client/src/Components/ThemeSwitch/index.jsx index 533b026b2..e5758eab1 100644 --- a/Client/src/Components/ThemeSwitch/index.jsx +++ b/Client/src/Components/ThemeSwitch/index.jsx @@ -4,6 +4,7 @@ import { IconButton } from "@mui/material"; import SunAndMoonIcon from "./SunAndMoonIcon"; const ThemeSwitch = () => { + // TODO: change to use the MUI theme const [currentTheme, setCurrentTheme] = useState("light"); const toggleTheme = () => setCurrentTheme((prevState) => (prevState === "light" ? "dark" : "light")); From a97b2f0887d0c44cda362f149c401a1826f6bced Mon Sep 17 00:00:00 2001 From: Peter Carl Pardo Date: Sun, 15 Dec 2024 23:52:07 +0800 Subject: [PATCH 106/178] feat: cleanup --- Client/src/Components/ThemeSwitch/index.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Client/src/Components/ThemeSwitch/index.jsx b/Client/src/Components/ThemeSwitch/index.jsx index e5758eab1..df3c813ab 100644 --- a/Client/src/Components/ThemeSwitch/index.jsx +++ b/Client/src/Components/ThemeSwitch/index.jsx @@ -1,7 +1,7 @@ import React, { useEffect, useState } from "react"; -import "./index.css"; import { IconButton } from "@mui/material"; import SunAndMoonIcon from "./SunAndMoonIcon"; +import "./index.css"; const ThemeSwitch = () => { // TODO: change to use the MUI theme From 7cbeb7518671342b4cbadad5f6e9c2c545f45b0d Mon Sep 17 00:00:00 2001 From: "Gorkem Cetin (BWL)" <167266851+gorkem-bwl@users.noreply.github.com> Date: Sun, 15 Dec 2024 14:45:57 -0500 Subject: [PATCH 107/178] Update README.md --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 92866185f..9e99985c4 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,8 @@ **Need support or have a suggestion? Check our [Discord channel](https://discord.gg/NAb6H3UTjK) or [Discussions](https://github.com/bluewave-labs/checkmate/discussions) forum.** -**Checkmate is on [GitHub trending](https://github.com/trending) and #1 trending for JavaScript apps on Fri Dec 13!** - -![1](https://github.com/user-attachments/assets/a4f9842e-c9d9-4672-badb-79a5eccbbf3a) +**Checkmate is on [GitHub trending](https://github.com/trending) and #1 trending for JavaScript apps on Fri Dec 13th & 15th** +2300 ![](https://img.shields.io/github/license/bluewave-labs/bluewave-uptime) ![](https://img.shields.io/github/repo-size/bluewave-labs/bluewave-uptime) From 265af611006ab53f54e3ce0721998dd40173a9c2 Mon Sep 17 00:00:00 2001 From: "Gorkem Cetin (BWL)" <167266851+gorkem-bwl@users.noreply.github.com> Date: Sun, 15 Dec 2024 15:09:33 -0500 Subject: [PATCH 108/178] Add a warning line in pull_request_template.md --- .github/PULL_REQUEST_TEMPLATE/pull_request_template.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md b/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md index c6383fbe2..b966a8cc6 100644 --- a/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md +++ b/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md @@ -1,6 +1,8 @@ +**(when sending your PR, only remove this line. Do not remove any lines below. Check all the items before sending your PR)** + ## Describe your changes -Briefly describe the changes you made and their purpose. +Briefly describe the changes you made and their purpose. ## Issue number From 3ab8b1241e950599571c7abb5250f8c1e5d72652 Mon Sep 17 00:00:00 2001 From: Peter Carl Pardo Date: Mon, 16 Dec 2024 14:05:56 +0800 Subject: [PATCH 109/178] feat: Add theme switch in login page --- Client/src/Pages/Auth/Login.jsx | 49 ++++++++++++++++----------------- 1 file changed, 23 insertions(+), 26 deletions(-) diff --git a/Client/src/Pages/Auth/Login.jsx b/Client/src/Pages/Auth/Login.jsx index a7554a7c1..b07f7aa84 100644 --- a/Client/src/Pages/Auth/Login.jsx +++ b/Client/src/Pages/Auth/Login.jsx @@ -17,6 +17,7 @@ import ArrowBackRoundedIcon from "@mui/icons-material/ArrowBackRounded"; import PropTypes from "prop-types"; import { logger } from "../../Utils/Logger"; import "./index.css"; +import ThemeSwitch from "../../Components/ThemeSwitch"; const DEMO = import.meta.env.VITE_APP_DEMO; /** @@ -327,33 +328,25 @@ const StepTwo = ({ form, errors, onSubmit, onChange, onBack }) => { - - - Forgot password? - - - Reset password - - + + + Forgot password? + + + Reset password + + ); }; @@ -520,6 +513,7 @@ const Login = () => { px={{ xs: theme.spacing(12), lg: theme.spacing(20) }} pb={theme.spacing(20)} mx="auto" + gap={theme.spacing(8)} sx={{ "& > .MuiStack-root": { border: 1, @@ -554,6 +548,9 @@ const Login = () => { /> ) )} + + + ); From cdcefb1106744323cec9c00c1c946f17d8165235 Mon Sep 17 00:00:00 2001 From: Peter Carl Pardo Date: Mon, 16 Dec 2024 14:16:58 +0800 Subject: [PATCH 110/178] feat: add theme switch in sidebar --- Client/src/Components/Sidebar/index.jsx | 48 ++++++++++++++----------- 1 file changed, 28 insertions(+), 20 deletions(-) diff --git a/Client/src/Components/Sidebar/index.jsx b/Client/src/Components/Sidebar/index.jsx index 95abe1d20..feed25f24 100644 --- a/Client/src/Components/Sidebar/index.jsx +++ b/Client/src/Components/Sidebar/index.jsx @@ -21,6 +21,7 @@ import { useDispatch, useSelector } from "react-redux"; import { clearAuthState } from "../../Features/Auth/authSlice"; import { toggleSidebar } from "../../Features/UI/uiSlice"; import { clearUptimeMonitorState } from "../../Features/UptimeMonitors/uptimeMonitorsSlice"; +import ThemeSwitch from "../ThemeSwitch"; import Avatar from "../Avatar"; import LockSvg from "../../assets/icons/lock.svg?react"; import UserSvg from "../../assets/icons/user.svg?react"; @@ -551,28 +552,35 @@ function Sidebar() { {authState.user?.role} - - openPopup(event, "logout")} + + - - - + openPopup(event, "logout")} + > + + + + )} Date: Mon, 16 Dec 2024 14:28:58 +0800 Subject: [PATCH 111/178] cleanup --- Client/src/Pages/Auth/Login.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Client/src/Pages/Auth/Login.jsx b/Client/src/Pages/Auth/Login.jsx index b07f7aa84..f007600f7 100644 --- a/Client/src/Pages/Auth/Login.jsx +++ b/Client/src/Pages/Auth/Login.jsx @@ -548,7 +548,7 @@ const Login = () => { /> ) )} - + From e30b64bed3f73f579e8eaf2353008c11b23dd599 Mon Sep 17 00:00:00 2001 From: Shalini M Date: Mon, 16 Dec 2024 17:08:27 +0530 Subject: [PATCH 112/178] Changed the avatar color to checkmate blue color --- Client/src/Components/Avatar/index.jsx | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/Client/src/Components/Avatar/index.jsx b/Client/src/Components/Avatar/index.jsx index 3760c04b8..18bb6be47 100644 --- a/Client/src/Components/Avatar/index.jsx +++ b/Client/src/Components/Avatar/index.jsx @@ -9,19 +9,8 @@ import { useEffect, useState } from "react"; * @returns {string} */ const stringToColor = (string) => { - let hash = 0; - let i; - for (i = 0; i < string.length; i += 1) { - hash = string.charCodeAt(i) + ((hash << 5) - hash); - } - let color = "#"; - for (i = 0; i < 3; i += 1) { - const value = (hash >> (i * 8)) & 0xff; - color += `00${value.toString(16)}`.slice(-2); - } - - return color; + return "#156EEF"; }; /** From 37f74271aaa33aa0b9cdbbb53b3a342a3b4e146e Mon Sep 17 00:00:00 2001 From: "Gorkem Cetin (BWL)" <167266851+gorkem-bwl@users.noreply.github.com> Date: Mon, 16 Dec 2024 09:24:39 -0500 Subject: [PATCH 113/178] 2500 * --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9e99985c4..99600f617 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ **Checkmate is on [GitHub trending](https://github.com/trending) and #1 trending for JavaScript apps on Fri Dec 13th & 15th** -2300 +Frame 34 ![](https://img.shields.io/github/license/bluewave-labs/bluewave-uptime) ![](https://img.shields.io/github/repo-size/bluewave-labs/bluewave-uptime) From 69ef798f603154597d70b0a11d6827edf192e260 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 16 Dec 2024 16:57:03 +0000 Subject: [PATCH 114/178] chore(deps): update dependency @types/react to v18.3.17 --- Client/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Client/package-lock.json b/Client/package-lock.json index dfc221fc4..603e30ae0 100644 --- a/Client/package-lock.json +++ b/Client/package-lock.json @@ -2372,9 +2372,9 @@ "license": "MIT" }, "node_modules/@types/react": { - "version": "18.3.16", - "resolved": "https://registry.npmjs.org/@types/react/-/react-18.3.16.tgz", - "integrity": "sha512-oh8AMIC4Y2ciKufU8hnKgs+ufgbA/dhPTACaZPM86AbwX9QwnFtSoPWEeRUj8fge+v6kFt78BXcDhAU1SrrAsw==", + "version": "18.3.17", + "resolved": "https://registry.npmjs.org/@types/react/-/react-18.3.17.tgz", + "integrity": "sha512-opAQ5no6LqJNo9TqnxBKsgnkIYHozW9KSTlFVoSUJYh1Fl/sswkEoqIugRSm7tbh6pABtYjGAjW+GOS23j8qbw==", "license": "MIT", "dependencies": { "@types/prop-types": "*", From 663f2334d1c703bb67bbf3c2fb2a9d995e859304 Mon Sep 17 00:00:00 2001 From: Peter Carl Pardo Date: Tue, 17 Dec 2024 01:24:15 +0800 Subject: [PATCH 115/178] feat: added dark mode functionality --- .../Components/ThemeSwitch/SunAndMoonIcon.jsx | 11 +++++++---- Client/src/Components/ThemeSwitch/index.css | 13 ------------- Client/src/Components/ThemeSwitch/index.jsx | 16 ++++++++++------ 3 files changed, 17 insertions(+), 23 deletions(-) diff --git a/Client/src/Components/ThemeSwitch/SunAndMoonIcon.jsx b/Client/src/Components/ThemeSwitch/SunAndMoonIcon.jsx index 91d54df22..820daeb3f 100644 --- a/Client/src/Components/ThemeSwitch/SunAndMoonIcon.jsx +++ b/Client/src/Components/ThemeSwitch/SunAndMoonIcon.jsx @@ -1,6 +1,9 @@ +import { useTheme } from "@mui/material"; import "./index.css"; const SunAndMoonIcon = () => { + const theme = useTheme(); + return ( { y="0" width="100%" height="100%" - fill="white" + fill="#fff" /> { cx="12" cy="12" r="6" - fill="currentColor" + fill={theme.palette.text.secondary} mask="url(#moon-mask)" /> :is(.moon, .sun) { - fill: var(--icon-fill); -} - -.theme-toggle:is(:hover, :focus-visible) > .sun-and-moon > :is(.moon, .sun) { - fill: var(--icon-fill-hover); -} - .theme-toggle .sun-and-moon > .sun-beams { - stroke: var(--icon-fill); stroke-width: 2px; } -.theme-toggle:is(:hover, :focus-visible) .sun-and-moon > .sun-beams { - stroke: var(--icon-fill-hover); -} - [data-theme="dark"] .sun-and-moon > .sun { transform: scale(1.75); } diff --git a/Client/src/Components/ThemeSwitch/index.jsx b/Client/src/Components/ThemeSwitch/index.jsx index df3c813ab..1e98dfe27 100644 --- a/Client/src/Components/ThemeSwitch/index.jsx +++ b/Client/src/Components/ThemeSwitch/index.jsx @@ -2,16 +2,20 @@ import React, { useEffect, useState } from "react"; import { IconButton } from "@mui/material"; import SunAndMoonIcon from "./SunAndMoonIcon"; import "./index.css"; +import { useDispatch, useSelector } from "react-redux"; +import { setMode } from "../../Features/UI/uiSlice"; const ThemeSwitch = () => { - // TODO: change to use the MUI theme - const [currentTheme, setCurrentTheme] = useState("light"); - const toggleTheme = () => - setCurrentTheme((prevState) => (prevState === "light" ? "dark" : "light")); + const mode = useSelector((state) => state.ui.mode); + const dispatch = useDispatch(); + + const toggleTheme = () => { + dispatch(setMode(mode === "light" ? "dark" : "light")); + }; useEffect(() => { - document.body.setAttribute("data-theme", currentTheme); - }, [currentTheme]); + document.body.setAttribute("data-theme", mode); + }, [mode]); return ( Date: Mon, 16 Dec 2024 18:59:29 +0000 Subject: [PATCH 116/178] modified radio button visibility --- Client/src/Components/Inputs/Radio/index.jsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Client/src/Components/Inputs/Radio/index.jsx b/Client/src/Components/Inputs/Radio/index.jsx index 7a700e2b7..6291485f0 100644 --- a/Client/src/Components/Inputs/Radio/index.jsx +++ b/Client/src/Components/Inputs/Radio/index.jsx @@ -42,6 +42,9 @@ const Radio = (props) => { width: 16, height: 16, boxShadow: `inset 0 0 0 1px ${theme.palette.secondary.main}`, + "&:not(.Mui-checked)": { + boxShadow: `inset 0 0 0 1px ${theme.palette.text.primary}70`, // Use theme text color for the outline + }, mt: theme.spacing(0.5), }} /> From 0022d839dfefcd58b43d8f995f89f2dd3d891b19 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 16 Dec 2024 23:54:02 +0000 Subject: [PATCH 117/178] fix(deps): update dependency mongoose to v8.9.1 --- Server/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Server/package-lock.json b/Server/package-lock.json index cb4ee1836..3f57f737a 100644 --- a/Server/package-lock.json +++ b/Server/package-lock.json @@ -4489,9 +4489,9 @@ } }, "node_modules/mongoose": { - "version": "8.9.0", - "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-8.9.0.tgz", - "integrity": "sha512-b58zY3PLNBcoz6ZXFckr0leJcVVBMAOBvD+7Bj2ZjghAwntXmNnqwlDixTKQU3UYoQIGTv+AQx/0ThsvaeVrCA==", + "version": "8.9.1", + "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-8.9.1.tgz", + "integrity": "sha512-whM6lWMdeKlUm4d2LSLS/q6cWtTp13lUrL5hy2YTsQdTSN+dsAu8HLdLUQOEgtBE59qp4IqLrjSXCSETbxhkQQ==", "license": "MIT", "dependencies": { "bson": "^6.10.1", From 0aa46aa2c29d4fb323baebbaeb3032ee1b7e3639 Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Mon, 16 Dec 2024 17:55:45 -0800 Subject: [PATCH 118/178] fix empty view message --- Client/src/Pages/Infrastructure/Details/empty.jsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Client/src/Pages/Infrastructure/Details/empty.jsx b/Client/src/Pages/Infrastructure/Details/empty.jsx index 4a311233f..ad3ed2505 100644 --- a/Client/src/Pages/Infrastructure/Details/empty.jsx +++ b/Client/src/Pages/Infrastructure/Details/empty.jsx @@ -21,8 +21,7 @@ const Empty = ({ styles }) => { textAlign="center" color={theme.palette.text.secondary} > - Hang tight! When we receive data, we'll show it here. Please check back in a few - minutes. + Hang tight! Data is loading From d94ba5c5240b637277caa764a428e6e04b6cb1f1 Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Mon, 16 Dec 2024 17:58:58 -0800 Subject: [PATCH 119/178] update dockeringore --- .dockerignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.dockerignore b/.dockerignore index e6b9c067d..fdfa00585 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,3 +1,3 @@ Client/node_modules/ Server/node_modules/ -*.env \ No newline at end of file +Server/*.env \ No newline at end of file From df11a457f1f830f2c8c96a808b94440c401d884b Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Mon, 16 Dec 2024 18:20:41 -0800 Subject: [PATCH 120/178] 401 -> 403 --- Server/controllers/authController.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Server/controllers/authController.js b/Server/controllers/authController.js index 1fba9c92f..fb48796df 100644 --- a/Server/controllers/authController.js +++ b/Server/controllers/authController.js @@ -284,7 +284,7 @@ const editUser = async (req, res, next) => { // If not a match, throw a 401 if (!match) { const error = new Error(errorMessages.AUTH_INCORRECT_PASSWORD); - error.status = 401; + error.status = 403; next(error); return; } From 2d27eed9ba7ebc57b12b5d026240bfc0d7fb448f Mon Sep 17 00:00:00 2001 From: Shalini Date: Tue, 17 Dec 2024 10:38:20 +0530 Subject: [PATCH 121/178] Used theme for the avatar BG instead of hard coding --- Client/src/Components/Avatar/index.jsx | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/Client/src/Components/Avatar/index.jsx b/Client/src/Components/Avatar/index.jsx index 18bb6be47..39e8a3f42 100644 --- a/Client/src/Components/Avatar/index.jsx +++ b/Client/src/Components/Avatar/index.jsx @@ -2,17 +2,7 @@ import { Avatar as MuiAvatar } from "@mui/material"; import PropTypes from "prop-types"; import { useSelector } from "react-redux"; import { useEffect, useState } from "react"; - -/** - * Generates a color based on the input string. - * @param {string} string - The input string to generate the color from. - * @returns {string} - */ -const stringToColor = (string) => { - - return "#156EEF"; -}; - +import { useTheme } from "@emotion/react"; /** * @component * @param {Object} props @@ -27,6 +17,7 @@ const stringToColor = (string) => { const Avatar = ({ src, small, sx }) => { const { user } = useSelector((state) => state.auth); + const theme = useTheme(); const style = small ? { width: 32, height: 32 } : { width: 64, height: 64 }; const border = small ? 1 : 3; @@ -46,7 +37,7 @@ const Avatar = ({ src, small, sx }) => { fontSize: small ? "16px" : "22px", color: "white", fontWeight: 400, - backgroundColor: stringToColor(`${user?.firstName} ${user?.lastName}`), + backgroundColor: theme.palette.primary.main, // Same BG color as checkmate BG in sidebar display: "inline-flex", "&::before": { content: `""`, @@ -63,7 +54,7 @@ const Avatar = ({ src, small, sx }) => { }} > {user.firstName?.charAt(0)} - {user.lastName?.charAt(0)} + {user.lastName?.charAt(0) || ''} ); }; From a9ed2158e9a2f18783423b3a0821393b45923e3d Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 17 Dec 2024 15:28:45 +0000 Subject: [PATCH 122/178] fix(deps): update material-ui monorepo --- Client/package-lock.json | 116 +++++++++++++++++++-------------------- Client/package.json | 6 +- 2 files changed, 61 insertions(+), 61 deletions(-) diff --git a/Client/package-lock.json b/Client/package-lock.json index 603e30ae0..8090e52b1 100644 --- a/Client/package-lock.json +++ b/Client/package-lock.json @@ -11,9 +11,9 @@ "@emotion/react": "^11.13.3", "@emotion/styled": "^11.13.0", "@fontsource/roboto": "^5.0.13", - "@mui/icons-material": "6.2.0", - "@mui/lab": "6.0.0-beta.19", - "@mui/material": "6.2.0", + "@mui/icons-material": "6.2.1", + "@mui/lab": "6.0.0-beta.20", + "@mui/material": "6.2.1", "@mui/x-charts": "^7.5.1", "@mui/x-data-grid": "7.23.2", "@mui/x-date-pickers": "7.23.2", @@ -1071,15 +1071,15 @@ } }, "node_modules/@mui/base": { - "version": "5.0.0-beta.66", - "resolved": "https://registry.npmjs.org/@mui/base/-/base-5.0.0-beta.66.tgz", - "integrity": "sha512-1SzcNbtIms0o/Dx+599B6QbvR5qUMBUjwc2Gs47h1HsF7RcEFXxqaq7zrWkIWbvGctIIPx0j330oGx/SkF+UmA==", + "version": "5.0.0-beta.67", + "resolved": "https://registry.npmjs.org/@mui/base/-/base-5.0.0-beta.67.tgz", + "integrity": "sha512-pwjibXqBrSw1Z1fZEIhWJnMJHSvh3BLz0pZcrX/x01B/BVf6QUbFlGVV/k8KCsZ9sPzln1l8bBJ+ynIIE9LtjA==", "license": "MIT", "dependencies": { "@babel/runtime": "^7.26.0", "@floating-ui/react-dom": "^2.1.1", - "@mui/types": "^7.2.19", - "@mui/utils": "^6.2.0", + "@mui/types": "^7.2.20", + "@mui/utils": "^6.2.1", "@popperjs/core": "^2.11.8", "clsx": "^2.1.1", "prop-types": "^15.8.1" @@ -1103,9 +1103,9 @@ } }, "node_modules/@mui/core-downloads-tracker": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/@mui/core-downloads-tracker/-/core-downloads-tracker-6.2.0.tgz", - "integrity": "sha512-Nn5PSkUqbDrvezpiiiYZiAbX4SFEiy3CbikUL6pWOXEUsq+L1j50OOyyUIHpaX2Hr+5V5UxTh+fPeC4nsGNhdw==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/@mui/core-downloads-tracker/-/core-downloads-tracker-6.2.1.tgz", + "integrity": "sha512-U/8vS1+1XiHBnnRRESSG1gvr6JDHdPjrpnW6KEebkAQWBn6wrpbSF/XSZ8/vJIRXH5NyDmMHi4Ro5Q70//JKhA==", "license": "MIT", "funding": { "type": "opencollective", @@ -1113,9 +1113,9 @@ } }, "node_modules/@mui/icons-material": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/@mui/icons-material/-/icons-material-6.2.0.tgz", - "integrity": "sha512-WR1EEhGOSvxAsoTSzWZBlrWFjul8wziDrII4rC3PvMBHhBYBqEc2n/0aamfFbwkH5EiYb96aqc6kYY6tB310Sw==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/@mui/icons-material/-/icons-material-6.2.1.tgz", + "integrity": "sha512-bP0XtW+t5KFL+wjfQp2UctN/8CuWqF1qaxbYuCAsJhL+AzproM8gGOh2n8sNBcrjbVckzDNqaXqxdpn+OmoWug==", "license": "MIT", "dependencies": { "@babel/runtime": "^7.26.0" @@ -1128,7 +1128,7 @@ "url": "https://opencollective.com/mui-org" }, "peerDependencies": { - "@mui/material": "^6.2.0", + "@mui/material": "^6.2.1", "@types/react": "^17.0.0 || ^18.0.0 || ^19.0.0", "react": "^17.0.0 || ^18.0.0 || ^19.0.0" }, @@ -1139,16 +1139,16 @@ } }, "node_modules/@mui/lab": { - "version": "6.0.0-beta.19", - "resolved": "https://registry.npmjs.org/@mui/lab/-/lab-6.0.0-beta.19.tgz", - "integrity": "sha512-t7iub8kjpLdA5uDGwGnNRjtGc1vYEUnDwSROjKrnYqjOlCQhBajFa8uoQtaST6jE/VEk6cxpDMnN5MalC6YpCg==", + "version": "6.0.0-beta.20", + "resolved": "https://registry.npmjs.org/@mui/lab/-/lab-6.0.0-beta.20.tgz", + "integrity": "sha512-Sg3aTrSSsfXcSHwKhnZbXmz7kUZzvXww3vO4p8U/DbMVSGJxll1GRpKNQkFLpZy2y7ZBTgKaZTbPYw4Q6UKrsA==", "license": "MIT", "dependencies": { "@babel/runtime": "^7.26.0", - "@mui/base": "5.0.0-beta.66", - "@mui/system": "^6.2.0", - "@mui/types": "^7.2.19", - "@mui/utils": "^6.2.0", + "@mui/base": "5.0.0-beta.67", + "@mui/system": "^6.2.1", + "@mui/types": "^7.2.20", + "@mui/utils": "^6.2.1", "clsx": "^2.1.1", "prop-types": "^15.8.1" }, @@ -1162,8 +1162,8 @@ "peerDependencies": { "@emotion/react": "^11.5.0", "@emotion/styled": "^11.3.0", - "@mui/material": "^6.2.0", - "@mui/material-pigment-css": "^6.2.0", + "@mui/material": "^6.2.1", + "@mui/material-pigment-css": "^6.2.1", "@types/react": "^17.0.0 || ^18.0.0 || ^19.0.0", "react": "^17.0.0 || ^18.0.0 || ^19.0.0", "react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0" @@ -1184,18 +1184,18 @@ } }, "node_modules/@mui/material": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/@mui/material/-/material-6.2.0.tgz", - "integrity": "sha512-7FXXUPIyYzP02a7GvqwJ7ocmdP+FkvLvmy/uxG1TDmTlsr8nEClQp75uxiVznJqAY/jJy4d+Rj/fNWNxwidrYQ==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/@mui/material/-/material-6.2.1.tgz", + "integrity": "sha512-7VlKGsRKsy1bOSOPaSNgpkzaL+0C7iWAVKd2KYyAvhR9fTLJtiAMpq+KuzgEh1so2mtvQERN0tZVIceWMiIesw==", "license": "MIT", "dependencies": { "@babel/runtime": "^7.26.0", - "@mui/core-downloads-tracker": "^6.2.0", - "@mui/system": "^6.2.0", - "@mui/types": "^7.2.19", - "@mui/utils": "^6.2.0", + "@mui/core-downloads-tracker": "^6.2.1", + "@mui/system": "^6.2.1", + "@mui/types": "^7.2.20", + "@mui/utils": "^6.2.1", "@popperjs/core": "^2.11.8", - "@types/react-transition-group": "^4.4.11", + "@types/react-transition-group": "^4.4.12", "clsx": "^2.1.1", "csstype": "^3.1.3", "prop-types": "^15.8.1", @@ -1212,7 +1212,7 @@ "peerDependencies": { "@emotion/react": "^11.5.0", "@emotion/styled": "^11.3.0", - "@mui/material-pigment-css": "^6.2.0", + "@mui/material-pigment-css": "^6.2.1", "@types/react": "^17.0.0 || ^18.0.0 || ^19.0.0", "react": "^17.0.0 || ^18.0.0 || ^19.0.0", "react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0" @@ -1239,13 +1239,13 @@ "license": "MIT" }, "node_modules/@mui/private-theming": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/@mui/private-theming/-/private-theming-6.2.0.tgz", - "integrity": "sha512-lYd2MrVddhentF1d/cMXKnwlDjr/shbO3A2eGq22PCYUoZaqtAGZMc0U86KnJ/Sh5YzNYePqTOaaowAN8Qea8A==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/@mui/private-theming/-/private-theming-6.2.1.tgz", + "integrity": "sha512-u1y0gpcfrRRxCcIdVeU5eIvkinA82Q8ft178WUNYuoFQrsOrXdlBdZlRVi+eYuUFp1iXI55Cud7sMZZtETix5Q==", "license": "MIT", "dependencies": { "@babel/runtime": "^7.26.0", - "@mui/utils": "^6.2.0", + "@mui/utils": "^6.2.1", "prop-types": "^15.8.1" }, "engines": { @@ -1266,9 +1266,9 @@ } }, "node_modules/@mui/styled-engine": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/@mui/styled-engine/-/styled-engine-6.2.0.tgz", - "integrity": "sha512-rV4YCu6kcCjMnHFXU/tQcL6XfYVfFVR8n3ZVNGnk2rpXnt/ctOPJsF+eUQuhkHciueLVKpI06+umr1FxWWhVmQ==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/@mui/styled-engine/-/styled-engine-6.2.1.tgz", + "integrity": "sha512-6R3OgYw6zgCZWFYYMfxDqpGfJA78mUTOIlUDmmJlr60ogVNCrM87X0pqx5TbZ2OwUyxlJxN9qFgRr+J9H6cOBg==", "license": "MIT", "dependencies": { "@babel/runtime": "^7.26.0", @@ -1300,16 +1300,16 @@ } }, "node_modules/@mui/system": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/@mui/system/-/system-6.2.0.tgz", - "integrity": "sha512-DCeqev9Cd4f4pm3O1lqSGW/DIHHBG6ZpqMX9iIAvN4asYv+pPWv2/lKov9kWk5XThhxFnGSv93SRNE1kNRRg5Q==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/@mui/system/-/system-6.2.1.tgz", + "integrity": "sha512-0lc8CbBP4WAAF+SmGMFJI9bpIyQvW3zvwIDzLsb26FIB/4Z0pO7qGe8mkAl0RM63Vb37899qxnThhHKgAAdy6w==", "license": "MIT", "dependencies": { "@babel/runtime": "^7.26.0", - "@mui/private-theming": "^6.2.0", - "@mui/styled-engine": "^6.2.0", - "@mui/types": "^7.2.19", - "@mui/utils": "^6.2.0", + "@mui/private-theming": "^6.2.1", + "@mui/styled-engine": "^6.2.1", + "@mui/types": "^7.2.20", + "@mui/utils": "^6.2.1", "clsx": "^2.1.1", "csstype": "^3.1.3", "prop-types": "^15.8.1" @@ -1340,9 +1340,9 @@ } }, "node_modules/@mui/types": { - "version": "7.2.19", - "resolved": "https://registry.npmjs.org/@mui/types/-/types-7.2.19.tgz", - "integrity": "sha512-6XpZEM/Q3epK9RN8ENoXuygnqUQxE+siN/6rGRi2iwJPgBUR25mphYQ9ZI87plGh58YoZ5pp40bFvKYOCDJ3tA==", + "version": "7.2.20", + "resolved": "https://registry.npmjs.org/@mui/types/-/types-7.2.20.tgz", + "integrity": "sha512-straFHD7L8v05l/N5vcWk+y7eL9JF0C2mtph/y4BPm3gn2Eh61dDwDB65pa8DLss3WJfDXYC7Kx5yjP0EmXpgw==", "license": "MIT", "peerDependencies": { "@types/react": "^17.0.0 || ^18.0.0 || ^19.0.0" @@ -1354,13 +1354,13 @@ } }, "node_modules/@mui/utils": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/@mui/utils/-/utils-6.2.0.tgz", - "integrity": "sha512-77CaFJi+OIi2SjbPwCis8z5DXvE0dfx9hBz5FguZHt1VYFlWEPCWTHcMsQCahSErnfik5ebLsYK8+D+nsjGVfw==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/@mui/utils/-/utils-6.2.1.tgz", + "integrity": "sha512-ubLqGIMhKUH2TF/Um+wRzYXgAooQw35th+DPemGrTpgrZHpOgcnUDIDbwsk1e8iQiuJ3mV/ErTtcQrecmlj5cg==", "license": "MIT", "dependencies": { "@babel/runtime": "^7.26.0", - "@mui/types": "^7.2.19", + "@mui/types": "^7.2.20", "@types/prop-types": "^15.7.14", "clsx": "^2.1.1", "prop-types": "^15.8.1", @@ -2392,11 +2392,11 @@ } }, "node_modules/@types/react-transition-group": { - "version": "4.4.11", - "resolved": "https://registry.npmjs.org/@types/react-transition-group/-/react-transition-group-4.4.11.tgz", - "integrity": "sha512-RM05tAniPZ5DZPzzNFP+DmrcOdD0efDUxMy3145oljWSl3x9ZV5vhme98gTxFrj2lhXvmGNnUiuDyJgY9IKkNA==", + "version": "4.4.12", + "resolved": "https://registry.npmjs.org/@types/react-transition-group/-/react-transition-group-4.4.12.tgz", + "integrity": "sha512-8TV6R3h2j7a91c+1DXdJi3Syo69zzIZbz7Lg5tORM5LEJG7X/E6a1V3drRyBRZq7/utz7A+c4OgYLiLcYGHG6w==", "license": "MIT", - "dependencies": { + "peerDependencies": { "@types/react": "*" } }, diff --git a/Client/package.json b/Client/package.json index b1a8409cf..882ecfd38 100644 --- a/Client/package.json +++ b/Client/package.json @@ -14,9 +14,9 @@ "@emotion/react": "^11.13.3", "@emotion/styled": "^11.13.0", "@fontsource/roboto": "^5.0.13", - "@mui/icons-material": "6.2.0", - "@mui/lab": "6.0.0-beta.19", - "@mui/material": "6.2.0", + "@mui/icons-material": "6.2.1", + "@mui/lab": "6.0.0-beta.20", + "@mui/material": "6.2.1", "@mui/x-charts": "^7.5.1", "@mui/x-data-grid": "7.23.2", "@mui/x-date-pickers": "7.23.2", From acefedd6e76dd04a66e38ef6555874b8cb1d62f9 Mon Sep 17 00:00:00 2001 From: Peter Carl Pardo Date: Tue, 17 Dec 2024 23:57:12 +0800 Subject: [PATCH 123/178] feat: add attribution for theme switch --- Client/src/Components/ThemeSwitch/index.jsx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Client/src/Components/ThemeSwitch/index.jsx b/Client/src/Components/ThemeSwitch/index.jsx index 1e98dfe27..4cb6c3a14 100644 --- a/Client/src/Components/ThemeSwitch/index.jsx +++ b/Client/src/Components/ThemeSwitch/index.jsx @@ -1,4 +1,15 @@ -import React, { useEffect, useState } from "react"; +/** + * ThemeSwitch Component + * Dark and Light Theme Switch + * Original Code: https://web.dev/patterns/theming/theme-switch + * License: Apache License 2.0 + * Copyright Β© Google LLC + * + * This code has been adapted for use in this project. + * Apache License: https://www.apache.org/licenses/LICENSE-2.0 + */ + +import React, { useEffect } from "react"; import { IconButton } from "@mui/material"; import SunAndMoonIcon from "./SunAndMoonIcon"; import "./index.css"; From a42e280e490d3ba78e1682db17bdc3b3148c6c2d Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Tue, 17 Dec 2024 10:02:56 -0800 Subject: [PATCH 124/178] update comments --- Server/controllers/authController.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Server/controllers/authController.js b/Server/controllers/authController.js index fb48796df..b7e4a7808 100644 --- a/Server/controllers/authController.js +++ b/Server/controllers/authController.js @@ -281,7 +281,8 @@ const editUser = async (req, res, next) => { const user = await req.db.getUserByEmail(email); // Compare passwords const match = await user.comparePassword(req.body.password); - // If not a match, throw a 401 + // If not a match, throw a 403 + // 403 instead of 401 to avoid triggering axios interceptor if (!match) { const error = new Error(errorMessages.AUTH_INCORRECT_PASSWORD); error.status = 403; From a507e1282e833c480a2b15ebbe0f70d949b1a279 Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Tue, 17 Dec 2024 13:10:28 -0800 Subject: [PATCH 125/178] Fix links in login page --- Client/src/Pages/Auth/Login/Login.jsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Client/src/Pages/Auth/Login/Login.jsx b/Client/src/Pages/Auth/Login/Login.jsx index 1b3a420ea..c1687a0ec 100644 --- a/Client/src/Pages/Auth/Login/Login.jsx +++ b/Client/src/Pages/Auth/Login/Login.jsx @@ -11,8 +11,8 @@ import Background from "../../../assets/Images/background-grid.svg?react"; import Logo from "../../../assets/icons/bwu-icon.svg?react"; import { logger } from "../../../Utils/Logger"; import "../index.css"; -import EmailStep from "./Components/EmailStep"; -import PasswordStep from "./Components/PasswordStep"; +import EmailStep from "./Components/EmailStep"; +import PasswordStep from "./Components/PasswordStep"; const DEMO = import.meta.env.VITE_APP_DEMO; @@ -42,7 +42,7 @@ const Login = () => { useEffect(() => { if (authToken) { - navigate("/monitors"); + navigate("/uptime"); return; } networkService @@ -108,7 +108,7 @@ const Login = () => { } else { const action = await dispatch(login(form)); if (action.payload.success) { - navigate("/monitors"); + navigate("/uptime"); createToast({ body: "Welcome back! You're successfully logged in.", }); From 1f823fc672cadc2d8cac5b05981204b29477670f Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Tue, 17 Dec 2024 13:10:40 -0800 Subject: [PATCH 126/178] remove old login page --- Client/src/Pages/Auth/Login.jsx | 562 -------------------------------- 1 file changed, 562 deletions(-) delete mode 100644 Client/src/Pages/Auth/Login.jsx diff --git a/Client/src/Pages/Auth/Login.jsx b/Client/src/Pages/Auth/Login.jsx deleted file mode 100644 index a7554a7c1..000000000 --- a/Client/src/Pages/Auth/Login.jsx +++ /dev/null @@ -1,562 +0,0 @@ -import { useState, useEffect, useRef } from "react"; -import { useNavigate } from "react-router-dom"; -import { Box, Button, Stack, Typography } from "@mui/material"; -import { useTheme } from "@emotion/react"; -import { credentials } from "../../Validation/validation"; -import { login } from "../../Features/Auth/authSlice"; -import LoadingButton from "@mui/lab/LoadingButton"; -import { useDispatch, useSelector } from "react-redux"; -import { createToast } from "../../Utils/toastUtils"; -import { networkService } from "../../main"; -import TextInput from "../../Components/Inputs/TextInput"; -import { PasswordEndAdornment } from "../../Components/Inputs/TextInput/Adornments"; -import Background from "../../assets/Images/background-grid.svg?react"; -import Logo from "../../assets/icons/bwu-icon.svg?react"; -import Mail from "../../assets/icons/mail.svg?react"; -import ArrowBackRoundedIcon from "@mui/icons-material/ArrowBackRounded"; -import PropTypes from "prop-types"; -import { logger } from "../../Utils/Logger"; -import "./index.css"; -const DEMO = import.meta.env.VITE_APP_DEMO; - -/** - * Displays the initial landing page. - * - * @param {Object} props - * @param {Function} props.onContinue - Callback function to handle "Continue with Email" button click. - * @returns {JSX.Element} - */ -const LandingPage = ({ onContinue }) => { - const theme = useTheme(); - - return ( - <> - - - Log In - We are pleased to see you again! - - - - - - - By continuing, you agree to our{" "} - { - window.open( - "https://bluewavelabs.ca/terms-of-service-open-source", - "_blank", - "noreferrer" - ); - }} - sx={{ - "&:hover": { - color: theme.palette.text.tertiary, - }, - }} - > - Terms of Service - {" "} - and{" "} - { - window.open( - "https://bluewavelabs.ca/privacy-policy-open-source", - "_blank", - "noreferrer" - ); - }} - sx={{ - "&:hover": { - color: theme.palette.text.tertiary, - }, - }} - > - Privacy Policy. - - - - - - ); -}; - -LandingPage.propTypes = { - onContinue: PropTypes.func.isRequired, -}; - -/** - * Renders the first step of the login process. - * - * @param {Object} props - * @param {Object} props.form - Form state object. - * @param {Object} props.errors - Object containing form validation errors. - * @param {Function} props.onSubmit - Callback function to handle form submission. - * @param {Function} props.onChange - Callback function to handle form input changes. - * @param {Function} props.onBack - Callback function to handle "Back" button click. - * @returns {JSX.Element} - */ -const StepOne = ({ form, errors, onSubmit, onChange, onBack }) => { - const theme = useTheme(); - const inputRef = useRef(null); - - useEffect(() => { - if (inputRef.current) { - inputRef.current.focus(); - } - }, []); - - return ( - <> - - - Log In - Enter your email address - - - (e.target.value = e.target.value.toLowerCase())} - onChange={onChange} - error={errors.email ? true : false} - helperText={errors.email} - ref={inputRef} - /> - - - - - - - - ); -}; - -StepOne.propTypes = { - form: PropTypes.object.isRequired, - errors: PropTypes.object.isRequired, - onSubmit: PropTypes.func.isRequired, - onChange: PropTypes.func.isRequired, - onBack: PropTypes.func.isRequired, -}; - -/** - * Renders the second step of the login process, including a password input field. - * - * @param {Object} props - * @param {Object} props.form - Form state object. - * @param {Object} props.errors - Object containing form validation errors. - * @param {Function} props.onSubmit - Callback function to handle form submission. - * @param {Function} props.onChange - Callback function to handle form input changes. - * @param {Function} props.onBack - Callback function to handle "Back" button click. - * @returns {JSX.Element} - */ -const StepTwo = ({ form, errors, onSubmit, onChange, onBack }) => { - const theme = useTheme(); - const navigate = useNavigate(); - const inputRef = useRef(null); - const authState = useSelector((state) => state.auth); - - useEffect(() => { - if (inputRef.current) { - inputRef.current.focus(); - } - }, []); - - const handleNavigate = () => { - if (form.email !== "" && !errors.email) { - sessionStorage.setItem("email", form.email); - } - navigate("/forgot-password"); - }; - - return ( - <> - - - Log In - Enter your password - - - } - /> - - - - Continue - - - - - - Forgot password? - - - Reset password - - - - - ); -}; - -StepTwo.propTypes = { - form: PropTypes.object.isRequired, - errors: PropTypes.object.isRequired, - onSubmit: PropTypes.func.isRequired, - onChange: PropTypes.func.isRequired, - onBack: PropTypes.func.isRequired, -}; - -const Login = () => { - const dispatch = useDispatch(); - const navigate = useNavigate(); - const theme = useTheme(); - - const authState = useSelector((state) => state.auth); - const { authToken } = authState; - - const idMap = { - "login-email-input": "email", - "login-password-input": "password", - }; - - const [form, setForm] = useState({ - email: DEMO !== undefined ? "uptimedemo@demo.com" : "", - password: DEMO !== undefined ? "Demouser1!" : "", - }); - const [errors, setErrors] = useState({}); - const [step, setStep] = useState(0); - - useEffect(() => { - if (authToken) { - navigate("/uptime"); - return; - } - networkService - .doesSuperAdminExist() - .then((response) => { - if (response.data.data === false) { - navigate("/register"); - } - }) - .catch((error) => { - logger.error(error); - }); - }, [authToken, navigate]); - - const handleChange = (event) => { - const { value, id } = event.target; - const name = idMap[id]; - setForm((prev) => ({ - ...prev, - [name]: value, - })); - - const { error } = credentials.validate({ [name]: value }, { abortEarly: false }); - - setErrors((prev) => { - const prevErrors = { ...prev }; - if (error) prevErrors[name] = error.details[0].message; - else delete prevErrors[name]; - return prevErrors; - }); - }; - - const handleSubmit = async (event) => { - event.preventDefault(); - - if (step === 1) { - const { error } = credentials.validate( - { email: form.email }, - { abortEarly: false } - ); - if (error) { - setErrors((prev) => ({ ...prev, email: error.details[0].message })); - createToast({ body: error.details[0].message }); - } else { - setStep(2); - } - } else if (step === 2) { - const { error } = credentials.validate(form, { abortEarly: false }); - - if (error) { - // validation errors - const newErrors = {}; - error.details.forEach((err) => { - newErrors[err.path[0]] = err.message; - }); - setErrors(newErrors); - createToast({ - body: - error.details && error.details.length > 0 - ? error.details[0].message - : "Error validating data.", - }); - } else { - const action = await dispatch(login(form)); - if (action.payload.success) { - navigate("/uptime"); - createToast({ - body: "Welcome back! You're successfully logged in.", - }); - } else { - if (action.payload) { - if (action.payload.msg === "Incorrect password") - setErrors({ - password: "The password you provided does not match our records", - }); - // dispatch errors - createToast({ - body: action.payload.msg, - }); - } else { - // unknown errors - createToast({ - body: "Unknown error.", - }); - } - } - } - } - }; - - return ( - - - - - - - BlueWave Uptime - - .MuiStack-root": { - border: 1, - borderRadius: theme.spacing(5), - borderColor: theme.palette.border.light, - backgroundColor: theme.palette.background.main, - padding: { - xs: theme.spacing(12), - sm: theme.spacing(20), - }, - }, - }} - > - {step === 0 ? ( - setStep(1)} /> - ) : step === 1 ? ( - setStep(0)} - /> - ) : ( - step === 2 && ( - setStep(1)} - /> - ) - )} - - - ); -}; - -export default Login; From f631fb16ac44416e41466af3005663e93b7ffc44 Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Tue, 17 Dec 2024 13:39:55 -0800 Subject: [PATCH 127/178] fix login import --- Client/src/Routes/index.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Client/src/Routes/index.jsx b/Client/src/Routes/index.jsx index 5fc764b6a..784b44609 100644 --- a/Client/src/Routes/index.jsx +++ b/Client/src/Routes/index.jsx @@ -3,7 +3,7 @@ import HomeLayout from "../Components/Layouts/HomeLayout"; import { Infrastructure } from "../Pages/Infrastructure"; import InfrastructureDetails from "../Pages/Infrastructure/Details"; import NotFound from "../Pages/NotFound"; -import Login from "../Pages/Auth/Login"; +import Login from "../Pages/Auth/Login/Login"; import Register from "../Pages/Auth/Register/Register"; import Account from "../Pages/Account"; import Monitors from "../Pages/Uptime/Home"; From 1e6b3394832ef04b1fd904a22a1217c364bf527e Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Tue, 17 Dec 2024 13:50:55 -0800 Subject: [PATCH 128/178] Add empty message to BasicTable component --- Client/src/Components/BasicTable/index.jsx | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/Client/src/Components/BasicTable/index.jsx b/Client/src/Components/BasicTable/index.jsx index e519a079f..9f9a5b9da 100644 --- a/Client/src/Components/BasicTable/index.jsx +++ b/Client/src/Components/BasicTable/index.jsx @@ -115,7 +115,7 @@ TablePaginationActions.propTypes = { * @param {boolean} [props.paginated=false] - Flag to enable pagination. * @param {boolean} [props.reversed=false] - Flag to enable reverse order. * @param {number} props.rowsPerPage- Number of rows per page (table). - * + * @param {string} props.emptyMessage - Message to display when there is no data. * @example * const data = { * cols: [ @@ -149,7 +149,7 @@ TablePaginationActions.propTypes = { * */ -const BasicTable = ({ data, paginated, reversed, table }) => { +const BasicTable = ({ data, paginated, reversed, table, emptyMessage = "No data" }) => { const DEFAULT_ROWS_PER_PAGE = 5; const theme = useTheme(); const dispatch = useDispatch(); @@ -228,6 +228,16 @@ const BasicTable = ({ data, paginated, reversed, table }) => { ); })} + {displayData.length === 0 && ( + + + {emptyMessage} + + + )} @@ -317,6 +327,7 @@ BasicTable.propTypes = { reversed: PropTypes.bool, rowPerPage: PropTypes.number, table: PropTypes.string, + emptyMessage: PropTypes.string, }; export default BasicTable; From f880c2623c24d2ed9ece9370cfd31eb382d9d1c5 Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Tue, 17 Dec 2024 13:51:03 -0800 Subject: [PATCH 129/178] Supply empty message to basic table --- .../TabPanels/Account/TeamPanel.jsx | 84 ++----------------- 1 file changed, 5 insertions(+), 79 deletions(-) diff --git a/Client/src/Components/TabPanels/Account/TeamPanel.jsx b/Client/src/Components/TabPanels/Account/TeamPanel.jsx index 209dbeaed..bbc6c4305 100644 --- a/Client/src/Components/TabPanels/Account/TeamPanel.jsx +++ b/Client/src/Components/TabPanels/Account/TeamPanel.jsx @@ -64,7 +64,7 @@ const TeamPanel = () => { }; fetchTeam(); - }, [user]); + }, [authToken]); useEffect(() => { let team = members; @@ -81,8 +81,6 @@ const TeamPanel = () => { { id: 1, name: "NAME" }, { id: 2, name: "EMAIL" }, { id: 3, name: "ROLE" }, - // FEATURE STILL TO BE IMPLEMENTED - // { id: 4, name: "ACTION" }, ], rows: team?.map((member, idx) => { const roles = member.role.map((role) => roleMap[role]).join(","); @@ -104,45 +102,19 @@ const TeamPanel = () => { }, { id: idx + 1, data: member.email }, { - // TODO - Add select dropdown id: idx + 2, data: roles, }, - // FEATURE STILL TO BE IMPLEMENTED - // { - // // TODO - Add delete onClick - // id: idx + 3, - // data: ( - // - // - // - // ), - // }, ], }; }), }; setTableData(data); - }, [members, filter]); + }, [filter, members, roleMap, theme]); useEffect(() => { setIsDisabled(Object.keys(errors).length !== 0 || toInvite.email === ""); }, [errors, toInvite.email]); - - // RENAME ORGANIZATION - // const toggleEdit = () => { - // setOrgStates((prev) => ({ ...prev, isEdit: !prev.isEdit })); - // }; - // const handleRename = () => {}; - - // INVITE MEMBER const [isOpen, setIsOpen] = useState(false); const handleChange = (event) => { @@ -226,58 +198,11 @@ const TeamPanel = () => { }, }} > - {/* FEATURE STILL TO BE IMPLEMENTED */} - {/* - - Organization name - - - - setOrgStates((prev) => ({ - ...prev, - name: event.target.value, - })) - } - disabled={!orgStates.isEdit} - sx={{ - color: theme.palette.otherColors.bluishGray, - "& .Mui-disabled": { - WebkitTextFillColor: "initial !important", - }, - "& .Mui-disabled fieldset": { - borderColor: "transparent !important", - }, - }} - inputProps={{ - sx: { textAlign: "end", padding: theme.spacing(4) }, - }} - /> - - - - - )} + About diff --git a/Client/src/Routes/index.jsx b/Client/src/Routes/index.jsx index 784b44609..7d444f2ab 100644 --- a/Client/src/Routes/index.jsx +++ b/Client/src/Routes/index.jsx @@ -19,7 +19,6 @@ import SetNewPassword from "../Pages/Auth/SetNewPassword"; import NewPasswordConfirmed from "../Pages/Auth/NewPasswordConfirmed"; import ProtectedRoute from "../Components/ProtectedRoute"; import Details from "../Pages/Uptime/Details"; -import AdvancedSettings from "../Pages/AdvancedSettings"; import Maintenance from "../Pages/Maintenance"; import Configure from "../Pages/Uptime/Configure"; import PageSpeed from "../Pages/PageSpeed"; @@ -114,10 +113,6 @@ const Routes = () => { path="settings" element={} /> - } - /> } From 7c5c3507d8c332bf469d758b69641f7f8950bb76 Mon Sep 17 00:00:00 2001 From: Peter Carl Pardo Date: Wed, 18 Dec 2024 18:57:38 +0800 Subject: [PATCH 131/178] feat: removed useEffect in toggling theme --- Client/src/Components/ThemeSwitch/index.css | 14 +++++++------- Client/src/Components/ThemeSwitch/index.jsx | 14 +++++--------- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/Client/src/Components/ThemeSwitch/index.css b/Client/src/Components/ThemeSwitch/index.css index c80a0f2d1..2519a0be8 100644 --- a/Client/src/Components/ThemeSwitch/index.css +++ b/Client/src/Components/ThemeSwitch/index.css @@ -6,20 +6,20 @@ stroke-width: 2px; } -[data-theme="dark"] .sun-and-moon > .sun { +.theme-dark .sun-and-moon > .sun { transform: scale(1.75); } -[data-theme="dark"] .sun-and-moon > .sun-beams { +.theme-dark .sun-and-moon > .sun-beams { opacity: 0; } -[data-theme="dark"] .sun-and-moon > .moon > circle { +.theme-dark .sun-and-moon > .moon > circle { transform: translateX(-7px); } @supports (cx: 1) { - [data-theme="dark"] .sun-and-moon > .moon > circle { + .theme-dark .sun-and-moon > .moon > circle { cx: 17; transform: translateX(0); } @@ -46,18 +46,18 @@ } } - [data-theme="dark"] .sun-and-moon > .sun { + .theme-dark .sun-and-moon > .sun { transition-timing-function: var(--ease-3); transition-duration: 0.25s; transform: scale(1.75); } - [data-theme="dark"] .sun-and-moon > .sun-beams { + .theme-dark .sun-and-moon > .sun-beams { transition-duration: 0.15s; transform: rotateZ(-25deg); } - [data-theme="dark"] .sun-and-moon > .moon > circle { + .theme-dark .sun-and-moon > .moon > circle { transition-duration: 0.5s; transition-delay: 0.25s; } diff --git a/Client/src/Components/ThemeSwitch/index.jsx b/Client/src/Components/ThemeSwitch/index.jsx index 4cb6c3a14..b751f542a 100644 --- a/Client/src/Components/ThemeSwitch/index.jsx +++ b/Client/src/Components/ThemeSwitch/index.jsx @@ -9,14 +9,13 @@ * Apache License: https://www.apache.org/licenses/LICENSE-2.0 */ -import React, { useEffect } from "react"; import { IconButton } from "@mui/material"; import SunAndMoonIcon from "./SunAndMoonIcon"; -import "./index.css"; import { useDispatch, useSelector } from "react-redux"; import { setMode } from "../../Features/UI/uiSlice"; +import "./index.css"; -const ThemeSwitch = () => { +const ThemeSwitch = ({ width = 48, height = 48 }) => { const mode = useSelector((state) => state.ui.mode); const dispatch = useDispatch(); @@ -24,20 +23,17 @@ const ThemeSwitch = () => { dispatch(setMode(mode === "light" ? "dark" : "light")); }; - useEffect(() => { - document.body.setAttribute("data-theme", mode); - }, [mode]); - return ( Date: Wed, 18 Dec 2024 13:33:35 +0000 Subject: [PATCH 132/178] fix(deps): update dependency bullmq to v5.34.3 --- Server/package-lock.json | 8 ++++---- Server/package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Server/package-lock.json b/Server/package-lock.json index 3f57f737a..9c1315867 100644 --- a/Server/package-lock.json +++ b/Server/package-lock.json @@ -11,7 +11,7 @@ "dependencies": { "axios": "^1.7.2", "bcrypt": "^5.1.1", - "bullmq": "5.34.2", + "bullmq": "5.34.3", "cors": "^2.8.5", "dockerode": "4.0.2", "dotenv": "^16.4.5", @@ -1223,9 +1223,9 @@ } }, "node_modules/bullmq": { - "version": "5.34.2", - "resolved": "https://registry.npmjs.org/bullmq/-/bullmq-5.34.2.tgz", - "integrity": "sha512-eUzeCswrKbQDE1WY8h4ZTBtynOzCU5qx9felFdYOmIJrsy0warDahHKUiCZ6dUCs6ZxYMGtcaciIMcAf1L54yw==", + "version": "5.34.3", + "resolved": "https://registry.npmjs.org/bullmq/-/bullmq-5.34.3.tgz", + "integrity": "sha512-S8/V11w7p6jYAGvv+00skLza/4inTOupWPe0uCD8mZSUiYKzvmW4/YEB+KVjZI2CC2oD3KJ3t7/KkUd31MxMig==", "license": "MIT", "dependencies": { "cron-parser": "^4.6.0", diff --git a/Server/package.json b/Server/package.json index 93d4d6be8..c480aea4c 100644 --- a/Server/package.json +++ b/Server/package.json @@ -14,7 +14,7 @@ "dependencies": { "axios": "^1.7.2", "bcrypt": "^5.1.1", - "bullmq": "5.34.2", + "bullmq": "5.34.3", "cors": "^2.8.5", "dockerode": "4.0.2", "dotenv": "^16.4.5", From 6e29e37241f20a3704f00df363bb06d14bd777b0 Mon Sep 17 00:00:00 2001 From: Shemy Gan Date: Wed, 18 Dec 2024 10:42:41 -0500 Subject: [PATCH 133/178] - Add divider for setting --- Client/src/Pages/Settings/styled.jsx | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/Client/src/Pages/Settings/styled.jsx b/Client/src/Pages/Settings/styled.jsx index 269706a27..aeefdaebb 100644 --- a/Client/src/Pages/Settings/styled.jsx +++ b/Client/src/Pages/Settings/styled.jsx @@ -5,19 +5,27 @@ export const ConfigBox = styled(Stack)(({ theme }) => ({ flexDirection: "row", justifyContent: "space-between", gap: theme.spacing(20), - paddingTop: theme.spacing(12), - paddingInline: theme.spacing(15), - paddingBottom: theme.spacing(25), backgroundColor: theme.palette.background.main, border: 1, borderStyle: "solid", borderColor: theme.palette.border.light, borderRadius: theme.spacing(2), + "& > *": { + paddingTop: theme.spacing(12), + paddingBottom: theme.spacing(18), + }, "& > div:first-of-type": { flex: 0.7, + borderRight: 1, + borderRightStyle: "solid", + borderRightColor: theme.palette.border.light, + paddingRight: theme.spacing(15), + paddingLeft: theme.spacing(15), }, "& > div:last-of-type": { flex: 1, + paddingRight: theme.spacing(20), + paddingLeft: theme.spacing(18), }, "& h1, & h2": { color: theme.palette.text.secondary, From 7f7423aed830ab9bdff0587e15841023d1c36d01 Mon Sep 17 00:00:00 2001 From: Anand Roy Date: Wed, 18 Dec 2024 17:46:44 +0000 Subject: [PATCH 134/178] reset password link added --- .../Pages/Auth/Login/Components/EmailStep.jsx | 40 ++++++++++++++++++- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/Client/src/Pages/Auth/Login/Components/EmailStep.jsx b/Client/src/Pages/Auth/Login/Components/EmailStep.jsx index f78193186..08ae51c4f 100644 --- a/Client/src/Pages/Auth/Login/Components/EmailStep.jsx +++ b/Client/src/Pages/Auth/Login/Components/EmailStep.jsx @@ -1,8 +1,9 @@ -import { useRef, useEffect } from "react"; +import { useRef, useEffect } from "react"; import { Box, Button, Stack, Typography } from "@mui/material"; import { useTheme } from "@emotion/react"; import TextInput from "../../../../Components/Inputs/TextInput"; import PropTypes from "prop-types"; +import { useNavigate } from "react-router"; /** * Renders the email step of the login process which includes an email field. @@ -18,6 +19,7 @@ import PropTypes from "prop-types"; const EmailStep = ({ form, errors, onSubmit, onChange }) => { const theme = useTheme(); const inputRef = useRef(null); + const navigate = useNavigate(); useEffect(() => { if (inputRef.current) { @@ -25,11 +27,19 @@ const EmailStep = ({ form, errors, onSubmit, onChange }) => { } }, []); + const handleNavigate = () => { + if (form.email !== "" && !errors.email) { + sessionStorage.setItem("email", form.email); + } + navigate("/forgot-password"); + }; + return ( <> Log In @@ -80,6 +90,32 @@ const EmailStep = ({ form, errors, onSubmit, onChange }) => { + + + Forgot password? + + + Reset password + + ); @@ -92,4 +128,4 @@ EmailStep.propTypes = { onChange: PropTypes.func.isRequired, }; -export default EmailStep; \ No newline at end of file +export default EmailStep; From bd5bc2617c031c78909cc5165b643f32aa52c4ec Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Wed, 18 Dec 2024 12:19:21 -0800 Subject: [PATCH 135/178] Add a config box component --- Client/src/Components/ConfigBox/index.jsx | 38 +++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 Client/src/Components/ConfigBox/index.jsx diff --git a/Client/src/Components/ConfigBox/index.jsx b/Client/src/Components/ConfigBox/index.jsx new file mode 100644 index 000000000..7650dd47f --- /dev/null +++ b/Client/src/Components/ConfigBox/index.jsx @@ -0,0 +1,38 @@ +import { Stack, styled } from "@mui/material"; + +const ConfigBox = styled(Stack)(({ theme }) => ({ + display: "flex", + flexDirection: "row", + justifyContent: "space-between", + gap: theme.spacing(20), + backgroundColor: theme.palette.background.main, + border: 1, + borderStyle: "solid", + borderColor: theme.palette.border.light, + borderRadius: theme.spacing(2), + "& > *": { + paddingTop: theme.spacing(12), + paddingBottom: theme.spacing(18), + }, + "& > div:first-of-type": { + flex: 0.7, + borderRight: 1, + borderRightStyle: "solid", + borderRightColor: theme.palette.border.light, + paddingRight: theme.spacing(15), + paddingLeft: theme.spacing(15), + }, + "& > div:last-of-type": { + flex: 1, + paddingRight: theme.spacing(20), + paddingLeft: theme.spacing(18), + }, + "& h1, & h2": { + color: theme.palette.text.secondary, + }, + "& p": { + color: theme.palette.text.tertiary, + }, +})); + +export default ConfigBox; From c47ec6ce8bb6925ea6f29965f41066a2cf757541 Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Wed, 18 Dec 2024 12:20:09 -0800 Subject: [PATCH 136/178] refactor create maintenance to use new ConfigBox --- .../Maintenance/CreateMaintenance/index.jsx | 232 ++++++++---------- .../Maintenance/CreateMaintenance/styled.jsx | 25 -- 2 files changed, 99 insertions(+), 158 deletions(-) delete mode 100644 Client/src/Pages/Maintenance/CreateMaintenance/styled.jsx diff --git a/Client/src/Pages/Maintenance/CreateMaintenance/index.jsx b/Client/src/Pages/Maintenance/CreateMaintenance/index.jsx index f41603330..c832d463a 100644 --- a/Client/src/Pages/Maintenance/CreateMaintenance/index.jsx +++ b/Client/src/Pages/Maintenance/CreateMaintenance/index.jsx @@ -2,7 +2,7 @@ import { Box, Button, Stack, Typography } from "@mui/material"; import { useSelector } from "react-redux"; import { useTheme } from "@emotion/react"; import { useEffect, useState } from "react"; -import { ConfigBox } from "./styled"; +import ConfigBox from "../../../Components/ConfigBox"; import { AdapterDayjs } from "@mui/x-date-pickers/AdapterDayjs"; import { LocalizationProvider } from "@mui/x-date-pickers"; import { DatePicker } from "@mui/x-date-pickers/DatePicker"; @@ -321,18 +321,27 @@ const CreateMaintenance = () => { Your pings won't be sent during this time frame - - - General Settings - - + + + + General Settings + + + + { + handleFormChange("name", event.target.value); + }} + error={errors["name"] ? true : false} + helperText={errors["name"]} + />