Compare commits

..
Author SHA1 Message Date
Alex Holliday afd6a12e7d restore PORT env var 2026-03-06 12:07:18 -08:00
Alexander Holliday 9fe8b7572f Merge pull request #3374 from bluewave-labs/fix/dark-mode-background-color
Fix dark mode background to use neutral gray
2026-03-06 11:14:21 -08:00
Alex Holliday a424092fbd remove unused imports 2026-03-06 11:12:52 -08:00
Alexander Holliday ad427dc765 Merge pull request #3385 from bluewave-labs/feat/globalping-ping-type
feat: globalping ping type
2026-03-06 11:10:45 -08:00
Alex Holliday 116eb80fc9 format 2026-03-06 11:07:48 -08:00
Alex Holliday c094a5fd73 format 2026-03-06 11:02:20 -08:00
Alex Holliday 206e28d1b9 user helper 2026-03-06 11:01:38 -08:00
Alex Holliday 2f1a164c26 remove rtt 2026-03-06 10:46:00 -08:00
Alex Holliday 124a8c0b07 ping type globalping checks 2026-03-06 10:37:29 -08:00
Alexander Holliday 188445c57a Merge pull request #3384 from bluewave-labs/fix/prettier
fix prettier hook
2026-03-06 09:46:08 -08:00
Alex Holliday 35f018623f fix prettier hook 2026-03-06 09:45:33 -08:00
Alexander Holliday d64526fed2 Merge pull request #3383 from bluewave-labs/fix/providers
fix: providers
2026-03-06 09:39:14 -08:00
Alex Holliday 9a8a175f7c format 2026-03-06 09:37:45 -08:00
Alex Holliday 6ecb27d522 remove buildStatusResponse 2026-03-06 09:35:52 -08:00
Alex Holliday 24b9b64979 manually build response 2026-03-06 09:35:07 -08:00
Alexander Holliday a4e4e1313e Merge pull request #3382 from bluewave-labs/fix/ts-errors
fix: resolve ts errors
2026-03-06 09:19:02 -08:00
Alex Holliday 990dc7875a format 2026-03-06 09:16:22 -08:00
Alex Holliday 69e98a51ec resolve ts errors 2026-03-06 09:14:12 -08:00
Alexander Holliday 3063b9cf22 Merge pull request #3379 from bluewave-labs/fix/network-providers
fix: network providers
2026-03-05 14:52:33 -08:00
Alex Holliday bd32854c7a cleanup services 2026-03-05 14:46:28 -08:00
Alex Holliday 0718e63e2f cleanup network service 2026-03-05 14:11:11 -08:00
Alexander Holliday cdb70f9171 Merge pull request #3378 from bluewave-labs/fix/email
Fix/email
2026-03-05 14:01:03 -08:00
Alex Holliday 69e07975e3 bump dependencies 2026-03-05 13:57:45 -08:00
Alex Holliday c5c9a1a88b fix missing await 2026-03-05 13:57:39 -08:00
Alexander Holliday 31efa791bd Merge pull request #3377 from bluewave-labs/fix/providers
fix/providers
2026-03-05 13:23:27 -08:00
Alex Holliday f8c0b57d21 remove unused imports 2026-03-05 19:37:32 +00:00
Alex Holliday 605c969d2f merge commit 2026-03-05 19:37:03 +00:00
Alex Holliday ad7d4e54c3 cleanup 2026-03-05 19:34:57 +00:00
Alex Holliday c7689cc64a grpc 2026-03-05 19:18:29 +00:00
Alex Holliday 27c44a0fbd config 2026-03-05 18:48:19 +00:00
Alex Holliday 190d9dd2b1 gameProvider 2026-03-05 18:45:27 +00:00
Alex Holliday 49672db563 port provider 2026-03-05 18:35:19 +00:00
Alex Holliday 80603c9a42 port provider 2026-03-05 18:30:06 +00:00
Alex Holliday f3b156f2d0 docker provider 2026-03-05 18:19:03 +00:00
Alex Holliday ec82efebb4 pagespeed provider, hardware provider 2026-03-05 17:54:16 +00:00
gorkem-bwl a1068f1d7e refactor: move dark background colors to colors object
Addresses review feedback — define gray900 and gray850 in the colors
object and reference them in the dark palette.
2026-03-04 19:56:54 -05:00
Alex Holliday 8dd846d6cd harden http provider 2026-03-04 23:36:36 +00:00
Alex Holliday 82175f166f pingProvider, httpProvider 2026-03-04 23:24:48 +00:00
Alex Holliday 3c99809e8e rix reveresed checks 2026-03-04 23:24:05 +00:00
Alexander Holliday 26db2b3a41 Merge pull request #3371 from bluewave-labs/fix/infrastructure-threshold-migration
Fix infrastructure threshold defaults via migration (#3327)
2026-03-04 14:28:49 -08:00
Alexander Holliday 232a71c502 Merge pull request #3369 from bluewave-labs/fix/swagger-dynamic-server-url
fix: dynamically set Swagger UI server URL from request
2026-03-04 14:28:06 -08:00
gorkem-bwl 8df263fd93 fix: also migrate threshold value of 0 to 100, fix formatting
Addresses review feedback — thresholds set to 0 also caused issues
and should be migrated to 100 (disabled) alongside the value of 5.
2026-03-04 16:44:20 -05:00
gorkem-bwl d2f3335b1a fix: add type annotations to Swagger middleware parameters
Fixes TypeScript build error TS7006 for implicit 'any' types on req, res, next.
2026-03-04 16:32:01 -05:00
gorkem-bwl 75eca743b4 fix: use neutral gray background for dark mode
## Changes
- Replace MUI default blue-tinted dark background with neutral grays
  (#151518 for default, #1c1c21 for paper/cards)
- Remove decorative blue/purple SVG blob overlay from dark mode background

## Benefits
- Dark mode now has a clean, neutral gray appearance instead of a blue tint
2026-03-04 16:30:19 -05:00
Alexander Holliday 7bfd68e374 Merge pull request #3372 from bluewave-labs/fix/ipv6-support
Fix IPv6 address handling in ping monitor (#3053)
2026-03-04 13:00:15 -08:00
gorkem-bwl b2e2b11ef2 fix: support IPv6 addresses in ping monitor
## Changes
- Fixed ping host sanitization regex that stripped everything after
  the first colon, which destroyed IPv6 addresses like 2001:db8::1
- New regex properly handles bracketed IPv6 ([::1]:port), bare IPv6,
  and IPv4/hostname:port formats separately

## Closes
Fixes #3053
2026-03-04 15:41:01 -05:00
gorkem-bwl 93b9abd508 fix: add migration to reset infrastructure thresholds from 5 to 100
## Changes
- Added migration 0004_fixInfrastructureThresholds that finds hardware
  monitors with threshold values of 5 (the old incorrect default) and
  updates them to 100 (effectively disabled)
- Runs automatically on server startup like other migrations

## Closes
Fixes #3327
2026-03-04 15:38:34 -05:00
gorkem-bwl 888b399a4f fix: dynamically set Swagger UI server URL from request
## Changes
- Swagger UI now prepends the current server URL (protocol + host) to
  the servers list, so it works correctly in remote/Docker environments
  instead of always pointing to localhost.

## Closes
Fixes #3339
2026-03-04 15:29:44 -05:00
Alexander Holliday 189293b04d Merge pull request #3366 from bluewave-labs/fix/eslint-warnings
fix: eslint warnings
2026-03-04 10:29:35 -08:00
Alex Holliday 13e9185011 bump version 2026-03-04 18:24:06 +00:00
Alex Holliday a7cf78cecc emailService 2026-03-04 18:16:31 +00:00
Alex Holliday 0b30e23783 globalPing 2026-03-04 17:50:27 +00:00
Alexander Holliday 1155619835 Merge pull request #3365 from bluewave-labs/fix/eslint
fix: eslint
2026-03-04 09:47:51 -08:00
Alex Holliday e0608ad3ed notificationMessageBuilder 2026-03-04 17:43:25 +00:00
Alex Holliday d665e95f02 discord 2026-03-04 17:39:31 +00:00
Alex Holliday afc27c804d email 2026-03-04 17:32:50 +00:00
Alex Holliday 1deb22bf63 pagerduty 2026-03-04 17:17:52 +00:00
Alex Holliday af8b128ac2 notificaiton providers 2026-03-03 23:27:48 +00:00
Alex Holliday 00150ba6f4 checkService, bufferService 2026-03-03 23:19:54 +00:00
Alex Holliday 7f04dd5d9a checksService 2026-03-03 23:09:10 +00:00
Alex Holliday ab5389190d stautsService and settingsService 2026-03-03 23:01:35 +00:00
Alexander Holliday cba9f43032 Merge pull request #3362 from bluewave-labs/fix/types
Fix/types
2026-03-03 13:41:05 -08:00
Alex Holliday 1cd6e723cc netowrk-service 2026-03-03 21:37:08 +00:00
Alex Holliday f79a87f98a resolve remaining TS errors 2026-03-03 19:34:28 +00:00
Alex Holliday a0ea50d745 correct return types 2026-03-03 18:50:10 +00:00
Alex Holliday bfa11216f0 correct payload type for monitor response 2026-03-03 18:29:17 +00:00
Alex Holliday 07a2f36dd7 app error 2026-03-03 18:27:42 +00:00
Alex Holliday 8e44718787 logger, imageProcessing 2026-03-03 18:26:42 +00:00
Alex Holliday 83572aa12a eslint update 2026-03-03 17:43:57 +00:00
Alexander Holliday 332a21cd99 Merge pull request #3361 from bluewave-labs/fix/logs
replace log statement
2026-03-03 09:20:22 -08:00
Alex Holliday 128d1d12b0 replace log statement 2026-03-02 23:04:20 +00:00
Alexander Holliday f73b07cd3c Merge pull request #3353 from bluewave-labs/feat/swr-global
feat: add global swr config
2026-03-02 14:50:44 -08:00
Alex Holliday a7d14e0e43 add global swr config 2026-03-02 22:37:58 +00:00
Alexander Holliday 6622a990be Merge pull request #3352 from bluewave-labs/fix/env-var-validation
Fix/env var validation
2026-03-02 14:01:35 -08:00
Alex Holliday 3854931682 remove comment 2026-03-02 22:00:03 +00:00
Alex Holliday 09534757a2 validation 2026-03-02 21:52:22 +00:00
Alexander Holliday 7b2ce0e350 Merge pull request #3350 from bluewave-labs/fix/server-validation
fix: server validation
2026-03-02 13:40:56 -08:00
Alexander Holliday 19887332c6 Merge pull request #3349 from bluewave-labs/fix/remove-monitor-swagger-api
fix: removing GET /monitors from swagger docs
2026-03-02 13:35:57 -08:00
Alex Holliday a1858e8302 remove passthrough, remove redudnant refine 2026-03-02 21:35:08 +00:00
Alex Holliday 9fd006cfff remove joi 2026-03-02 19:42:47 +00:00
Alex Holliday 75a7e144cd remove comments 2026-03-02 19:26:20 +00:00
Alex Holliday 16cf23baf1 status page validation 2026-03-02 19:25:34 +00:00
Alex Holliday 8236b02034 remove comments 2026-03-02 19:06:32 +00:00
Alex Holliday 64242322a2 add try/catch block 2026-03-02 18:46:21 +00:00
Alex Holliday c1e03a45b0 settings 2026-03-02 18:03:10 +00:00
Alex Holliday f1466df56c update monitor validation 2026-03-02 17:54:52 +00:00
mannilakash 3654c58469 fix: removing GET /monitors from swagger docs 2026-03-02 12:48:04 -05:00
Alex Holliday b997c43bd5 check, monitor, maintenance 2026-03-02 17:46:33 +00:00
Alex Holliday a5d3c95145 validation refactoring 2026-03-02 17:29:48 +00:00
Gorkem Cetin 003106348a Change demo username in README
Updated demo username in README.
2026-03-02 02:22:46 -05:00
Alex Holliday c3a41272a3 validation refactoring 2026-03-01 17:35:00 +00:00
Alexander Holliday 0bff26fe47 Merge pull request #3346 from bluewave-labs/fix/hardcoded-dimensions
Fix/hardcoded dimensions
2026-03-01 07:19:44 -08:00
Alex Holliday 9169410c1a fallback and histogram 2026-02-28 22:03:30 +00:00
Alex Holliday 9174e66134 sidebar and starprompt 2026-02-28 21:48:42 +00:00
Alex Holliday 04c3c57a59 card-details 2026-02-28 21:27:33 +00:00
Alex Holliday f69b6bbf31 create status page 2026-02-28 21:04:46 +00:00
Alex Holliday 05aa1e7112 authfooter 2026-02-28 20:57:44 +00:00
Alexander Holliday 8aead0a00c Merge pull request #3332 from bluewave-labs/fix/pagespeed-sort
Pagespeed filter sorting fix
2026-02-28 12:51:49 -08:00
Alex Holliday db8ed2994a maintenance create 2026-02-28 20:42:10 +00:00
Alex Holliday 8571ccea78 settings page 2026-02-28 20:25:49 +00:00
Alex Holliday 4d273a6dce table and createMonitor 2026-02-28 16:30:04 +00:00
Alex Holliday 4aabc16096 theme constants 2026-02-28 16:16:14 +00:00
Alexander Holliday 94f9c3d118 Merge pull request #3326 from bluewave-labs/fix/uptime/row-ui
Fix: Uptime Table Body Placement
2026-02-28 08:04:50 -08:00
Alexander Holliday a719364e40 Merge pull request #3344 from bluewave-labs/fix/logging
fix/logging
2026-02-27 18:07:53 -08:00
Alex Holliday 308a439790 apply logger 2026-02-28 01:55:41 +00:00
Alex Holliday 42a001b24e logger 2026-02-28 01:04:35 +00:00
Alexander Holliday f48fc24b9e Merge pull request #3342 from bluewave-labs/fix/remove-on-row-click
remove on row click
2026-02-26 14:22:41 -08:00
Alex Holliday e3057ad039 remove unused import 2026-02-26 22:21:19 +00:00
Alex Holliday 32f41a3cc4 remove unused import 2026-02-26 22:11:32 +00:00
Alex Holliday 177d6f80d0 remove on row click 2026-02-26 22:08:14 +00:00
Alexander Holliday ecef55f1b3 Merge pull request #3341 from bluewave-labs/fix/global-thresholds
Fix/global thresholds
2026-02-26 11:36:21 -08:00
Alex Holliday dede689990 global threshold slider fix 2026-02-26 19:31:12 +00:00
Alex Holliday 85edea713a replace textfields with sliders 2026-02-26 19:07:43 +00:00
Alexander Holliday 7e3da7add7 Merge pull request #3304 from bluewave-labs/feat/grpc-monitoring
Feat: gRPC Monitoring
2026-02-26 09:34:04 -08:00
Alex Holliday dfeba1e4fb resolve conflicts 2026-02-26 17:32:11 +00:00
Alexander Holliday 0442c8dd0f Merge pull request #3336 from bluewave-labs/feat/globalping-map
Feat/globalping map
2026-02-25 14:00:03 -08:00
Alex Holliday 7960f1e82c popup close button 2026-02-25 21:58:48 +00:00
Alexander Holliday f7f1602423 Merge pull request #3335 from bluewave-labs/feat/globalping-map
feat: globalping map
2026-02-25 13:57:12 -08:00
Alex Holliday 78d1451621 hide attribution 2026-02-25 21:49:01 +00:00
Alex Holliday a9f005b2c4 move css styles 2026-02-25 21:44:09 +00:00
Alex Holliday b68214fc47 dark/light mode 2026-02-25 21:20:45 +00:00
Alex Holliday 64c0c93c3e chart 2026-02-25 21:14:17 +00:00
Alexander Holliday 40a1f0c6e0 Merge pull request #3334 from bluewave-labs/feat/global-ping-implementation
remove comment
2026-02-25 12:18:01 -08:00
Alex Holliday 1bb2dd323a remove comment 2026-02-25 20:17:34 +00:00
Alexander Holliday 17238c982e Merge pull request #3333 from bluewave-labs/feat/global-ping-implementation
feat: global ping implementation
2026-02-25 12:17:12 -08:00
Alex Holliday cc1d63f91a remove comment 2026-02-25 20:14:31 +00:00
Alex Holliday ba6e931c59 date range extraction, minor fixes 2026-02-25 20:13:07 +00:00
Alex Holliday 885acf6fe6 all continents in table 2026-02-25 19:34:24 +00:00
Alex Holliday 477c30286d show all checks 2026-02-25 18:43:12 +00:00
Alex Holliday 88e28b9819 cleanup on delete, cleanup orphans 2026-02-24 23:28:27 +00:00
Alex Holliday e7ba3cb5f9 checks route, checks table 2026-02-24 23:20:36 +00:00
Alex Holliday 651fbd7cbb add graph 2026-02-24 22:45:59 +00:00
Alex Holliday 64fdd04cc7 conitnent based query 2026-02-24 22:30:28 +00:00
Alex Holliday c3e4b5b95f ui initial commit 2026-02-24 22:16:02 +00:00
Alex Holliday 10313102ee use correct validation 2026-02-24 21:45:55 +00:00
Alexander Holliday 868cbae66f Merge pull request #3331 from bluewave-labs/fix/uptime-filter-status
Fix: Uptime Status Filter
2026-02-24 13:33:15 -08:00
Alex Holliday 2989968fa1 button string 2026-02-24 13:31:36 -08:00
Alex Holliday 89a7fdbe34 cleanup imports 2026-02-24 19:36:45 +00:00
Alex Holliday 432d1d8ccf remove circular dep 2026-02-24 19:19:32 +00:00
Alex Holliday 5a74411ea2 geo bufer 2026-02-24 18:44:47 +00:00
Alex Holliday 705ecf41c2 rename interface 2026-02-24 18:19:51 +00:00
Alex Holliday 1d4e9d6806 geochecks iniital commit 2026-02-24 18:10:20 +00:00
Alex Holliday 8e37ed7ba2 geo jobs scheduling 2026-02-24 17:55:06 +00:00
Alex Holliday b870f25d1a geo job template 2026-02-24 17:39:09 +00:00
Alex Holliday 7d3abb3f98 map fields 2026-02-24 17:18:22 +00:00
mannilakash 9baa6692dd fix: pagespeed filter sorting fix 2026-02-24 07:45:12 -05:00
Br0wnHammer dd7dfba1cf Fix: Uptime Status Filter 2026-02-24 15:05:27 +05:30
Alex Holliday 858aecce62 fe config box 2026-02-23 18:08:01 +00:00
Alex Holliday 42fdc47d86 initial commit 2026-02-23 17:48:53 +00:00
Br0wnHammer af8f913e62 Fix: Uptime Table Body Placement 2026-02-23 13:38:26 +05:30
Br0wnHammer ea086d6956 Fix: PR comments 2026-02-23 10:25:01 +05:30
Br0wnHammer 22b33d789c Fix: Add grpc in checkData 2026-02-23 10:25:00 +05:30
Br0wnHammer 42e7bc1dbf Feat: Add gRPC to filters 2026-02-23 10:25:00 +05:30
Br0wnHammer 13aa600852 Feat: Add gRPC to CreateMonitor UI 2026-02-23 10:25:00 +05:30
Br0wnHammer c06f81ef76 Feat: Add gRPC to client validation 2026-02-23 10:25:00 +05:30
Br0wnHammer c95db26437 Feat: Update backend Joi validation 2026-02-23 10:25:00 +05:30
Br0wnHammer 94a85f8bbb Feat: Impement requestGrpc in NetworkService 2026-02-23 10:25:00 +05:30
Br0wnHammer 05f8e6a07e Feat: Add GrpcStatus to network and Mongoose schema 2026-02-23 10:25:00 +05:30
Br0wnHammer dac78c7647 Feat: Add gRPC to monitortypes 2026-02-23 10:25:00 +05:30
Alexander Holliday 2d023de568 Merge pull request #3325 from bluewave-labs/feat/pagespeed-date-range
feat: pagespeed date range
2026-02-21 13:09:58 -08:00
Alex Holliday f2c88cfd23 fe 2026-02-21 21:05:51 +00:00
Alex Holliday 910c675a49 aggregate pagespeed 2026-02-21 20:52:47 +00:00
Alex Holliday 882e91f6a7 hook up header 2026-02-21 20:31:56 +00:00
Alexander Holliday 06be65ec52 Merge pull request #3324 from bluewave-labs/fix/import
fix: import
2026-02-21 08:20:57 -08:00
Alex Holliday ea54736a39 remove string 2026-02-21 16:19:43 +00:00
Alex Holliday da38f2ee76 createBulkMonitors -> CreateMonitors 2026-02-21 16:17:23 +00:00
Alex Holliday 83d56f1ff6 fe->be 2026-02-21 16:03:45 +00:00
Alex Holliday f94afb63c6 backend 2026-02-21 03:43:11 +00:00
Alex Holliday 673f47983a FE implementation 2026-02-21 03:14:11 +00:00
Alex Holliday b708e83cce add TODOs 2026-02-20 15:11:37 -08:00
Alexander Holliday 288b677781 Merge pull request #3322 from bluewave-labs/fix/ts-error
ts error
2026-02-20 12:37:57 -08:00
Alex Holliday efcf2567b8 ts error 2026-02-20 20:37:29 +00:00
Alexander Holliday 3763b668ed Merge pull request #3320 from bluewave-labs/fix/no-cache
no cache
2026-02-20 12:20:12 -08:00
Alex Holliday 39c6d05196 no cache 2026-02-20 20:19:42 +00:00
Alexander Holliday 7bf83c12af Merge pull request #3310 from bluewave-labs/fix/be/status-page-access
Fix: Authentication Middleware in StatusPage
2026-02-20 10:45:11 -08:00
Br0wnHammer e25669ac6a Fix: Client Redirect 2026-02-21 00:12:17 +05:30
Br0wnHammer f9653888b1 Fix: One Route 2026-02-21 00:10:39 +05:30
Alexander Holliday 921a1c5145 Merge pull request #3316 from bluewave-labs/fix/settings-refactor
fix/settings refactor
2026-02-20 10:29:46 -08:00
Alex Holliday d45e6ec97c remove v2 dir 2026-02-20 18:13:39 +00:00
Alex Holliday ef774b44f2 remove v1 theme and components 2026-02-20 18:10:43 +00:00
Alex Holliday 8d104ee30a remove v1 theme provider 2026-02-20 17:59:08 +00:00
Alex Holliday fc6300d057 remove old, add about and export 2026-02-20 17:36:04 +00:00
Alex Holliday 73f313e4d5 remove old settings strings 2026-02-20 17:22:43 +00:00
Alex Holliday 42fe6ade3e target blank 2026-02-20 17:22:20 +00:00
Alex Holliday b78b584844 add link text 2026-02-20 17:20:43 +00:00
Alex Holliday b64cf3f6b6 email 2026-02-19 19:23:40 +00:00
Br0wnHammer c27bb0e7f1 fix: build error 2026-02-20 00:52:36 +05:30
Br0wnHammer 1a52531faf feat: new middleware 2026-02-20 00:34:43 +05:30
Br0wnHammer 0974c84b8d feat: fe integration of new endpoint 2026-02-20 00:34:23 +05:30
Br0wnHammer 600c937062 feat: API Middleware 2026-02-20 00:31:42 +05:30
Br0wnHammer b87fd5438e feat: verifyStatusPage middleware 2026-02-20 00:30:06 +05:30
Alex Holliday 6a04ce5eee demo monitors, remove monitors 2026-02-19 18:26:40 +00:00
Br0wnHammer dae2709d31 Fix: Authentication Middleware in StatusPage 2026-02-19 23:55:43 +05:30
Alex Holliday 889bb07946 min values 2026-02-19 18:04:34 +00:00
Alex Holliday 9283890b5f 0 handling 2026-02-19 18:01:15 +00:00
Alex Holliday f2779160a1 port 2026-02-19 17:55:55 +00:00
Alex Holliday 216c7753b4 add global thresholds configbox 2026-02-19 17:33:28 +00:00
Alex Holliday a3a25b2add clear-stats 2026-02-19 17:28:00 +00:00
Alex Holliday b5f2a7b26c Fix pagespeed key issue 2026-02-18 21:06:29 +00:00
Alex Holliday d4e72ee8a6 url settigns 2026-02-18 21:02:08 +00:00
Alex Holliday a59f7fd830 pagespeed 2026-02-18 20:35:46 +00:00
Alex Holliday d8e7f9fc0f add pagespeed config 2026-02-18 20:20:45 +00:00
Alex Holliday cdbf5fd0c0 simplify form 2026-02-18 20:14:35 +00:00
Alex Holliday bbb2da3935 fix state type 2026-02-18 20:04:53 +00:00
Alex Holliday 248482a406 initial commit 2026-02-18 19:59:03 +00:00
Alexander Holliday 1c1474cd6f Merge pull request #3302 from bluewave-labs/fix/settings-form
fix: settings form
2026-02-18 11:25:34 -08:00
Alex Holliday db800e2259 simplify form 2026-02-18 19:23:03 +00:00
Alex Holliday b6765830a5 fix client/server validation 2026-02-18 19:13:52 +00:00
Alex Holliday 8cbde4a705 initial commit 2026-02-18 18:47:58 +00:00
Alexander Holliday 6fcaabbdb6 Merge pull request #3301 from bluewave-labs/fix/settings-form
fix logical errors in settings form
2026-02-18 10:12:44 -08:00
Alex Holliday 7cfbc85d9b fix logical errors in settings form 2026-02-18 18:06:00 +00:00
Alexander Holliday ab834d400e Merge pull request #3300 from bluewave-labs/fix/remove-constraint
fix: remove unique constraint
2026-02-18 09:45:15 -08:00
Alex Holliday 1fcf06a415 remove unique constraint 2026-02-18 17:43:32 +00:00
Alexander Holliday dab465b8c5 Merge pull request #3288 from bluewave-labs/settings-zod-schema
Settings zod schema
2026-02-18 09:32:28 -08:00
Alex Holliday 59d245b424 remove pre tag 2026-02-18 17:27:59 +00:00
karenvicent e921b20fe3 fix zod patterns 2026-02-17 22:21:56 -05:00
Gorkem Cetin 0e6680366d Remove Owaise from the contributing section 2026-02-17 19:53:24 -05:00
Alexander Holliday 7f7a9f40df Merge pull request #3298 from bluewave-labs/fix/monitor-stats-duplication
fix monitor stats bug
2026-02-17 16:08:44 -08:00
Alex Holliday 31698bd002 fix monitor stats bug 2026-02-18 00:06:02 +00:00
Alexander Holliday c7ccdafec2 Merge pull request #3297 from bluewave-labs/fix/avg-response-time-calc
fix: increment before calculate
2026-02-17 15:42:22 -08:00
Alex Holliday c920191984 increment before calculate 2026-02-17 23:40:14 +00:00
Alexander Holliday 374b6aa6ae Merge pull request #3296 from bluewave-labs/feat/max-response-time-rolling-stats
feat: max response time rolling stats
2026-02-17 15:34:35 -08:00
Alex Holliday 3d5c81fe2f Add maxResponseTime to client-side MonitorStats type 2026-02-17 22:50:44 +00:00
Alex Holliday 3bd6ec5d28 max response time 2026-02-17 22:47:37 +00:00
Alexander Holliday 7bb47ef432 Merge pull request #3295 from bluewave-labs/feat/cleanup-job
feat: cleanup job
2026-02-17 14:34:42 -08:00
Alex Holliday 7856317e8f remvoe space 2026-02-17 22:29:30 +00:00
Alex Holliday edbd8f2abb fix check bug 2026-02-17 22:27:52 +00:00
Alex Holliday cddf8b32e6 cleanup incidents 2026-02-17 19:39:24 +00:00
Alex Holliday 0032765bd1 remove orphaned checks 2026-02-17 19:20:08 +00:00
Alex Holliday 6bc9194e8f initial commit 2026-02-17 19:03:17 +00:00
Alexander Holliday ef15e5d6e0 Merge pull request #3294 from bluewave-labs/fix/remove-incidents-on-delete-monitor
fix: remove incidents on delete
2026-02-17 10:32:16 -08:00
Alex Holliday 97750da889 remove incidents on delete 2026-02-17 18:30:22 +00:00
Alexander Holliday af8083bdaa Merge pull request #3293 from bluewave-labs/fix/active-incidents
fix: add missing pluralization strings
2026-02-17 10:16:45 -08:00
Alexander Holliday 54b33ec835 Merge pull request #3292 from bluewave-labs/fix/incident-reason
fix/incident reason
2026-02-17 10:15:41 -08:00
Alex Holliday 847904a274 add missing pluralization strings 2026-02-17 18:15:30 +00:00
Alex Holliday 7bc03c976b remove comment 2026-02-17 17:53:00 +00:00
Alex Holliday 73f05ab78e refactor to remove duplication 2026-02-17 17:49:56 +00:00
Alex Holliday 584e4633d3 incident details 2026-02-17 17:42:11 +00:00
Alexander Holliday 433c57b42e Merge pull request #3291 from bluewave-labs/feat/notification-refactor
feat: notification refactor
2026-02-17 09:31:47 -08:00
Alexander Holliday a2cf2afc09 Merge pull request #3279 from bluewave-labs/enhancement/uptime-graph-avg-max-response
enhancement: add average and max response time to histogram
2026-02-17 09:31:25 -08:00
Alex Holliday 232be7a405 cleanup 2026-02-17 17:28:43 +00:00
mannilakash 7d66bb5668 fix: unnecessary custom styling and originalResponseTime usage 2026-02-17 10:27:22 -05:00
mannilakash 566fded55c Merge branch 'develop' of github.com:bluewave-labs/Checkmate into enhancement/uptime-graph-avg-max-response 2026-02-17 10:20:37 -05:00
Alex Holliday fbb0e940c6 emails 2026-02-17 01:47:57 +00:00
Alex Holliday f983863c72 new template 2026-02-17 01:25:30 +00:00
Alex Holliday e0a75c78db refactor discord 2026-02-17 01:16:00 +00:00
Alex Holliday 2cd2a6d917 pagerduty 2026-02-16 21:58:58 +00:00
Alex Holliday 6f55e4934f matrix 2026-02-16 21:49:42 +00:00
Alex Holliday 0e1dc3e3fe slack 2026-02-16 21:48:03 +00:00
Alex Holliday e18681606c add webhook 2026-02-16 20:55:00 +00:00
Alex Holliday d2d75cd035 initial commit 2026-02-16 20:18:25 +00:00
Alex Holliday a65515fc08 logger type 2026-02-16 19:42:10 +00:00
Alex Holliday 302ac6f4f1 update gitignore 2026-02-16 19:32:28 +00:00
Alexander Holliday b51d40fe77 Merge pull request #3290 from bluewave-labs/feat/incident-on-threshold-exception
Feat/incident on threshold exception
2026-02-16 10:47:24 -08:00
Alex Holliday 27f3def9bd correct logger type 2026-02-16 18:43:03 +00:00
Alex Holliday e7a7c0e603 remove grouping 2026-02-16 18:39:41 +00:00
Alex Holliday 55885ea007 remove global decision 2026-02-16 18:25:35 +00:00
karenvicent 475801e91c fix traslation object 2026-02-16 00:47:23 -05:00
karenvicent cd501e46cd Merge branch 'develop' into settings-zod-schema 2026-02-16 00:12:08 -05:00
karenvicent 93c15588a4 implement schema zod and validation on settings 2026-02-16 00:09:08 -05:00
Alex Holliday a8ecd44abf inject settings service, extract client host 2026-02-16 00:39:34 +00:00
Alex Holliday 412a3b7cc9 remove redundant method 2026-02-16 00:17:51 +00:00
Alex Holliday be8580ee99 update providers 2026-02-15 18:35:54 +00:00
Alex Holliday 8020bfde21 refactor handleIncidents 2026-02-15 18:20:42 +00:00
Alex Holliday 7061eb8eb0 use decision object in incidentService 2026-02-15 18:09:21 +00:00
Alex Holliday 70ae15725e conditinally render breached stauts box 2026-02-14 23:09:27 +00:00
Alex Holliday 32a7bd6543 add breached status to summary header 2026-02-14 22:57:27 +00:00
Alex Holliday 68db4b8701 breached status 2026-02-14 22:52:14 +00:00
Alex Holliday b75c1a4fcb create incident on hardware breach 2026-02-14 22:29:06 +00:00
Alex Holliday e50240885d debug logging 2026-02-14 22:25:15 +00:00
Alex Holliday 22645d86f7 handle infra thresholds 2026-02-14 22:14:51 +00:00
Alex Holliday 62778886e1 use counters 2026-02-14 21:55:47 +00:00
Alex Holliday 9c467c763d add threshold counters 2026-02-14 21:49:32 +00:00
Alex Holliday 97ace1e058 remove unused checks 2026-02-14 21:38:00 +00:00
Alex Holliday 2fb6cb0b6f remove alertThreshold 2026-02-14 21:29:30 +00:00
Alex Holliday a7b0ce4d8f remove thresholds 2026-02-14 21:21:18 +00:00
Alex Holliday 4a73170583 initial commit 2026-02-14 21:05:31 +00:00
Alexander Holliday 41310cb552 Merge pull request #3286 from bluewave-labs/feat/infra-thresholds
feat: infra thresholds
2026-02-13 17:23:49 -08:00
Alex Holliday 111b68b8df revert slider size change 2026-02-14 01:21:02 +00:00
Alex Holliday 2430bbeebb remove slider hover 2026-02-14 01:15:12 +00:00
Alex Holliday f694917dd4 remove unused 2026-02-14 01:07:46 +00:00
Alex Holliday 47b18e1d9d use sliderwithlabels 2026-02-14 01:02:15 +00:00
Alexander Holliday 0d863aefe8 Merge pull request #3285 from bluewave-labs/fix/create-monitors-port
fix port input
2026-02-13 16:45:01 -08:00
Alex Holliday c319738048 add config box for thresholds 2026-02-14 00:40:59 +00:00
Alex Holliday 002a82bb9a fix port input 2026-02-14 00:19:01 +00:00
Alexander Holliday 8719efab5d Merge pull request #3284 from bluewave-labs/fix/routes
fix: routes
2026-02-13 16:17:57 -08:00
Alex Holliday 86fd535eaf routes to TS 2026-02-14 00:08:28 +00:00
Alex Holliday 2f6dbe9a3a update gitignore 2026-02-13 23:56:35 +00:00
Alexander Holliday 649eaae712 Merge pull request #3283 from bluewave-labs/fix/string-cleanup
clean up strings
2026-02-13 13:22:34 -08:00
Alex Holliday 1888ee0478 remove unused monitor import 2026-02-13 21:19:55 +00:00
Alex Holliday fd2c54d3d3 remove unused 2026-02-13 20:42:26 +00:00
Alex Holliday bd941db771 clean up strings 2026-02-13 20:41:27 +00:00
Alexander Holliday 88fceddbbf Merge pull request #3282 from bluewave-labs/fix/monitor-stats
fix: initializing stats
2026-02-13 11:18:54 -08:00
Alex Holliday 13251ca7c5 fix initializing stats 2026-02-13 19:04:19 +00:00
Alexander Holliday 6d6b597f99 Merge pull request #3281 from bluewave-labs/fix/cleanup
fix: cleanup
2026-02-13 11:01:43 -08:00
Alex Holliday dfc1733820 remove icons 2026-02-13 18:51:29 +00:00
mannilakash 39a449e594 fix: padding fix for stats text 2026-02-13 11:14:25 -05:00
mannilakash 974d33b3de enhancement: add average and max response time for histogram 2026-02-13 10:32:52 -05:00
Alex Holliday afe2b9d3bb remove unused images 2026-02-12 23:37:08 +00:00
Alex Holliday 5ab5cbe622 status box fix 2026-02-12 23:31:37 +00:00
Alex Holliday b6b1b8464c remove old DB references 2026-02-12 23:03:16 +00:00
Alex Holliday f337ca5ff0 initial commit 2026-02-12 22:37:40 +00:00
Alexander Holliday f5bc8e78e4 Merge pull request #3278 from bluewave-labs/fix/failed-check-warn
Fix/failed check warn
2026-02-12 11:44:48 -08:00
Alex Holliday 8089e71f96 warn instead of throw on failure to build check 2026-02-12 19:42:58 +00:00
karenvicent 6195650dc1 Merge branch 'develop' into settings-zod-schema 2026-02-12 14:25:05 -05:00
Alex Holliday f600647ff0 fix ts error 2026-02-12 19:16:16 +00:00
Alex Holliday cafea2bf5d remove unused utils, convert utils to TS 2026-02-12 19:13:53 +00:00
Alexander Holliday 4e3a82d25f Merge pull request #3276 from bluewave-labs/fix/monitor-status
fix: monitor status
2026-02-12 10:32:38 -08:00
Alexander Holliday 33e0136a2a Merge pull request #3275 from bluewave-labs/fix/ts
Fix/ts
2026-02-12 10:32:22 -08:00
Alex Holliday b0b7b6a435 fix status change issue 2026-02-12 18:30:44 +00:00
Alex Holliday 85dbe34e00 store to ts 2026-02-12 18:30:15 +00:00
Alex Holliday f38b305ba7 ui slice to TS 2026-02-12 18:07:48 +00:00
Alexander Holliday f9c32cb19b Merge pull request #3274 from bluewave-labs/fix/css-cleanup
fix: clean up index.css
2026-02-12 10:02:39 -08:00
Alex Holliday b540e48aab clean up index.css 2026-02-12 18:01:12 +00:00
Alexander Holliday a50c2578e9 Merge pull request #3273 from bluewave-labs/fix/settings
fix: put -> patch
2026-02-12 09:28:40 -08:00
Alex Holliday 2e30b622d3 put -> patch 2026-02-12 17:26:17 +00:00
karenvicent f59d8bf1bf Merge branch 'develop' into settings-zod-schema 2026-02-12 12:18:05 -05:00
karenvicent 0941f3ce1a zod schema and hook 2026-02-12 12:13:36 -05:00
Alexander Holliday 3838b18931 Merge pull request #3270 from bluewave-labs/feat/monitor-status
feat: monitor status
2026-02-11 12:30:59 -08:00
Alex Holliday 71cdd05b15 type errors 2026-02-11 20:29:50 +00:00
Alex Holliday 4b1c588f5a extract header 2026-02-11 20:11:22 +00:00
Alex Holliday cbd8b5db47 update monitor status on maintenance 2026-02-11 19:38:32 +00:00
Alex Holliday 94afe19b37 update services/repositories to reflect new monitorstatus type 2026-02-11 19:22:35 +00:00
Alex Holliday d622bce6c1 update summary type 2026-02-11 19:00:04 +00:00
Alex Holliday 7b658a9e52 initial commit 2026-02-11 18:58:12 +00:00
Alex Holliday d296aec02e add monitor statuses 2026-02-11 18:44:21 +00:00
Alexander Holliday 82c8122a5a Merge pull request #3269 from bluewave-labs/fix/cleanup
fix: cleanup
2026-02-11 10:38:27 -08:00
Alex Holliday 446c791f88 avatar text color 2026-02-11 18:36:20 +00:00
Alex Holliday e214d9a54c sidebar tweak 2026-02-11 18:34:55 +00:00
Alex Holliday 6f6920f3b2 migrate protected routes 2026-02-11 18:15:26 +00:00
Alex Holliday de447d7be2 move admin check to regsiter page 2026-02-11 17:52:26 +00:00
Alex Holliday ee3062fcb4 remove unused components 2026-02-11 17:37:50 +00:00
Alex Holliday 6443802024 cleanup imports 2026-02-11 17:21:32 +00:00
Alexander Holliday d88c73bb20 Merge pull request #3267 from bluewave-labs/feat/v2-layout
feat: v2 layout
2026-02-11 09:09:28 -08:00
Alex Holliday 10bfdc9da1 hook up offline banner 2026-02-10 23:53:06 +00:00
Alex Holliday 0503c25663 cleanup 2026-02-10 23:32:58 +00:00
Alex Holliday 442fc2ce22 account tab fix 2026-02-10 23:24:51 +00:00
Alex Holliday 71f3c90472 strings 2026-02-10 23:16:12 +00:00
Alex Holliday 4c5c2d2d5e auth footer 2026-02-10 23:12:33 +00:00
Alex Holliday a390ee5f21 auth footer 2026-02-10 22:54:23 +00:00
Alex Holliday 0d98353625 auth footer 2026-02-10 22:47:39 +00:00
Alex Holliday 0e1b074c6c styling 2026-02-10 22:28:47 +00:00
Alex Holliday a289a197a1 starprompt 2026-02-10 22:24:35 +00:00
Alex Holliday 0f6c273dad bottom menu 2026-02-10 22:17:13 +00:00
Alex Holliday 1db5f4b70f sidebar 2026-02-10 21:54:31 +00:00
Alex Holliday d1d96bd2ba sidebar 2026-02-10 19:21:57 +00:00
Alex Holliday 7ef10b4fcd initial commit 2026-02-10 17:53:00 +00:00
Alexander Holliday a2dfbd29c7 Merge pull request #3266 from bluewave-labs/fix/cleanup
fix; cleanup
2026-02-10 09:33:33 -08:00
Alex Holliday 14ba3016f6 Merge branch 'develop' into fix/cleanup 2026-02-10 17:06:29 +00:00
Alexander Holliday ac98f783e3 Merge pull request #3257 from bluewave-labs/fix/search-input-debounce
fix: changes for debounce search in uptime/infrastructure pages
2026-02-10 07:18:46 -08:00
Alex Holliday 28dc61e1a6 v1 cleanup 2026-02-10 00:01:27 +00:00
Alex Holliday a20fdb423a remove unused 2026-02-09 23:51:18 +00:00
Alex Holliday 1236b9191e fix email config 2026-02-09 23:41:21 +00:00
Alex Holliday 34762ef475 remove network servcie 2026-02-09 23:37:07 +00:00
Alex Holliday b817a16459 remove settings hooks 2026-02-09 23:28:46 +00:00
Alex Holliday 2091d8dcd7 remove monitorHooks 2026-02-09 23:16:14 +00:00
Alex Holliday 3d1bd94279 remove unused hooks 2026-02-09 23:02:26 +00:00
Alex Holliday 07aad0204e update slice 2026-02-09 22:56:56 +00:00
Alexander Holliday 7c0d45d287 Merge pull request #3265 from bluewave-labs/feat/v2-not-found
feat: v2 not found
2026-02-09 14:23:56 -08:00
Alex Holliday 06c571d89f img -> box 2026-02-09 22:22:01 +00:00
Alex Holliday 9b60e32125 initial commit 2026-02-09 22:19:10 +00:00
Alexander Holliday c681074bb2 Merge pull request #3264 from bluewave-labs/feat/v2-set-new-password
feat: v2 set new password
2026-02-09 14:09:39 -08:00
Alex Holliday b47e17fe91 cleanup 2026-02-09 22:07:02 +00:00
Alex Holliday 28affa1cd1 submit 2026-02-09 21:56:28 +00:00
Alex Holliday f5372b4d86 ui and strings 2026-02-09 21:29:55 +00:00
Alex Holliday 4db4947220 basic UI 2026-02-09 21:21:17 +00:00
Alex Holliday 48fb422e0f initial commit 2026-02-09 21:00:27 +00:00
Alexander Holliday 20d4f2c092 Merge pull request #3262 from bluewave-labs/feat/v2-edit-user
feat: v2 edit user
2026-02-09 12:50:17 -08:00
Alex Holliday 48081d85ee cleanup 2026-02-09 20:48:12 +00:00
Alex Holliday ece6970fa7 hook up role 2026-02-09 20:38:04 +00:00
Alex Holliday 4434189c72 remove breadcrumb 2026-02-09 20:09:08 +00:00
Alex Holliday 197e075ba1 strings 2026-02-09 20:07:45 +00:00
Alex Holliday c4ab56095e strings 2026-02-09 19:46:11 +00:00
Alex Holliday 550d5cc555 initial commit 2026-02-09 19:26:58 +00:00
Alexander Holliday b08e69764c Merge pull request #3261 from bluewave-labs/feat/v2-account
feat: v2 account
2026-02-09 11:17:25 -08:00
Alex Holliday 08e4b0c39e remove unused 2026-02-09 19:15:22 +00:00
Alex Holliday a46e282633 role column 2026-02-09 18:57:24 +00:00
Alex Holliday 8b7fd826b3 createUser endpoint 2026-02-09 18:49:31 +00:00
Alex Holliday 264e6f7d1f form submission 2026-02-09 18:29:36 +00:00
Alex Holliday fafd581f06 add team member initial commit 2026-02-09 18:14:06 +00:00
Alex Holliday d69cec9730 dialog 2026-02-09 17:52:14 +00:00
Alex Holliday 1552018796 optional additionalButtons 2026-02-08 16:30:51 +00:00
Alex Holliday 3fc4160b88 add buttons 2026-02-08 16:23:24 +00:00
Alex Holliday 9ca79ea793 team initial commit 2026-02-08 16:14:35 +00:00
Alex Holliday 2e3b32462f remove mongo hash middleware 2026-02-07 21:15:58 +00:00
Alex Holliday 7e527b8eb2 submit 2026-02-07 21:05:45 +00:00
Alex Holliday 021b4e8ae5 controllers 2026-02-07 20:57:03 +00:00
Alex Holliday b6004241e7 validation 2026-02-07 20:54:17 +00:00
Alex Holliday af4c9d8f91 fix unset 2026-02-07 20:33:11 +00:00
Alex Holliday f2b740a8f9 put -> patch 2026-02-07 20:17:59 +00:00
Alex Holliday b26d135a4f submit 2026-02-07 20:11:30 +00:00
Alex Holliday 4f4203dbb3 remove delete 2026-02-07 19:59:28 +00:00
Alex Holliday 4945b29334 wire up form 2026-02-07 01:13:58 +00:00
Alex Holliday 1808db5cd7 form 2026-02-07 01:04:20 +00:00
Alex Holliday 31cc9cd294 fix strings 2026-02-07 00:51:04 +00:00
Alex Holliday 19b370d89b initial commit 2026-02-07 00:49:49 +00:00
507 changed files with 14085 additions and 24342 deletions

No files matched your search

@@ -107,6 +107,7 @@ jobs:
context: .
file: ./docker/dist-arm/server.Dockerfile
push: true
no-cache: true
tags: |
ghcr.io/bluewave-labs/checkmate-backend-mono-multiarch:${{ steps.extract_tag.outputs.version }}
platforms: linux/amd64,linux/arm64
+1
View File
@@ -102,6 +102,7 @@ jobs:
context: .
file: ./docker/dist-arm/server.Dockerfile
push: true
no-cache: true
tags: |
ghcr.io/bluewave-labs/checkmate-backend-mono-multiarch:latest
platforms: linux/amd64,linux/arm64
+5 -1
View File
@@ -3,4 +3,8 @@
.VSCodeCounter
*.sh
mongo
node_modules/
node_modules/
docs/architecture
docs/reviews
docs/todo
docs/frontend
+2 -2
View File
@@ -42,7 +42,7 @@ Checkmate has been stress-tested with 1000+ active monitors without any particul
## Demo
You can see the latest build of [Checkmate](https://checkmate-demo.bluewavelabs.ca/) in action. The username is uptimedemo@demo.com and the password is Demouser1! (just a note that we update the demo server from time to time, so if it doesn't work for you, please ping us on the Discussions channel).
You can see the latest build of [Checkmate](https://checkmate-demo.bluewavelabs.ca/) in action. The username is demouser@demo.com and the password is Demouser1! (just a note that we update the demo server from time to time, so if it doesn't work for you, please ping us on the Discussions channel).
## User's guide
@@ -147,7 +147,7 @@ If you would like to sponsor an additional feature, [see this page](https://chec
## Contributing
We are [Alex](http://github.com/ajhollid) (team lead), [Gorkem](http://github.com/gorkem-bwl/), [Owaise](http://github.com/Owaiseimdad), [Aryaman](https://github.com/Br0wnHammer), [Mert](https://github.com/mertssmnoglu) and [Karen](https://github.com/karenvicent) helping individuals and businesses monitor their infra and servers.
We are [Alex](http://github.com/ajhollid) (team lead), [Gorkem](http://github.com/gorkem-bwl/), [Aryaman](https://github.com/Br0wnHammer), [Mert](https://github.com/mertssmnoglu) and [Karen](https://github.com/karenvicent) helping individuals and businesses monitor their infra and servers.
We pride ourselves on building strong connections with contributors at every level. Despite being a young project, Checkmate has already earned 7000+ stars and attracted 90+ contributors from around the globe.
+1 -1
View File
@@ -18,7 +18,7 @@
<div id="root"></div>
<script
type="module"
src="/src/main.jsx"
src="/src/main.tsx"
></script>
</body>
</html>
+692 -106
View File
File diff suppressed because it is too large. Load diff
+5 -2
View File
@@ -13,7 +13,7 @@
"format-check": "prettier --check ."
},
"lint-staged": {
"**/*": "npm run format"
"**/*": "prettier --write"
},
"dependencies": {
"@emotion/react": "^11.13.3",
@@ -25,6 +25,7 @@
"@mui/x-charts": "7.29.1",
"@mui/x-date-pickers": "7.29.4",
"@reduxjs/toolkit": "2.7.0",
"@types/maplibre-gl": "^1.13.2",
"axios": "^1.7.4",
"dayjs": "1.11.13",
"flag-icons": "7.3.2",
@@ -33,6 +34,7 @@
"i18next": "25.4.2",
"joi": "17.13.3",
"lucide-react": "^0.562.0",
"maplibre-gl": "^5.19.0",
"mui-color-input": "^7.0.0",
"pretty-bytes": "^7.1.0",
"pretty-ms": "^9.3.0",
@@ -41,6 +43,7 @@
"react-hook-form": "^7.63.0",
"react-i18next": "^15.4.0",
"react-icons": "5.5.0",
"react-map-gl": "^8.1.0",
"react-redux": "9.2.0",
"react-router": "^6.23.0",
"react-router-dom": "^6.23.1",
@@ -63,6 +66,6 @@
"lint-staged": "^16.2.7",
"prettier": "^3.3.3",
"typescript": "5.9.3",
"vite": "6.3.6"
"vite": "6.4.1"
}
}
-52
View File
@@ -1,52 +0,0 @@
import { useEffect } from "react";
import { useSelector } from "react-redux";
import "react-toastify/dist/ReactToastify.css";
import { ToastContainer } from "react-toastify";
import { ThemeProvider } from "@emotion/react";
import lightTheme from "./Utils/Theme/lightTheme";
import darkTheme from "./Utils/Theme/darkTheme";
import { CssBaseline, GlobalStyles } from "@mui/material";
import { logger } from "./Utils/Logger"; // Import the logger
import { networkService } from "./main";
import { Routes } from "./Routes";
import AppLayout from "@/Components/v1/Layouts/AppLayout";
function App() {
const mode = useSelector((state) => state.ui.mode);
// Cleanup
useEffect(() => {
return () => {
logger.cleanup();
networkService.cleanup();
};
}, []);
const theme = mode === "light" ? lightTheme : darkTheme;
return (
<ThemeProvider theme={theme}>
<CssBaseline />
<GlobalStyles
styles={{
body: {
backgroundColor: theme.palette.background.main,
},
}}
/>
<AppLayout>
<Routes />
</AppLayout>
<ToastContainer
newestOnTop={true}
theme={mode}
style={{
"--toastify-color-progress-light": "#7C8BA1",
"--toastify-color-progress-dark": "#7C8BA1",
}}
/>
</ThemeProvider>
);
}
export default App;
+56
View File
@@ -0,0 +1,56 @@
import { type CSSProperties } from "react";
import { useSelector } from "react-redux";
import "react-toastify/dist/ReactToastify.css";
import { ToastContainer } from "react-toastify";
import { ThemeProvider } from "@emotion/react";
import { CssBaseline, GlobalStyles } from "@mui/material";
import { SWRConfig } from "swr";
import { Routes } from "./Routes";
import AppLayout from "@/Components/layout/AppLayout";
import type { RootState } from "@/Types/state";
import { lightTheme, darkTheme } from "@/Utils/Theme/Theme";
const swrConfig = {
dedupingInterval: 5000,
revalidateOnFocus: false,
revalidateOnReconnect: true,
shouldRetryOnError: false,
errorRetryCount: 2,
errorRetryInterval: 1000,
focusThrottleInterval: 5000,
};
function App() {
const mode = useSelector((state: RootState) => state.ui.mode);
const theme = mode === "light" ? lightTheme : darkTheme;
return (
<SWRConfig value={swrConfig}>
<ThemeProvider theme={theme}>
<CssBaseline />
<GlobalStyles
styles={{
body: {
backgroundColor: theme.palette.background.default,
},
}}
/>
<AppLayout>
<Routes />
</AppLayout>
<ToastContainer
newestOnTop={true}
theme={mode}
style={
{
"--toastify-color-progress-light": "#7C8BA1",
"--toastify-color-progress-dark": "#7C8BA1",
} as CSSProperties
}
/>
</ThemeProvider>
</SWRConfig>
);
}
export default App;
@@ -1,53 +0,0 @@
.wallet-adapter-dropdown {
width: 100%;
display: flex;
flex-wrap: wrap;
justify-content: center;
align-items: center;
gap: var(--env-var-spacing-1);
}
.wallet-adapter-button {
display: flex;
align-items: center;
justify-content: center;
width: auto;
height: var(--env-var-height-2) !important;
font-size: var(--env-var-font-size-medium-plus) !important;
font-weight: 500 !important;
margin: 0;
padding: calc(
(var(--env-var-height-2) - var(--env-var-font-size-medium-plus) * 1.2) / 2
)
var(--env-var-spacing-1);
white-space: nowrap;
}
.wallet-adapter-modal-title {
font-size: var(--font-size-h5) !important;
}
/* Separator styling */
.wallet-adapter-modal-divider {
background-color: var(--border-color) !important;
margin: var(--spacing-md) 0 !important;
}
/* Responsive fixes */
@media (max-width: 1200px) {
.wallet-adapter-button {
font-size: var(--env-var-font-size-medium) !important;
padding: calc((var(--env-var-height-2) - var(--env-var-font-size-medium) * 1.2) / 2)
var(--env-var-spacing-1-minus) !important;
}
}
@media (max-width: 900px) {
.wallet-adapter-modal-wrapper {
flex-direction: column !important;
}
.wallet-adapter-modal-divider {
margin: var(--spacing-sm) 0 !important;
}
}
@@ -1,50 +0,0 @@
// import { useMemo } from "react";
// import { ConnectionProvider, WalletProvider } from "@solana/wallet-adapter-react";
// import { WalletAdapterNetwork } from "@solana/wallet-adapter-base";
// import {
// UnsafeBurnerWalletAdapter,
// PhantomWalletAdapter,
// } from "@solana/wallet-adapter-wallets";
// import { WalletModalProvider } from "@solana/wallet-adapter-react-ui";
// import { clusterApiUrl } from "@solana/web3.js";
// import PropTypes from "prop-types";
// import "./index.css";
// // Default styles that can be overridden by your app
// import "@solana/wallet-adapter-react-ui/styles.css";
// export const Wallet = ({ children }) => {
// // The network can be set to 'devnet', 'testnet', or 'mainnet-beta'.
// const network = WalletAdapterNetwork.Mainnet;
// // You can also provide a custom RPC endpoint.
// const endpoint = useMemo(() => clusterApiUrl(network), [network]);
// const wallets = useMemo(
// () => [new PhantomWalletAdapter()],
// // eslint-disable-next-line react-hooks/exhaustive-deps
// [network]
// );
// return (
// <ConnectionProvider endpoint={endpoint}>
// <WalletProvider
// wallets={wallets}
// autoConnect
// >
// <WalletModalProvider>{children}</WalletModalProvider>
// </WalletProvider>
// </ConnectionProvider>
// );
// };
// Wallet.propTypes = {
// children: PropTypes.node,
// };
const Wallet = ({ children }) => {
return children;
};
export default Wallet;
@@ -2,7 +2,7 @@ import Box from "@mui/material/Box";
import { useTheme } from "@mui/material/styles";
import type { CheckSnapshot } from "@/Types/Check";
import { getResponseColor } from "@/Utils/DataUtils";
import { HeatmapResponseTimeTooltip } from "@/Components/v2/common/charts/HeatmapResponseTimeTooltip";
import { HeatmapResponseTimeTooltip } from "@/Components/common/charts/HeatmapResponseTimeTooltip";
import type { SxProps } from "@mui/material/styles";
import type { ResponsiveStyleValue } from "@mui/system";
@@ -32,7 +32,7 @@ export const HeatmapResponseTime = ({
if (!checks || checks.length === 0) return null;
const latestChecks = checks.slice(-25).reverse();
const latestChecks = checks.slice(-25);
let data: Array<CheckSnapshot | PlaceholderCheck>;
if (latestChecks.length !== 25) {
@@ -0,0 +1,155 @@
import Box from "@mui/material/Box";
import Stack from "@mui/material/Stack";
import Typography from "@mui/material/Typography";
import { useTheme } from "@mui/material/styles";
import type { ResponsiveStyleValue } from "@mui/system";
import type { CheckSnapshot } from "@/Types/Check";
import { HeatmapResponseTimeTooltip } from "./HeatmapResponseTimeTooltip";
import { useMemo } from "react";
import { useTranslation } from "react-i18next";
interface HistogramResponseTimeProps {
checks: CheckSnapshot[];
height?: ResponsiveStyleValue<number | string>;
gap?: ResponsiveStyleValue<number | string>;
showStats?: boolean;
statsPosition?: "left" | "right";
}
interface ResponseTimeStats {
max: number | string;
avg: number | string;
}
const DEFAULT_HEIGHT = 50;
const calculateResponseTimeStats = (checks: CheckSnapshot[]): ResponseTimeStats => {
if (!Array.isArray(checks) || checks.length === 0) {
return { max: "-", avg: "-" };
}
const validChecks = checks.filter((check) => check.originalResponseTime != null);
if (validChecks.length === 0) {
return { max: "-", avg: "-" };
}
const responseTimes = validChecks.map((check) => check.originalResponseTime);
const max = Math.max(...responseTimes);
const avg = Math.round(
responseTimes.reduce((sum, time) => sum + time, 0) / responseTimes.length
);
return { max, avg };
};
export const HistogramResponseTime = ({
checks,
height = DEFAULT_HEIGHT,
gap,
showStats = true,
statsPosition = "right",
}: HistogramResponseTimeProps) => {
const theme = useTheme();
const { t } = useTranslation();
const stats = useMemo(() => calculateResponseTimeStats(checks), [checks]);
if (!Array.isArray(checks) || checks.length === 0) return null;
const data =
checks.length !== 25
? [...checks, ...Array(25 - checks.length).fill({ status: "placeholder" })]
: checks;
const chartHeight = typeof height === "number" ? `${height}px` : height;
const gridGap = gap ?? theme.spacing(0.5);
const statsContent = showStats &&
(typeof stats.max === "number" || typeof stats.avg === "number") && (
<Stack
justifyContent="center"
alignItems={statsPosition === "left" ? "flex-end" : "flex-start"}
minWidth={70}
pr={statsPosition === "left" ? theme.spacing(8) : 0}
pl={statsPosition === "right" ? theme.spacing(8) : 0}
>
<Typography variant="body2">
{t("common.charts.histogram.avg", { value: stats.avg })}
</Typography>
<Typography variant="body2">
{t("common.charts.histogram.max", { value: stats.max })}
</Typography>
</Stack>
);
return (
<Stack
direction={statsPosition === "left" ? "row-reverse" : "row"}
alignItems="center"
sx={{ width: "100%" }}
>
<Box sx={{ flex: 1 }}>
<Box
sx={{
width: "100%",
display: "grid",
gridTemplateColumns: "repeat(25, 1fr)",
gap: gridGap,
alignItems: "end",
height: chartHeight,
}}
>
{data.map((check, index) => {
const isPlaceholder = (check as any).status === "placeholder";
const heightPct = `${Math.max(0, Math.min(100, (check as any).responseTime ?? 0))}%`;
const barColor =
check.status === true
? theme.palette.success.light
: theme.palette.error.light;
const bar = (
<Box
sx={{
position: "relative",
width: "100%",
height: "100%",
borderRadius: theme.spacing(1),
bgcolor: theme.palette.action.hover,
overflow: "hidden",
}}
>
<Box
sx={{
position: "absolute",
bottom: 0,
left: 0,
width: "100%",
height: isPlaceholder ? 0 : heightPct,
bgcolor: barColor,
transition: "height 500ms cubic-bezier(0.4, 0, 0.2, 1)",
}}
/>
</Box>
);
return isPlaceholder ? (
<Box
key={index}
sx={{ height: "100%" }}
>
{bar}
</Box>
) : (
<HeatmapResponseTimeTooltip
key={index}
check={check}
>
{bar}
</HeatmapResponseTimeTooltip>
);
})}
</Box>
</Box>
{statsContent}
</Stack>
);
};
@@ -1,7 +1,7 @@
import Stack from "@mui/material/Stack";
import Box from "@mui/material/Box";
import Typography from "@mui/material/Typography";
import { ToggleButtonGroup, ToggleButton } from "@/Components/v2/inputs";
import { ToggleButtonGroup, ToggleButton } from "@/Components/inputs";
import { useTheme } from "@mui/material/styles";
import CircularProgress from "@mui/material/CircularProgress";
import { useTranslation } from "react-i18next";
+5
View File
@@ -0,0 +1,5 @@
export * from "./charts/HistogramResponseTime";
export * from "./charts/HeatmapResponseTime";
export * from "./charts/HeatmapResponseTimeTooltip";
export * from "./controls/HeaderCreate";
export * from "./controls/HeaderTimeRange";
@@ -0,0 +1,48 @@
import { Avatar as MuiAvatar } from "@mui/material";
import { useSelector } from "react-redux";
import { useEffect, useState } from "react";
import { useTheme } from "@mui/material";
import type { RootState } from "@/Types/state";
interface AvatarProps {
src?: string;
small?: boolean;
sx?: object;
onClick?: (event: React.MouseEvent<HTMLDivElement>) => void;
}
export const Avatar = ({ src, small, sx, onClick = () => {} }: AvatarProps) => {
const { user } = useSelector((state: RootState) => state.auth);
const theme = useTheme();
if (!user) return null;
const style = small ? { width: 32, height: 32 } : { width: 64, height: 64 };
const [image, setImage] = useState<string>();
useEffect(() => {
if (user.avatarImage) {
setImage(`data:image/png;base64,${user.avatarImage}`);
}
}, [user?.avatarImage]);
return (
<MuiAvatar
onClick={onClick}
alt={`${user?.firstName} ${user?.lastName}`}
src={src ? src : user?.avatarImage ? image : undefined}
sx={{
color: theme.palette.primary.contrastText,
fontSize: small ? "16px" : "22px",
fontWeight: 400,
backgroundColor: theme.palette.primary.main,
display: "inline-flex",
...style,
...sx,
}}
>
{user.firstName?.charAt(0)}
{user.lastName?.charAt(0) || ""}
</MuiAvatar>
);
};
@@ -1,7 +1,8 @@
import { BaseBox } from "../design-elements";
import { BaseBox } from ".";
import Stack from "@mui/material/Stack";
import Box from "@mui/material/Box";
import Typography from "@mui/material/Typography";
import { LAYOUT } from "@/Utils/Theme/constants";
import type { ResponsiveStyleValue } from "@mui/system";
import { useTheme } from "@mui/material/styles";
@@ -26,7 +27,7 @@ export const BaseChart = ({
return (
<BaseBox
sx={{
padding: padding ?? theme.spacing(8),
padding: padding ?? theme.spacing(LAYOUT.MD),
display: "flex",
flex: 1,
width: width,
@@ -34,13 +35,13 @@ export const BaseChart = ({
}}
>
<Stack
gap={theme.spacing(8)}
gap={theme.spacing(LAYOUT.MD)}
flex={1}
>
<Stack
direction="row"
alignItems={"center"}
gap={theme.spacing(4)}
gap={theme.spacing(LAYOUT.XS)}
>
{icon && (
<BaseBox
@@ -3,13 +3,14 @@ import Stack from "@mui/material/Stack";
import Box from "@mui/material/Box";
import Alert from "@mui/material/Alert";
import Link from "@mui/material/Link";
import { LAYOUT, SPACING } from "@/Utils/Theme/constants";
import {
ErrorFallback,
EmptyFallback,
EmptyMonitorFallback,
BaseFallback,
} from "@/Components/v2/design-elements/Fallback";
import { Breadcrumb } from "@/Components/v2/design-elements/Breadcrumb";
} from "@/Components/design-elements/Fallback";
import { Breadcrumb } from "@/Components/design-elements/Breadcrumb";
import CircularProgress from "@mui/material/CircularProgress";
import { HeaderAuthControls } from "@/Pages/Auth/components/HeaderAuthControls";
@@ -91,7 +92,7 @@ export const BasePage = ({
return (
<Stack
spacing={theme.spacing(10)}
spacing={theme.spacing(LAYOUT.LG)}
{...props}
>
<Breadcrumb breadcrumbOverride={breadcrumbOverride} />
@@ -177,7 +178,7 @@ export const MonitorBasePageWithStates = ({
error={error}
{...props}
>
{priorityFallback}
<Stack height={"100%"}>{priorityFallback}</Stack>
</BasePage>
);
}
@@ -220,7 +221,7 @@ export const BaseAuthPage = ({
return (
<BasePage
breadcrumbOverride={[]}
gap={theme.spacing(8)}
gap={theme.spacing(LAYOUT.MD)}
alignItems={"center"}
justifyContent={"center"}
minHeight="100vh"
@@ -229,7 +230,7 @@ export const BaseAuthPage = ({
>
<HeaderAuthControls
hideLogo
py={theme.spacing(4)}
py={theme.spacing(LAYOUT.XS)}
position={"absolute"}
top={0}
left={0}
@@ -243,14 +244,14 @@ export const BaseAuthPage = ({
<Stack alignItems={"center"}>
<Typography
variant="h1"
mb={theme.spacing(2)}
mb={theme.spacing(SPACING.LG)}
>
{title}
</Typography>
<Typography variant="h2">{subtitle}</Typography>
</Stack>
<Stack
gap={theme.spacing(8)}
gap={theme.spacing(LAYOUT.MD)}
width={{
xs: "80%",
md: "25%",
@@ -2,6 +2,7 @@ import Stack from "@mui/material/Stack";
import Typography from "@mui/material/Typography";
import { Check } from "lucide-react";
import { useTheme } from "@mui/material/styles";
import { LAYOUT } from "@/Utils/Theme/constants";
export const BulletPointCheck = ({
text,
@@ -21,12 +22,13 @@ export const BulletPointCheck = ({
return (
<Stack
direction="row"
gap={theme.spacing(6)}
gap={theme.spacing(LAYOUT.SM)}
alignItems="center"
>
<Check
size={16}
strokeWidth={1.5}
color={variant === "info" ? theme.palette.text.secondary : colors[variant]}
style={{
flexShrink: 0,
}}
@@ -1,7 +1,8 @@
import Stack from "@mui/material/Stack";
import Typography from "@mui/material/Typography";
import { BulletPointCheck, SkeletonCard } from "@/Components/v2/design-elements";
import { Button } from "@/Components/v2/inputs";
import { BulletPointCheck, SkeletonCard } from "@/Components/design-elements";
import { Button } from "@/Components/inputs";
import { SPACING, LAYOUT } from "@/Utils/Theme/constants";
import { useNavigate } from "react-router";
import useMediaQuery from "@mui/material/useMediaQuery";
@@ -27,7 +28,7 @@ export const BaseFallback = ({ children, ...props }: BaseFallbackProps) => {
lg: "50%",
xl: "40%",
}}
padding={{ xs: theme.spacing(8), md: theme.spacing(16) }}
padding={{ xs: theme.spacing(LAYOUT.MD), md: theme.spacing(LAYOUT.XXL) }}
bgcolor={theme.palette.background.paper}
border={1}
borderColor={theme.palette.divider}
@@ -55,7 +56,7 @@ export const ErrorFallback = ({
<BaseFallback>
<Typography
variant="h1"
marginY={theme.spacing(4)}
marginY={theme.spacing(LAYOUT.XS)}
color={theme.palette.text.secondary}
>
{title}
@@ -81,20 +82,15 @@ export const EmptyFallback = ({
return (
<BaseFallback>
<Stack
gap={theme.spacing(10)}
gap={theme.spacing(LAYOUT.MD)}
zIndex={1}
alignItems="center"
>
<Typography
component="h1"
color={theme.palette.primary.contrastText}
>
{title}
</Typography>
<Typography component="h1">{title}</Typography>
<Stack
sx={{
flexWrap: "wrap",
gap: theme.spacing(2),
gap: theme.spacing(SPACING.MD),
maxWidth: "1100px",
width: "100%",
}}
@@ -139,7 +135,7 @@ export const EmptyMonitorFallback = ({
return (
<BaseFallback>
<Stack
gap={theme.spacing(10)}
gap={theme.spacing(LAYOUT.MD)}
zIndex={1}
alignItems="center"
>
@@ -152,7 +148,7 @@ export const EmptyMonitorFallback = ({
<Stack
sx={{
flexWrap: "wrap",
gap: theme.spacing(2),
gap: theme.spacing(SPACING.MD),
maxWidth: "1100px",
width: "100%",
}}
@@ -1,4 +1,4 @@
import { BaseChart } from "@/Components/v2/design-elements";
import { BaseChart } from "@/Components/design-elements";
import Stack from "@mui/material/Stack";
import Box from "@mui/material/Box";
import Typography from "@mui/material/Typography";
@@ -4,6 +4,7 @@ interface IconProps {
icon: LucideIcon;
size?: number;
strokeWidth?: number;
stroke?: string;
}
const Icon = ({ icon: Icon, size = 20, strokeWidth = 1.5 }: IconProps) => {
@@ -1,11 +1,11 @@
import type { Monitor } from "@/Types/Monitor";
import Stack from "@mui/material/Stack";
import Typography from "@mui/material/Typography";
import { PulseDot, Dot } from "@/Components/v2/design-elements";
import { PulseDot, Dot } from "@/Components/design-elements";
import { getStatusColor, formatUrl } from "@/Utils/MonitorUtils";
import { useTheme } from "@mui/material/styles";
import prettyMilliseconds from "pretty-ms";
import { typographyLevels } from "@/Utils/Theme/v2Palette";
import { typographyLevels } from "@/Utils/Theme/Palette";
import useMediaQuery from "@mui/material/useMediaQuery";
export const MonitorStatus = ({ monitor }: { monitor: Monitor }) => {
const theme = useTheme();
@@ -19,11 +19,9 @@ export const MonitorStatus = ({ monitor }: { monitor: Monitor }) => {
<Typography
fontSize={typographyLevels.xl}
fontWeight={500}
color={theme.palette.primary.contrastText}
overflow={"hidden"}
textOverflow={"ellipsis"}
whiteSpace={"nowrap"}
maxWidth={isSmall ? "100%" : "calc((100vw - var(--env-var-width-2)) / 2)"}
>
{monitor.name}
</Typography>
@@ -40,7 +38,6 @@ export const MonitorStatus = ({ monitor }: { monitor: Monitor }) => {
overflow={"hidden"}
textOverflow={"ellipsis"}
whiteSpace={"nowrap"}
maxWidth={isSmall ? "100%" : "calc((100vw - var(--env-var-width-2)) / 2)"}
>
{formatUrl(monitor?.url)}
</Typography>
@@ -0,0 +1,63 @@
import Box from "@mui/material/Box";
import Stack from "@mui/material/Stack";
import Typography from "@mui/material/Typography";
import { useTheme } from "@mui/material/styles";
import { useTranslation } from "react-i18next";
import { WifiOff } from "lucide-react";
import { useState, useEffect } from "react";
interface OfflineBannerProps {
visible: boolean;
}
export const OfflineBanner = ({ visible }: OfflineBannerProps) => {
const theme = useTheme();
const { t } = useTranslation();
const [shouldRender, setShouldRender] = useState(visible);
const [isAnimating, setIsAnimating] = useState(false);
useEffect(() => {
if (visible) {
setShouldRender(true);
requestAnimationFrame(() => setIsAnimating(true));
} else {
setIsAnimating(false);
const timer = setTimeout(() => setShouldRender(false), 1000);
return () => clearTimeout(timer);
}
}, [visible]);
if (!shouldRender) return null;
return (
<Box
sx={{
position: "fixed",
top: isAnimating ? 0 : "-100%",
left: 0,
right: 0,
zIndex: theme.zIndex.snackbar,
backgroundColor: theme.palette.error.main,
color: theme.palette.error.contrastText,
px: theme.spacing(8),
py: theme.spacing(4),
transition: "top 1s ease-in-out",
}}
>
<Stack
direction="row"
alignItems="center"
justifyContent="center"
gap={theme.spacing(4)}
>
<WifiOff size={20} />
<Typography
variant="body2"
fontWeight={500}
>
{t("components.offlineBanner.serverUnreachable")}
</Typography>
</Stack>
</Box>
);
};
@@ -1,4 +1,17 @@
import { Box, Stack, useTheme } from "@mui/material";
import Box from "@mui/material/Box";
import Stack from "@mui/material/Stack";
import { useTheme, keyframes } from "@mui/material";
const ripple = keyframes`
from {
opacity: 1;
transform: scale(0);
}
to {
opacity: 0;
transform: scale(2);
}
`;
interface PulseDotProps {
color: string;
@@ -28,7 +41,7 @@ export const PulseDot = ({ color }: PulseDotProps) => {
height: "100%",
backgroundColor: "inherit",
borderRadius: "50%",
animation: "ripple 1.8s ease-out infinite",
animation: `${ripple} 1.8s ease-out infinite`,
},
"&::after": {
content: `""`,
@@ -3,6 +3,7 @@ import Box from "@mui/material/Box";
import Typography from "@mui/material/Typography";
import { useTheme } from "@mui/material/styles";
import useMediaQuery from "@mui/material/useMediaQuery";
import { LAYOUT } from "@/Utils/Theme/constants";
export const SplitBox = ({
left,
right,
@@ -18,10 +19,10 @@ export const SplitBox = ({
bgcolor={theme.palette.background.paper}
border={1}
borderColor={theme.palette.divider}
borderRadius={theme.spacing(2)}
borderRadius={theme.shape.borderRadius}
>
<Box
padding={theme.spacing(15)}
padding={theme.spacing(LAYOUT.XXL)}
borderRight={isSmall ? 0 : 1}
borderBottom={isSmall ? 1 : 0}
borderColor={theme.palette.divider}
@@ -37,7 +38,7 @@ export const SplitBox = ({
</Box>
<Box
flex={1}
padding={theme.spacing(15)}
padding={theme.spacing(LAYOUT.XXL)}
>
{right}
</Box>
@@ -60,7 +61,7 @@ export const ConfigBox = ({
return (
<SplitBox
left={
<Stack spacing={theme.spacing(4)}>
<Stack spacing={theme.spacing(LAYOUT.XS)}>
<Typography
textTransform={"capitalize"}
component="h2"
@@ -4,8 +4,8 @@ import Box from "@mui/material/Box";
import { useTheme } from "@mui/material/styles";
import { lighten } from "@mui/material/styles";
import useMediaQuery from "@mui/material/useMediaQuery";
import type { PaletteKey } from "@/Utils/Theme/v2Theme";
import { BaseBox, TooltipWithInfo } from "@/Components/v2/design-elements";
import type { PaletteKey } from "@/Utils/Theme/Theme";
import { BaseBox, TooltipWithInfo } from "@/Components/design-elements";
import type { SxProps } from "@mui/material";
type GradientBox = React.PropsWithChildren<{
@@ -1,8 +1,7 @@
import Stack from "@mui/material/Stack";
import Typography from "@mui/material/Typography";
import Box from "@mui/material/Box";
import { BaseBox } from "@/Components/v2/design-elements";
import Background from "@/assets/Images/background-grid.svg?react";
import { BaseBox } from "@/Components/design-elements";
import { useTranslation } from "react-i18next";
import type { SxProps } from "@mui/material";
@@ -18,6 +17,7 @@ export const BGBox = ({ children, sx }: StatusBoxProps) => {
return (
<BaseBox
sx={{
backgroundColor: theme.palette.background.default,
overflow: "hidden",
position: "relative",
flex: 1,
@@ -27,11 +27,23 @@ export const BGBox = ({ children, sx }: StatusBoxProps) => {
>
<Box
position="absolute"
top="-10%"
left="5%"
>
<Background />
</Box>
top={0}
left={0}
right={0}
bottom={0}
sx={{
pointerEvents: "none",
backgroundImage: `
linear-gradient(${theme.palette.divider} 1px, transparent 1px),
linear-gradient(90deg, ${theme.palette.divider} 1px, transparent 1px)
`,
backgroundSize: "24px 24px",
maskImage:
"linear-gradient(135deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0) 30%, rgba(0,0,0,0.4) 100%)",
WebkitMaskImage:
"linear-gradient(135deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0) 30%, rgba(0,0,0,0.4) 100%)",
}}
/>
{children}
</BaseBox>
);
@@ -105,6 +117,40 @@ export const PausedStatusBox = ({ n }: { n: number }) => {
/>
);
};
export const MaintenanceStatusBox = ({ n }: { n: number }) => {
const theme = useTheme();
const { t } = useTranslation();
return (
<StatusBox
label={t("pages.common.monitors.status.maintenance")}
n={n}
color={theme.palette.warning.light}
/>
);
};
export const InitializingStatusBox = ({ n }: { n: number }) => {
const theme = useTheme();
const { t } = useTranslation();
return (
<StatusBox
label={t("pages.common.monitors.status.initializing")}
n={n}
color={theme.palette.warning.light}
/>
);
};
export const BreachedStatusBox = ({ n }: { n: number }) => {
const theme = useTheme();
const { t } = useTranslation();
return (
<StatusBox
label={t("pages.common.monitors.status.breached")}
n={n}
color={theme.palette.warning.main}
/>
);
};
export const TotalChecksBox = ({ n }: { n: number }) => {
const theme = useTheme();
const { t } = useTranslation();
@@ -138,15 +184,3 @@ export const UpChecksBox = ({ n }: { n: number }) => {
/>
);
};
export const InitializingStatusBox = ({ n }: { n: number }) => {
const theme = useTheme();
const { t } = useTranslation();
return (
<StatusBox
label={t("pages.common.monitors.status.initializing")}
n={n}
color={theme.palette.warning.light}
/>
);
};
@@ -1,5 +1,5 @@
import Box from "@mui/material/Box";
import { BaseBox } from "@/Components/v2/design-elements";
import { BaseBox } from "@/Components/design-elements";
import Typography from "@mui/material/Typography";
import type { MonitorStatus } from "@/Types/Monitor";
@@ -11,33 +11,26 @@ import { useTranslation } from "react-i18next";
export const ValueTypes = ["positive", "negative", "neutral"] as const;
export type ValueType = (typeof ValueTypes)[number];
export const StatusLabel = ({
status,
isActive,
sx,
}: {
status: MonitorStatus;
isActive?: boolean;
sx?: SxProps;
}) => {
export const StatusLabel = ({ status, sx }: { status: MonitorStatus; sx?: SxProps }) => {
const { t } = useTranslation();
const theme = useTheme();
const palette = getStatusPalette(status);
const determineStatus = (
isActive: boolean | undefined,
status: MonitorStatus
): string => {
if (isActive === false) {
const determineStatus = (status: MonitorStatus): string => {
if (status === "up") {
return t("pages.common.monitors.status.up");
} else if (status === "down") {
return t("pages.common.monitors.status.down");
} else if (status === "breached") {
return t("pages.common.monitors.status.breached");
} else if (status === "maintenance") {
return t("pages.common.monitors.status.maintenance");
} else if (status === "paused") {
return t("pages.common.monitors.status.paused");
} else if (status === "initializing") {
return t("pages.common.monitors.status.initializing");
}
if (status === true) {
return t("pages.common.monitors.status.up");
}
if (status === false) {
return t("pages.common.monitors.status.down");
}
return t("pages.common.monitors.status.initializing");
};
@@ -64,9 +57,7 @@ export const StatusLabel = ({
borderRadius="50%"
marginRight="5px"
/>
<Typography textTransform={"capitalize"}>
{determineStatus(isActive, status)}
</Typography>
<Typography textTransform={"capitalize"}>{determineStatus(status)}</Typography>
</BaseBox>
);
};
@@ -29,6 +29,7 @@ import type { TablePaginationOwnProps } from "@mui/material/TablePagination";
import { useTranslation } from "react-i18next";
import { useState, Fragment, useEffect } from "react";
import { useTheme } from "@mui/material/styles";
import { SPACING, LAYOUT } from "@/Utils/Theme/constants";
import type { SxProps, Theme } from "@mui/material/styles";
import useMediaQuery from "@mui/material/useMediaQuery";
@@ -90,20 +91,20 @@ export function DataTable<
// Return stack of cards for small screens
if (isSmall && cardsOnSmallScreens) {
return (
<Stack spacing={theme.spacing(4)}>
<Stack spacing={theme.spacing(LAYOUT.XS)}>
{data.map((row) => {
const key = row.id || row._id || Math.random();
keys.push(key);
return (
<Stack
onClick={() => (onRowClick ? onRowClick(row) : null)}
spacing={theme.spacing(4)}
spacing={theme.spacing(LAYOUT.XS)}
sx={{
borderStyle: "solid",
borderWidth: 1,
borderColor: theme.palette.divider,
borderRadius: theme.shape.borderRadius,
padding: theme.spacing(4),
padding: theme.spacing(LAYOUT.XS),
cursor: onRowClick ? "pointer" : "default",
}}
key={key}
@@ -155,7 +156,7 @@ export function DataTable<
<Table
sx={{
"&.MuiTable-root :is(.MuiTableHead-root, .MuiTableBody-root) :is(th, td)": {
paddingLeft: theme.spacing(8),
paddingLeft: theme.spacing(LAYOUT.MD),
},
"& .MuiTableCell-root": {
borderBottom: `1px solid ${theme.palette.divider}`,
@@ -168,13 +169,13 @@ export function DataTable<
color: theme.palette.text.secondary,
fontWeight: 500,
textTransform: "uppercase",
padding: `${theme.spacing(2)} ${theme.spacing(8)}`,
padding: `${theme.spacing(SPACING.LG)} ${theme.spacing(LAYOUT.MD)}`,
fontSize: theme.typography.fontSize,
},
"& :is(td)": {
backgroundColor: theme.palette.background.paper,
color: theme.palette.text.secondary,
padding: `${theme.spacing(7)} ${theme.spacing(8)}`,
padding: `${theme.spacing(LAYOUT.MD)} ${theme.spacing(LAYOUT.MD)}`,
fontSize: theme.typography.fontSize,
overflowX: "hidden",
},
@@ -514,7 +515,7 @@ export const Pagination = ({ ...props }: PaginationProps) => {
display: "grid",
gridTemplateColumns: "1fr 1fr",
gridAutoRows: "auto",
rowGap: theme.spacing(1),
rowGap: theme.spacing(SPACING.SM),
alignItems: "center",
justifyItems: "center",
paddingLeft: 0,
@@ -556,8 +557,8 @@ const EmptyView = ({ text, positive }: { text?: string; positive?: boolean }) =>
alignItems={"center"}
justifyContent={"center"}
sx={{
py: theme.spacing(12),
px: theme.spacing(4),
py: theme.spacing(LAYOUT.XL),
px: theme.spacing(LAYOUT.XS),
borderWidth: 1,
borderStyle: "solid",
borderColor: theme.palette.divider,
@@ -574,7 +575,7 @@ const EmptyView = ({ text, positive }: { text?: string; positive?: boolean }) =>
display: "flex",
alignItems: "center",
justifyContent: "center",
mb: theme.spacing(2),
mb: theme.spacing(SPACING.LG),
}}
>
<Icon
@@ -10,7 +10,7 @@ interface TextLinkProps extends StackProps {
text: string;
linkText: string;
href: string;
target?: string;
target?: "_self" | "_blank" | "_parent" | "_top";
}
export const TextLink = ({
@@ -34,6 +34,7 @@ export const TextLink = ({
to={href}
component={RouterLink}
target={target}
{...(target === "_blank" && { rel: "noopener noreferrer" })}
>
{linkText}
</Link>
@@ -19,3 +19,5 @@ export * from "./Gauge";
export * from "./Tabs";
export * from "./SplitBox";
export * from "./TextLink";
export * from "./OfflineBanner";
export * from "./Avatar";
@@ -1,8 +1,9 @@
import i18n from "../../../Utils/i18n.js";
import i18n from "@/Utils/i18n.js";
import { useSelector } from "react-redux";
import { useEffect } from "react";
import type { RootState } from "@/store";
const I18nLoader = () => {
const language = useSelector((state) => state.ui.language ?? "en");
const language = useSelector((state: RootState) => state.ui.language ?? "en");
useEffect(() => {
if (language && i18n.language !== language) {
@@ -1,6 +1,6 @@
import Autocomplete from "@mui/material/Autocomplete";
import type { AutocompleteProps } from "@mui/material/Autocomplete";
import { TextField, Checkbox } from "@/Components/v2/inputs";
import { TextField, Checkbox } from "@/Components/inputs";
import ListItem from "@mui/material/ListItem";
import Stack from "@mui/material/Stack";
import { useTheme } from "@mui/material/styles";
@@ -1,9 +1,9 @@
import { MuiColorInput } from "mui-color-input";
import type { MuiColorInputProps } from "mui-color-input";
import { typographyLevels } from "@/Utils/Theme/v2Palette";
import { typographyLevels } from "@/Utils/Theme/Palette";
import { useTheme } from "@mui/material";
import Stack from "@mui/material/Stack";
import { FieldLabel } from "@/Components/v2/inputs/FieldLabel";
import { FieldLabel } from "@/Components/inputs/FieldLabel";
interface ColorPickerProps extends MuiColorInputProps {
fieldLabel?: string;
@@ -4,8 +4,8 @@ import DialogActions from "@mui/material/DialogActions";
import DialogContent from "@mui/material/DialogContent";
import DialogContentText from "@mui/material/DialogContentText";
import DialogTitle from "@mui/material/DialogTitle";
import { Button } from "@/Components/v2/inputs";
import { typographyLevels } from "@/Utils/Theme/v2Palette";
import { Button } from "@/Components/inputs";
import { typographyLevels } from "@/Utils/Theme/Palette";
import { useTranslation } from "react-i18next";
import type { ReactNode } from "react";
@@ -23,6 +23,7 @@ export const DialogInput = ({
children,
maxWidth,
fullWidth = false,
additionalButtons,
}: {
open: boolean;
title?: string;
@@ -37,6 +38,7 @@ export const DialogInput = ({
children?: ReactNode;
maxWidth?: DialogProps["maxWidth"];
fullWidth?: boolean;
additionalButtons?: ReactNode;
}) => {
const { t } = useTranslation();
return (
@@ -59,6 +61,7 @@ export const DialogInput = ({
>
{cancelText ?? t("common.buttons.cancel")}
</Button>
{additionalButtons}
{onConfirm && (
<Button
loading={loading}
@@ -38,11 +38,11 @@ export const ImageUpload = ({
const isValidType = accept.some((type) => file.type.includes(type));
const isValidSize = file.size <= maxSize;
if (!isValidType) {
setLocalError(t("common.errors.invalidFileFormat"));
setLocalError(t("components.imageUpload.errors.invalidFileFormat"));
return;
}
if (!isValidSize) {
setLocalError(t("common.errors.invalidFileSize"));
setLocalError(t("components.imageUpload.errors.invalidFileSize"));
return;
}
setLocalError(null);
@@ -137,15 +137,15 @@ export const ImageUpload = ({
color="primary"
fontWeight={500}
>
{t("common.imageUpload.clickToUpload")}
{t("components.imageUpload.clickToUpload")}
</Typography>{" "}
{t("common.imageUpload.orDragAndDrop")}
{t("components.imageUpload.orDragAndDrop")}
</Typography>
<Typography
variant="caption"
color="text.disabled"
>
{accept.join(", ").toUpperCase()} • {t("common.imageUpload.maxSize")}{" "}
{accept.join(", ").toUpperCase()} • {t("components.imageUpload.maxSize")}{" "}
{Math.round(maxSize / 1024 / 1024)}MB
</Typography>
</Stack>
@@ -1,7 +1,7 @@
import Stack from "@mui/material/Stack";
import Box from "@mui/material/Box";
import MenuItem from "@mui/material/MenuItem";
import { Select } from "@/Components/v2/inputs";
import { Select } from "@/Components/inputs";
import "flag-icons/css/flag-icons.min.css";
import { useTranslation } from "react-i18next";
@@ -41,7 +41,10 @@ export const SliderInput = forwardRef<HTMLSpanElement, SliderInputProps>(
"& .MuiSlider-thumb": {
backgroundColor: "#fff",
"&:hover, &.Mui-focusVisible": {
boxShadow: `0 0 0 8px ${theme.palette.primary.main}20`,
boxShadow: "none",
},
"&:active": {
boxShadow: "none",
},
},
"& .MuiSlider-valueLabel": {
@@ -1,7 +1,7 @@
import { forwardRef } from "react";
import TextField from "@mui/material/TextField";
import type { TextFieldProps } from "@mui/material";
import { typographyLevels } from "@/Utils/Theme/v2Palette";
import { typographyLevels } from "@/Utils/Theme/Palette";
import { useTheme } from "@mui/material/styles";
import Stack from "@mui/material/Stack";
import { FieldLabel } from "./FieldLabel";
@@ -0,0 +1,54 @@
import Box from "@mui/material/Box";
import { useState, useEffect, useRef } from "react";
import { useTheme } from "@mui/material/styles";
import { OfflineBanner } from "@/Components/design-elements";
import { setServerUnreachableCallback, get } from "@/Utils/ApiClient";
interface AppLayoutProps {
children: React.ReactNode;
}
const AppLayout = ({ children }: AppLayoutProps) => {
const theme = useTheme();
const [serverUnreachable, setServerUnreachable] = useState(false);
const retryIntervalRef = useRef<number | null>(null);
useEffect(() => {
setServerUnreachableCallback(setServerUnreachable);
}, []);
useEffect(() => {
if (serverUnreachable) {
retryIntervalRef.current = window.setInterval(async () => {
try {
await get("/health", { timeout: 5000 });
} catch {
// NO_OP
}
}, 5000);
} else if (retryIntervalRef.current) {
clearInterval(retryIntervalRef.current);
retryIntervalRef.current = null;
}
return () => {
if (retryIntervalRef.current) {
clearInterval(retryIntervalRef.current);
}
};
}, [serverUnreachable]);
return (
<Box
sx={{
minHeight: "100vh",
backgroundColor: theme.palette.background.default,
}}
>
<OfflineBanner visible={serverUnreachable} />
{children}
</Box>
);
};
export default AppLayout;
@@ -0,0 +1,44 @@
import { Sidebar } from "@/Components/sidebar";
import { Outlet } from "react-router";
import Stack from "@mui/material/Stack";
import { useMediaQuery } from "@mui/material";
import { useSidebar } from "@/Hooks/useSidebar";
import { useTheme } from "@mui/material";
const RootLayout = () => {
const theme = useTheme();
const isSmall = useMediaQuery(theme.breakpoints.down("md"));
const { collapsedWidth } = useSidebar();
return (
<Stack flexDirection="row">
<Sidebar />
<Stack
flex={1}
padding={6}
overflow={"hidden"}
sx={{
backgroundColor:
theme.palette.mode === "dark"
? "rgba(255, 255, 255, 0.01)"
: "rgba(0, 0, 0, 0.01)",
display: "flex",
alignItems: "center",
paddingLeft: isSmall ? `${collapsedWidth + 12}px` : 12,
}}
>
<Stack
maxWidth={1280}
width="100%"
paddingY={theme.spacing(6)}
flex={1}
>
<Outlet />
</Stack>
</Stack>
</Stack>
);
};
export default RootLayout;
@@ -1,12 +1,21 @@
import Stack from "@mui/material/Stack";
import { Select, Button } from "@/Components/v2/inputs";
import { Select, Button } from "@/Components/inputs";
import MenuItem from "@mui/material/MenuItem";
import useMediaQuery from "@mui/material/useMediaQuery";
import type { MonitorType } from "@/Types/Monitor";
import { Typography, useTheme } from "@mui/material";
import { useTranslation } from "react-i18next";
const types = ["http", "ping", "port", "docker", "game"];
const types = ["http", "ping", "port", "docker", "game", "grpc"];
const typeDisplayNames: Record<string, string> = {
http: "HTTP",
ping: "Ping",
port: "Port",
docker: "Docker",
game: "Game",
grpc: "gRPC",
};
const statuses = ["up", "down"];
const states = ["active", "paused"];
@@ -30,6 +39,7 @@ export const ControlsFilter = ({
onClearFilters: () => void;
}) => {
const theme = useTheme();
const { t } = useTranslation();
const isSmall = useMediaQuery(theme.breakpoints.down("md"));
const isFilterActive =
(selectedTypes?.length ?? 0) > 0 || selectedStatus !== "" || selectedState !== "";
@@ -50,7 +60,7 @@ export const ControlsFilter = ({
key={type}
value={type}
>
<Typography textTransform={"capitalize"}>{type}</Typography>
<Typography>{typeDisplayNames[type] ?? type}</Typography>
</MenuItem>
))}
</Select>
@@ -88,7 +98,7 @@ export const ControlsFilter = ({
variant="contained"
onClick={onClearFilters}
>
Clear Filters
{t("common.buttons.clearFilters")}
</Button>
)}
</Stack>
@@ -0,0 +1,203 @@
import { useRef, useEffect, useState } from "react";
import { Box, Typography, Stack, useTheme, GlobalStyles } from "@mui/material";
import Map, { Marker, Popup } from "react-map-gl/maplibre";
import type { MapRef } from "react-map-gl/maplibre";
import type { FlatGeoCheck } from "@/Types/GeoCheck";
import "maplibre-gl/dist/maplibre-gl.css";
interface GeoChecksMapProps {
geoChecks: FlatGeoCheck[];
}
export const GeoChecksMap = ({ geoChecks }: GeoChecksMapProps) => {
const mapRef = useRef<MapRef>(null);
const [selectedCheck, setSelectedCheck] = useState<FlatGeoCheck | null>(null);
const theme = useTheme();
const isDarkMode = theme.palette.mode === "dark";
const mapPopupStyles = (
<GlobalStyles
styles={{
".maplibregl-popup-content": {
background: "transparent !important",
padding: "0 !important",
boxShadow: "none !important",
},
".maplibregl-popup-tip": {
display: "none",
},
".maplibregl-ctrl-attrib": {
display: "none",
},
".maplibregl-ctrl-logo": {
display: "none",
},
".maplibregl-popup-close-button": {
color: theme.palette.text.primary,
background: "transparent",
fontSize: "20px",
padding: "4px",
"&:hover": {
backgroundColor: theme.palette.action.hover,
},
},
}}
/>
);
useEffect(() => {
if (geoChecks.length === 0 || !mapRef.current) return;
const bounds = geoChecks.reduce(
(acc, check) => {
return {
minLng: Math.min(acc.minLng, check.location.longitude),
maxLng: Math.max(acc.maxLng, check.location.longitude),
minLat: Math.min(acc.minLat, check.location.latitude),
maxLat: Math.max(acc.maxLat, check.location.latitude),
};
},
{
minLng: Infinity,
maxLng: -Infinity,
minLat: Infinity,
maxLat: -Infinity,
}
);
if (bounds.minLng !== Infinity) {
mapRef.current.fitBounds(
[
[bounds.minLng, bounds.minLat],
[bounds.maxLng, bounds.maxLat],
],
{ padding: 50, duration: 1000 }
);
}
}, [geoChecks]);
const getMarkerColor = (status: boolean): string => {
return status ? theme.palette.success.main : theme.palette.error.main;
};
const formatResponseTime = (timing: number): string => {
return `${timing.toFixed(0)}ms`;
};
return (
<>
{mapPopupStyles}
<Box
height={500}
width={"100%"}
borderRadius={theme.shape.borderRadius}
overflow={"hidden"}
>
<Map
ref={mapRef}
initialViewState={{
longitude: 0,
latitude: 20,
zoom: 1.5,
}}
style={{ height: "100%", width: "100%" }}
mapStyle={
isDarkMode
? "https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json"
: "https://basemaps.cartocdn.com/gl/positron-gl-style/style.json"
}
>
{geoChecks.map((check, index) => (
<Marker
key={`${check.id}-${index}`}
longitude={check.location.longitude}
latitude={check.location.latitude}
anchor="bottom"
onClick={(e: any) => {
e.originalEvent.stopPropagation();
setSelectedCheck(check);
}}
>
<div
style={{
width: "10px",
height: "10px",
borderRadius: "50%",
backgroundColor: getMarkerColor(check.status),
boxShadow: "0 2px 4px rgba(0,0,0,0.3)",
cursor: "pointer",
}}
/>
</Marker>
))}
{selectedCheck && (
<Popup
longitude={selectedCheck.location.longitude}
latitude={selectedCheck.location.latitude}
anchor="top"
onClose={() => setSelectedCheck(null)}
closeOnClick={false}
>
<Box
sx={{
minWidth: 200,
p: theme.spacing(4),
bgcolor: theme.palette.background.paper,
borderWidth: 1,
borderStyle: "solid",
borderColor: theme.palette.divider,
borderRadius: 1,
}}
>
<Typography
variant="subtitle1"
fontWeight="bold"
gutterBottom
>
{selectedCheck.location.city}, {selectedCheck.location.country}
</Typography>
<Stack spacing={0.5}>
<Typography variant="body2">
<Typography
component="span"
fontWeight="medium"
>
Status:
</Typography>{" "}
{selectedCheck.status ? "Up" : "Down"}
</Typography>
<Typography variant="body2">
<Typography
component="span"
fontWeight="medium"
>
Status Code:
</Typography>{" "}
{selectedCheck.statusCode}
</Typography>
<Typography variant="body2">
<Typography
component="span"
fontWeight="medium"
>
Response Time:
</Typography>{" "}
{formatResponseTime(selectedCheck.timings.total)}
</Typography>
<Typography
variant="caption"
color="text.secondary"
sx={{ mt: 0.5 }}
>
{new Date(selectedCheck.createdAt).toLocaleString()}
</Typography>
</Stack>
</Box>
</Popup>
)}
</Map>
</Box>
</>
);
};
@@ -0,0 +1,54 @@
import Stack from "@mui/material/Stack";
import { Tabs, Tab } from "@/Components/design-elements";
import { useTheme } from "@mui/material/styles";
import { useTranslation } from "react-i18next";
import type { GeoContinent } from "@/Types/GeoCheck";
interface HeaderGeoTabsProps {
geoCheckEnabled: boolean;
locations: GeoContinent[] | undefined;
selectedLocation: GeoContinent;
onLocationChange: (location: GeoContinent) => void;
}
export const HeaderGeoTabs = ({
geoCheckEnabled,
locations,
selectedLocation,
onLocationChange,
}: HeaderGeoTabsProps) => {
const { t } = useTranslation();
const theme = useTheme();
if (!geoCheckEnabled || !locations || locations.length === 0) {
return null;
}
const handleChange = (_event: React.SyntheticEvent, newValue: GeoContinent) => {
onLocationChange(newValue);
};
return (
<Stack
spacing={{ xs: theme.spacing(8), md: 0 }}
direction={{ xs: "column", md: "row" }}
alignItems={"center"}
justifyContent={"flex-start"}
>
<Tabs
value={selectedLocation}
onChange={handleChange}
>
{locations.map((location) => (
<Tab
key={location}
label={t(
`pages.createMonitor.form.geoChecks.option.locations.options.${location}`
)}
value={location}
/>
))}
</Tabs>
</Stack>
);
};
@@ -1,6 +1,6 @@
import Stack from "@mui/material/Stack";
import { Icon, MonitorStatus } from "@/Components/v2/design-elements";
import { Button } from "@/Components/v2/inputs";
import { Icon, MonitorStatus } from "@/Components/design-elements";
import { Button } from "@/Components/inputs";
import { Settings, Pause, Play, Mail, Bug, Trash } from "lucide-react";
import { useTranslation } from "react-i18next";
@@ -0,0 +1,35 @@
import {
UpStatusBox,
DownStatusBox,
PausedStatusBox,
InitializingStatusBox,
BreachedStatusBox,
} from "@/Components/design-elements";
import Stack from "@mui/material/Stack";
import type { MonitorsSummary } from "@/Types/Monitor";
import { useTheme } from "@mui/material";
interface MonitorsSummaryProps {
summary: MonitorsSummary | null;
showBreached?: boolean;
}
export const HeaderMonitorsSummary = ({
summary,
showBreached = false,
}: MonitorsSummaryProps) => {
const theme = useTheme();
return (
<Stack
direction={{ xs: "column", md: "row" }}
gap={theme.spacing(8)}
>
<UpStatusBox n={summary?.upMonitors || 0} />
<DownStatusBox n={summary?.downMonitors || 0} />
{showBreached && <BreachedStatusBox n={summary?.breachedMonitors || 0} />}
<PausedStatusBox n={summary?.pausedMonitors || 0} />
<InitializingStatusBox n={summary?.initializingMonitors || 0} />
</Stack>
);
};
@@ -1,5 +1,5 @@
import Stack from "@mui/material/Stack";
import { StatBox } from "@/Components/v2/design-elements";
import { StatBox } from "@/Components/design-elements";
import prettyMilliseconds from "pretty-ms";
import { useTheme } from "@mui/material/styles";
@@ -1,4 +1,4 @@
import { BaseChart, BaseBox } from "@/Components/v2/design-elements";
import { BaseChart, BaseBox } from "@/Components/design-elements";
import { Clock } from "lucide-react";
import {
AreaChart,
@@ -1,4 +1,4 @@
import { BaseChart } from "@/Components/v2/design-elements";
import { BaseChart } from "@/Components/design-elements";
import {
AreaChart,
Area,
@@ -8,7 +8,7 @@ import {
ResponsiveContainer,
} from "recharts";
import { Fragment, useId } from "react";
import { XTick } from "@/Components/v2/monitors";
import { XTick } from "@/Components/monitors";
import { useTheme } from "@mui/material/styles";
import type { HardwareCheckStats } from "@/Types/Monitor";
@@ -1,6 +1,6 @@
import Stack from "@mui/material/Stack";
import { Area, AreaChart, CartesianGrid, ResponsiveContainer, Tooltip } from "recharts";
import { HistogramPageSpeedTooltip } from "@/Components/v2/monitors/charts/HistogramPageSpeedTooltip";
import { HistogramPageSpeedTooltip } from "@/Components/monitors/charts/HistogramPageSpeedTooltip";
import { useTheme } from "@mui/material/styles";
import type { CheckSnapshot } from "@/Types/Check";
import type { MonitorStatus } from "@/Types/Monitor";
@@ -1,6 +1,6 @@
import { BaseChart } from "@/Components/v2/design-elements";
import { BaseChart } from "@/Components/design-elements";
import { TrendingUp } from "lucide-react";
import { XTick } from "@/Components/v2/monitors/";
import { XTick } from "@/Components/monitors";
import {
XAxis,
AreaChart,
@@ -9,10 +9,10 @@ import {
CartesianGrid,
ResponsiveContainer,
} from "recharts";
import { HistogramPageSpeedScoresTooltip } from "@/Components/v2/monitors";
import { HistogramPageSpeedScoresTooltip } from "@/Components/monitors";
import { useTheme } from "@mui/material/styles";
import type { CheckSnapshot } from "@/Types/Check";
import type { PageSpeedGroupedCheck } from "@/Types/Check";
import type { Palette } from "@mui/material/styles";
type PaletteColorKey = Extract<
keyof Palette,
@@ -52,7 +52,7 @@ export const HistogramPageSpeedDetails = ({
checks,
range,
}: {
checks: CheckSnapshot[];
checks: PageSpeedGroupedCheck[];
range: string;
}) => {
const theme = useTheme();
@@ -73,7 +73,7 @@ export const HistogramPageSpeedDetails = ({
>
<AreaChart data={checks}>
<XAxis
dataKey={"createdAt"}
dataKey={"bucketDate"}
tick={(props) => (
<XTick
{...props}
@@ -2,8 +2,9 @@ import Box from "@mui/material/Box";
import Stack from "@mui/material/Stack";
import Typography from "@mui/material/Typography";
import { useTheme } from "@mui/material/styles";
import { SPACING, LAYOUT } from "@/Utils/Theme/constants";
import { formatDateWithTz } from "@/Utils/TimeUtils";
import type { ConfigItem } from "@/Components/v2/monitors";
import type { ConfigItem } from "@/Components/monitors";
import type { TooltipProps } from "recharts";
import { useSelector } from "react-redux";
import type { RootState } from "@/Types/state";
@@ -30,8 +31,8 @@ export const HistogramPageSpeedScoresTooltip = ({
border: 1,
borderColor: theme.palette.divider,
borderRadius: theme.shape.borderRadius,
py: theme.spacing(2),
px: theme.spacing(4),
py: theme.spacing(SPACING.LG),
px: theme.spacing(LAYOUT.XS),
}}
>
<Typography
@@ -54,12 +55,12 @@ export const HistogramPageSpeedScoresTooltip = ({
key={`${key}-tooltip`}
direction="row"
alignItems="center"
gap={theme.spacing(3)}
mt={theme.spacing(1)}
gap={theme.spacing(SPACING.XXL)}
mt={theme.spacing(SPACING.SM)}
>
<Box
width={theme.spacing(4)}
height={theme.spacing(4)}
width={theme.spacing(LAYOUT.XS)}
height={theme.spacing(LAYOUT.XS)}
sx={{ borderRadius: "50%", backgroundColor: dotColor }}
/>
<Typography
@@ -1,9 +1,9 @@
import Stack from "@mui/material/Stack";
import Typography from "@mui/material/Typography";
import { BaseChart } from "@/Components/v2/design-elements";
import { BaseChart } from "@/Components/design-elements";
import { useTheme } from "@mui/material/styles";
import { useSelector } from "react-redux";
import { formatDateWithTz } from "@/Utils/timeUtilsLegacy";
import { formatDateWithTz } from "@/Utils/TimeUtils";
import { useTranslation } from "react-i18next";
import { ResponsiveContainer, BarChart, XAxis, Bar, Cell, Tooltip } from "recharts";
import { getResponseTimeColor } from "@/Utils/MonitorUtils";
@@ -1,4 +1,4 @@
import { BaseChart } from "@/Components/v2/design-elements";
import { BaseChart } from "@/Components/design-elements";
import { FileText } from "lucide-react";
import type { CheckAudits, CheckSnapshot } from "@/Types/Check";
import { Pie, PieChart, ResponsiveContainer, Label } from "recharts";
@@ -1,7 +1,7 @@
import Stack from "@mui/material/Stack";
import Box from "@mui/material/Box";
import { BarChart3 } from "lucide-react";
import { BaseChart } from "@/Components/v2/design-elements";
import { BaseChart } from "@/Components/design-elements";
import Typography from "@mui/material/Typography";
import type { CheckSnapshot } from "@/Types/Check";
@@ -1,4 +1,4 @@
import { BaseChart } from "@/Components/v2/design-elements";
import { BaseChart } from "@/Components/design-elements";
import Stack from "@mui/material/Stack";
import Typography from "@mui/material/Typography";
import { Gauge } from "lucide-react";
@@ -1,6 +1,8 @@
export * from "./ControlsFilter";
export * from "./MonitorStatBoxes";
export * from "./HeaderMonitorControls";
export * from "./HeaderGeoTabs";
export * from "./GeoChecksMap";
export * from "./charts/HistogramStatus";
export * from "./charts/RadialAvgResponse";
export * from "./charts/HistogramDetails";
@@ -11,3 +13,4 @@ export * from "./charts/PiePageSpeedLegend";
export * from "./charts/HistogramPageSpeedDetails";
export * from "./charts/HistogramPageSpeedDetailsTooltip";
export * from "./charts/HistogramInfrastructure";
export * from "./HeaderMonitorsSummary";
@@ -0,0 +1,41 @@
import { Navigate } from "react-router-dom";
import { useSelector } from "react-redux";
import type { RootState } from "@/Types/state";
import type { UserRole } from "@/Types/User";
interface ProtectedRouteProps {
children: React.ReactNode;
}
export const ProtectedRoute = ({ children }: ProtectedRouteProps) => {
const authState = useSelector((state: RootState) => state.auth);
return authState.authToken ? (
children
) : (
<Navigate
to="/login"
replace
/>
);
};
interface RoleProtectedRouteProps {
roles: UserRole[];
children: React.ReactNode;
}
export const RoleProtectedRoute = ({ roles, children }: RoleProtectedRouteProps) => {
const authState = useSelector((state: RootState) => state.auth);
const userRoles = authState?.user?.role || [];
const canAccess = userRoles.some((role) => roles.includes(role));
return canAccess ? (
children
) : (
<Navigate
to="/uptime"
replace
/>
);
};
@@ -0,0 +1,189 @@
import Stack from "@mui/material/Stack";
import Box from "@mui/material/Box";
import Typography from "@mui/material/Typography";
import IconButton from "@mui/material/IconButton";
import Menu from "@mui/material/Menu";
import MenuItem from "@mui/material/MenuItem";
import { useTheme } from "@mui/material";
import { SPACING, LAYOUT } from "@/Utils/Theme/constants";
import { useSelector, useDispatch } from "react-redux";
import { useTranslation } from "react-i18next";
import { useState } from "react";
import { useNavigate } from "react-router";
import { MoreVertical, LogOut } from "lucide-react";
import { Avatar, Icon } from "@/Components/design-elements";
import { clearAuthState } from "@/Features/Auth/authSlice.js";
import type { RootState } from "@/Types/state.js";
interface AuthFooterProps {
collapsed: boolean;
accountMenuItems: Array<{
name: string;
path: string;
icon: React.ReactNode;
}>;
}
export const AuthFooter = ({ collapsed, accountMenuItems }: AuthFooterProps) => {
const { t } = useTranslation();
const theme = useTheme();
const user = useSelector((state: RootState) => state.auth.user);
const navigate = useNavigate();
const dispatch = useDispatch();
const [anchorEl, setAnchorEl] = useState<null | HTMLElement>(null);
const menuOpen = Boolean(anchorEl);
const handleMenuOpen = (e: React.MouseEvent<HTMLElement>) =>
setAnchorEl(e.currentTarget);
const handleMenuClose = () => setAnchorEl(null);
const handleNavigate = (path: string) => {
handleMenuClose();
navigate(path);
};
const handleLogout = () => {
dispatch(clearAuthState());
navigate("/login");
};
const getRoleText = () => {
const role = user?.role ?? "";
if (role.includes("superadmin"))
return t("components.sidebar.authFooter.roles.superAdmin");
if (role.includes("admin")) return t("components.sidebar.authFooter.roles.admin");
if (role.includes("user")) return t("components.sidebar.authFooter.roles.user");
if (role.includes("demo")) return t("components.sidebar.authFooter.roles.demoUser");
return role;
};
const filteredMenuItems = accountMenuItems.filter((item) => {
if (!user) return false;
if (item.name === "Password" && user.role?.includes("demo")) return false;
if (item.name === "Team" && !user.role?.includes("superadmin")) return false;
return true;
});
const menuItemSx = {
gap: theme.spacing(LAYOUT.MD),
borderRadius: theme.shape.borderRadius,
pl: theme.spacing(LAYOUT.XS),
"& svg": { stroke: theme.palette.text.secondary },
};
return (
<Stack
direction="row"
alignItems="center"
py={theme.spacing(LAYOUT.XS)}
px={theme.spacing(LAYOUT.MD)}
gap={theme.spacing(LAYOUT.MD)}
>
<Avatar
small
onClick={collapsed ? handleMenuOpen : undefined}
sx={{ cursor: collapsed ? "pointer" : "default" }}
/>
{!collapsed && (
<Stack
direction="row"
alignItems="center"
gap={theme.spacing(SPACING.MD)}
minWidth={0}
flex={1}
>
<Stack
minWidth={0}
flex={1}
>
<Typography
fontWeight={500}
noWrap
sx={{ color: theme.palette.text.primary }}
>
{user?.firstName} {user?.lastName}
</Typography>
<Typography
noWrap
sx={{ textTransform: "capitalize", color: theme.palette.text.secondary }}
>
{getRoleText()}
</Typography>
</Stack>
<IconButton
onClick={handleMenuOpen}
sx={{
"&:focus": { outline: "none" },
"& svg": { stroke: theme.palette.text.secondary },
}}
>
<Icon
icon={MoreVertical}
size={22}
/>
</IconButton>
</Stack>
)}
<Menu
anchorEl={anchorEl}
open={menuOpen}
onClose={handleMenuClose}
disableScrollLock
anchorOrigin={{ vertical: "top", horizontal: "right" }}
slotProps={{
paper: {
sx: {
mt: theme.spacing(-LAYOUT.XS),
ml: collapsed ? theme.spacing(SPACING.LG) : 0,
},
},
}}
MenuListProps={{ sx: { p: 2, "& li": { m: 0 } } }}
sx={{ ml: theme.spacing(LAYOUT.XS) }}
>
{collapsed && (
<Box
px={2}
pb={2}
sx={{ pointerEvents: "none" }}
>
<Typography
fontWeight={500}
fontSize={13}
>
{user?.firstName} {user?.lastName}
</Typography>
<Typography
fontSize={12}
sx={{ textTransform: "capitalize" }}
>
{getRoleText()}
</Typography>
</Box>
)}
{filteredMenuItems.map((item) => (
<MenuItem
key={item.name}
onClick={() => handleNavigate(item.path)}
sx={menuItemSx}
>
{item.icon}
{item.name}
</MenuItem>
))}
<MenuItem
onClick={handleLogout}
sx={menuItemSx}
>
<Icon
icon={LogOut}
size={20}
/>
{t("components.sidebar.authFooter.logOut")}
</MenuItem>
</Menu>
</Stack>
);
};
@@ -1,37 +1,37 @@
import Stack from "@mui/material/Stack";
import Stack, { type StackProps } from "@mui/material/Stack";
import Box from "@mui/material/Box";
import Typography from "@mui/material/Typography";
import { useTheme } from "@mui/material/styles";
import { useNavigate } from "react-router";
import { toggleSidebar } from "@/Features/UI/uiSlice.js";
import { useDispatch } from "react-redux";
import { useTranslation } from "react-i18next";
import PropTypes from "prop-types";
import useSidebar from "@/Hooks/useSidebar";
const Logo = ({ collapsed }) => {
export const Logo = (props: StackProps) => {
const { t } = useTranslation();
const theme = useTheme();
const navigate = useNavigate();
const dispatch = useDispatch();
const { collapsed } = useSidebar();
return (
<Stack
pt={theme.spacing(6)}
pb={theme.spacing(12)}
pl={theme.spacing(8)}
direction="row"
alignItems="center"
gap={theme.spacing(4)}
onClick={() => navigate("/")}
onClick={() => {
dispatch(toggleSidebar());
}}
sx={{ cursor: "pointer" }}
{...props}
>
<Typography
pl={theme.spacing("1px")}
minWidth={theme.spacing(16)}
minHeight={theme.spacing(16)}
display={"flex"}
justifyContent={"center"}
alignItems={"center"}
backgroundColor={theme.palette.accent.main}
bgcolor={theme.palette.primary.main}
borderRadius={theme.shape.borderRadius}
color={theme.palette.accent.contrastText}
color={theme.palette.primary.contrastText}
fontSize={18}
>
C
@@ -49,9 +49,8 @@ const Logo = ({ collapsed }) => {
<Typography
lineHeight={1}
mt={theme.spacing(2)}
color={theme.palette.primary.contrastText}
fontSize={"var(--env-var-font-size-medium-plus)"}
sx={{ fontWeight: 500 }}
variant="h2"
fontWeight={500}
>
{t("common.appName")}
</Typography>
@@ -59,9 +58,3 @@ const Logo = ({ collapsed }) => {
</Stack>
);
};
Logo.propTypes = {
collapsed: PropTypes.bool,
};
export default Logo;
+120
View File
@@ -0,0 +1,120 @@
import { Icon } from "@/Components/design-elements";
import {
Globe,
Gauge,
Link,
Bell,
FileText,
AlertTriangle,
Wifi,
Wrench,
Database,
Settings,
HelpCircle,
MessageCircle,
Code,
User,
Lock,
Users,
} from "lucide-react";
export const getMenu = (t: Function) => {
return [
{
name: t("components.sidebar.menu.uptime"),
path: "uptime",
icon: <Icon icon={Globe} />,
},
{
name: t("components.sidebar.menu.pagespeed"),
path: "pagespeed",
icon: <Icon icon={Gauge} />,
},
{
name: t("components.sidebar.menu.infrastructure"),
path: "infrastructure",
icon: <Icon icon={Link} />,
},
{
name: t("components.sidebar.menu.notifications"),
path: "notifications",
icon: <Icon icon={Bell} />,
},
{
name: t("components.sidebar.menu.checks"),
path: "checks",
icon: <Icon icon={FileText} />,
},
{
name: t("components.sidebar.menu.incidents"),
path: "incidents",
icon: <Icon icon={AlertTriangle} />,
},
{
name: t("components.sidebar.menu.statusPages"),
path: "status",
icon: <Icon icon={Wifi} />,
},
{
name: t("components.sidebar.menu.maintenance"),
path: "maintenance",
icon: <Icon icon={Wrench} />,
},
{
name: t("components.sidebar.menu.logs"),
path: "logs",
icon: <Icon icon={Database} />,
},
{
name: t("components.sidebar.menu.settings"),
icon: <Icon icon={Settings} />,
path: "settings",
},
];
};
export const getBottomMenu = (t: Function) => {
return [
{
name: t("components.sidebar.bottomMenu.support"),
path: "support",
icon: <Icon icon={HelpCircle} />,
},
{
name: t("components.sidebar.bottomMenu.discussions"),
path: "discussions",
icon: <Icon icon={MessageCircle} />,
},
{
name: t("components.sidebar.bottomMenu.docs"),
path: "docs",
icon: <Icon icon={FileText} />,
},
{
name: t("components.sidebar.bottomMenu.changelog"),
path: "changelog",
icon: <Icon icon={Code} />,
},
];
};
export const getAccountMenu = (t: Function) => {
return [
{
name: t("components.sidebar.accountMenu.profile"),
path: "account/profile",
icon: <Icon icon={User} />,
},
{
name: t("components.sidebar.accountMenu.password"),
path: "account/password",
icon: <Icon icon={Lock} />,
},
{
name: t("components.sidebar.accountMenu.team"),
path: "account/team",
icon: <Icon icon={Users} />,
},
];
};
@@ -3,19 +3,31 @@ import ListItemButton from "@mui/material/ListItemButton";
import ListItemIcon from "@mui/material/ListItemIcon";
import Box from "@mui/material/Box";
import Typography from "@mui/material/Typography";
import { useTheme } from "@emotion/react";
import PropTypes from "prop-types";
import { useTheme } from "@mui/material/styles";
import useSidebar from "@/Hooks/useSidebar";
const NavItem = ({ item, collapsed, selected, onClick }) => {
export interface NavData {
name: string;
icon: React.ReactElement;
}
export const NavItem = ({
item,
selected,
onClick,
}: {
item: NavData;
selected: boolean;
onClick: (event: React.MouseEvent) => void;
}) => {
const { collapsed } = useSidebar();
const theme = useTheme();
const iconStroke = selected
? theme.palette.primary.contrastText
: theme.palette.primary.contrastTextTertiary;
const iconStroke = selected ? theme.palette.primary.main : theme.palette.text.secondary;
const buttonBgColor = selected ? theme.palette.secondary.main : "transparent";
const buttonBgColor = selected ? theme.palette.action.selected : "transparent";
const buttonBgHoverColor = selected
? theme.palette.secondary.main
: theme.palette.tertiary.main;
? theme.palette.action.selected
: theme.palette.action.hover;
const fontWeight = selected ? 600 : 400;
return (
<Tooltip
@@ -38,10 +50,14 @@ const NavItem = ({ item, collapsed, selected, onClick }) => {
<ListItemButton
sx={{
backgroundColor: buttonBgColor,
backgroundImage: "none",
border: 1,
borderColor: "transparent",
"&:hover": {
backgroundColor: buttonBgHoverColor,
backgroundImage: "none",
},
height: 37,
height: 32,
gap: theme.spacing(4),
borderRadius: theme.shape.borderRadius,
px: theme.spacing(4),
@@ -52,13 +68,20 @@ const NavItem = ({ item, collapsed, selected, onClick }) => {
<ListItemIcon
sx={{
minWidth: 0,
color: iconStroke,
"& svg": {
height: 20,
width: 20,
height: 16,
width: 16,
opacity: 0.81,
transition: "stroke 0.2s ease",
},
"& svg path, & svg line, & svg polyline, & svg rect, & svg circle": {
stroke: iconStroke,
},
".MuiListItemButton-root:hover &": {
"& svg path, & svg line, & svg polyline, & svg rect, & svg circle": {
stroke: theme.palette.primary.main,
},
},
}}
>
{item.icon}
@@ -73,7 +96,6 @@ const NavItem = ({ item, collapsed, selected, onClick }) => {
>
<Typography
variant="body1"
color={theme.palette.primary.contrastText}
sx={{
fontWeight: fontWeight,
opacity: 0.9,
@@ -86,11 +108,3 @@ const NavItem = ({ item, collapsed, selected, onClick }) => {
</Tooltip>
);
};
NavItem.propTypes = {
item: PropTypes.object,
collapsed: PropTypes.bool,
selected: PropTypes.bool,
onClick: PropTypes.func,
};
export default NavItem;
@@ -1,18 +1,26 @@
import React from "react";
import { Typography, IconButton, Stack, Box } from "@mui/material";
import Icon from "../Icon";
import { useTheme } from "@emotion/react";
import { Icon } from "@/Components/design-elements";
import { X } from "lucide-react";
import { SPACING, LAYOUT } from "@/Utils/Theme/constants";
import { useTheme } from "@mui/material";
import { useSelector, useDispatch } from "react-redux";
import { useTranslation } from "react-i18next";
import { setStarPromptOpen } from "../../../Features/UI/uiSlice.js";
import { setStarPromptOpen } from "@/Features/UI/uiSlice.js";
import type { RootState } from "@/Types/state.js";
import useSidebar from "@/Hooks/useSidebar.js";
const StarPrompt = ({ repoUrl = "https://github.com/bluewave-labs/checkmate" }) => {
export const StarPrompt = ({
repoUrl = "https://github.com/bluewave-labs/checkmate",
}: {
repoUrl?: string;
}) => {
const theme = useTheme();
const dispatch = useDispatch();
const { t } = useTranslation();
const isOpen = useSelector((state) => state.ui?.starPromptOpen ?? true);
const mode = useSelector((state) => state.ui.mode);
const isOpen = useSelector((state: RootState) => state.ui?.starPromptOpen ?? true);
const mode = useSelector((state: RootState) => state.ui.mode);
const { collapsed } = useSidebar();
const handleClose = () => {
dispatch(setStarPromptOpen(false));
};
@@ -21,38 +29,30 @@ const StarPrompt = ({ repoUrl = "https://github.com/bluewave-labs/checkmate" })
window.open(repoUrl, "_blank");
};
if (collapsed) return null;
if (!isOpen) return null;
return (
<Stack
direction="column"
sx={{
width: "100%",
padding: `${theme.spacing(6)} ${theme.spacing(6)}`,
borderTop: `1px solid ${theme.palette.primary.lowContrast}`,
borderBottom: `1px solid ${theme.palette.primary.lowContrast}`,
borderRadius: 0,
gap: theme.spacing(1.5),
}}
gap={theme.spacing(LAYOUT.MD)}
padding={theme.spacing(LAYOUT.SM)}
width={"100%"}
borderTop={`1px solid ${theme.palette.divider}`}
borderBottom={`1px solid ${theme.palette.divider}`}
>
<Stack
direction="row"
justifyContent="space-between"
alignItems="center"
width="100%"
pl={theme.spacing(4)}
pl={theme.spacing(LAYOUT.XS)}
>
<Typography
variant="subtitle2"
sx={{
color:
mode === "dark"
? theme.palette.primary.contrastText
: theme.palette.text.primary,
mt: theme.spacing(3),
}}
mt={theme.spacing(SPACING.XXL)}
>
{t("starPromptTitle")}
{t("components.sidebar.starPrompt.title")}
</Typography>
<IconButton
onClick={handleClose}
@@ -60,7 +60,6 @@ const StarPrompt = ({ repoUrl = "https://github.com/bluewave-labs/checkmate" })
sx={{
color: theme.palette.text.primary,
padding: 0,
marginTop: theme.spacing(-5),
"&:hover": {
backgroundColor: "transparent",
opacity: 0.8,
@@ -68,23 +67,19 @@ const StarPrompt = ({ repoUrl = "https://github.com/bluewave-labs/checkmate" })
}}
>
<Icon
name="X"
icon={X}
size={20}
/>
</IconButton>
</Stack>
<Typography
variant="body1"
sx={{
color: theme.palette.primary.contrastTextTertiary,
fontSize: "0.938rem",
lineHeight: 1.5,
mb: 1,
px: theme.spacing(4),
px: theme.spacing(LAYOUT.XS),
}}
>
{t("starPromptDescription")}
{t("components.sidebar.starPrompt.description")}
</Typography>
<Box
@@ -99,12 +94,10 @@ const StarPrompt = ({ repoUrl = "https://github.com/bluewave-labs/checkmate" })
"&:hover": {
opacity: 0.8,
},
pl: theme.spacing(4),
pl: theme.spacing(LAYOUT.XS),
filter: mode === "dark" ? "invert(1)" : "none",
}}
/>
</Stack>
);
};
export default StarPrompt;
+132
View File
@@ -0,0 +1,132 @@
import { useEffect } from "react";
import Backdrop from "@mui/material/Backdrop";
import Stack from "@mui/material/Stack";
import List from "@mui/material/List";
import Divider from "@mui/material/Divider";
import { LAYOUT } from "@/Utils/Theme/constants";
import { useSidebar } from "@/Hooks/useSidebar.js";
import { Logo } from "@/Components/sidebar/Logo";
import { getMenu, getBottomMenu, getAccountMenu } from "@/Components/sidebar/Menu";
import { NavItem } from "@/Components/sidebar/NavItem";
import { StarPrompt } from "@/Components/sidebar/StarPrompt";
import { AuthFooter } from "@/Components/sidebar/Authfooter";
import { useNavigate, useLocation } from "react-router";
import { useTranslation } from "react-i18next";
import { useTheme, useMediaQuery } from "@mui/material";
import { useDispatch } from "react-redux";
import { setCollapsed } from "@/Features/UI/uiSlice";
const URL_MAP: Record<string, string> = {
support: "https://discord.com/invite/NAb6H3UTjK",
discussions: "https://github.com/bluewave-labs/checkmate/discussions",
docs: "https://bluewavelabs.gitbook.io/checkmate",
changelog: "https://github.com/bluewave-labs/checkmate/releases",
};
export const Sidebar = () => {
const dispatch = useDispatch();
const navigate = useNavigate();
const location = useLocation();
const { t } = useTranslation();
const { width, transition, collapsed } = useSidebar();
const theme = useTheme();
const isSmall = useMediaQuery(theme.breakpoints.down("md"));
const menu = getMenu(t);
const bottomMenu = getBottomMenu(t);
const accountMenu = getAccountMenu(t);
useEffect(() => {
dispatch(setCollapsed({ collapsed: isSmall }));
}, [isSmall, dispatch]);
const handleNavClick = (path: string) => {
const url = URL_MAP[path];
if (url) {
window.open(url, "_blank", "noreferrer");
} else {
navigate(`/${path}`);
}
if (isSmall) {
dispatch(setCollapsed({ collapsed: true }));
}
};
return (
<>
<Backdrop
open={!collapsed && isSmall}
onClick={() => dispatch(setCollapsed({ collapsed: true }))}
sx={{ zIndex: 999 }}
/>
<Stack
component="aside"
position={isSmall ? "fixed" : "sticky"}
top={0}
left={0}
minHeight={"100vh"}
maxHeight={"100vh"}
paddingTop={theme.spacing(LAYOUT.SM)}
paddingBottom={theme.spacing(LAYOUT.SM)}
gap={theme.spacing(LAYOUT.SM)}
borderRight={`1px solid ${theme.palette.divider}`}
width={width}
sx={{
touchAction: "none",
transition: transition,
zIndex: 1000,
backdropFilter: "blur(8px)",
}}
>
<List
component="nav"
disablePadding
sx={{
px: theme.spacing(LAYOUT.SM),
flex: 1,
}}
>
<Logo
pt={theme.spacing(LAYOUT.MD)}
pb={theme.spacing(LAYOUT.MD)}
/>
{menu.map((item) => {
const selected = location.pathname.startsWith(`/${item.path}`);
return (
<NavItem
key={item.path}
item={item}
selected={selected}
onClick={() => handleNavClick(item.path)}
/>
);
})}
</List>
<StarPrompt />
<List
component="nav"
disablePadding
sx={{ px: theme.spacing(LAYOUT.SM) }}
>
{bottomMenu.map((item) => {
const selected = location.pathname.startsWith(`/${item.path}`);
return (
<NavItem
key={item.path}
item={item}
selected={selected}
onClick={() => handleNavClick(item.path)}
/>
);
})}
</List>
<Divider sx={{ borderColor: theme.palette.divider }} />
<AuthFooter
collapsed={collapsed}
accountMenuItems={accountMenu}
/>
</Stack>
</>
);
};
@@ -1,228 +0,0 @@
// Components
import IconButton from "@mui/material/IconButton";
import Menu from "@mui/material/Menu";
import MenuItem from "@mui/material/MenuItem";
import Icon from "../Icon";
import Dialog from "../Dialog/index.jsx";
// Utils
import { useState } from "react";
import { useTheme } from "@emotion/react";
import { useNavigate } from "react-router-dom";
import { createToast } from "../../../Utils/toastUtils.jsx";
import PropTypes from "prop-types";
import { usePauseMonitor, useDeleteMonitor } from "../../../Hooks/monitorHooks.js";
const ActionsMenu = ({
monitor,
isAdmin,
updateRowCallback,
pauseCallback,
setIsLoading = () => {},
}) => {
const [anchorEl, setAnchorEl] = useState(null);
const [actions, setActions] = useState({});
const [isOpen, setIsOpen] = useState(false);
const theme = useTheme();
const [pauseMonitor, isPausing, error] = usePauseMonitor();
const [deleteMonitor, isDeleting] = useDeleteMonitor();
const handleRemove = async (event) => {
event.preventDefault();
event.stopPropagation();
let monitor = { id: actions.id };
await deleteMonitor({ monitor });
updateRowCallback();
};
const handlePause = async () => {
try {
setIsLoading(true);
await pauseMonitor({ monitorId: monitor.id });
pauseCallback();
} catch (error) {
createToast({ body: "Failed to pause monitor." });
} finally {
setIsLoading(false);
}
};
const openMenu = (event, id, url) => {
event.preventDefault();
event.stopPropagation();
setAnchorEl(event.currentTarget);
setActions({ id: id, url: url });
};
const openRemove = (e) => {
closeMenu(e);
setIsOpen(true);
};
const closeMenu = (e) => {
e.stopPropagation();
setAnchorEl(null);
};
const navigate = useNavigate();
return (
<>
<IconButton
aria-label="monitor actions"
onClick={(event) => {
event.stopPropagation();
openMenu(event, monitor.id, monitor.type === "ping" ? null : monitor.url);
}}
sx={{
"&:focus": {
outline: "none",
},
"& svg path": {
stroke: theme.palette.primary.contrastTextTertiary,
},
}}
>
<Icon
name="Settings"
size={20}
/>
</IconButton>
<Menu
className="actions-menu"
anchorEl={anchorEl}
open={Boolean(anchorEl)}
onClose={(e) => closeMenu(e)}
disableScrollLock
slotProps={{
paper: {
sx: {
"& ul": {
p: theme.spacing(2.5),
backgroundColor: theme.palette.primary.main,
},
"& li": { m: 0, color: theme.palette.primary.contrastTextSecondary },
/*
This should not be set automatically on the last of type
"& li:last-of-type": {
color: theme.palette.error.main,
}, */
},
},
}}
>
{actions.url !== null ? (
<MenuItem
onClick={(e) => {
closeMenu(e);
e.stopPropagation();
window.open(actions.url, "_blank", "noreferrer");
}}
>
Open site
</MenuItem>
) : (
""
)}
<MenuItem
onClick={(e) => {
e.stopPropagation();
navigate(`/uptime/${actions.id}`);
}}
>
Details
</MenuItem>
{/* TODO - pass monitor id to Incidents page */}
<MenuItem
onClick={(e) => {
e.stopPropagation();
navigate(`/incidents/${actions.id}`);
}}
>
Incidents
</MenuItem>
{isAdmin && (
<MenuItem
onClick={(e) => {
e.stopPropagation();
navigate(`/uptime/configure/${actions.id}`);
}}
>
Configure
</MenuItem>
)}
{isAdmin && (
<MenuItem
onClick={(e) => {
e.stopPropagation();
navigate(`/uptime/create/${actions.id}`);
}}
>
Clone
</MenuItem>
)}
{isAdmin && (
<MenuItem
onClick={(e) => {
closeMenu(e);
e.stopPropagation();
handlePause(e);
}}
>
{monitor?.isActive === true ? "Pause" : "Resume"}
</MenuItem>
)}
{isAdmin && (
<MenuItem
onClick={(e) => {
e.stopPropagation();
openRemove(e);
}}
sx={{ "&.MuiButtonBase-root": { color: theme.palette.error.main } }}
>
Remove
</MenuItem>
)}
</Menu>
<Dialog
open={isOpen}
theme={theme}
title="Do you really want to delete this monitor?"
description="Once deleted, this monitor cannot be retrieved."
/* Do we need stop propagation? */
onCancel={(e) => {
e.stopPropagation();
setIsOpen(false);
}}
confirmationButtonLabel="Delete"
/* Do we need stop propagation? */
onConfirm={(e) => {
console.log(e);
e.stopPropagation();
handleRemove(e);
}}
isLoading={isDeleting}
modelTitle="modal-delete-monitor"
modelDescription="delete-monitor-confirmation"
/>
</>
);
};
ActionsMenu.propTypes = {
monitor: PropTypes.shape({
id: PropTypes.string,
url: PropTypes.string,
type: PropTypes.string,
isActive: PropTypes.bool,
}).isRequired,
isAdmin: PropTypes.bool,
updateRowCallback: PropTypes.func,
pauseCallback: PropTypes.func,
setIsLoading: PropTypes.func,
};
export default ActionsMenu;
-9
View File
@@ -1,9 +0,0 @@
.alert {
margin: 0;
width: fit-content;
}
.alert,
.alert button,
.alert .MuiTypography-root {
font-size: var(--env-var-font-size-medium);
}
-138
View File
@@ -1,138 +0,0 @@
import PropTypes from "prop-types";
import { useTheme } from "@emotion/react";
import { Box, Button, IconButton, Stack, Typography } from "@mui/material";
import Icon from "../Icon";
import "./index.css";
/**
* Icons mapping for different alert variants.
* @type {Object<string, JSX.Element>}
*/
const icons = {
info: (
<Icon
name="Info"
size={24}
/>
),
error: (
<Icon
name="AlertCircle"
size={24}
/>
),
warning: (
<Icon
name="AlertTriangle"
size={24}
/>
),
};
/**
* @param {Object} props
* @param {'info' | 'error' | 'warning'} props.variant - The type of alert.
* @param {string} [props.title] - The title of the alert.
* @param {string} [props.body] - The body text of the alert.
* @param {boolean} [props.isToast] - Indicates if the alert is used as a toast notification.
* @param {boolean} [props.hasIcon] - Whether to display an icon in the alert.
* @param {function} props.onClick - Toast dismiss function.
* @returns {JSX.Element}
*/
const Alert = ({ variant, title, body, isToast, hasIcon = true, onClick }) => {
const theme = useTheme();
/* TODO
Do we need other variants for alert?
*/
const text = theme.palette.secondary.contrastText;
const border = theme.palette.alert.contrastText;
const bg = theme.palette.alert.main;
const icon = icons[variant];
return (
<Stack
direction="row"
justifyContent="flex-start"
alignItems={hasIcon ? "" : "center"}
className="alert row-stack"
gap={theme.spacing(8)}
sx={{
padding: hasIcon ? theme.spacing(8) : `${theme.spacing(4)} ${theme.spacing(8)}`,
backgroundColor: bg,
border: `solid 1px ${border}`,
borderRadius: theme.shape.borderRadius,
}}
>
{hasIcon && <Box sx={{ color: text }}>{icon}</Box>}
<Stack
direction="column"
gap="2px"
sx={{ flex: 1 }}
>
{title && (
<Typography sx={{ fontWeight: "700", color: `${text}` }}>{title}</Typography>
)}
{body && (
<Typography sx={{ fontWeight: "400", color: `${text}` }}>{body}</Typography>
)}
{hasIcon && isToast && (
<Button
variant="text"
color="info"
onClick={onClick}
sx={{
fontWeight: "600",
width: "fit-content",
mt: theme.spacing(4),
padding: 0,
minWidth: 0,
}}
>
Dismiss
</Button>
)}
</Stack>
{isToast && (
<IconButton
onClick={onClick}
sx={{
alignSelf: "flex-start",
ml: "auto",
mr: "-5px",
mt: hasIcon ? "-5px" : 0,
padding: "5px",
"&:focus": {
outline: "none",
},
}}
>
<Icon
name="X"
size={20}
/>
</IconButton>
)}
</Stack>
);
};
Alert.propTypes = {
variant: PropTypes.oneOf(["info", "error", "warning"]).isRequired,
title: PropTypes.string,
body: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
isToast: PropTypes.bool,
hasIcon: PropTypes.bool,
onClick: function (props, propName, componentName) {
if (props.isToast && !props[propName]) {
return new Error(
`Prop '${propName}' is required when 'isToast' is true in '${componentName}'.`
);
}
return null;
},
};
export default Alert;
@@ -1,68 +0,0 @@
import PropTypes from "prop-types";
import { Box, Stack, useTheme } from "@mui/material";
// import useUtils from "../../Pages/Uptime/utils";
/**
* A component that renders a pulsating dot with a specified color.
*
* @component
* @example
* // Example usage:
* <PulseDot color="#f00" />
*
* @param {Object} props
* @param {string} props.color - The color of the dot.
* @returns {JSX.Element} The PulseDot component.
*/
const PulseDot = ({ color }) => {
const theme = useTheme();
// const { statusToTheme } = useUtils();
/* TODO refactor so it gets status and gets theme color. Then uses theme.palette.[themeColor].lowContrast */
/* const themeColor = statusToTheme[status]; */
return (
<Stack
width="26px"
height="24px"
alignItems="center"
justifyContent="center"
>
<Box
minWidth="18px"
minHeight="18px"
sx={{
position: "relative",
backgroundColor: color,
borderRadius: "50%",
"&::before": {
content: `""`,
position: "absolute",
width: "100%",
height: "100%",
backgroundColor: "inherit",
borderRadius: "50%",
animation: "ripple 1.8s ease-out infinite",
},
"&::after": {
content: `""`,
position: "absolute",
width: "7px",
height: "7px",
borderRadius: "50%",
backgroundColor: theme.palette.accent.contrastText,
top: "50%",
left: "50%",
transform: "translate(-50%, -50%)",
},
}}
/>
</Stack>
);
};
PulseDot.propTypes = {
color: PropTypes.string.isRequired,
};
export default PulseDot;
@@ -1,36 +0,0 @@
import Icon from "../Icon";
import PropTypes from "prop-types";
const ArrowLeft = ({ type, color = "#667085", ...props }) => {
if (type === "double") {
return (
<Icon
name="ChevronsLeft"
color={color}
{...props}
/>
);
} else if (type === "long") {
return (
<Icon
name="ArrowLeft"
color={color}
{...props}
/>
);
} else {
return (
<Icon
name="ChevronLeft"
color={color}
{...props}
/>
);
}
};
ArrowLeft.propTypes = {
color: PropTypes.string,
type: PropTypes.oneOf(["double", "long", "default"]),
};
export default ArrowLeft;
@@ -1,29 +0,0 @@
import Icon from "../Icon";
import PropTypes from "prop-types";
const ArrowRight = ({ type, color = "#667085", ...props }) => {
if (type === "double") {
return (
<Icon
name="ChevronsRight"
color={color}
{...props}
/>
);
} else {
return (
<Icon
name="ChevronRight"
color={color}
{...props}
/>
);
}
};
ArrowRight.propTypes = {
type: PropTypes.oneOf(["double", "default"]),
color: PropTypes.string,
};
export default ArrowRight;
Whitespace-only changes.
-73
View File
@@ -1,73 +0,0 @@
import { Avatar as MuiAvatar } from "@mui/material";
import PropTypes from "prop-types";
import { useSelector } from "react-redux";
import { useEffect, useState } from "react";
import { useTheme } from "@emotion/react";
/**
* @component
* @param {Object} props
* @param {string} props.src - Path to image for avatar
* @param {boolean} props.small - Specifies if avatar should be large
* @param {Object} [props.sx] - Additional styles to apply to the button.
* @returns {JSX.Element}
* @example
* // Render a red label
* <Avatar src="assets/img" first="Alex" last="Holliday" small />
*/
const Avatar = ({ src, small, sx, onClick = () => {} }) => {
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;
const [image, setImage] = useState();
useEffect(() => {
if (user.avatarImage) {
setImage(`data:image/png;base64,${user.avatarImage}`);
}
}, [user?.avatarImage]);
return (
<MuiAvatar
onClick={onClick}
alt={`${user?.firstName} ${user?.lastName}`}
/* TODO What is the /static/images/avatar/2.jpg ?*/
src={src ? src : user?.avatarImage ? image : "/static/images/avatar/2.jpg"}
sx={{
fontSize: small ? "16px" : "22px",
fontWeight: 400,
color: theme.palette.accent.contrastText,
backgroundColor: theme.palette.accent.main, // Same BG color as checkmate BG in sidebar
display: "inline-flex",
/*
TODO not sure what this is for*/
"&::before": {
content: `""`,
position: "absolute",
top: 0,
left: 0,
width: `100%`,
height: `100%`,
border: `${border}px solid rgba(255,255,255,0.2)`,
borderRadius: "50%",
},
...style,
...sx,
}}
>
{user.firstName?.charAt(0)}
{user.lastName?.charAt(0) || ""}
</MuiAvatar>
);
};
Avatar.propTypes = {
src: PropTypes.string,
small: PropTypes.bool,
sx: PropTypes.object,
onClick: PropTypes.func,
};
export default Avatar;
@@ -1,22 +0,0 @@
.MuiBreadcrumbs-root {
min-height: 34px;
}
.MuiBreadcrumbs-root svg {
width: 16px;
min-height: 16px;
}
.MuiBreadcrumbs-root .MuiBreadcrumbs-li a {
font-size: var(--env-var-font-size-medium);
font-weight: 400;
}
.MuiBreadcrumbs-root .MuiBreadcrumbs-li:not(:last-child) {
cursor: pointer;
}
.MuiBreadcrumbs-root .MuiBreadcrumbs-li:last-child a {
font-weight: 500;
opacity: 1;
cursor: default;
}
.MuiBreadcrumbs-root .MuiBreadcrumbs-separator {
margin: 0;
}
@@ -1,78 +0,0 @@
import PropTypes from "prop-types";
import { Box, Breadcrumbs as MUIBreadcrumbs } from "@mui/material";
import { useTheme } from "@emotion/react";
import { useNavigate } from "react-router-dom";
import ArrowRight from "../ArrowRight/index.jsx";
import "./index.css";
/**
* Breadcrumbs component that displays a list of breadcrumb items.
*
* @param {Object} props
* @param {Array} props.list - Array of breadcrumb items. Each item should have `name` and `path` properties.
* @param {string} props.list.name - The name to display for the breadcrumb.
* @param {string} props.list.path - The path to navigate to when the breadcrumb is clicked.
*
* @returns {JSX.Element} The rendered Breadcrumbs component.
*/
const Breadcrumbs = ({ list }) => {
const theme = useTheme();
const navigate = useNavigate();
return (
<MUIBreadcrumbs
separator={<ArrowRight />}
aria-label="breadcrumb"
px={theme.spacing(2)}
py={theme.spacing(3.5)}
width="fit-content"
backgroundColor={theme.palette.secondary.main}
borderRadius={theme.shape.borderRadius}
lineHeight="18px"
sx={{
"& .MuiBreadcrumbs-li a": {
transition: "background-color 0.2s ease-in-out, color 0.2s ease-in-out",
},
"& .MuiBreadcrumbs-li:not(:last-of-type):hover a": {
backgroundColor: theme.palette.secondary.contrastText,
color: theme.palette.secondary.main,
},
}}
>
{list.map((item, index) => {
return (
<Box
component="a"
key={`${item.name}-${index}`}
px={theme.spacing(4)}
pt={theme.spacing(2)}
pb={theme.spacing(3)}
borderRadius={theme.shape.borderRadius}
onClick={() => navigate(item.path)}
sx={{
opacity: 0.8,
textTransform: "capitalize",
"&, &:hover": {
color: theme.palette.secondary.contrastText,
},
}}
>
{item.name}
</Box>
);
})}
</MUIBreadcrumbs>
);
};
Breadcrumbs.propTypes = {
list: PropTypes.arrayOf(
PropTypes.shape({
name: PropTypes.string.isRequired,
path: PropTypes.string.isRequired,
}).isRequired
).isRequired,
};
export default Breadcrumbs;
@@ -1,30 +0,0 @@
import React from "react";
import Button from "@mui/material/Button";
import { styled } from "@mui/material/styles";
const RoundGradientButton = styled(Button)(({ theme }) => ({
position: "relative",
border: "5px solid transparent",
backgroundClip: "padding-box",
borderRadius: 30,
fontSize: "1.2rem",
color: theme.palette.primary.contrastText,
backgroundColor: theme.palette.background.main,
"&:after": {
position: "absolute",
top: -3,
left: -3,
right: -3,
bottom: -3,
background:
theme.palette.mode === "dark"
? "linear-gradient(90deg, #842bd2, #ff5451, #8c52ff)"
: "linear-gradient(90deg, #842bd2, #ff5451, #8c52ff)",
content: '""',
zIndex: -1,
borderRadius: 30,
},
}));
export default RoundGradientButton;
@@ -1,214 +0,0 @@
/**
* CustomAreaChart component for rendering an area chart with optional gradient and custom ticks.
*
* @param {Object} props - The properties object.
* @param {Array} props.data - The data array for the chart.
* @param {Array} props.dataKeys - An array of data keys to be plotted as separate areas.
* @param {string} props.xKey - The key for the x-axis data.
* @param {string} [props.yKey] - The key for the y-axis data (optional).
* @param {Object} [props.xTick] - Custom tick component for the x-axis.
* @param {Object} [props.yTick] - Custom tick component for the y-axis.
* @param {string} [props.strokeColor] - The base stroke color for the areas.
* If not provided, uses a predefined color palette.
* @param {string} [props.fillColor] - The base fill color for the areas.
* @param {boolean} [props.gradient=false] - Whether to apply a gradient fill to the areas.
* @param {string} [props.gradientDirection="vertical"] - The direction of the gradient.
* @param {string} [props.gradientStartColor] - The start color of the gradient.
* Defaults to the area's stroke color if not provided.
* @param {string} [props.gradientEndColor] - The end color of the gradient.
* @param {Object} [props.customTooltip] - Custom tooltip component for the chart.
* @param {string|number} [props.height="100%"] - Height of the chart container.
*
* @returns {JSX.Element} The rendered area chart component.
*
* @example
* // Single series chart
* <CustomAreaChart
* data={temperatureData}
* dataKeys={["temperature"]}
* xKey="date"
* yKey="temperature"
* gradient={true}
* gradientStartColor="#ff6b6b"
* gradientEndColor="#4ecdc4"
* />
*
* @example
* // Multi-series chart with custom tooltip
* <CustomAreaChart
* data={performanceData}
* dataKeys={["cpu.usage", "memory.usage"]}
* xKey="timestamp"
* xTick={<CustomTimeTick />}
* yTick={<PercentageTick />}
* gradient={true}
* customTooltip={({ active, payload, label }) => (
* <CustomTooltip
* label={label}
* payload={payload}
* active={active}
* />
* )}
* />
*/
import {
AreaChart,
Area,
XAxis,
YAxis,
CartesianGrid,
Tooltip,
ResponsiveContainer,
} from "recharts";
import { createGradient } from "../Utils/gradientUtils.jsx";
import PropTypes from "prop-types";
import { useTheme } from "@mui/material";
import { useId } from "react";
import { Fragment } from "react";
const CustomAreaChart = ({
data,
dataKeys,
xKey,
xDomain,
yKey,
yDomain,
xTick,
yTick,
strokeColor,
fillColor,
gradient = false,
gradientDirection = "vertical",
gradientStartColor,
gradientEndColor,
customTooltip,
height = "100%",
}) => {
const theme = useTheme();
const uniqueId = useId();
const AREA_COLORS = [
// Blues
"#3182bd", // Deep blue
"#6baed6", // Medium blue
"#9ecae1", // Light blue
// Greens
"#74c476", // Soft green
"#a1d99b", // Light green
"#c7e9c0", // Pale green
// Oranges
"#fdae6b", // Warm orange
"#fdd0a2", // Light orange
"#feedde", // Pale orange
// Purples
"#9467bd", // Lavender
"#a55194", // Deep magenta
"#c994c7", // Soft magenta
// Reds
"#ff9896", // Soft red
"#de2d26", // Deep red
"#fc9272", // Medium red
// Cyans/Teals
"#17becf", // Cyan
"#7fcdbb", // Teal
"#a1dab4", // Light teal
// Yellows
"#fec44f", // Mustard
"#fee391", // Light yellow
"#ffffd4", // Pale yellow
// Additional colors
"#e377c2", // Soft pink
"#bcbd22", // Olive
"#2ca02c", // Vibrant green
];
return (
<ResponsiveContainer
width="100%"
height={height}
// FE team HELP! Why does this overflow if set to 100%?
>
<AreaChart data={data}>
<XAxis
dataKey={xKey}
{...(xDomain && { domain: xDomain })}
{...(xTick && { tick: xTick })}
/>
<YAxis
dataKey={yKey}
{...(yDomain && { domain: yDomain })}
{...(yTick && { tick: yTick })}
/>
<CartesianGrid
stroke={theme.palette.primary.lowContrast}
strokeWidth={1}
strokeOpacity={1}
fill="transparent"
vertical={false}
/>
{dataKeys.map((dataKey, index) => {
const gradientId = `gradient-${uniqueId}-${index}`;
return (
<Fragment key={dataKey}>
{gradient === true &&
createGradient({
id: gradientId,
startColor: gradientStartColor || AREA_COLORS[index],
endColor: gradientEndColor,
direction: gradientDirection,
})}
<Area
yKey={dataKey}
key={dataKey}
type="monotone"
dataKey={dataKey}
stroke={strokeColor || AREA_COLORS[index]}
fill={gradient === true ? `url(#${gradientId})` : fillColor}
/>
</Fragment>
);
})}
{customTooltip ? (
<Tooltip
cursor={{ stroke: theme.palette.primary.lowContrast }}
content={customTooltip}
wrapperStyle={{ pointerEvents: "none" }}
/>
) : (
<Tooltip />
)}
</AreaChart>
</ResponsiveContainer>
);
};
CustomAreaChart.propTypes = {
data: PropTypes.array.isRequired,
dataKeys: PropTypes.array.isRequired,
xTick: PropTypes.object, // Recharts takes an instance of component, so we can't pass the component itself
yTick: PropTypes.object, // Recharts takes an instance of component, so we can't pass the component itself
xKey: PropTypes.string.isRequired,
xDomain: PropTypes.array,
yKey: PropTypes.string,
yDomain: PropTypes.array,
fillColor: PropTypes.string,
strokeColor: PropTypes.string,
gradient: PropTypes.bool,
gradientDirection: PropTypes.string,
gradientStartColor: PropTypes.string,
gradientEndColor: PropTypes.string,
customTooltip: PropTypes.object,
height: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
};
export default CustomAreaChart;
Whitespace-only changes.
@@ -1,181 +0,0 @@
import { useTheme } from "@emotion/react";
import { Box, Stack, Tooltip, Typography } from "@mui/material";
import { formatDateWithTz } from "../../../../Utils/timeUtilsLegacy.js";
import { useEffect, useState } from "react";
import "./index.css";
import { useSelector } from "react-redux";
/* TODO add prop validation and jsdocs */
const BarChart = ({ checks = [] }) => {
const theme = useTheme();
const [animate, setAnimate] = useState(false);
const uiTimezone = useSelector((state) => state.ui.timezone);
useEffect(() => {
setAnimate(true);
});
// set responseTime to average if there's only one check
if (checks.length === 1) {
checks[0] = { ...checks[0], responseTime: 50 };
}
if (checks.length !== 25) {
const placeholders = Array(25 - checks.length).fill("placeholder");
checks = [...checks, ...placeholders];
}
return (
<Stack
direction="row"
flexWrap="nowrap"
gap={theme.spacing(1.5)}
height="50px"
width="fit-content"
onClick={(event) => event.stopPropagation()}
sx={{
cursor: "default",
}}
>
{checks.map((check, index) =>
check === "placeholder" ? (
/* TODO what is the purpose of this box? */
// CAIO_REVIEW the purpose of this box is to make sure there are always at least 25 bars
// even if there are less than 25 checks
<Box
key={`${check}-${index}`}
position="relative"
width={theme.spacing(4.5)}
height="100%"
backgroundColor={theme.palette.primary.lowContrast}
sx={{
borderRadius: theme.spacing(1.5),
}}
/>
) : (
<Tooltip
title={
<>
<Typography>
{formatDateWithTz(
check.updatedAt,
"ddd, MMMM D, YYYY, HH:mm A",
uiTimezone
)}
</Typography>
<Box mt={theme.spacing(2)}>
<Box
display="inline-block"
width={theme.spacing(4)}
height={theme.spacing(4)}
backgroundColor={
check.status
? theme.palette.success.lowContrast
: theme.palette.error.lowContrast
}
sx={{ borderRadius: "50%" }}
/>
<Stack
display="inline-flex"
direction="row"
justifyContent="space-between"
ml={theme.spacing(2)}
gap={theme.spacing(12)}
>
<Typography
component="span"
sx={{ opacity: 0.8 }}
>
Response Time
</Typography>
<Typography component="span">
{check.originalResponseTime}
<Typography
component="span"
sx={{ opacity: 0.8 }}
>
{" "}
ms
</Typography>
</Typography>
</Stack>
</Box>
</>
}
placement="top"
key={`check-${check?.id}`}
slotProps={{
popper: {
className: "bar-tooltip",
modifiers: [
{
name: "offset",
options: {
offset: [0, -10],
},
},
],
sx: {
"& .MuiTooltip-tooltip": {
backgroundColor: theme.palette.secondary.main,
border: 1,
borderColor: theme.palette.primary.lowContrast,
borderRadius: theme.shape.borderRadius,
boxShadow: theme.shape.boxShadow,
px: theme.spacing(4),
py: theme.spacing(3),
},
"& .MuiTooltip-tooltip p": {
/* TODO Font size should point to theme */
fontSize: 12,
color: theme.palette.secondary.contrastText,
fontWeight: 500,
},
"& .MuiTooltip-tooltip span": {
/* TODO Font size should point to theme */
fontSize: 11,
color: theme.palette.secondary.contrastText,
fontWeight: 600,
},
},
},
}}
>
<Box
position="relative"
width="9px"
height="100%"
backgroundColor={theme.palette.primary.lowContrast}
sx={{
borderRadius: theme.spacing(1.5),
/*
TODO this doesn't seem to be used
"&:hover > .MuiBox-root": {
filter: "brightness(0.8)",
}, */
}}
>
<Box
position="absolute"
bottom={0}
width="100%"
height={`${animate ? check.responseTime : 0}%`}
backgroundColor={
check.status
? theme.palette.success.lowContrast
: theme.palette.error.lowContrast
}
sx={{
borderRadius: theme.spacing(1.5),
transition: "height 600ms cubic-bezier(0.4, 0, 0.2, 1)",
}}
/>
</Box>
</Tooltip>
)
)}
</Stack>
);
};
export default BarChart;
Loaded 100 of 507 files, more files were not shown because too many files have changed in this diff. Show more