Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f600647ff0 | ||
|
|
cafea2bf5d | ||
|
|
4e3a82d25f | ||
|
|
33e0136a2a | ||
|
|
b0b7b6a435 | ||
|
|
85dbe34e00 | ||
|
|
f38b305ba7 | ||
|
|
f9c32cb19b | ||
|
|
b540e48aab | ||
|
|
a50c2578e9 | ||
|
|
2e30b622d3 | ||
|
|
3838b18931 | ||
|
|
71cdd05b15 | ||
|
|
4b1c588f5a | ||
|
|
cbd8b5db47 | ||
|
|
94afe19b37 | ||
|
|
d622bce6c1 | ||
|
|
7b658a9e52 | ||
|
|
d296aec02e | ||
|
|
82c8122a5a | ||
|
|
446c791f88 | ||
|
|
e214d9a54c | ||
|
|
6f6920f3b2 | ||
|
|
de447d7be2 | ||
|
|
ee3062fcb4 | ||
|
|
6443802024 | ||
|
|
d88c73bb20 | ||
|
|
10bfdc9da1 | ||
|
|
0503c25663 | ||
|
|
442fc2ce22 | ||
|
|
71f3c90472 | ||
|
|
4c5c2d2d5e | ||
|
|
a390ee5f21 | ||
|
|
0d98353625 | ||
|
|
0e1b074c6c | ||
|
|
a289a197a1 | ||
|
|
0f6c273dad | ||
|
|
1db5f4b70f | ||
|
|
d1d96bd2ba | ||
|
|
7ef10b4fcd | ||
|
|
a2dfbd29c7 | ||
|
|
14ba3016f6 | ||
|
|
ac98f783e3 | ||
|
|
98943ad461 | ||
|
|
28dc61e1a6 | ||
|
|
a20fdb423a | ||
|
|
1236b9191e | ||
|
|
34762ef475 | ||
|
|
b817a16459 | ||
|
|
2091d8dcd7 | ||
|
|
3d1bd94279 | ||
|
|
07aad0204e | ||
|
|
7c0d45d287 | ||
|
|
06c571d89f | ||
|
|
9b60e32125 | ||
|
|
c681074bb2 | ||
|
|
b47e17fe91 | ||
|
|
28affa1cd1 | ||
|
|
f5372b4d86 | ||
|
|
4db4947220 | ||
|
|
48fb422e0f | ||
|
|
20d4f2c092 | ||
|
|
48081d85ee | ||
|
|
ece6970fa7 | ||
|
|
4434189c72 | ||
|
|
197e075ba1 | ||
|
|
c4ab56095e | ||
|
|
550d5cc555 | ||
|
|
b08e69764c | ||
|
|
08e4b0c39e | ||
|
|
a46e282633 | ||
|
|
8b7fd826b3 | ||
|
|
264e6f7d1f | ||
|
|
fafd581f06 | ||
|
|
d69cec9730 | ||
|
|
c670653ab3 | ||
|
|
e75606aad3 | ||
|
|
07b0483352 | ||
|
|
1552018796 | ||
|
|
3fc4160b88 | ||
|
|
9ca79ea793 | ||
|
|
2e3b32462f | ||
|
|
7e527b8eb2 | ||
|
|
021b4e8ae5 | ||
|
|
b6004241e7 | ||
|
|
af4c9d8f91 | ||
|
|
f2b740a8f9 | ||
|
|
b26d135a4f | ||
|
|
4f4203dbb3 | ||
|
|
4945b29334 | ||
|
|
1808db5cd7 | ||
|
|
31cc9cd294 | ||
|
|
19b370d89b | ||
|
|
8555e7c122 | ||
|
|
734ec41ca0 | ||
|
|
5152336591 | ||
|
|
78b920aaf6 | ||
|
|
2d84fae470 | ||
|
|
97e4b105a2 | ||
|
|
a053386f4a | ||
|
|
e0991e28e5 | ||
|
|
0f26648855 | ||
|
|
6a0f3426b3 | ||
|
|
16e8035299 | ||
|
|
31b09c316a | ||
|
|
8f2072e497 | ||
|
|
514570da78 | ||
|
|
ea68e660fc | ||
|
|
527543d79f | ||
|
|
1c390a8baf | ||
|
|
43ac5b57cf | ||
|
|
1558b27497 | ||
|
|
9caa6c830f | ||
|
|
ea115ede53 | ||
|
|
8470631162 | ||
|
|
597732e109 | ||
|
|
9974fa4010 | ||
|
|
b0686c0576 | ||
|
|
a148f56b22 | ||
|
|
3b25b37c22 | ||
|
|
1e04345aa0 | ||
|
|
174c3cd47a | ||
|
|
0e149fa477 | ||
|
|
5b4a99af3d | ||
|
|
2ecdc2096e | ||
|
|
6e66a18535 | ||
|
|
bd6aa0fa3a | ||
|
|
4e678a4ce7 | ||
|
|
5999315791 | ||
|
|
0c8b8a9358 | ||
|
|
dfe62bd301 | ||
|
|
747ff824cc | ||
|
|
f12c544751 | ||
|
|
278ced2a6c | ||
|
|
88d539b2a4 | ||
|
|
f0b152fc8f | ||
|
|
dc0e198a8e | ||
|
|
0a5067ef46 | ||
|
|
4f0017c031 | ||
|
|
f0b2292f0a | ||
|
|
d74d79c332 | ||
|
|
1a096b66f7 | ||
|
|
7cb866ce4a | ||
|
|
c54582ca70 | ||
|
|
362034ba26 | ||
|
|
b536099d03 | ||
|
|
04fef2ef75 | ||
|
|
a89e5ed565 | ||
|
|
ca153b65a9 | ||
|
|
cc188b2ba3 | ||
|
|
18018ceef1 | ||
|
|
189f309631 | ||
|
|
97dd3ec9cb | ||
|
|
b4c929963f | ||
|
|
4ecc737438 | ||
|
|
bc58f6e08e | ||
|
|
4f3bcd4624 | ||
|
|
d469590ef3 | ||
|
|
35eba6897a | ||
|
|
667dc55fc8 | ||
|
|
f2d2687d2a | ||
|
|
4e3e580179 | ||
|
|
4080ac8c2c | ||
|
|
0a408f8cfd | ||
|
|
e3921beac4 | ||
|
|
4c284493ba | ||
|
|
0fcceeb7a6 | ||
|
|
f799d46025 | ||
|
|
a80df60fc1 | ||
|
|
cbec0fa065 | ||
|
|
40e5550e0f | ||
|
|
90fd9930db | ||
|
|
f10f7385b0 | ||
|
|
2d85abf030 | ||
|
|
3c0c470ca3 | ||
|
|
4c5cae8722 | ||
|
|
8650f30d12 | ||
|
|
09e37f4356 | ||
|
|
6bc8a521c9 | ||
|
|
a1e6eaa9d0 | ||
|
|
bbb61a6f88 | ||
|
|
c1d2041482 | ||
|
|
7aa05c7f85 | ||
|
|
539866e119 | ||
|
|
6f0ff1583e | ||
|
|
12b61d17f2 | ||
|
|
7426418629 | ||
|
|
3566da7515 | ||
|
|
b451489bd8 | ||
|
|
d4a0489275 | ||
|
|
080c91284d | ||
|
|
dadc74373c | ||
|
|
6fdea04416 | ||
|
|
67963823d9 | ||
|
|
ab12a9bd3a | ||
|
|
3b25c50247 | ||
|
|
63e42b7276 | ||
|
|
090d002578 | ||
|
|
ae7524f507 | ||
|
|
54d71bef61 | ||
|
|
a77c74b17c | ||
|
|
f2363a7a09 | ||
|
|
69f95723f1 | ||
|
|
1fefb038f0 | ||
|
|
85190992c7 | ||
|
|
efe87b599f | ||
|
|
ed1bcf97da | ||
|
|
56ead03416 | ||
|
|
a912a5ebb8 | ||
|
|
0fd4173816 | ||
|
|
75d3644b36 | ||
|
|
853e21623e | ||
|
|
57c3bf3240 | ||
|
|
6be1eb0a3e | ||
|
|
9d70623e0f | ||
|
|
43fe66022b | ||
|
|
294fb13005 | ||
|
|
8028cab487 | ||
|
|
8160ab4a3c | ||
|
|
6063532c79 | ||
|
|
83b628c8f9 | ||
|
|
88a91022c3 | ||
|
|
5822a363a9 | ||
|
|
464b16ec9d | ||
|
|
d54c90d511 | ||
|
|
3a5783fe91 | ||
|
|
479f22ac69 | ||
|
|
30202b2249 | ||
|
|
888910abb2 | ||
|
|
874d1b277a | ||
|
|
f34520cdbf | ||
|
|
f420044b64 | ||
|
|
53d5ae2251 | ||
|
|
bcc57c7135 | ||
|
|
6b67f4977f | ||
|
|
87255071f4 | ||
|
|
cbf1f97591 | ||
|
|
7a881fda03 | ||
|
|
50fd66ef56 | ||
|
|
f9b677b1ad | ||
|
|
b7a6d50c73 | ||
|
|
04bd7f0e2e | ||
|
|
2e7aba788d | ||
|
|
e1665b29af | ||
|
|
17450e2537 | ||
|
|
270293a2b5 | ||
|
|
a7c5b0c7fb | ||
|
|
e804c35c3a | ||
|
|
5c4133097d | ||
|
|
85f93cd6d2 | ||
|
|
d4db32e392 | ||
|
|
791b9fc7a2 | ||
|
|
206c5577a6 | ||
|
|
cbd0530d85 | ||
|
|
45ef2438de | ||
|
|
ec818eaacb | ||
|
|
91bb60f2ff | ||
|
|
443ad46fa7 | ||
|
|
f685c9cd5d | ||
|
|
0263c17618 | ||
|
|
5a12e36c7e | ||
|
|
67da6c61cf | ||
|
|
f538f61464 | ||
|
|
f6971ede69 | ||
|
|
e69283e3ed | ||
|
|
084eed85bf | ||
|
|
9a42fb031f | ||
|
|
943e88c54d | ||
|
|
24ce64b439 | ||
|
|
841d25ce3e | ||
|
|
84e4ea7b64 | ||
|
|
4b92dbd19b | ||
|
|
5eb1d54d65 | ||
|
|
a0aee182de | ||
|
|
2dca5ccb67 | ||
|
|
348eea5475 | ||
|
|
2a3683c74a | ||
|
|
806d7ae456 | ||
|
|
cac502573f | ||
|
|
830318edc3 | ||
|
|
86a55e3cfe | ||
|
|
796960aeb2 | ||
|
|
a25ff03b71 | ||
|
|
22ae6b4be6 | ||
|
|
0b5e28c296 | ||
|
|
c5c91e28f8 | ||
|
|
3ba3e4b865 | ||
|
|
77fa394004 | ||
|
|
c0ba278e47 | ||
|
|
73f41906b0 | ||
|
|
cb5af2741d | ||
|
|
af4ef87966 | ||
|
|
a154ad11b5 | ||
|
|
1bfd1c9119 | ||
|
|
fc98192bcf | ||
|
|
b1db74d96f | ||
|
|
c1258d3cdf | ||
|
|
6ffa5ac648 | ||
|
|
6395e8a10e | ||
|
|
2852d2cdce | ||
|
|
363baef7b1 | ||
|
|
a1973a6d2b | ||
|
|
12f02d6eea | ||
|
|
a6c291c8ef | ||
|
|
227dc9e7e8 | ||
|
|
38ef9ccad3 | ||
|
|
353b97e7d3 | ||
|
|
9b871ffb52 | ||
|
|
cb392eaaba | ||
|
|
dcf5a77923 | ||
|
|
ec03addba6 | ||
|
|
eefdb8d253 | ||
|
|
e539f40612 | ||
|
|
c18159afd3 | ||
|
|
5596e45ff3 | ||
|
|
bde13f4fa7 | ||
|
|
7f1c996632 | ||
|
|
396d5b369b | ||
|
|
bb8cc8b464 | ||
|
|
66efa25e2b | ||
|
|
7bef6dc0e6 | ||
|
|
1c341a4e3d | ||
|
|
f41f2322cf | ||
|
|
b653f26c96 | ||
|
|
ece1dadb78 | ||
|
|
1f003c4d48 | ||
|
|
5a468d717a | ||
|
|
975d134dd8 | ||
|
|
7a66b5310b | ||
|
|
fcfad945a0 | ||
|
|
6b4032ecfe | ||
|
|
41d6c092d4 | ||
|
|
f9e366e181 | ||
|
|
07705e9823 | ||
|
|
c48049e0af | ||
|
|
f3ba8c9815 | ||
|
|
f88e4ee6f4 | ||
|
|
53f420cf56 | ||
|
|
589825c1c5 | ||
|
|
300b1b2238 | ||
|
|
6efc05879a | ||
|
|
20dccb140e | ||
|
|
8dfedb8a52 | ||
|
|
d48cdaca9c | ||
|
|
36a53ee80b | ||
|
|
4400ca703d | ||
|
|
c1d0cb568d | ||
|
|
81e73e5adf | ||
|
|
7a84d06a79 | ||
|
|
63d2bb97ee | ||
|
|
0af7cfe714 | ||
|
|
d190f5ab02 | ||
|
|
8cfe1d3c1a | ||
|
|
1bf4c75418 | ||
|
|
7771a0ce35 | ||
|
|
fcd9e78367 | ||
|
|
6f9fefddd2 | ||
|
|
5731283c46 | ||
|
|
420ff292d9 | ||
|
|
290ee7d2df | ||
|
|
50c644231e | ||
|
|
5729b0a263 | ||
|
|
4f3f5408ef | ||
|
|
de7038d6c3 | ||
|
|
4119189c71 | ||
|
|
fd66affea8 | ||
|
|
839dc201df | ||
|
|
bbb0716251 | ||
|
|
bbdfc00eb9 | ||
|
|
ba498534e6 | ||
|
|
f51bf36ddd | ||
|
|
716479c5bb | ||
|
|
f9c85e2d76 | ||
|
|
e26f3facf1 | ||
|
|
fd5f493345 | ||
|
|
e5bb736530 | ||
|
|
d71d16ecd0 | ||
|
|
389716fa77 | ||
|
|
1bcb2ddf91 | ||
|
|
b61077bd3f | ||
|
|
1cffd51bd3 | ||
|
|
451e352458 | ||
|
|
a07e41d8f1 | ||
|
|
90e9b41973 | ||
|
|
1819df5117 | ||
|
|
6380dcc6ba | ||
|
|
6cb45ea6de | ||
|
|
67f74dd7de | ||
|
|
8f58ceafab | ||
|
|
c7aa45cd77 | ||
|
|
d0727f91dd | ||
|
|
967b2b200b | ||
|
|
d71c7c6ee1 | ||
|
|
6daa79f0ed | ||
|
|
93a5eff562 | ||
|
|
11c95f885d | ||
|
|
174665e70a | ||
|
|
64de01437e | ||
|
|
a64885e609 | ||
|
|
e354fa7ebf | ||
|
|
04cf47544a | ||
|
|
e1dfd98840 | ||
|
|
4ce4a124d6 | ||
|
|
f564636cb4 | ||
|
|
3208cc9e2c | ||
|
|
79dfa886f1 | ||
|
|
8af8efbe3b | ||
|
|
71bd1fa28f | ||
|
|
14a08a303b | ||
|
|
4645bde025 | ||
|
|
a2569c50c7 | ||
|
|
f7ae11997d | ||
|
|
0b7a41dc78 | ||
|
|
d42d5f2325 | ||
|
|
369d16c7c3 | ||
|
|
6e8172c126 | ||
|
|
794018a6ab | ||
|
|
8d6bc7bc0b | ||
|
|
30631d6ff8 | ||
|
|
56c5ad419a | ||
|
|
b852293447 | ||
|
|
d877ecf061 | ||
|
|
73e90bfab6 | ||
|
|
a55163de56 | ||
|
|
f5c6abad1b | ||
|
|
3dbbe035a8 | ||
|
|
9904626526 | ||
|
|
61f3aa1d1c | ||
|
|
a0a8ceb0db | ||
|
|
c2dece862c | ||
|
|
69018a4944 | ||
|
|
363d89e4f4 | ||
|
|
f8bb01190e | ||
|
|
00cf0b6521 | ||
|
|
a11d551a99 | ||
|
|
b35be1ecfc | ||
|
|
9d64de57b3 | ||
|
|
de6c4d9c3e | ||
|
|
e0e79fb0da | ||
|
|
3339b6b67f | ||
|
|
b511cde849 | ||
|
|
ce322a8e28 | ||
|
|
d25ca473de | ||
|
|
5292ca8988 | ||
|
|
c98cba2eef | ||
|
|
6b89db131d | ||
|
|
995ae5252d | ||
|
|
e6c268f14e | ||
|
|
5aef405414 | ||
|
|
a5112a7955 | ||
|
|
5404b65ce2 | ||
|
|
34dfe33c29 | ||
|
|
1e24c8841e | ||
|
|
0c04c06781 | ||
|
|
7441169a0e | ||
|
|
3520e5adf4 | ||
|
|
227e0128f9 | ||
|
|
2359255ef7 | ||
|
|
b074f2401f | ||
|
|
eee3caf021 | ||
|
|
f9848e4e1e | ||
|
|
8bd608bee0 | ||
|
|
ea589d6be4 | ||
|
|
5a0078cf92 | ||
|
|
f4a5bd65ad | ||
|
|
4766594413 | ||
|
|
9962866ba5 | ||
|
|
82cc289f53 | ||
|
|
117c22fae4 | ||
|
|
e0cabdb4fc | ||
|
|
155a2577d0 | ||
|
|
d627a25b40 | ||
|
|
b8a5af9c10 | ||
|
|
5b43d9d173 | ||
|
|
801b716a03 | ||
|
|
fdc3983328 | ||
|
|
0cf85f8b3b | ||
|
|
0ea4a5024a | ||
|
|
09513696ee | ||
|
|
b0da1f4259 | ||
|
|
5b96075c03 | ||
|
|
36e02e0a9a | ||
|
|
9fa0113f2b | ||
|
|
371e8cc154 | ||
|
|
7b4286646b | ||
|
|
2a8d2cb06a | ||
|
|
147eff3ede | ||
|
|
81c7c992e2 | ||
|
|
35488fed3e | ||
|
|
760abe69ed | ||
|
|
d242382abf | ||
|
|
ef61a63da0 | ||
|
|
3fa370765e | ||
|
|
3b5e793f8f | ||
|
|
b34dbec3cf | ||
|
|
90eee474d2 | ||
|
|
63416ceb4b | ||
|
|
eb8c9bea76 | ||
|
|
63b4779961 | ||
|
|
d2040495d6 | ||
|
|
f436e15569 | ||
|
|
952c70fca4 | ||
|
|
4957209307 | ||
|
|
cc9850c975 | ||
|
|
c6ac48b4ff | ||
|
|
82584d85c7 | ||
|
|
ffd67150eb | ||
|
|
44079f2eb8 | ||
|
|
f03ded4109 | ||
|
|
fa520e5f88 | ||
|
|
e9fbb472f4 | ||
|
|
de236f03eb | ||
|
|
4f043fe1d4 | ||
|
|
102bd0a5f8 | ||
|
|
118372630e | ||
|
|
27dea6a08e | ||
|
|
dd259fea89 | ||
|
|
9af25a19e5 | ||
|
|
6101fe1bfa | ||
|
|
795146c79b | ||
|
|
a69091bb28 | ||
|
|
6160806963 | ||
|
|
c1b2bda623 | ||
|
|
c0e4893f96 | ||
|
|
476ff39a17 | ||
|
|
f467ef1411 | ||
|
|
36b02e5e66 | ||
|
|
f6fd8729c3 | ||
|
|
cdfc87da09 | ||
|
|
427e5a18ea | ||
|
|
f696b4ef9b | ||
|
|
69d050ff61 | ||
|
|
7afdcb8ebc | ||
|
|
3cf7243c93 | ||
|
|
4ed0033a41 | ||
|
|
bafd82a691 | ||
|
|
adb2a383cf | ||
|
|
e91a54b75c | ||
|
|
33dfedb4d3 | ||
|
|
dde54a4e45 | ||
|
|
5f17520ba0 | ||
|
|
bebb5d6942 | ||
|
|
7c9410f9d7 | ||
|
|
348ca0dd02 | ||
|
|
1d36f40caf | ||
|
|
9006707e57 | ||
|
|
be82a7ee2d | ||
|
|
fd33b903ed | ||
|
|
ab25531758 | ||
|
|
f7f764fd68 | ||
|
|
3b0326457f | ||
|
|
7d6bc4b2dc | ||
|
|
c2487f0134 | ||
|
|
a86588f080 | ||
|
|
4e9839e2e5 | ||
|
|
487f6b222d | ||
|
|
391f42ee53 | ||
|
|
cff5508614 | ||
|
|
a0ebf7d224 | ||
|
|
ec9c79fc94 | ||
|
|
3e8d4cb49b | ||
|
|
288ac08cd6 | ||
|
|
ba35230919 | ||
|
|
048e53ea15 | ||
|
|
e498bd60b1 | ||
|
|
a4cf53ee15 | ||
|
|
3a77c6d7fa | ||
|
|
b47f3710fe | ||
|
|
9c92542653 | ||
|
|
173a4e17d2 | ||
|
|
70b197675e | ||
|
|
11dcccc085 | ||
|
|
e3e08da259 | ||
|
|
6447c315ce | ||
|
|
cb5b8e0673 | ||
|
|
f1a6afb860 | ||
|
|
5c52a208b9 | ||
|
|
4fdc0bde5c | ||
|
|
3d4ebe9588 | ||
|
|
88bb8ef2d3 | ||
|
|
64dc381e0f | ||
|
|
af82dec2ad | ||
|
|
62ea7b0e5b | ||
|
|
8747c38f40 | ||
|
|
d633fc5ccb | ||
|
|
0d7a35367f | ||
|
|
af141ec772 | ||
|
|
5784fec3d1 | ||
|
|
7436c2b5df | ||
|
|
2055943876 | ||
|
|
95cd33ac06 | ||
|
|
2a591ee503 | ||
|
|
f5aa24d77e | ||
|
|
7874439e4c | ||
|
|
7140d436a5 | ||
|
|
ba0c89fc6c | ||
|
|
d91e87f484 | ||
|
|
bf15018173 | ||
|
|
b5caabed20 | ||
|
|
8814596d6e | ||
|
|
c60d07c3a0 | ||
|
|
54ecf02d9a | ||
|
|
1ab31d19f3 | ||
|
|
2f2ce34373 | ||
|
|
0f764ca084 | ||
|
|
8b2ee8d937 | ||
|
|
ed80837810 | ||
|
|
d82877b28d | ||
|
|
cf67c82f5e | ||
|
|
5a7b51bfec | ||
|
|
206dcae196 | ||
|
|
56bfbe2c77 | ||
|
|
8aac3086b8 | ||
|
|
9255500bfc | ||
|
|
e99b87fc1e | ||
|
|
ec953ff262 | ||
|
|
68559741ba | ||
|
|
74a7f0a701 | ||
|
|
75bcf9df58 | ||
|
|
6b5fd8d17f | ||
|
|
a1069f487b | ||
|
|
86a2171988 | ||
|
|
420164d616 | ||
|
|
f0a6fc4fdf | ||
|
|
e306499bce | ||
|
|
1472a09718 | ||
|
|
1c01dcaf31 | ||
|
|
e7e4ce7f57 | ||
|
|
93c24d2f5c | ||
|
|
cdbaad5bd9 | ||
|
|
b1b27be731 | ||
|
|
01f005ca41 | ||
|
|
1326a6222b | ||
|
|
aea0b34533 | ||
|
|
d4af86f26c | ||
|
|
940247b7bf | ||
|
|
2b0c523047 | ||
|
|
4ad09fad4f | ||
|
|
665eb9a67f | ||
|
|
d1faeab042 | ||
|
|
76fa99f7bd | ||
|
|
77764c51ee | ||
|
|
8a986d2e58 | ||
|
|
e57b161be9 | ||
|
|
8de06df8c4 | ||
|
|
8e359cf145 | ||
|
|
52e598a66e | ||
|
|
0a60cc0363 | ||
|
|
75788f7cb5 | ||
|
|
b58a7ad053 | ||
|
|
f763126b38 | ||
|
|
e79bf28bdc | ||
|
|
d0b3bc60df | ||
|
|
117a2e00c4 | ||
|
|
f8e88623a8 | ||
|
|
705475e971 | ||
|
|
2b0a51520a | ||
|
|
55145a38ff | ||
|
|
25d1039376 | ||
|
|
7a6b0d5da4 | ||
|
|
e090d3cfd3 | ||
|
|
1c1ac25857 | ||
|
|
3ce40b1ab8 | ||
|
|
1494df9eb3 | ||
|
|
a70959e4a6 | ||
|
|
b6f48a910f | ||
|
|
e4d101237e | ||
|
|
7556086f71 | ||
|
|
7b619e6b31 | ||
|
|
76ab2695db | ||
|
|
418068e702 | ||
|
|
12b28ffb3f | ||
|
|
526fa24eab | ||
|
|
a13f6a34c4 | ||
|
|
f659876845 | ||
|
|
643a743d70 | ||
|
|
ab4cc80628 | ||
|
|
fb3795bd70 | ||
|
|
5c14c68899 | ||
|
|
5a878e89d0 | ||
|
|
bdb07220ed | ||
|
|
641d5e6dda | ||
|
|
b24339f232 | ||
|
|
ff324fe6e7 | ||
|
|
fee9b8a0de | ||
|
|
ad9488f54e | ||
|
|
ed77fc3a9d | ||
|
|
babd8e672f | ||
|
|
8ceac493ef | ||
|
|
fee808789f | ||
|
|
dd03c554c9 | ||
|
|
3ab4fcb277 | ||
|
|
11e3cac440 | ||
|
|
1d7f3b15a4 | ||
|
|
b7ad3c036b | ||
|
|
7b2ff593a4 | ||
|
|
916f3c0921 | ||
|
|
846f1dfa6c | ||
|
|
3f631ff382 | ||
|
|
43a370e162 | ||
|
|
64320c7aca | ||
|
|
61cedfb2b7 | ||
|
|
a9ce980d03 | ||
|
|
8409f08a2d | ||
|
|
ef2cccf16e | ||
|
|
0285302ecc | ||
|
|
668ea7418d | ||
|
|
b12bdfcc22 | ||
|
|
65de627870 | ||
|
|
03d1dcaefb | ||
|
|
14768bde28 | ||
|
|
9555ff43c7 | ||
|
|
75acb1ade6 | ||
|
|
fd12ca6e21 | ||
|
|
ff2f84d46b | ||
|
|
1ffce112d1 | ||
|
|
382df34f06 | ||
|
|
124f300362 | ||
|
|
f782899768 | ||
|
|
cdb83bb47d | ||
|
|
72bcc0d020 | ||
|
|
ac901b46c3 | ||
|
|
c1b3d325f6 | ||
|
|
7cad2fec27 | ||
|
|
7edc2a71d8 | ||
|
|
913f7a9e42 | ||
|
|
dd98757b2a | ||
|
|
1e3ee23120 | ||
|
|
74d8e0a892 | ||
|
|
50af063f64 | ||
|
|
80a66d74ca | ||
|
|
6c2908681a | ||
|
|
90593c0d7c | ||
|
|
8fb958e772 | ||
|
|
fc39ab3fb9 | ||
|
|
58e7ef2527 | ||
|
|
fec32380ae | ||
|
|
3b8d87bd17 | ||
|
|
131ced10fc | ||
|
|
886752effd | ||
|
|
a5d54a637e | ||
|
|
1b4edf16fb | ||
|
|
4042d34585 | ||
|
|
135c3ff454 | ||
|
|
f8d5791fab | ||
|
|
ffa4b1695b | ||
|
|
98214ff578 | ||
|
|
57ceac0c24 | ||
|
|
a526bc5a3e | ||
|
|
fac4516353 | ||
|
|
4db13fb924 | ||
|
|
c97ee22e66 | ||
|
|
98737f92af | ||
|
|
74637f9d2a | ||
|
|
69dbc2fe7a | ||
|
|
d157e200f6 | ||
|
|
594540cff5 | ||
|
|
8e47e8cd3d | ||
|
|
c5d7625a06 | ||
|
|
7763c5e288 | ||
|
|
957988d977 | ||
|
|
0c04c06d4e | ||
|
|
a7ef014b92 | ||
|
|
3822d971cb | ||
|
|
eb65c41d15 | ||
|
|
0c3fdbc539 | ||
|
|
7cb985116e | ||
|
|
2297494d21 | ||
|
|
19a61b6ce4 | ||
|
|
492aed200a | ||
|
|
be2f33b5d1 | ||
|
|
5d48cecee8 | ||
|
|
f0bfe1a152 | ||
|
|
d2ff386f97 | ||
|
|
42eaa75437 | ||
|
|
7fb4e75956 | ||
|
|
87c549960e | ||
|
|
4ac0f1e87f | ||
|
|
5465bee630 | ||
|
|
60a3d46e59 | ||
|
|
e100d54eed | ||
|
|
848d50ec43 | ||
|
|
a9a8686295 | ||
|
|
30a9309bd8 | ||
|
|
ab64cd192b | ||
|
|
5fc2c8c14b | ||
|
|
ea7ce450f1 | ||
|
|
ce77b43705 | ||
|
|
bd2ba804ee | ||
|
|
bd75f7b0fc | ||
|
|
32e4f7514d | ||
|
|
c9e1d35daf | ||
|
|
3be6ae91f2 | ||
|
|
931104fbcf | ||
|
|
1d5cec94a5 | ||
|
|
faeec01a6d | ||
|
|
b8db987579 | ||
|
|
1fad85d48d | ||
|
|
eb70c9f5f0 | ||
|
|
ce025df7b7 | ||
|
|
daf5797fed | ||
|
|
0baa7d9891 | ||
|
|
f6cd0f668f | ||
|
|
9ae83cc34d | ||
|
|
06ebb76948 | ||
|
|
3a8ba154b2 | ||
|
|
089801109e | ||
|
|
a8a4b5c2b4 | ||
|
|
089bda2de0 | ||
|
|
e18e2e26da | ||
|
|
104cf194ac | ||
|
|
de7cdb4aef | ||
|
|
6bdf9891e8 | ||
|
|
27d37ece7d | ||
|
|
b9afca3608 | ||
|
|
b796464241 | ||
|
|
97a14ed926 | ||
|
|
5018c56d0d | ||
|
|
c7799ca7dc | ||
|
|
78b5cc9c6f | ||
|
|
ab3e6cdff9 | ||
|
|
1cc01e6952 | ||
|
|
fb90f193b1 | ||
|
|
1bacab89bb | ||
|
|
7378f2e33b | ||
|
|
d0bb2b2ad5 | ||
|
|
376da7c70e | ||
|
|
d58e5cf7ee | ||
|
|
e02eb2e30c | ||
|
|
c4906d069a | ||
|
|
d4ed535454 | ||
|
|
f9d0ab5e07 | ||
|
|
0a5efc75cd | ||
|
|
aae1fefb31 | ||
|
|
86bb28e239 | ||
|
|
16b68b3d00 | ||
|
|
a700f446fd | ||
|
|
2246f227d1 | ||
|
|
29fbf0a362 | ||
|
|
8a1fc94c31 | ||
|
|
abadc99bf1 | ||
|
|
7af7647bbf | ||
|
|
9a24090337 | ||
|
|
d81a4ef0ee | ||
|
|
cfb1830b55 | ||
|
|
f7c094317a | ||
|
|
56e0ac9640 | ||
|
|
61651a0f4d | ||
|
|
7c3a05077c | ||
|
|
2d29bce97b | ||
|
|
4f45baab00 | ||
|
|
6def64d38e | ||
|
|
32b31076e6 | ||
|
|
91a4911d42 | ||
|
|
7298faac2b | ||
|
|
711253beb2 | ||
|
|
a380389386 | ||
|
|
f6b97c691e | ||
|
|
f31ff994fe | ||
|
|
a46ef5c9dd | ||
|
|
0018c452bb | ||
|
|
6c6fc28f6e | ||
|
|
575cf31c78 | ||
|
|
938d9b6642 | ||
|
|
9d68d35ca8 | ||
|
|
8033eea267 | ||
|
|
469c4d7e99 | ||
|
|
5159d43cad | ||
|
|
c5bbb7aa2c | ||
|
|
4317d1a47e | ||
|
|
a1c04ba35e | ||
|
|
95ad3e71ca | ||
|
|
8bf3875d9a | ||
|
|
080a33fac7 | ||
|
|
851d722746 | ||
|
|
3b22ce75db | ||
|
|
5dbfb3b8c5 | ||
|
|
735054b4e1 | ||
|
|
3ae2f857d4 | ||
|
|
220abb8579 | ||
|
|
468a67f937 | ||
|
|
99b3e3c516 | ||
|
|
8d48b2cc8a | ||
|
|
d63731fced | ||
|
|
7a352cdcb3 | ||
|
|
4744c05f07 | ||
|
|
c6cf7a4639 | ||
|
|
7f2318da01 | ||
|
|
fc9018e314 | ||
|
|
c30d6019df | ||
|
|
b57ed47592 | ||
|
|
6234be17cd | ||
|
|
5cab842f0a | ||
|
|
ca84c60614 | ||
|
|
09fbc6b0b2 | ||
|
|
f8b1998564 | ||
|
|
4d254b004d | ||
|
|
1d5f2427ed | ||
|
|
0249f89a8c | ||
|
|
ce0aaa7ac7 | ||
|
|
b7db3f96ba | ||
|
|
ad5ab82c3b | ||
|
|
0567569faa | ||
|
|
a8f111b399 | ||
|
|
7c2f789a31 | ||
|
|
77c76b6b6d | ||
|
|
60a90ce424 | ||
|
|
3f581ae1b0 | ||
|
|
277aff3898 | ||
|
|
0c5b9a863b | ||
|
|
cb1e10f0a9 | ||
|
|
659162d60c | ||
|
|
28ef465b3a | ||
|
|
e29f7af858 | ||
|
|
17b84cbe8a | ||
|
|
4d89213e1c | ||
|
|
879cbb8886 | ||
|
|
5957479d03 | ||
|
|
d7bc9bdb90 | ||
|
|
811a6bf222 | ||
|
|
6d0c560948 | ||
|
|
f4b76baaa2 | ||
|
|
76f4e974db | ||
|
|
66e5441bdf | ||
|
|
68f4adfbfe | ||
|
|
35a712eafb | ||
|
|
2d12fbdff1 | ||
|
|
c0ff162ed9 | ||
|
|
059408f098 | ||
|
|
b118a321b9 | ||
|
|
b3b6f1d834 | ||
|
|
1383d8b59a | ||
|
|
990aed9f2e | ||
|
|
003d419a64 | ||
|
|
7368cb2567 | ||
|
|
f945a27011 | ||
|
|
72882fded9 | ||
|
|
0030394008 | ||
|
|
bfb299cfca | ||
|
|
b06d5c10ea | ||
|
|
2a0d4195a1 | ||
|
|
11ff99613a | ||
|
|
0b646ee64f | ||
|
|
23126a92cd | ||
|
|
f767125acd | ||
|
|
d8ed9abebf | ||
|
|
e4e75632c5 | ||
|
|
ddb7c24832 | ||
|
|
4a824dec81 | ||
|
|
b35fee1be8 | ||
|
|
1b167af12b | ||
|
|
f2962e34ae | ||
|
|
386db5029a | ||
|
|
0e6e54a124 | ||
|
|
c666cb3879 | ||
|
|
4039517683 | ||
|
|
00fc7b8038 | ||
|
|
81d283ec8d | ||
|
|
105100e349 | ||
|
|
4598690dbf | ||
|
|
f68341c315 | ||
|
|
e8a8cea909 | ||
|
|
bf53f107e3 | ||
|
|
00de974528 | ||
|
|
0445398e94 | ||
|
|
272e2ba955 | ||
|
|
0a2adc2d92 | ||
|
|
7008fc1770 | ||
|
|
041a261540 | ||
|
|
1008d819f7 | ||
|
|
fb84a79a04 | ||
|
|
45bfdbdce0 | ||
|
|
1537c2141f | ||
|
|
3ba1a52644 | ||
|
|
a015cc6706 | ||
|
|
5bad362793 | ||
|
|
5520756edd | ||
|
|
ba954a1d6e | ||
|
|
2944ff298c | ||
|
|
80d121e87a | ||
|
|
ed8352d857 | ||
|
|
41f64ca9fe | ||
|
|
738e49dc92 | ||
|
|
68a16257c6 | ||
|
|
5dcbae55f4 | ||
|
|
e0d963256c | ||
|
|
2bff4bbd15 | ||
|
|
a0eba89f34 | ||
|
|
4e78de9da2 | ||
|
|
85f00eb7e8 | ||
|
|
8e13855b66 | ||
|
|
06f49e24c2 | ||
|
|
e598ae45f7 | ||
|
|
ad7f469e06 | ||
|
|
cb57ff5cc2 | ||
|
|
72f070fbcb | ||
|
|
fb0a86d37c | ||
|
|
36402dfefa | ||
|
|
c61874dbdd | ||
|
|
20848f28d5 | ||
|
|
5d23966f00 | ||
|
|
294cc66e4a | ||
|
|
0fd2e7032a | ||
|
|
340b85043e | ||
|
|
1821ae3c2b | ||
|
|
c536cb2afa | ||
|
|
3f79b4c2f6 | ||
|
|
137ba9185e | ||
|
|
2f6a0913dc | ||
|
|
2c7336d440 | ||
|
|
5a022ff3f6 | ||
|
|
fe4855500e | ||
|
|
ce8f5cbe0c | ||
|
|
b6bebe33fe | ||
|
|
9cf8072c1e | ||
|
|
0ca00ca6a1 | ||
|
|
619c5242db | ||
|
|
ff07854590 | ||
|
|
ba99989c66 | ||
|
|
3c75933cf2 | ||
|
|
ea9ef7afd3 | ||
|
|
f5e633a781 | ||
|
|
90b94816dd | ||
|
|
11dcaef3ff | ||
|
|
3f3e7f71ec | ||
|
|
b6070572cf | ||
|
|
e818a02a2a | ||
|
|
d8c8e222c8 | ||
|
|
f12b9715bc | ||
|
|
31c65d3e0b | ||
|
|
fcd6741cf9 | ||
|
|
d663b9230f | ||
|
|
5f2d61ad7a | ||
|
|
ec80a2dc0b | ||
|
|
2cece3de59 | ||
|
|
79eb580802 | ||
|
|
b93e3327a7 | ||
|
|
f01030a47a | ||
|
|
3cbd907c09 | ||
|
|
8fae69b7a4 | ||
|
|
e45dd4240e | ||
|
|
16a8552e6c | ||
|
|
c953ec6152 | ||
|
|
a433f10240 | ||
|
|
b73b97b5e9 | ||
|
|
0607e0b228 | ||
|
|
3bd4f67ec7 | ||
|
|
845d5a5d51 | ||
|
|
0101da731f | ||
|
|
68592acd39 | ||
|
|
b86fc5edb3 | ||
|
|
32b54ddf11 | ||
|
|
f8a0741e6c | ||
|
|
652d231771 | ||
|
|
1c3c5f4fec | ||
|
|
e7006a4a44 | ||
|
|
0f81d54f25 | ||
|
|
f3121c24c6 | ||
|
|
7abd0f2cd4 | ||
|
|
46b342005a | ||
|
|
4e0349bd58 | ||
|
|
30a569233b | ||
|
|
44ba6b4d0f | ||
|
|
9065070eb2 | ||
|
|
fd951bfdd5 | ||
|
|
27d613b594 | ||
|
|
ba757b9aa4 | ||
|
|
c445463c0c | ||
|
|
4693177e4b | ||
|
|
30b135eba3 | ||
|
|
bda48e07f1 | ||
|
|
7c8ab64e34 | ||
|
|
ec7855bd02 | ||
|
|
d401eefd6b | ||
|
|
0ad759a384 | ||
|
|
d3d20b29c3 | ||
|
|
fbb570c0d5 | ||
|
|
2318082bb8 | ||
|
|
05dd5f7de2 | ||
|
|
841251d09e | ||
|
|
a4dd8f70f0 | ||
|
|
9d0d1329b6 | ||
|
|
7a929777b4 | ||
|
|
ce3ec99c9f | ||
|
|
4f7847275e | ||
|
|
9a5ddb22b3 | ||
|
|
b1322cbec3 | ||
|
|
637bc84136 | ||
|
|
3147f02b6a | ||
|
|
dabff74946 | ||
|
|
de99577b9d | ||
|
|
1846432601 | ||
|
|
6f307dc822 | ||
|
|
f43210e29e | ||
|
|
50b9be4eca | ||
|
|
1a38222974 | ||
|
|
cb9cd0a43c | ||
|
|
c2e2ae8dbd | ||
|
|
df790a92be | ||
|
|
e1f9242b34 | ||
|
|
9d2a52e639 | ||
|
|
5cbca9457e | ||
|
|
25c66cff43 | ||
|
|
75a2e0deee | ||
|
|
b857137f1a | ||
|
|
40141cdcb0 | ||
|
|
c5c1d6903e | ||
|
|
f15c8188b9 | ||
|
|
8f971cfb02 | ||
|
|
32c811ec5a | ||
|
|
4febc56c30 | ||
|
|
f22ee4a68b | ||
|
|
87bec0399f | ||
|
|
1f29255dd1 | ||
|
|
4a11638182 | ||
|
|
10743372f8 | ||
|
|
d4b11bbb76 | ||
|
|
ced2417c98 | ||
|
|
27415aeca6 | ||
|
|
9bd2e336a6 | ||
|
|
d5778ec173 | ||
|
|
74e80f086a | ||
|
|
b1c6191fa1 | ||
|
|
8e0245c844 | ||
|
|
613fbf8c39 | ||
|
|
1788cda5c2 | ||
|
|
155adf549e | ||
|
|
5463542532 | ||
|
|
f5a25bc0e5 | ||
|
|
993339d0d1 | ||
|
|
bc4fe897cf | ||
|
|
c773bdaabd | ||
|
|
9f9a2be1d8 | ||
|
|
1e4b0c2f20 | ||
|
|
56025f6d56 | ||
|
|
5188b90f32 | ||
|
|
7178f537a8 | ||
|
|
45ac589975 | ||
|
|
9925e10ffc | ||
|
|
e3fde8d564 | ||
|
|
8aee01e008 | ||
|
|
cd203ff067 | ||
|
|
254cb6d80f | ||
|
|
9b3ad54d0a | ||
|
|
4ae3bb5780 | ||
|
|
b8aa1ef765 | ||
|
|
5e5daef49a | ||
|
|
88c478c533 | ||
|
|
1ecec115e4 | ||
|
|
8ff597eedb | ||
|
|
69f74488e5 | ||
|
|
ded9a27f42 | ||
|
|
43284ae625 | ||
|
|
f7b1ef9741 | ||
|
|
a6d445818f | ||
|
|
122a84b9e2 | ||
|
|
065a6cb1fd | ||
|
|
ae9eb494ae | ||
|
|
0241797e79 | ||
|
|
9d45947b08 | ||
|
|
f2c26c0eed | ||
|
|
f7a1416070 | ||
|
|
9e05d024a8 | ||
|
|
3bd4c8d747 | ||
|
|
9ae7314f54 | ||
|
|
c77d1e3322 | ||
|
|
0e767d6581 | ||
|
|
7ff5935f94 | ||
|
|
cb4566f829 | ||
|
|
52249d5b7e | ||
|
|
22e0507fbd | ||
|
|
e32e72de7a | ||
|
|
ff31ee773f | ||
|
|
a1cbbf5d42 | ||
|
|
ce667bc53b | ||
|
|
d5526b89d9 | ||
|
|
096cfccf40 | ||
|
|
f381b0ce4a | ||
|
|
867b530573 | ||
|
|
2141c3eacd | ||
|
|
13a5f699ba | ||
|
|
7ab5f4ab09 | ||
|
|
480ba034ce | ||
|
|
d560e923d2 | ||
|
|
235fc979b2 | ||
|
|
f5aefb1f0b | ||
|
|
e27cc8a12b | ||
|
|
f2e2d5c2ed | ||
|
|
6d999eccbd | ||
|
|
136144b8ec | ||
|
|
355a445ead | ||
|
|
c490508252 | ||
|
|
7b4160ac92 | ||
|
|
781854d85c | ||
|
|
86dc71687d | ||
|
|
f0e79121a7 | ||
|
|
ed1b88f1fd | ||
|
|
bb5a3e73c8 | ||
|
|
38b2025286 | ||
|
|
c12f5880e2 | ||
|
|
94cf22ab8e | ||
|
|
0bc8142e71 | ||
|
|
d890b972be | ||
|
|
05945a9a74 | ||
|
|
88b68a9df0 | ||
|
|
8b322a0ec0 | ||
|
|
7968ed8a19 | ||
|
|
2fba22d0f6 | ||
|
|
cce930b90a | ||
|
|
c5dd16511d | ||
|
|
65f437f08e | ||
|
|
47c231a214 | ||
|
|
f5d0b74ccf | ||
|
|
17cac37967 | ||
|
|
b7e7028b6f | ||
|
|
ea3df7be42 | ||
|
|
f0d7e82e22 | ||
|
|
c6d56b30e4 | ||
|
|
8225924da6 | ||
|
|
6517e9ee6c | ||
|
|
10ad3397a3 | ||
|
|
dd9468cb2e | ||
|
|
0b9ab0614f | ||
|
|
e13f495d71 | ||
|
|
029b8fac37 | ||
|
|
6e5ada79de | ||
|
|
59f050135a | ||
|
|
dc8b0aed9f | ||
|
|
424df24bf3 | ||
|
|
d451f725cd | ||
|
|
d04b8fddb0 | ||
|
|
bb592964ee | ||
|
|
786dd427bc | ||
|
|
4c2c452b91 | ||
|
|
1765bf7e55 | ||
|
|
e19de23770 | ||
|
|
765a1a24ed | ||
|
|
e42b4b2808 | ||
|
|
65f6925864 | ||
|
|
02b7dc080b | ||
|
|
d4e8381827 | ||
|
|
de34710c90 | ||
|
|
cd8752c1cb | ||
|
|
86a0b0b60c | ||
|
|
fc5ccf1cf8 | ||
|
|
45352b62e1 | ||
|
|
0ea3379397 | ||
|
|
281cbbc30f | ||
|
|
0de9e067c6 | ||
|
|
77c00558aa | ||
|
|
10c5463892 | ||
|
|
7b963ca877 | ||
|
|
aa35e9211b | ||
|
|
2fc0eb9460 | ||
|
|
91b4c976e5 | ||
|
|
950c5fdc92 | ||
|
|
114572024c | ||
|
|
8503b7ece4 | ||
|
|
b53650a50f | ||
|
|
9ad3b58fcd | ||
|
|
521c6988a5 | ||
|
|
7900e1104f | ||
|
|
035edd92f4 | ||
|
|
2c4c6a5024 | ||
|
|
12747bd95b | ||
|
|
7c22663250 | ||
|
|
eb4856901b | ||
|
|
da905169e1 | ||
|
|
fe9bf6375f | ||
|
|
800f988979 | ||
|
|
b4f42bb7d4 | ||
|
|
e58c5fdb86 | ||
|
|
4e3f552538 | ||
|
|
2d01205f70 | ||
|
|
ebfb25ebc0 | ||
|
|
d93fb48202 | ||
|
|
a73d0ef3b4 | ||
|
|
8274d4ffbe | ||
|
|
48990b860f | ||
|
|
b61a7ffc3c | ||
|
|
37a3028540 | ||
|
|
2e675f5dee | ||
|
|
6a2a79c086 | ||
|
|
a86e9ff480 | ||
|
|
3dc332010e | ||
|
|
61a1972c4c | ||
|
|
0779e5ea15 | ||
|
|
fab78f0cee | ||
|
|
ce49270cf8 | ||
|
|
7a190f7c69 | ||
|
|
126767ed5c | ||
|
|
7d5302cfcf | ||
|
|
87d3d6a8f0 | ||
|
|
927e8a88b8 | ||
|
|
73a6277feb | ||
|
|
94a7044b7b | ||
|
|
54d3392cf1 | ||
|
|
f1c9aad4e6 | ||
|
|
48cf8a5e73 | ||
|
|
b5f4c04165 | ||
|
|
a9c2549376 | ||
|
|
7bf96f6194 | ||
|
|
ae40cb8a54 | ||
|
|
16ebe4b1ab | ||
|
|
c7914a1c4f | ||
|
|
6b12246ec0 | ||
|
|
4a42b6eb43 | ||
|
|
de742068a7 | ||
|
|
b383ce5b11 | ||
|
|
ccb424eafe | ||
|
|
585fb4f700 | ||
|
|
00f5eaf44d | ||
|
|
8bacbcde89 | ||
|
|
245e436a88 | ||
|
|
2d6fdcb1e2 | ||
|
|
8adad64248 | ||
|
|
e7cf6d385c | ||
|
|
753a904c94 | ||
|
|
0ccbd17709 | ||
|
|
78a5b2e666 | ||
|
|
5e46a9f2d5 | ||
|
|
0ecbf48f5d | ||
|
|
d4ecb26ffe | ||
|
|
e04ac77ddd | ||
|
|
cd3702f5b5 | ||
|
|
ca02ed9d18 | ||
|
|
f934bbf829 | ||
|
|
da7d9c02c8 | ||
|
|
e55d8618bd | ||
|
|
af010e138d | ||
|
|
9d94b71583 | ||
|
|
38d31192ed | ||
|
|
a0799874e4 | ||
|
|
5ec2500310 | ||
|
|
0bd9aa1e3f | ||
|
|
20dd3ead3e | ||
|
|
b30a512d6e | ||
|
|
e63faebcb8 | ||
|
|
7e5cb1facc | ||
|
|
10c822c5d9 | ||
|
|
8761b3e28d | ||
|
|
19cccbbcad | ||
|
|
dbea93f9ba | ||
|
|
4629014922 | ||
|
|
24e7b1c224 | ||
|
|
ad06544a64 | ||
|
|
8d105e636d | ||
|
|
bf5d7f3c53 | ||
|
|
c5cd3512af | ||
|
|
2802cce6f1 | ||
|
|
6e49e19ba1 | ||
|
|
0c6d635b67 | ||
|
|
de80a530e5 | ||
|
|
63b106d844 | ||
|
|
ab96e321c9 | ||
|
|
0b7d1abb71 | ||
|
|
592c184ffe | ||
|
|
f3e50120ee | ||
|
|
850510b7e8 | ||
|
|
d1e9a1221f | ||
|
|
56ea28aa83 | ||
|
|
140ae1d049 | ||
|
|
6025323c4b | ||
|
|
261c83158b | ||
|
|
1a5f16c4e3 | ||
|
|
ab0bf5ca5f | ||
|
|
158b66e43b | ||
|
|
ec99b5e9b4 | ||
|
|
19fe41d738 | ||
|
|
5c147562b3 | ||
|
|
051c17f454 | ||
|
|
ab8868e6c4 | ||
|
|
b5b600db1f | ||
|
|
41f917ddf6 | ||
|
|
e5e02b553a | ||
|
|
729f107af2 | ||
|
|
8bfb187ef0 | ||
|
|
1c47c8ce2c | ||
|
|
acc910cbc0 | ||
|
|
1aedf21566 | ||
|
|
6cb538ce69 | ||
|
|
cafd9f9899 | ||
|
|
bb2ab8e08a | ||
|
|
3059e730e2 | ||
|
|
dc321580c3 | ||
|
|
6cfa77a335 | ||
|
|
ddf3e8251d | ||
|
|
0cfe9d60fb | ||
|
|
19d3ae119c | ||
|
|
d59e2796e7 | ||
|
|
12ff66fd3e | ||
|
|
35270e2761 | ||
|
|
47021fa55c | ||
|
|
89f5be2cc9 | ||
|
|
d3493a0af6 | ||
|
|
157343d152 | ||
|
|
5f36543d44 | ||
|
|
a004b7b450 | ||
|
|
56d8224fb9 | ||
|
|
dd6e7b7e7e | ||
|
|
6d5034e2a5 | ||
|
|
ed6882ba95 | ||
|
|
b3f8d77238 | ||
|
|
c287da92d9 | ||
|
|
aea79fec2e | ||
|
|
3239f555a1 | ||
|
|
da49e15589 | ||
|
|
cfebc770fd | ||
|
|
ffef14957f | ||
|
|
05666f70e0 | ||
|
|
c1dc575f53 | ||
|
|
bf861700fa | ||
|
|
627c2174a9 | ||
|
|
b27eccec88 | ||
|
|
8c0dfb2cc5 | ||
|
|
c766dc9f00 | ||
|
|
7236e85321 | ||
|
|
b7093b5de5 | ||
|
|
3650c400ca | ||
|
|
4933d11dfd | ||
|
|
08128279b4 | ||
|
|
181e149028 | ||
|
|
9bb9265a19 | ||
|
|
65f232161f | ||
|
|
df97b93a9a | ||
|
|
f58d05f1b3 | ||
|
|
06fa79e09d | ||
|
|
6da52adc74 | ||
|
|
0b4ec46f79 | ||
|
|
6e321afa72 | ||
|
|
a08ded4093 | ||
|
|
e76b44fcba | ||
|
|
1fa2dbcf85 | ||
|
|
74fd20cfa8 | ||
|
|
f90b5bab4b | ||
|
|
812cff0fd9 | ||
|
|
7127c28c35 | ||
|
|
4f186a6b49 | ||
|
|
fe76416059 | ||
|
|
ac2b7bd65d | ||
|
|
604b20855b | ||
|
|
e157ee7c53 | ||
|
|
91ccfe26b7 | ||
|
|
de88e1d442 | ||
|
|
baf5967dca | ||
|
|
df6a1b39e0 | ||
|
|
8fcaf721ad | ||
|
|
22d17708cd | ||
|
|
457408006b | ||
|
|
f74289fe49 | ||
|
|
86ece89cec | ||
|
|
22826afd21 | ||
|
|
73f2f29c2a | ||
|
|
a6eb2735aa | ||
|
|
c4d42dd9e3 | ||
|
|
e047309812 | ||
|
|
c11da04e13 | ||
|
|
4f68a76674 | ||
|
|
b2fdb11195 | ||
|
|
97082b30b9 | ||
|
|
43ac0174d1 | ||
|
|
cb02bb0de7 | ||
|
|
9c9eaca990 | ||
|
|
8336ea199d | ||
|
|
48848d1d43 | ||
|
|
1eea0b6862 | ||
|
|
2977c1f6db | ||
|
|
c70ee26c8a | ||
|
|
1b085236c7 | ||
|
|
78b371bfad | ||
|
|
fdff3be316 | ||
|
|
f2037bf5fe | ||
|
|
a28a8fe5f9 | ||
|
|
62f94cfb20 | ||
|
|
3e75972b02 | ||
|
|
d6d3b53846 | ||
|
|
87f843df1c | ||
|
|
5dbec377e5 | ||
|
|
a489c9ff45 | ||
|
|
4d989746fd | ||
|
|
ba48461417 | ||
|
|
55e2d5c0e3 | ||
|
|
8864f9799f | ||
|
|
e2ddffe24b | ||
|
|
12b7819791 | ||
|
|
bfa6832beb | ||
|
|
846564a17e | ||
|
|
46d7009837 | ||
|
|
0c04db3299 | ||
|
|
2d437e2016 | ||
|
|
37655a64c0 | ||
|
|
4921b17f11 | ||
|
|
dae0d6cc42 | ||
|
|
c392933e55 | ||
|
|
c915137ed7 | ||
|
|
945cff978b | ||
|
|
ae21b728bc | ||
|
|
8ffd9a5e2a | ||
|
|
b823f0f7db | ||
|
|
066df2c64f | ||
|
|
200a933647 | ||
|
|
4cd5cd4bae | ||
|
|
bfba1d148e | ||
|
|
c58801f6f7 | ||
|
|
616927d388 | ||
|
|
1cbebf322b | ||
|
|
a46c032979 | ||
|
|
f03f94c3dd | ||
|
|
1cee10842e | ||
|
|
55e9c74031 | ||
|
|
45a9495a51 | ||
|
|
c785704dd8 | ||
|
|
38bb915144 | ||
|
|
e2f99f52db | ||
|
|
c54feb9306 | ||
|
|
e11b09feac | ||
|
|
fe44bc989a | ||
|
|
93bf98fe72 | ||
|
|
5a2626b38b | ||
|
|
5d57138ea8 | ||
|
|
20519afe17 | ||
|
|
f23f7df147 | ||
|
|
b89ab5a192 | ||
|
|
35c59dc53b | ||
|
|
870cd6407e | ||
|
|
f62350fea0 | ||
|
|
39779b9dd5 | ||
|
|
9716e64c93 | ||
|
|
0f9f814b27 | ||
|
|
49b08e9e6f | ||
|
|
a879051454 | ||
|
|
a0439cd7f4 | ||
|
|
bc436da263 | ||
|
|
c86c5d8235 | ||
|
|
86160a103d | ||
|
|
f912c5eb5d | ||
|
|
84f0b936ca | ||
|
|
72d34fcc4f | ||
|
|
2bb7818116 | ||
|
|
39d666df6b | ||
|
|
a7dd23141c | ||
|
|
a7e26d553f | ||
|
|
95e82cf254 | ||
|
|
07c8334248 | ||
|
|
c54e6b0b34 | ||
|
|
f8a7b86ab7 | ||
|
|
5b395b96cd | ||
|
|
b1b4fd3f64 | ||
|
|
352d3a1647 | ||
|
|
f04fd8bea2 | ||
|
|
6e76e29768 | ||
|
|
2c1a01bb6a | ||
|
|
2d587a7d1b | ||
|
|
b7b7687608 | ||
|
|
840069b935 | ||
|
|
1cbec8220d | ||
|
|
1456c4f749 | ||
|
|
881944ab98 | ||
|
|
eaa85bb9c4 | ||
|
|
cc26601c06 | ||
|
|
643d160748 | ||
|
|
a71756a6ec | ||
|
|
db02f68095 | ||
|
|
a0f3db812e | ||
|
|
8c393f848b | ||
|
|
cf591a5a0b | ||
|
|
b45df68ece | ||
|
|
fdaaacc3af | ||
|
|
cb2016a5dc | ||
|
|
9040a99853 | ||
|
|
94ac24289e | ||
|
|
eb8cf1b6da | ||
|
|
1d816b0677 | ||
|
|
c3f5d249a0 | ||
|
|
f00d7275e5 | ||
|
|
4ed8d6b90c | ||
|
|
6e5550ba32 | ||
|
|
edd2346939 | ||
|
|
2b4727db0d | ||
|
|
ce103c6b59 | ||
|
|
38f5c41272 | ||
|
|
ca13185d84 | ||
|
|
f1c6beacf2 |
No files matched your search
@@ -0,0 +1 @@
|
|||||||
|
release_notes: false
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
* @ajhollid @mohicody @Br0wnHammer @Owaiseimdad @karenvicent @shanikauwu1
|
||||||
@@ -6,7 +6,9 @@ import { URLSearchParams } from "url";
|
|||||||
// POEditor API information
|
// POEditor API information
|
||||||
const API_TOKEN = process.env.POEDITOR_API;
|
const API_TOKEN = process.env.POEDITOR_API;
|
||||||
const PROJECT_ID = process.env.POEDITOR_PROJECT_ID;
|
const PROJECT_ID = process.env.POEDITOR_PROJECT_ID;
|
||||||
const LANGUAGES = (process.env.LANGUAGES || "tr,en").split(",");
|
const LANGUAGES = (
|
||||||
|
process.env.LANGUAGES || "ar,zh-tw,cs,en,fi,fr,de,pt-br,ru,es,tr,ja,zh-cn,th"
|
||||||
|
).split(",");
|
||||||
const EXPORT_FORMAT = process.env.EXPORT_FORMAT || "key_value_json";
|
const EXPORT_FORMAT = process.env.EXPORT_FORMAT || "key_value_json";
|
||||||
|
|
||||||
// POEditor API endpoint
|
// POEditor API endpoint
|
||||||
|
|||||||
@@ -0,0 +1,40 @@
|
|||||||
|
name: Build Check (Client & Server)
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-client:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Node
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: 22
|
||||||
|
|
||||||
|
- name: Install client dependencies
|
||||||
|
working-directory: client
|
||||||
|
run: npm install
|
||||||
|
|
||||||
|
- name: Check client build
|
||||||
|
working-directory: client
|
||||||
|
run: npm run build
|
||||||
|
build-server:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Node
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: 22
|
||||||
|
|
||||||
|
- name: Install server dependencies
|
||||||
|
working-directory: server
|
||||||
|
run: npm install
|
||||||
|
|
||||||
|
- name: Check server build
|
||||||
|
working-directory: server
|
||||||
|
run: npm run build
|
||||||
@@ -16,7 +16,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Install client dependencies
|
- name: Install client dependencies
|
||||||
working-directory: client
|
working-directory: client
|
||||||
run: npm ci
|
run: npm install
|
||||||
|
|
||||||
- name: Check client formatting
|
- name: Check client formatting
|
||||||
working-directory: client
|
working-directory: client
|
||||||
@@ -34,29 +34,8 @@ jobs:
|
|||||||
|
|
||||||
- name: Install server dependencies
|
- name: Install server dependencies
|
||||||
working-directory: server
|
working-directory: server
|
||||||
run: npm ci
|
run: npm install
|
||||||
|
|
||||||
- name: Check server formatting
|
- name: Check server formatting
|
||||||
working-directory: server
|
working-directory: server
|
||||||
run: npm run format-check
|
run: npm run format-check
|
||||||
close-pr-if-needed:
|
|
||||||
if: always()
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
needs: [format-client, format-server]
|
|
||||||
steps:
|
|
||||||
- name: Checkout repo
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Get PR number
|
|
||||||
id: pr
|
|
||||||
run: echo "PR_NUMBER=$(jq -r .pull_request.number "$GITHUB_EVENT_PATH")" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Close PR using GitHub CLI
|
|
||||||
if: |
|
|
||||||
needs.format-client.result == 'failure' ||
|
|
||||||
needs.format-server.result == 'failure'
|
|
||||||
env:
|
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
run: |
|
|
||||||
gh pr close "$PR_NUMBER" --delete-branch --comment "❌ Formatting check failed — PR auto-closed.
|
|
||||||
Please run \`npm run format\` in both `client` and `server` directories and push again."
|
|
||||||
@@ -79,18 +79,6 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
docker push ghcr.io/bluewave-labs/checkmate-mongo:${{ steps.extract_tag.outputs.version }}
|
docker push ghcr.io/bluewave-labs/checkmate-mongo:${{ steps.extract_tag.outputs.version }}
|
||||||
|
|
||||||
- name: Build Redis Docker image
|
|
||||||
run: |
|
|
||||||
docker build \
|
|
||||||
-t ghcr.io/bluewave-labs/checkmate-redis:${{ steps.extract_tag.outputs.version }} \
|
|
||||||
-f ./docker/dist/redis.Dockerfile \
|
|
||||||
--label org.opencontainers.image.source=https://github.com/bluewave-labs/checkmate \
|
|
||||||
.
|
|
||||||
|
|
||||||
- name: Push Redis Docker image
|
|
||||||
run: |
|
|
||||||
docker push ghcr.io/bluewave-labs/checkmate-redis:${{ steps.extract_tag.outputs.version }}
|
|
||||||
|
|
||||||
docker-build-and-push-server-mono-multiarch:
|
docker-build-and-push-server-mono-multiarch:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
|||||||
@@ -74,18 +74,6 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
docker push ghcr.io/bluewave-labs/checkmate-mongo:latest
|
docker push ghcr.io/bluewave-labs/checkmate-mongo:latest
|
||||||
|
|
||||||
- name: Build Redis Docker image
|
|
||||||
run: |
|
|
||||||
docker build \
|
|
||||||
-t ghcr.io/bluewave-labs/checkmate-redis:latest \
|
|
||||||
-f ./docker/dist/redis.Dockerfile \
|
|
||||||
--label org.opencontainers.image.source=https://github.com/bluewave-labs/checkmate \
|
|
||||||
.
|
|
||||||
|
|
||||||
- name: Push Redis Docker image
|
|
||||||
run: |
|
|
||||||
docker push ghcr.io/bluewave-labs/checkmate-redis:latest
|
|
||||||
|
|
||||||
docker-build-and-push-server-mono-multiarch:
|
docker-build-and-push-server-mono-multiarch:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ on:
|
|||||||
languages:
|
languages:
|
||||||
description: "Languages to synchronize (comma separated, e.g.: tr,en,es)"
|
description: "Languages to synchronize (comma separated, e.g.: tr,en,es)"
|
||||||
required: false
|
required: false
|
||||||
default: "ar,zh-tw,cs,en,fi,fr,de,pt-br,ru,es,tr"
|
default: "ar,zh-tw,cs,en,fi,fr,de,pt-br,ru,es,tr,ja,zh-cn,th"
|
||||||
format:
|
format:
|
||||||
description: "Export format (key_value_json or json)"
|
description: "Export format (key_value_json or json)"
|
||||||
required: false
|
required: false
|
||||||
|
|||||||
@@ -71,17 +71,6 @@ jobs:
|
|||||||
- name: Push MongoDB Docker image
|
- name: Push MongoDB Docker image
|
||||||
run: docker push ghcr.io/bluewave-labs/checkmate:mongo-demo
|
run: docker push ghcr.io/bluewave-labs/checkmate:mongo-demo
|
||||||
|
|
||||||
- name: Build Redis Docker image
|
|
||||||
run: |
|
|
||||||
docker build \
|
|
||||||
-t ghcr.io/bluewave-labs/checkmate:redis-demo \
|
|
||||||
-f ./docker/prod/redis.Dockerfile \
|
|
||||||
--label org.opencontainers.image.source=https://github.com/bluewave-labs/checkmate \
|
|
||||||
.
|
|
||||||
|
|
||||||
- name: Push Redis Docker image
|
|
||||||
run: docker push ghcr.io/bluewave-labs/checkmate:redis-demo
|
|
||||||
|
|
||||||
deploy-to-demo:
|
deploy-to-demo:
|
||||||
needs: docker-build-and-push-server
|
needs: docker-build-and-push-server
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|||||||
@@ -71,17 +71,6 @@ jobs:
|
|||||||
- name: Push MongoDB Docker image
|
- name: Push MongoDB Docker image
|
||||||
run: docker push ghcr.io/bluewave-labs/checkmate:mongo-staging
|
run: docker push ghcr.io/bluewave-labs/checkmate:mongo-staging
|
||||||
|
|
||||||
- name: Build Redis Docker image
|
|
||||||
run: |
|
|
||||||
docker build \
|
|
||||||
-t ghcr.io/bluewave-labs/checkmate:redis-staging \
|
|
||||||
-f ./docker/staging/redis.Dockerfile \
|
|
||||||
--label org.opencontainers.image.source=https://github.com/bluewave-labs/checkmate \
|
|
||||||
.
|
|
||||||
|
|
||||||
- name: Push Redis Docker image
|
|
||||||
run: docker push ghcr.io/bluewave-labs/checkmate:redis-staging
|
|
||||||
|
|
||||||
deploy-to-staging:
|
deploy-to-staging:
|
||||||
needs: docker-build-and-push-server
|
needs: docker-build-and-push-server
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -99,3 +88,4 @@ jobs:
|
|||||||
docker compose down
|
docker compose down
|
||||||
docker compose pull
|
docker compose pull
|
||||||
docker compose up -d
|
docker compose up -d
|
||||||
|
docker system prune -af
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
.idea
|
||||||
|
.vscode
|
||||||
|
.VSCodeCounter
|
||||||
|
*.sh
|
||||||
|
mongo
|
||||||
|
node_modules/
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
echo "Running lint-staged..."
|
||||||
|
cd client && npx lint-staged && cd ..
|
||||||
|
cd server && npx lint-staged && cd ..
|
||||||
@@ -0,0 +1,145 @@
|
|||||||
|
# CLAUDE.md
|
||||||
|
|
||||||
|
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
||||||
|
|
||||||
|
## Project Overview
|
||||||
|
|
||||||
|
Checkmate is an open-source uptime and infrastructure monitoring application. It monitors server hardware, uptime, response times, and incidents with real-time alerts. The companion agent [Capture](https://github.com/bluewave-labs/capture) provides infrastructure metrics (CPU, RAM, disk, temperature).
|
||||||
|
|
||||||
|
## Development Commands
|
||||||
|
|
||||||
|
### Client (React/Vite)
|
||||||
|
```bash
|
||||||
|
cd client
|
||||||
|
npm install
|
||||||
|
npm run dev # Start dev server at http://localhost:5173
|
||||||
|
npm run build # TypeScript check + production build
|
||||||
|
npm run lint # ESLint (strict, max-warnings 0)
|
||||||
|
npm run format # Prettier formatting
|
||||||
|
npm run format-check # Check formatting
|
||||||
|
```
|
||||||
|
|
||||||
|
### Server (Node.js/Express)
|
||||||
|
```bash
|
||||||
|
cd server
|
||||||
|
npm install
|
||||||
|
npm run dev # Start with hot-reload (nodemon + tsx) at http://localhost:52345
|
||||||
|
npm run build # TypeScript compile + path alias resolution
|
||||||
|
npm run test # Run Mocha tests with c8 coverage
|
||||||
|
npm run lint # ESLint v9
|
||||||
|
npm run lint-fix # Auto-fix lint issues
|
||||||
|
npm run format # Prettier formatting
|
||||||
|
```
|
||||||
|
|
||||||
|
### Docker Development
|
||||||
|
```bash
|
||||||
|
cd docker/dev
|
||||||
|
./build_images.sh
|
||||||
|
docker run -d -p 27017:27017 -v uptime_mongo_data:/data/db --name uptime_database_mongo mongo:6.0
|
||||||
|
```
|
||||||
|
|
||||||
|
## Environment Setup
|
||||||
|
|
||||||
|
### Server `.env` (minimum required)
|
||||||
|
```env
|
||||||
|
CLIENT_HOST="http://localhost:5173"
|
||||||
|
JWT_SECRET="my_secret_key_change_this"
|
||||||
|
DB_CONNECTION_STRING="mongodb://localhost:27017/uptime_db"
|
||||||
|
TOKEN_TTL="99d"
|
||||||
|
ORIGIN="localhost"
|
||||||
|
LOG_LEVEL="debug"
|
||||||
|
```
|
||||||
|
|
||||||
|
### Client `.env`
|
||||||
|
```env
|
||||||
|
VITE_APP_API_BASE_URL="http://localhost:52345/api/v1"
|
||||||
|
VITE_APP_LOG_LEVEL="debug"
|
||||||
|
```
|
||||||
|
|
||||||
|
## Architecture
|
||||||
|
|
||||||
|
### Monorepo Structure
|
||||||
|
- `/client` - React 18 + TypeScript + Vite + MUI frontend
|
||||||
|
- `/server` - Node.js 20+ + Express + TypeScript backend
|
||||||
|
- `/docker` - Multi-environment Docker configs (dev, staging, prod, arm, mono)
|
||||||
|
|
||||||
|
### Backend Layers
|
||||||
|
```
|
||||||
|
server/src/
|
||||||
|
├── controllers/ # Route handlers (authController, monitorController, etc.)
|
||||||
|
├── service/ # Business logic
|
||||||
|
│ ├── business/ # Core monitoring logic
|
||||||
|
│ ├── infrastructure/ # Server/system utilities
|
||||||
|
│ └── system/ # App-level settings
|
||||||
|
├── db/
|
||||||
|
│ ├── models/ # Mongoose schemas (Monitor, Check, Incident, User, etc.)
|
||||||
|
│ ├── migration/ # Database migrations (run on startup)
|
||||||
|
│ └── modules/ # Database-specific modules
|
||||||
|
├── middleware/v1/ # verifyJWT, rateLimiter, sanitization, responseHandler
|
||||||
|
├── routes/v1/ # API route definitions
|
||||||
|
├── validation/ # Joi input validation schemas
|
||||||
|
└── repositories/ # Data access layer
|
||||||
|
```
|
||||||
|
|
||||||
|
### Frontend Structure
|
||||||
|
```
|
||||||
|
client/src/
|
||||||
|
├── Components/ # Reusable UI components
|
||||||
|
├── Pages/ # Page components (Auth, Uptime, Infrastructure, Incidents, etc.)
|
||||||
|
├── Features/ # Redux slices (Auth, UI)
|
||||||
|
├── Hooks/ # Custom React hooks
|
||||||
|
├── Utils/ # Utilities (NetworkService.js is main API client)
|
||||||
|
├── Validation/ # Input validation
|
||||||
|
└── locales/ # i18n translations
|
||||||
|
```
|
||||||
|
|
||||||
|
### API
|
||||||
|
- Base URL: `/api/v1`
|
||||||
|
- Documentation: `http://localhost:52345/api-docs` (Swagger UI)
|
||||||
|
- OpenAPI spec: `/server/openapi.json`
|
||||||
|
|
||||||
|
### Key Technologies
|
||||||
|
- **State Management**: Redux Toolkit + Redux-Persist
|
||||||
|
- **Data Fetching**: SWR + Axios
|
||||||
|
- **Database**: MongoDB with Mongoose ODM
|
||||||
|
- **Queue/Cache**: Redis + BullMQ + Pulse (cron scheduling)
|
||||||
|
- **i18n**: i18next + react-i18next (translations via PoEditor)
|
||||||
|
|
||||||
|
## Code Conventions
|
||||||
|
|
||||||
|
### Internationalization
|
||||||
|
All user-facing strings must use the translation function:
|
||||||
|
```javascript
|
||||||
|
t('your.key') // Never hardcode UI strings
|
||||||
|
```
|
||||||
|
|
||||||
|
### Branching
|
||||||
|
- Always branch from `develop` (not master)
|
||||||
|
- Use descriptive names: `feat/add-alerts`, `fix/login-error`
|
||||||
|
- PRs target `develop` branch
|
||||||
|
|
||||||
|
### Formatting
|
||||||
|
- **Client**: Prettier with `printWidth: 90`, tabs, double quotes
|
||||||
|
- **Server**: Prettier with `printWidth: 150`, tabs, double quotes
|
||||||
|
- Both use ESLint with strict settings
|
||||||
|
|
||||||
|
### Testing
|
||||||
|
Server tests use Mocha + Chai + Sinon:
|
||||||
|
```bash
|
||||||
|
npm test # Run all tests with coverage
|
||||||
|
npm test -- --grep "pattern" # Run specific tests
|
||||||
|
```
|
||||||
|
Test files: `server/tests/**/*.test.js`
|
||||||
|
|
||||||
|
## Database Models
|
||||||
|
|
||||||
|
Key Mongoose models in `/server/src/db/models/`:
|
||||||
|
- **Monitor** - Monitoring configuration (website, infrastructure, port, etc.)
|
||||||
|
- **Check** - Individual monitoring check results
|
||||||
|
- **Incident** - Downtime incidents
|
||||||
|
- **User** - User accounts
|
||||||
|
- **Team** - Team/workspace management
|
||||||
|
- **StatusPage** - Public status pages
|
||||||
|
- **Notification** - Alert configuration (email, Discord, Slack, webhooks)
|
||||||
|
- **MaintenanceWindow** - Scheduled maintenance periods
|
||||||
|
- **AppSettings** - Global application settings
|
||||||
+191
-12
@@ -6,10 +6,35 @@ We truly appreciate all kinds of contributions — code, ideas, translations or
|
|||||||
|
|
||||||
Before you start, please take a moment to read the relevant section. It helps us review and accept contributions faster, and makes the whole process smoother for everyone. 💚
|
Before you start, please take a moment to read the relevant section. It helps us review and accept contributions faster, and makes the whole process smoother for everyone. 💚
|
||||||
|
|
||||||
PS: **We work closely with contributors on our [Discord channel](https://discord.com/invite/NAb6H3UTjK)**. You’ll find community members, core maintainers, and first-timers helping each other out.
|
PS: **We work closely with contributors on our [Discord channel](https://discord.com/invite/NAb6H3UTjK)**. You'll find community members, core maintainers, and first-timers helping each other out.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
||||||
|
## 🚀 Quick Setup Checklist
|
||||||
|
|
||||||
|
Before you dive in, make sure you have these installed:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Check Node.js (v16+ required)
|
||||||
|
node --version
|
||||||
|
|
||||||
|
# Check npm
|
||||||
|
npm --version
|
||||||
|
|
||||||
|
# Check Docker
|
||||||
|
docker --version
|
||||||
|
|
||||||
|
# Check Git
|
||||||
|
git --version
|
||||||
|
```
|
||||||
|
|
||||||
|
**New to contributing?** Start here:
|
||||||
|
1. Pick a [`good-first-issue`](https://github.com/bluewave-labs/checkmate/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22)
|
||||||
|
2. Comment that you'd like to work on it
|
||||||
|
3. Follow the [setup guide](#set-up-checkmate-locally) below
|
||||||
|
4. Join our [Discord](https://discord.com/invite/NAb6H3UTjK) if you get stuck
|
||||||
|
|
||||||
## Table of contents
|
## Table of contents
|
||||||
|
|
||||||
- [How do I...?](#how-do-i)
|
- [How do I...?](#how-do-i)
|
||||||
@@ -32,12 +57,12 @@ PS: **We work closely with contributors on our [Discord channel](https://discord
|
|||||||
|
|
||||||
### Get help or ask a question?
|
### Get help or ask a question?
|
||||||
|
|
||||||
Ask anything in our [Discord server](https://discord.com/invite/NAb6H3UTjK) — we’re friendly and happy to help. [Our core contributors](https://github.com/bluewave-labs/checkmate?tab=readme-ov-file#-contributing) are active and ready to support you. You can also use [GitHub Discussions](https://github.com/bluewave-labs/Checkmate/discussions) section to ask your questions.
|
Ask anything in our [Discord server](https://discord.com/invite/NAb6H3UTjK) — we're friendly and happy to help. [Our core contributors](https://github.com/bluewave-labs/checkmate?tab=readme-ov-file#-contributing) are active and ready to support you. You can also use [GitHub Discussions](https://github.com/bluewave-labs/Checkmate/discussions) section to ask your questions.
|
||||||
|
|
||||||
### Report a bug?
|
### Report a bug?
|
||||||
|
|
||||||
1. Search [existing issues](https://github.com/bluewave-labs/checkmate/issues).
|
1. Search [existing issues](https://github.com/bluewave-labs/checkmate/issues).
|
||||||
2. If it’s not listed, open a **new issue**.
|
2. If it's not listed, open a **new issue**.
|
||||||
3. Include as much detail as possible: what happened, what you expected, and steps to reproduce. Logs and screenshots help.
|
3. Include as much detail as possible: what happened, what you expected, and steps to reproduce. Logs and screenshots help.
|
||||||
|
|
||||||
### Suggest a new feature?
|
### Suggest a new feature?
|
||||||
@@ -48,19 +73,175 @@ Ask anything in our [Discord server](https://discord.com/invite/NAb6H3UTjK) —
|
|||||||
|
|
||||||
### Set up Checkmate locally?
|
### Set up Checkmate locally?
|
||||||
|
|
||||||
Frontend & backend:
|
#### Prerequisites
|
||||||
|
|
||||||
|
- Node.js (with npm)
|
||||||
|
- Docker
|
||||||
|
- Git
|
||||||
|
|
||||||
|
#### Step 1: Clone the Repository
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git clone https://github.com/bluewave-labs/Checkmate.git
|
||||||
|
cd Checkmate
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Step 2: Set Up Docker Containers (MongoDB)
|
||||||
|
|
||||||
|
Navigate to the Docker dev directory:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd docker/dev
|
||||||
|
```
|
||||||
|
|
||||||
|
Build the Docker images:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
./build_images.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
Run MongoDB container:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker run -d -p 27017:27017 -v uptime_mongo_data:/data/db --name uptime_database_mongo mongo:6.0
|
||||||
|
```
|
||||||
|
|
||||||
|
Navigate back to the root directory:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd ../..
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Step 3: Set Up the Backend (Server)
|
||||||
|
|
||||||
|
Navigate to the server directory:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd server
|
||||||
|
```
|
||||||
|
|
||||||
|
Install dependencies:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
npm install
|
npm install
|
||||||
|
```
|
||||||
|
|
||||||
|
Create a `.env` file in the `server` directory with the following minimum required configuration:
|
||||||
|
|
||||||
|
```env
|
||||||
|
CLIENT_HOST="http://localhost:5173"
|
||||||
|
JWT_SECRET="my_secret_key_change_this"
|
||||||
|
DB_CONNECTION_STRING="mongodb://localhost:27017/uptime_db"
|
||||||
|
TOKEN_TTL="99d"
|
||||||
|
ORIGIN="localhost"
|
||||||
|
LOG_LEVEL="debug"
|
||||||
|
```
|
||||||
|
|
||||||
|
**Environment Variables Explained:**
|
||||||
|
|
||||||
|
- `CLIENT_HOST`: Frontend URL (default: http://localhost:5173)
|
||||||
|
- `JWT_SECRET`: Secret key for JWT tokens (change to something secure)
|
||||||
|
- `DB_CONNECTION_STRING`: MongoDB connection URL
|
||||||
|
- `ORIGIN`: Origin for CORS purposes
|
||||||
|
- `TOKEN_TTL`: Token time to live (in vercel/ms format)
|
||||||
|
- `LOG_LEVEL`: Debug level (debug, info, warn, error)
|
||||||
|
|
||||||
|
Start the backend server:
|
||||||
|
|
||||||
|
```bash
|
||||||
npm run dev
|
npm run dev
|
||||||
```
|
```
|
||||||
|
|
||||||
By default, the frontend expects the backend on `http://localhost:3001`. Update configs if needed.
|
The server will run at `http://localhost:52345`.
|
||||||
|
|
||||||
|
#### Step 4: Set Up the Frontend (Client)
|
||||||
|
|
||||||
|
Open a new terminal window and navigate to the client directory from the root:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd client
|
||||||
|
```
|
||||||
|
|
||||||
|
Install dependencies:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npm install
|
||||||
|
```
|
||||||
|
|
||||||
|
Create a `.env` file in the `client` directory:
|
||||||
|
|
||||||
|
```env
|
||||||
|
VITE_APP_API_BASE_URL="http://localhost:52345/api/v1"
|
||||||
|
VITE_APP_LOG_LEVEL="debug"
|
||||||
|
```
|
||||||
|
|
||||||
|
**Environment Variables Explained:**
|
||||||
|
|
||||||
|
- `VITE_APP_API_BASE_URL`: Backend API URL
|
||||||
|
- `VITE_APP_LOG_LEVEL`: Log level (none, error, warn, debug, info)
|
||||||
|
|
||||||
|
Start the frontend:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npm run dev
|
||||||
|
```
|
||||||
|
|
||||||
|
The client will run at `http://localhost:5173`.
|
||||||
|
|
||||||
|
#### Step 5: Access the Application
|
||||||
|
|
||||||
|
Open your browser and navigate to:
|
||||||
|
|
||||||
|
- **Frontend**: http://localhost:5173
|
||||||
|
- **Backend API**: http://localhost:52345
|
||||||
|
- **API Documentation**: http://localhost:52345/api-docs
|
||||||
|
|
||||||
|
#### Managing Docker Containers
|
||||||
|
|
||||||
|
Stop containers:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker stop uptime_database_mongo
|
||||||
|
```
|
||||||
|
|
||||||
|
Start containers:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker start uptime_database_mongo
|
||||||
|
```
|
||||||
|
|
||||||
|
Remove containers (if needed):
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker rm uptime_database_mongo
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Troubleshooting
|
||||||
|
|
||||||
|
**Port already in use:**
|
||||||
|
|
||||||
|
- Check if another service is using ports 5173, 52345, 27017, or 6379
|
||||||
|
- Stop the conflicting service or change the port in `.env` files
|
||||||
|
|
||||||
|
**MongoDB connection issues:**
|
||||||
|
|
||||||
|
- Verify container is running: `docker ps`
|
||||||
|
- Check container logs: `docker logs uptime_database_mongo`
|
||||||
|
|
||||||
|
**Module not found errors:**
|
||||||
|
|
||||||
|
- Ensure you ran `npm install` in both `client` and `server` directories
|
||||||
|
|
||||||
|
**Need more help?**
|
||||||
|
|
||||||
|
- Check the [full documentation](https://docs.checkmate.so)
|
||||||
|
- Ask on [Discord](https://discord.com/invite/NAb6H3UTjK)
|
||||||
|
|
||||||
### Start contributing code?
|
### Start contributing code?
|
||||||
|
|
||||||
1. Pick or open an issue (check `good-first-issue`s first)
|
1. Pick or open an issue (check `good-first-issue`s first)
|
||||||
2. (optional but highly suggested) Read a detailed structure of [Checkmate](https://deepwiki.com/bluewave-labs/Checkmate) if you would like to deep dive into the architecture.
|
2. (optional but highly suggested) Read a detailed structure of [Checkmate](https://deepwiki.com/bluewave-labs/Checkmate) if you would like to deep dive into the architecture.
|
||||||
3. Ask to be assigned. If there is alrady someone assigned and it's been more than 7 days, you can raise the flag and ask to be assigned as well.
|
3. Ask to be assigned. If there is already someone assigned and it's been more than 7 days, you can raise the flag and ask to be assigned as well.
|
||||||
4. Create a branch from `develop`.
|
4. Create a branch from `develop`.
|
||||||
5. Write your code.
|
5. Write your code.
|
||||||
6. Run and test locally.
|
6. Run and test locally.
|
||||||
@@ -75,6 +256,7 @@ Docs live in [checkmate-documentation](https://github.com/bluewave-labs/checkmat
|
|||||||
### Help with translations?
|
### Help with translations?
|
||||||
|
|
||||||
We use [PoEditor](https://poeditor.com) for translations. You can:
|
We use [PoEditor](https://poeditor.com) for translations. You can:
|
||||||
|
|
||||||
- [Sign up and join your language team](https://poeditor.com/join/project/lRUoGZFCsJ).
|
- [Sign up and join your language team](https://poeditor.com/join/project/lRUoGZFCsJ).
|
||||||
- Translate UI strings.
|
- Translate UI strings.
|
||||||
- Ask questions on Discord in the relevant #translations channel.
|
- Ask questions on Discord in the relevant #translations channel.
|
||||||
@@ -84,6 +266,7 @@ Make sure all new UI strings in code use `t('key')`.
|
|||||||
### Submit a pull request?
|
### Submit a pull request?
|
||||||
|
|
||||||
Follow the [pull request checklist](#pull-request-checklist). Your PR should:
|
Follow the [pull request checklist](#pull-request-checklist). Your PR should:
|
||||||
|
|
||||||
- Be focused on one issue.
|
- Be focused on one issue.
|
||||||
- Be tested locally.
|
- Be tested locally.
|
||||||
- Use our linting and translation rules.
|
- Use our linting and translation rules.
|
||||||
@@ -123,7 +306,6 @@ If one or more of these are missing, we may ask you to update your pull request
|
|||||||
|
|
||||||
## Branching model
|
## Branching model
|
||||||
|
|
||||||
|
|
||||||
- Code contributions should go to the `develop` branch.
|
- Code contributions should go to the `develop` branch.
|
||||||
- `master` is used for stable releases.
|
- `master` is used for stable releases.
|
||||||
- Use descriptive branch names, like `fix/login-error` or `feat/add-alerts`.
|
- Use descriptive branch names, like `fix/login-error` or `feat/add-alerts`.
|
||||||
@@ -137,13 +319,10 @@ If one or more of these are missing, we may ask you to update your pull request
|
|||||||
|
|
||||||
## Thank you
|
## Thank you
|
||||||
|
|
||||||
Thanks for making Checkmate better. We mean it. Whether it’s your first pull request or your 50th, we’re excited to build with you.
|
Thanks for making Checkmate better. We mean it. Whether it's your first pull request or your 50th, we're excited to build with you.
|
||||||
|
|
||||||
|
PS: feel free to introduce yourself on [Discord](https://discord.gg/NAb6H3UTjK) and say hi.
|
||||||
PS: feel free to introduce yourself on [Discord](https://discord.gg/YOUR-DISCORD-LINK) and say hi.
|
|
||||||
|
|
||||||
-- Checkmate team
|
-- Checkmate team
|
||||||
|
|
||||||
Also make sure you read the [document about how to make a good pull request](/PULLREQUESTS.md).
|
Also make sure you read the [document about how to make a good pull request](/PULLREQUESTS.md).
|
||||||
|
|
||||||
|
|
||||||
+11325
File diff suppressed because it is too large.
Load diff
+172
@@ -0,0 +1,172 @@
|
|||||||
|
<p align=center> <a href="https://trendshift.io/repositories/12443" target="_blank"><img src="https://trendshift.io/api/badge/repositories/12443" alt="bluewave-labs%2Fcheckmate | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a></p>
|
||||||
|
|
||||||
|

|
||||||
|

|
||||||
|

|
||||||
|

|
||||||
|

|
||||||
|

|
||||||
|

|
||||||
|
[](https://www.bestpractices.dev/projects/9901)
|
||||||
|
[](https://deepwiki.com/bluewave-labs/checkmate)
|
||||||
|
|
||||||
|
<h1 align="center"><a href="https://bluewavelabs.ca" target="_blank">Checkmate</a></h1>
|
||||||
|
|
||||||
|
<p align="center"><strong>Una aplicación de código abierto para monitoreo de infraestructura y tiempo de actividad</strong></p>
|
||||||
|
|
||||||
|
<img width="1660" alt="image" src="https://github.com/user-attachments/assets/b748f36d-a271-4965-ad0a-18bf153bbee7" />
|
||||||
|
|
||||||
|
Este repositorio contiene tanto el frontend como el backend de Checkmate, una herramienta de monitoreo de código abierto y autoalojada para rastrear hardware de servidores, tiempo de actividad, tiempos de respuesta e incidentes en tiempo real con visualizaciones atractivas. Checkmate revisa regularmente si un servidor o sitio web es accesible y funciona de manera óptima, proporcionando alertas e informes en tiempo real sobre la disponibilidad, el tiempo de inactividad y el tiempo de respuesta de los servicios monitoreados.
|
||||||
|
|
||||||
|
Checkmate también tiene un agente llamado [Capture](https://github.com/bluewave-labs/capture), para recuperar datos de servidores remotos. Aunque Capture no es obligatorio para ejecutar Checkmate, proporciona información adicional sobre el estado de la CPU, RAM, disco y temperatura de tus servidores.
|
||||||
|
|
||||||
|
Checkmate ha sido probado con más de 1000 monitores activos sin problemas ni cuellos de botella de rendimiento.
|
||||||
|
|
||||||
|
**Si deseas patrocinar una función, [visita este enlace](https://checkmate.so/sponsored-features).**
|
||||||
|
|
||||||
|
## 📚 Tabla de contenidos
|
||||||
|
|
||||||
|
- [📦 Demo](#demo)
|
||||||
|
- [🔗 Guía del usuario](#guía-del-usuario)
|
||||||
|
- [🛠️ Instalación](#instalación)
|
||||||
|
- [🏁 Traducciones](#traducciones)
|
||||||
|
- [🚀 Rendimiento](#rendimiento)
|
||||||
|
- [💚 Preguntas e ideas](#preguntas-e-ideas)
|
||||||
|
- [🧩 Características](#características)
|
||||||
|
- [🏗️ Capturas de pantalla](#capturas-de-pantalla)
|
||||||
|
- [🏗️ Tecnologías](#tecnologías)
|
||||||
|
- [🔗 Enlaces útiles](#enlaces-útiles)
|
||||||
|
- [🤝 Contribuciones](#contribuciones)
|
||||||
|
- [💰 Patrocinadores](#patrocinadores)
|
||||||
|
|
||||||
|
...
|
||||||
|
|
||||||
|
**[Texto truncado para mantener la longitud del mensaje manejable]**
|
||||||
|
|
||||||
|
## Demo
|
||||||
|
|
||||||
|
Puedes ver la última versión de [Checkmate](https://checkmate-demo.bluewavelabs.ca/) en acción. El usuario es uptimedemo@demo.com y la contraseña es Demouser1! (ten en cuenta que actualizamos el servidor de demostración de vez en cuando, así que si no funciona para ti, por favor contáctanos en el canal de Discusiones).
|
||||||
|
|
||||||
|
## Guía del usuario
|
||||||
|
|
||||||
|
Las instrucciones de uso se pueden encontrar [aquí](https://docs.checkmate.so/checkmate-2.1). Todavía está en desarrollo y parte de la información puede estar desactualizada ya que continuamente añadimos funciones cada semana. ¡Ten por seguro que estamos haciendo lo mejor posible! :)
|
||||||
|
|
||||||
|
## Instalación
|
||||||
|
|
||||||
|
Consulta las instrucciones de instalación en el [portal de documentación de Checkmate](https://docs.checkmate.so/checkmate-2.1/users-guide/quickstart).
|
||||||
|
|
||||||
|
Alternativamente, también puedes usar [Coolify](https://coolify.io/), [Elestio](https://elest.io/open-source/checkmate), [K8s](./charts/helm/checkmate/INSTALLATION.md) o [Pikapods](https://www.pikapods.com/) para desplegar rápidamente una instancia de Checkmate. Si deseas monitorear tu infraestructura de servidores, necesitarás el agente [Capture](https://github.com/bluewave-labs/capture). El repositorio de Capture también contiene las instrucciones de instalación.
|
||||||
|
|
||||||
|
## Traducciones
|
||||||
|
|
||||||
|
Si deseas usar Checkmate en tu idioma, por favor [ve a esta página](https://poeditor.com/join/project/lRUoGZFCsJ) y regístrate para el idioma al que te gustaría traducir Checkmate.
|
||||||
|
|
||||||
|
## Rendimiento
|
||||||
|
|
||||||
|
Gracias a extensas optimizaciones, Checkmate opera con un uso de memoria excepcionalmente bajo, requiriendo recursos mínimos de memoria y CPU. Aquí está el uso de memoria de una instancia de Node.js ejecutándose en un servidor que monitorea 323 servidores cada minuto:
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
También puedes ver el consumo de memoria de MongoDB y Redis en el mismo servidor (398Mb y 15Mb) para la misma cantidad de servidores:
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
## Preguntas e Ideas
|
||||||
|
|
||||||
|
Si tienes alguna pregunta, sugerencia o comentario, tienes varias opciones:
|
||||||
|
|
||||||
|
- [Canal de Discord](https://discord.gg/NAb6H3UTjK)
|
||||||
|
- [Discusiones en GitHub](https://github.com/bluewave-labs/bluewave-uptime/discussions)
|
||||||
|
- [Grupo en Reddit](https://www.reddit.com/r/CheckmateMonitoring/)
|
||||||
|
|
||||||
|
¡No dudes en hacer preguntas o compartir tus ideas, nos encantaría saber de ti!
|
||||||
|
|
||||||
|
## Características
|
||||||
|
|
||||||
|
- Completamente de código abierto, desplegable en tus propios servidores o dispositivos personales (por ejemplo, Raspberry Pi 4 o 5)
|
||||||
|
- Monitoreo de sitios web
|
||||||
|
- Monitoreo de velocidad de carga
|
||||||
|
- Monitoreo de infraestructura (memoria, uso de disco, rendimiento de CPU, etc) - requiere el agente [Capture](https://github.com/bluewave-labs/capture)
|
||||||
|
- Monitoreo de Docker
|
||||||
|
- Monitoreo con ping
|
||||||
|
- Monitoreo de certificados SSL
|
||||||
|
- Monitoreo de puertos
|
||||||
|
- Incidentes en una sola vista
|
||||||
|
- Páginas de estado
|
||||||
|
- Notificaciones por correo, Webhooks, Discord, Telegram, Slack
|
||||||
|
- Mantenimiento programado
|
||||||
|
- Monitoreo de consultas JSON
|
||||||
|
- Soporte para múltiples idiomas
|
||||||
|
|
||||||
|
**Hoja de ruta a corto plazo:** ([Milestone 2.2](https://github.com/bluewave-labs/Checkmate/milestone/8))
|
||||||
|
|
||||||
|
- Mejores notificaciones
|
||||||
|
- Monitoreo de red
|
||||||
|
- ...y algunas funciones más
|
||||||
|
|
||||||
|
## Capturas de pantalla
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<img width="1628" alt="image" src="https://github.com/user-attachments/assets/2eff6464-0738-4a32-9312-26e1e8e86275" />
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<img width="1656" alt="image" src="https://github.com/user-attachments/assets/616c3563-c2a7-4ee4-af6c-7e6068955d1a" />
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<img width="1652" alt="image" src="https://github.com/user-attachments/assets/7912d7cf-0d0e-4f26-aa5c-2ad7170b5c99" />
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<img width="1652" alt="image" src="https://github.com/user-attachments/assets/08c2c6ac-3a2f-44d1-a229-d1746a3f9d16" />
|
||||||
|
</p>
|
||||||
|
|
||||||
|
## Tecnologías
|
||||||
|
|
||||||
|
- [ReactJs](https://react.dev/)
|
||||||
|
- [MUI (framework de React)](https://mui.com/)
|
||||||
|
- [Node.js](https://nodejs.org/en)
|
||||||
|
- [MongoDB](https://mongodb.com)
|
||||||
|
- [Recharts](https://recharts.org)
|
||||||
|
- ¡Y muchos otros componentes de código abierto!
|
||||||
|
|
||||||
|
## Enlaces útiles
|
||||||
|
|
||||||
|
- Si deseas apoyarnos, por favor considera darle una ⭐ y haz clic en "watch".
|
||||||
|
- ¿Tienes una pregunta o sugerencia para la hoja de ruta? Revisa nuestro [canal de Discord](https://discord.gg/NAb6H3UTjK) o el foro de [Discusiones](https://github.com/bluewave-labs/checkmate/discussions).
|
||||||
|
- ¿Quieres saber cuándo hay una nueva versión? Usa [Newreleases](https://newreleases.io/), un servicio gratuito para seguir lanzamientos.
|
||||||
|
- Mira un video de instalación y uso de Checkmate [aquí](https://www.youtube.com/watch?v=GfFOc0xHIwY)
|
||||||
|
|
||||||
|
## Contribuciones
|
||||||
|
|
||||||
|
Somos [Alex](http://github.com/ajhollid) (líder de equipo), [Vishnu](http://github.com/vishnusn77), [Mohadeseh](http://github.com/mohicody), [Gorkem](http://github.com/gorkem-bwl/), [Owaise](http://github.com/Owaiseimdad), [Aryaman](https://github.com/Br0wnHammer) y [Mert](https://github.com/mertssmnoglu), ayudando a personas y empresas a monitorear su infraestructura y servidores.
|
||||||
|
|
||||||
|
Nos enorgullecemos de construir conexiones fuertes con contribuyentes de todos los niveles. A pesar de ser un proyecto joven, Checkmate ya ha ganado más de 7000 estrellas y ha atraído a más de 90 contribuyentes de todo el mundo.
|
||||||
|
|
||||||
|
Nuestro repositorio ha sido marcado con estrella por empleados de **Google, Microsoft, Intel, Cisco, Tencent, Electronic Arts, ByteDance, JP Morgan Chase, Deloitte, Accenture, Foxconn, Broadcom, China Telecom, Barclays, Capgemini, Wipro, Cloudflare, Dassault Systèmes y NEC**, ¡así que no te detengas — participa, contribuye y aprende con nosotros!
|
||||||
|
|
||||||
|
Cómo contribuir:
|
||||||
|
|
||||||
|
0. Dale una estrella al repositorio :)
|
||||||
|
1. Revisa la [guía para contribuidores](https://github.com/bluewave-labs/Checkmate/blob/develop/CONTRIBUTING.md). Se anima a los nuevos a revisar las etiquetas `good-first-issue`.
|
||||||
|
2. Consulta la [estructura del proyecto](https://docs.checkmate.so/checkmate-2.1/developers-guide/general-project-structure) y la [visión general](https://bluewavelabs.gitbook.io/checkmate/developers-guide/high-level-overview).
|
||||||
|
3. Lee una estructura detallada de [Checkmate](https://deepwiki.com/bluewave-labs/Checkmate) si deseas profundizar en la arquitectura.
|
||||||
|
4. Abre un issue si crees que has encontrado un error.
|
||||||
|
5. Revisa los issues con la etiqueta `good-first-issue` si eres nuevo.
|
||||||
|
6. Haz un pull request para añadir nuevas funciones, mejoras o correcciones.
|
||||||
|
|
||||||
|
<a href="https://github.com/bluewave-labs/checkmate/graphs/contributors">
|
||||||
|
<img src="https://contrib.rocks/image?repo=bluewave-labs/checkmate" />
|
||||||
|
</a>
|
||||||
|
|
||||||
|
[](https://star-history.com/#bluewave-labs/bluewave-uptime&Date)
|
||||||
|
|
||||||
|
## Patrocinadores
|
||||||
|
|
||||||
|
Gracias a [Gitbook](https://gitbook.io/) por darnos una cuenta gratuita para su plataforma de documentación, y a [Poeditor](https://poeditor.com/) por proporcionarnos una cuenta gratuita para servicios de traducción. Si deseas patrocinar Checkmate, por favor envía un correo a hello@bluewavelabs.ca
|
||||||
|
|
||||||
|
Si deseas patrocinar una función, [visita esta página](https://checkmate.so/sponsored-features).
|
||||||
|
|
||||||
|
También puedes revisar otros proyectos de BlueWave orientados a desarrolladores y contribuidores:
|
||||||
|
|
||||||
|
- [VerifyWise](https://github.com/bluewave-labs/verifywise), la primera plataforma de gobernanza de IA de código abierto.
|
||||||
|
- [DataRoom](https://github.com/bluewave-labs/bluewave-dataroom), una aplicación de intercambio de archivos seguro, también conocida como dataroom.
|
||||||
|
- [Guidefox](https://github.com/bluewave-labs/guidefox), una app que ayuda a nuevos usuarios a aprender a usar tu producto mediante pistas, tours, popups y banners.
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
This repository contains both the frontend and the backend of Checkmate, an open-source, self-hosted monitoring tool for tracking server hardware, uptime, response times, and incidents in real-time with beautiful visualizations. Checkmate regularly checks whether a server/website is accessible and performs optimally, providing real-time alerts and reports on the monitored services' availability, downtime, and response time.
|
This repository contains both the frontend and the backend of Checkmate, an open-source, self-hosted monitoring tool for tracking server hardware, uptime, response times, and incidents in real-time with beautiful visualizations. Checkmate regularly checks whether a server/website is accessible and performs optimally, providing real-time alerts and reports on the monitored services' availability, downtime, and response time.
|
||||||
|
|
||||||
Checkmate also has an agent, called [Capture](https://github.com/bluewave-labs/capture), to retrieve data from remote servers. While Capture is not required to run Checkmate, it provides additional insights about your servers' CPU, RAM, disk, and temperature status.
|
Checkmate also has an agent, called [Capture](https://github.com/bluewave-labs/capture), to retrieve data from remote servers. While Capture is not required to run Checkmate, it provides additional insights about your servers' CPU, RAM, disk, and temperature status. Capture can run on Linux, Windows, Mac, Raspberry Pi, or any device that can run Go.
|
||||||
|
|
||||||
Checkmate has been stress-tested with 1000+ active monitors without any particular issues or performance bottlenecks.
|
Checkmate has been stress-tested with 1000+ active monitors without any particular issues or performance bottlenecks.
|
||||||
|
|
||||||
@@ -26,37 +26,46 @@ Checkmate has been stress-tested with 1000+ active monitors without any particul
|
|||||||
|
|
||||||
## 📚 Table of contents
|
## 📚 Table of contents
|
||||||
|
|
||||||
- [📦 Demo](#-demo)
|
- [📦 Demo](#demo)
|
||||||
- [🔗 User's guide](#-users-guide)
|
- [🔗 User's guide](#users-guide)
|
||||||
- [🛠️ Installation](#️-installation)
|
- [🛠️ Installation](#installation)
|
||||||
- [🏁 Translations](#-translations)
|
- [🏁 Translations](#translations)
|
||||||
- [🚀 Performance](#-performance)
|
- [🚀 Performance](#performance)
|
||||||
- [💚 Questions & Ideas](#-questions--ideas)
|
- [💚 Questions & Ideas](#questions--ideas)
|
||||||
- [🧩 Features](#-features)
|
- [🧩 Features](#features)
|
||||||
- [🏗️ Screenshots](#-screenshots)
|
- [🏗️ Screenshots](#screenshots)
|
||||||
- [🏗️ Tech stack](#-tech-stack)
|
- [🏗️ Tech stack](#tech-stack)
|
||||||
- [🔗 A few links](#a-few-links)
|
- [🔗 A few links](#a-few-links)
|
||||||
- [🤝 Contributing](#-contributing)
|
- [🤝 Contributing](#contributing)
|
||||||
- [💰 Our sponsors](#-our-sponsors)
|
- [💰 Our sponsors](#our-sponsors)
|
||||||
|
|
||||||
|
|
||||||
## 📦 Demo
|
## 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 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).
|
||||||
|
|
||||||
## 🔗 User's guide
|
## User's guide
|
||||||
|
|
||||||
Usage instructions can be found [here](https://docs.checkmate.so/checkmate-2.1). It's still WIP and some of the information there might be outdated as we continuously add features weekly. Rest assured, we are doing our best! :)
|
Usage instructions can be found [here](https://docs.checkmate.so/checkmate-2.1). It's still WIP and some of the information there might be outdated as we continuously add features weekly. Rest assured, we are doing our best! :)
|
||||||
|
|
||||||
## 🛠️ Installation
|
## Installation
|
||||||
|
|
||||||
See installation instructions in [Checkmate documentation portal](https://docs.checkmate.so/checkmate-2.1/users-guide/quickstart). Alternatively, you can also use [Coolify](https://coolify.io/), [Elestio](https://elest.io/open-source/checkmate) or [Pikapods](https://www.pikapods.com/) to quickly spin off a Checkmate instance. If you would like to monitor your server infrastructure, you'll need [Capture agent](https://github.com/bluewave-labs/capture). Capture repository also contains the installation instructions.
|
See installation instructions in [Checkmate documentation portal](https://docs.checkmate.so/checkmate-2.1/users-guide/quickstart).
|
||||||
|
|
||||||
## 🏁 Translations
|
Alternatively, you can also use [Elestio](https://elest.io/open-source/checkmate), [K8s](./charts/helm/checkmate/INSTALLATION.md), [Sive Host](https://sive.host) (South Africa) or [Pikapods](https://www.pikapods.com/) to quickly spin off a Checkmate instance. If you would like to monitor your server infrastructure, you'll need [Capture agent](https://github.com/bluewave-labs/capture). Capture repository also contains the installation instructions.
|
||||||
|
|
||||||
|
### Using a Custom CA
|
||||||
|
|
||||||
|
If you need to monitor internal HTTPS endpoints with certificates from private Certificate Authorities (like Smallstep), see our [Custom CA Trust Guide](./docs/custom-ca-trust.md) for Docker configuration options.
|
||||||
|
|
||||||
|
For more documentation, see the [docs directory](./docs/).
|
||||||
|
|
||||||
|
|
||||||
|
## Translations
|
||||||
|
|
||||||
If you would like to use Checkmate in your language, please [go to this page](https://poeditor.com/join/project/lRUoGZFCsJ) and register for the language you would like to translate Checkmate to.
|
If you would like to use Checkmate in your language, please [go to this page](https://poeditor.com/join/project/lRUoGZFCsJ) and register for the language you would like to translate Checkmate to.
|
||||||
|
|
||||||
## 🚀 Performance
|
## Performance
|
||||||
|
|
||||||
Thanks to extensive optimizations, Checkmate operates with an exceptionally small memory footprint, requiring minimal memory and CPU resources. Here’s the memory usage of a Node.js instance running on a server that monitors 323 servers every minute:
|
Thanks to extensive optimizations, Checkmate operates with an exceptionally small memory footprint, requiring minimal memory and CPU resources. Here’s the memory usage of a Node.js instance running on a server that monitors 323 servers every minute:
|
||||||
|
|
||||||
@@ -66,34 +75,44 @@ You can see the memory footprint of MongoDB and Redis on the same server (398Mb
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
## 💚 Questions & Ideas
|
## Questions & Ideas
|
||||||
|
|
||||||
If you have any questions, suggestions or comments, please use our [Discord channel](https://discord.gg/NAb6H3UTjK). We've also launched our [Discussions](https://github.com/bluewave-labs/bluewave-uptime/discussions) page! Feel free to ask questions or share your ideas—we'd love to hear from you!
|
If you have any questions, suggestions or comments, you have several options:
|
||||||
|
|
||||||
## 🧩 Features
|
- [Discord channel](https://discord.gg/NAb6H3UTjK) (preferred)
|
||||||
|
- [GitHub Discussions](https://github.com/bluewave-labs/bluewave-uptime/discussions) (we check here from time to time)
|
||||||
|
|
||||||
|
Feel free to ask questions or share your ideas - we'd love to hear from you!
|
||||||
|
|
||||||
|
## Features
|
||||||
|
|
||||||
- Completely open source, deployable on your servers or home devices (e.g Raspberry Pi 4 or 5)
|
- Completely open source, deployable on your servers or home devices (e.g Raspberry Pi 4 or 5)
|
||||||
- Website monitoring
|
- Website monitoring
|
||||||
- Page speed monitoring
|
- Page speed monitoring
|
||||||
- Infrastructure monitoring (memory, disk usage, CPU performance etc) - requires [Capture](https://github.com/bluewave-labs/capture)
|
- Infrastructure monitoring (memory, disk usage, CPU performance, network etc) - requires [Capture](https://github.com/bluewave-labs/capture) agent
|
||||||
|
- Selective disk monitoring with mountpoint selection
|
||||||
- Docker monitoring
|
- Docker monitoring
|
||||||
- Ping monitoring
|
- Ping monitoring
|
||||||
- SSL monitoring
|
- SSL monitoring
|
||||||
- Port monitoring
|
- Port monitoring
|
||||||
|
- Game server monitoring (3.0)
|
||||||
- Incidents at a glance
|
- Incidents at a glance
|
||||||
- Status pages
|
- Status pages
|
||||||
- E-mail, Webhooks, Discord, Telegram, Slack notifications
|
- E-mail, Webhooks, Discord and Slack notifications
|
||||||
- Scheduled maintenance
|
- Scheduled maintenance
|
||||||
- JSON query monitoring
|
- JSON query monitoring
|
||||||
- Support for multiple languages
|
- Multi-language support for English, German, Japanese, Portuguese (Brazil), Russian, Turkish, Ukrainian, Vietnamese, Chinese (Traditional, Taiwan)
|
||||||
|
|
||||||
**Short term roadmap:** ([Milestone 2.2](https://github.com/bluewave-labs/Checkmate/milestone/8))
|
**Short term roadmap:**
|
||||||
|
|
||||||
|
- Plugins that will help Checkmate get any information from a remote service (e.g database, etc)
|
||||||
- Better notifications
|
- Better notifications
|
||||||
- Network monitoring
|
- Network monitoring
|
||||||
- ..and a few more features
|
- ..and a few more features
|
||||||
|
|
||||||
## 🏗️ Screenshots
|
If you would like to sponsor an additional feature, [see this page](https://checkmate.so/sponsored-features).
|
||||||
|
|
||||||
|
## Screenshots
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
<img width="1628" alt="image" src="https://github.com/user-attachments/assets/2eff6464-0738-4a32-9312-26e1e8e86275" />
|
<img width="1628" alt="image" src="https://github.com/user-attachments/assets/2eff6464-0738-4a32-9312-26e1e8e86275" />
|
||||||
@@ -110,7 +129,7 @@ If you have any questions, suggestions or comments, please use our [Discord chan
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
## 🏗️ Tech stack
|
## Tech stack
|
||||||
|
|
||||||
- [ReactJs](https://react.dev/)
|
- [ReactJs](https://react.dev/)
|
||||||
- [MUI (React framework)](https://mui.com/)
|
- [MUI (React framework)](https://mui.com/)
|
||||||
@@ -126,11 +145,11 @@ If you have any questions, suggestions or comments, please use our [Discord chan
|
|||||||
- Need a ping when there's a new release? Use [Newreleases](https://newreleases.io/), a free service to track releases.
|
- Need a ping when there's a new release? Use [Newreleases](https://newreleases.io/), a free service to track releases.
|
||||||
- Watch a Checkmate [installation and usage video](https://www.youtube.com/watch?v=GfFOc0xHIwY)
|
- Watch a Checkmate [installation and usage video](https://www.youtube.com/watch?v=GfFOc0xHIwY)
|
||||||
|
|
||||||
## 🤝 Contributing
|
## Contributing
|
||||||
|
|
||||||
We are [Alex](http://github.com/ajhollid) (team lead), [Vishnu](http://github.com/vishnusn77), [Mohadeseh](http://github.com/mohicody), [Gorkem](http://github.com/gorkem-bwl/), [Owaise](http://github.com/Owaiseimdad), [Aryaman](https://github.com/Br0wnHammer) and [Mert](https://github.com/mertssmnoglu) helping individuals and businesses monitor their infra and servers.
|
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 pride ourselves on building strong connections with contributors at every level. Despite being a young project, Checkmate has already earned 6000+ stars and attracted 80+ contributors from around the globe.
|
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.
|
||||||
|
|
||||||
Our repo is starred by employees from **Google, Microsoft, Intel, Cisco, Tencent, Electronic Arts, ByteDance, JP Morgan Chase, Deloitte, Accenture, Foxconn, Broadcom, China Telecom, Barclays, Capgemini, Wipro, Cloudflare, Dassault Systèmes and NEC**, so don’t hold back — jump in, contribute and learn with us!
|
Our repo is starred by employees from **Google, Microsoft, Intel, Cisco, Tencent, Electronic Arts, ByteDance, JP Morgan Chase, Deloitte, Accenture, Foxconn, Broadcom, China Telecom, Barclays, Capgemini, Wipro, Cloudflare, Dassault Systèmes and NEC**, so don’t hold back — jump in, contribute and learn with us!
|
||||||
|
|
||||||
@@ -143,6 +162,7 @@ Here's how you can contribute:
|
|||||||
4. Open an issue if you believe you've encountered a bug.
|
4. Open an issue if you believe you've encountered a bug.
|
||||||
5. Check for good-first-issue's if you are a newcomer.
|
5. Check for good-first-issue's if you are a newcomer.
|
||||||
6. Make a pull request to add new features/make quality-of-life improvements/fix bugs.
|
6. Make a pull request to add new features/make quality-of-life improvements/fix bugs.
|
||||||
|
7. Check out this interactive walkthrough of the `Checkmate` codebase on CodeCanvas [here](https://www.code-canvas.com/?session=unauthenticatedGithub&repo=Checkmate&owner=bluewave-labs&branch=develop&OnboardingTutorial=true). To refine existing dataflow simulation or create new ones, follow the quick tutorial [here](https://docs.code-canvas.com/updating-diagram).
|
||||||
|
|
||||||
<a href="https://github.com/bluewave-labs/checkmate/graphs/contributors">
|
<a href="https://github.com/bluewave-labs/checkmate/graphs/contributors">
|
||||||
<img src="https://contrib.rocks/image?repo=bluewave-labs/checkmate" />
|
<img src="https://contrib.rocks/image?repo=bluewave-labs/checkmate" />
|
||||||
@@ -150,7 +170,7 @@ Here's how you can contribute:
|
|||||||
|
|
||||||
[](https://star-history.com/#bluewave-labs/bluewave-uptime&Date)
|
[](https://star-history.com/#bluewave-labs/bluewave-uptime&Date)
|
||||||
|
|
||||||
## 💰 Our sponsors
|
## Our sponsors
|
||||||
|
|
||||||
Thanks to [Gitbook](https://gitbook.io/) for giving us a free tier for their documentation platform, and [Poeditor](https://poeditor.com/) providing us a free account to use their i18n services. If you would like to sponsor Checkmate, please send an email to hello@bluewavelabs.ca
|
Thanks to [Gitbook](https://gitbook.io/) for giving us a free tier for their documentation platform, and [Poeditor](https://poeditor.com/) providing us a free account to use their i18n services. If you would like to sponsor Checkmate, please send an email to hello@bluewavelabs.ca
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
.DS_Store
|
||||||
|
.git/
|
||||||
|
.gitignore
|
||||||
|
.bzr/
|
||||||
|
.bzrignore
|
||||||
|
.hg/
|
||||||
|
.hgignore
|
||||||
|
.svn/
|
||||||
|
*.swp
|
||||||
|
*.bak
|
||||||
|
*.tmp
|
||||||
|
*.orig
|
||||||
|
*~
|
||||||
|
.project
|
||||||
|
.idea/
|
||||||
|
*.tmproj
|
||||||
|
.vscode/
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
apiVersion: v2
|
||||||
|
name: checkmate-chart
|
||||||
|
description: A Helm chart for Checkmate App
|
||||||
|
type: application
|
||||||
|
version: 0.1.0
|
||||||
|
appVersion: "2.3"
|
||||||
@@ -0,0 +1,116 @@
|
|||||||
|
# Kubernetes Installation Guide for Checkmate
|
||||||
|
|
||||||
|
This guide walks you through deploying Checkmate on your Kubernetes cluster using Helm.
|
||||||
|
|
||||||
|
## Prerequisites
|
||||||
|
|
||||||
|
- A running Kubernetes cluster
|
||||||
|
- Helm CLI installed and configured
|
||||||
|
- `kubectl` configured to access your cluster
|
||||||
|
|
||||||
|
## Steps
|
||||||
|
|
||||||
|
### 1. Clone the repo and navigate to the Helm chart
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git clone https://github.com/bluewave-labs/checkmate.git
|
||||||
|
cd checkmate/charts/helm/checkmate
|
||||||
|
```
|
||||||
|
|
||||||
|
### 2. Customize values.yaml
|
||||||
|
Edit `values.yaml` to update:
|
||||||
|
- `client.ingress.host` and `server.ingress.host` with your domain names
|
||||||
|
- `server.protocol` (usually http or https)
|
||||||
|
- **If upgrading**: Migrate persistence settings from flat structure to nested:
|
||||||
|
- Old: `persistence.mongodbSize` → New: `persistence.mongo.size`
|
||||||
|
- Old: `persistence.redisSize` → New: `persistence.redis.size`
|
||||||
|
- Add: `persistence.mongo.storageClass` and `persistence.redis.storageClass` (leave empty for default)
|
||||||
|
- Secrets under the `secrets` section (`JWT_SECRET`, email credentials, API keys, etc.) — replace all change_me values
|
||||||
|
- **For TLS/HTTPS**: Configure ingress TLS settings (see section below)
|
||||||
|
|
||||||
|
### 3. Deploy the Helm chart
|
||||||
|
```bash
|
||||||
|
helm install checkmate ./charts/helm/checkmate
|
||||||
|
```
|
||||||
|
This will deploy the client, server, MongoDB, and Redis components.
|
||||||
|
|
||||||
|
### 4. Verify the deployment
|
||||||
|
Check pods and services:
|
||||||
|
```bash
|
||||||
|
kubectl get pods
|
||||||
|
kubectl get svc
|
||||||
|
```
|
||||||
|
|
||||||
|
Once all pods are `Running` and `Ready`, you can access Checkmate via the configured ingress hosts.
|
||||||
|
|
||||||
|
## Enabling TLS/HTTPS with cert-manager
|
||||||
|
|
||||||
|
If you have [cert-manager](https://cert-manager.io/) installed in your cluster, you can enable automatic TLS certificate provisioning using Let's Encrypt or other certificate issuers.
|
||||||
|
|
||||||
|
### Prerequisites
|
||||||
|
- cert-manager installed in your cluster
|
||||||
|
- A ClusterIssuer or Issuer configured (e.g., `letsencrypt-prod`)
|
||||||
|
|
||||||
|
### Configuration
|
||||||
|
|
||||||
|
Edit `values.yaml` to enable TLS (and update protocols to https):
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
client:
|
||||||
|
protocol: https
|
||||||
|
ingress:
|
||||||
|
enabled: true
|
||||||
|
host: checkmate.example.com
|
||||||
|
className: nginx
|
||||||
|
annotations:
|
||||||
|
cert-manager.io/cluster-issuer: "letsencrypt-prod"
|
||||||
|
tls:
|
||||||
|
enabled: true
|
||||||
|
secretName: checkmate-client-tls
|
||||||
|
|
||||||
|
server:
|
||||||
|
protocol: https
|
||||||
|
ingress:
|
||||||
|
enabled: true
|
||||||
|
host: checkmate.example.com
|
||||||
|
className: nginx
|
||||||
|
annotations:
|
||||||
|
cert-manager.io/cluster-issuer: "letsencrypt-prod"
|
||||||
|
tls:
|
||||||
|
enabled: true
|
||||||
|
secretName: checkmate-server-tls
|
||||||
|
```
|
||||||
|
|
||||||
|
### Alternative: Using --set flags
|
||||||
|
|
||||||
|
You can also enable TLS during installation using Helm's `--set` flags:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
helm install checkmate ./charts/helm/checkmate \
|
||||||
|
--set client.protocol=https \
|
||||||
|
--set server.protocol=https \
|
||||||
|
--set client.ingress.annotations."cert-manager\.io/cluster-issuer"="letsencrypt-prod" \
|
||||||
|
--set client.ingress.tls.enabled=true \
|
||||||
|
--set client.ingress.tls.secretName=checkmate-client-tls \
|
||||||
|
--set server.ingress.annotations."cert-manager\.io/cluster-issuer"="letsencrypt-prod" \
|
||||||
|
--set server.ingress.tls.enabled=true \
|
||||||
|
--set server.ingress.tls.secretName=checkmate-server-tls
|
||||||
|
```
|
||||||
|
|
||||||
|
### Verification
|
||||||
|
|
||||||
|
After deployment, cert-manager will automatically create the TLS secrets. You can verify the certificate status:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Check certificates
|
||||||
|
kubectl get certificates
|
||||||
|
|
||||||
|
# Check certificate details
|
||||||
|
kubectl describe certificate checkmate-client-tls
|
||||||
|
kubectl describe certificate checkmate-server-tls
|
||||||
|
|
||||||
|
# Verify the secrets were created
|
||||||
|
kubectl get secrets | grep checkmate-tls
|
||||||
|
```
|
||||||
|
|
||||||
|
The ingress will automatically use these secrets to enable HTTPS access to your Checkmate instance.
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: checkmate-client
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: checkmate-client
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: checkmate-client
|
||||||
|
spec:
|
||||||
|
{{- with .Values.client.affinity }}
|
||||||
|
affinity:
|
||||||
|
{{- tpl ( . | toYaml) $ | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Values.client.tolerations }}
|
||||||
|
tolerations:
|
||||||
|
{{- tpl ( . | toYaml) $ | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
containers:
|
||||||
|
- name: client
|
||||||
|
image: {{ .Values.client.image }}
|
||||||
|
ports:
|
||||||
|
- containerPort: {{ .Values.client.port }}
|
||||||
|
env:
|
||||||
|
- name: UPTIME_APP_API_BASE_URL
|
||||||
|
value: "{{ .Values.server.protocol }}://{{ .Values.server.ingress.host }}/api/v1"
|
||||||
|
- name: UPTIME_APP_CLIENT_HOST
|
||||||
|
value: "{{ .Values.client.protocol }}://{{ .Values.client.ingress.host }}"
|
||||||
|
volumeMounts:
|
||||||
|
- name: config-volume
|
||||||
|
mountPath: /etc/nginx/conf.d/default.conf
|
||||||
|
subPath: default.conf
|
||||||
|
{{- with .Values.client.resources }}
|
||||||
|
resources:
|
||||||
|
{{- tpl ( . | toYaml) $ | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
volumes:
|
||||||
|
- name: config-volume
|
||||||
|
configMap:
|
||||||
|
name: checkmate-server-nginx-cm
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
{{- if .Values.client.ingress.enabled }}
|
||||||
|
apiVersion: networking.k8s.io/v1
|
||||||
|
kind: Ingress
|
||||||
|
metadata:
|
||||||
|
name: checkmate-client-ingress
|
||||||
|
{{- if .Values.client.ingress.annotations }}
|
||||||
|
annotations:
|
||||||
|
{{- range $key, $value := .Values.client.ingress.annotations }}
|
||||||
|
{{ $key }}: {{ $value | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
ingressClassName: {{ .Values.client.ingress.className }}
|
||||||
|
{{- if .Values.client.ingress.tls.enabled }}
|
||||||
|
tls:
|
||||||
|
- hosts:
|
||||||
|
- {{ .Values.client.ingress.host }}
|
||||||
|
secretName: {{ default (printf "%s-client-tls" .Release.Name) .Values.client.ingress.tls.secretName }}
|
||||||
|
{{- end }}
|
||||||
|
rules:
|
||||||
|
- host: {{ .Values.client.ingress.host }}
|
||||||
|
http:
|
||||||
|
paths:
|
||||||
|
- path: /
|
||||||
|
pathType: Prefix
|
||||||
|
backend:
|
||||||
|
service:
|
||||||
|
name: checkmate-client
|
||||||
|
port:
|
||||||
|
number: {{ .Values.client.port }}
|
||||||
|
{{- end }}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: checkmate-client
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
app: checkmate-client
|
||||||
|
ports:
|
||||||
|
- port: {{ .Values.client.port }}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: checkmate-mongodb
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
app: checkmate-mongodb
|
||||||
|
ports:
|
||||||
|
- port: {{ .Values.mongodb.port }}
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: StatefulSet
|
||||||
|
metadata:
|
||||||
|
name: checkmate-mongodb
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: checkmate-mongodb
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: checkmate-mongodb
|
||||||
|
spec:
|
||||||
|
{{- with .Values.mongodb.affinity }}
|
||||||
|
affinity:
|
||||||
|
{{- tpl ( . | toYaml) $ | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Values.mongodb.tolerations }}
|
||||||
|
tolerations:
|
||||||
|
{{- tpl ( . | toYaml) $ | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
containers:
|
||||||
|
- name: mongodb
|
||||||
|
image: {{ .Values.mongodb.image }}
|
||||||
|
ports:
|
||||||
|
- containerPort: {{ .Values.mongodb.port }}
|
||||||
|
command: ["mongod", "--quiet", "--bind_ip_all"]
|
||||||
|
volumeMounts:
|
||||||
|
- name: checkmate-mongo-persistent-storage
|
||||||
|
mountPath: /data/db
|
||||||
|
{{- with .Values.mongodb.resources }}
|
||||||
|
resources:
|
||||||
|
{{- tpl ( . | toYaml) $ | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
volumeClaimTemplates:
|
||||||
|
- metadata:
|
||||||
|
name: checkmate-mongo-persistent-storage
|
||||||
|
spec:
|
||||||
|
storageClassName: {{ .Values.persistence.mongo.storageClass | quote }}
|
||||||
|
accessModes: ["ReadWriteOnce"]
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: {{ .Values.persistence.mongo.size | default "5Gi" | quote }}
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
{{- if eq .Values.client.ingress.host "change_me" }}
|
||||||
|
{{- fail "client.ingress.host must be overridden and not set to 'change_me'" }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{- if eq .Values.server.ingress.host "change_me" }}
|
||||||
|
{{- fail "server.ingress.host must be overridden and not set to 'change_me'" }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{- $serverProtocol := .Values.server.protocol }}
|
||||||
|
{{- if not (or (eq $serverProtocol "http") (eq $serverProtocol "https")) }}
|
||||||
|
{{- fail "server.protocol must be either 'http' or 'https'" }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{- $clientProtocol := .Values.client.protocol }}
|
||||||
|
{{- if not (or (eq $clientProtocol "http") (eq $clientProtocol "https")) }}
|
||||||
|
{{- fail "client.protocol must be either 'http' or 'https'" }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{/* Enforce protocol when TLS is enabled to avoid mixed-content */}}
|
||||||
|
{{- if and .Values.client.ingress.tls.enabled (ne $clientProtocol "https") }}
|
||||||
|
{{- fail "client.ingress.tls.enabled is true but client.protocol is not 'https'. Set client.protocol: https to avoid mixed content." }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{- if and .Values.server.ingress.tls.enabled (ne $serverProtocol "https") }}
|
||||||
|
{{- fail "server.ingress.tls.enabled is true but server.protocol is not 'https'. Set server.protocol: https to ensure correct API base URL." }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{/* If client runs on https, API must also be https to avoid mixed content */}}
|
||||||
|
{{- if and (eq $clientProtocol "https") (ne $serverProtocol "https") }}
|
||||||
|
{{- fail "client.protocol is 'https' but server.protocol is not. Set server.protocol: https to prevent browser mixed-content issues." }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{/* Fail early if TLS enabled without cert-manager annotations (cluster-issuer or issuer) */}}
|
||||||
|
{{- $cAnn := .Values.client.ingress.annotations | default dict }}
|
||||||
|
{{- $sAnn := .Values.server.ingress.annotations | default dict }}
|
||||||
|
|
||||||
|
{{- $clientHasIssuer := or (hasKey $cAnn "cert-manager.io/cluster-issuer") (hasKey $cAnn "cert-manager.io/issuer") }}
|
||||||
|
{{- $serverHasIssuer := or (hasKey $sAnn "cert-manager.io/cluster-issuer") (hasKey $sAnn "cert-manager.io/issuer") }}
|
||||||
|
|
||||||
|
{{- if and .Values.client.ingress.tls.enabled (not $clientHasIssuer) }}
|
||||||
|
{{- fail "client.ingress.tls.enabled is true but no cert-manager issuer annotation found. Add 'cert-manager.io/cluster-issuer' or 'cert-manager.io/issuer'." }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{- if and .Values.server.ingress.tls.enabled (not $serverHasIssuer) }}
|
||||||
|
{{- fail "server.ingress.tls.enabled is true but no cert-manager issuer annotation found. Add 'cert-manager.io/cluster-issuer' or 'cert-manager.io/issuer'." }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{/* Secret name can be omitted; we default to <release>-client|server-tls in templates */}}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
{{- if .Values.redis.enabled }}
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: checkmate-redis
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
app: checkmate-redis
|
||||||
|
ports:
|
||||||
|
- port: {{ .Values.redis.port }}
|
||||||
|
{{- end }}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
{{- if .Values.redis.enabled }}
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: StatefulSet
|
||||||
|
metadata:
|
||||||
|
name: checkmate-redis
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: checkmate-redis
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: checkmate-redis
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: redis
|
||||||
|
image: {{ .Values.redis.image }}
|
||||||
|
ports:
|
||||||
|
- containerPort: {{ .Values.redis.port }}
|
||||||
|
volumeMounts:
|
||||||
|
- name: redis-data
|
||||||
|
mountPath: /data
|
||||||
|
volumeClaimTemplates:
|
||||||
|
- metadata:
|
||||||
|
name: checkmate-redis-persistent-storage
|
||||||
|
spec:
|
||||||
|
storageClassName: {{ .Values.persistence.redis.storageClass | quote }}
|
||||||
|
accessModes: ["ReadWriteOnce"]
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: {{ .Values.persistence.redis.size | default "1Gi" | quote }}
|
||||||
|
{{- end }}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
{{- $secrets := .Values.secrets }}
|
||||||
|
|
||||||
|
{{- if or (not $secrets.JWT_SECRET) (eq $secrets.JWT_SECRET "change_me") }}
|
||||||
|
{{- fail "secrets.JWT_SECRET must be overridden and cannot be 'change_me'" }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Secret
|
||||||
|
metadata:
|
||||||
|
name: checkmate-secrets
|
||||||
|
type: Opaque
|
||||||
|
stringData:
|
||||||
|
{{- range $key, $value := $secrets }}
|
||||||
|
{{ $key }}: {{ $value | quote }}
|
||||||
|
{{- end }}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: checkmate-server
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: checkmate-server
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: checkmate-server
|
||||||
|
spec:
|
||||||
|
{{- with .Values.server.affinity }}
|
||||||
|
affinity:
|
||||||
|
{{- tpl ( . | toYaml) $ | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Values.server.tolerations }}
|
||||||
|
tolerations:
|
||||||
|
{{- tpl ( . | toYaml) $ | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
containers:
|
||||||
|
- name: server
|
||||||
|
image: {{ .Values.server.image }}
|
||||||
|
ports:
|
||||||
|
- containerPort: {{ .Values.server.port }}
|
||||||
|
envFrom:
|
||||||
|
- secretRef:
|
||||||
|
name: checkmate-secrets
|
||||||
|
{{- with .Values.server.resources }}
|
||||||
|
resources:
|
||||||
|
{{- tpl ( . | toYaml) $ | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
env:
|
||||||
|
- name: CLIENT_HOST
|
||||||
|
value: "{{ .Values.client.protocol }}://{{ .Values.client.ingress.host }}"
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
{{- if .Values.server.ingress.enabled }}
|
||||||
|
apiVersion: networking.k8s.io/v1
|
||||||
|
kind: Ingress
|
||||||
|
metadata:
|
||||||
|
name: checkmate-server-ingress
|
||||||
|
{{- if .Values.server.ingress.annotations }}
|
||||||
|
annotations:
|
||||||
|
{{- range $key, $value := .Values.server.ingress.annotations }}
|
||||||
|
{{ $key }}: {{ $value | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{/*#annotations:
|
||||||
|
#nginx.ingress.kubernetes.io/rewrite-target: /
|
||||||
|
#nginx.ingress.kubernetes.io/enable-cors: "true"
|
||||||
|
#nginx.ingress.kubernetes.io/cors-allow-origin: "http://{{ .Values.client.ingress.host }},https://{{ .Values.client.ingress.host }}"
|
||||||
|
#nginx.ingress.kubernetes.io/cors-allow-methods: "GET, PUT, POST, DELETE, PATCH, OPTIONS"
|
||||||
|
#nginx.ingress.kubernetes.io/cors-allow-headers: "DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,Authorization"
|
||||||
|
#nginx.ingress.kubernetes.io/cors-allow-credentials: "true"*/}}
|
||||||
|
spec:
|
||||||
|
ingressClassName: {{ .Values.server.ingress.className }}
|
||||||
|
{{- if .Values.server.ingress.tls.enabled }}
|
||||||
|
tls:
|
||||||
|
- hosts:
|
||||||
|
- {{ .Values.server.ingress.host }}
|
||||||
|
secretName: {{ default (printf "%s-server-tls" .Release.Name) .Values.server.ingress.tls.secretName }}
|
||||||
|
{{- end }}
|
||||||
|
rules:
|
||||||
|
- host: {{ .Values.server.ingress.host }}
|
||||||
|
http:
|
||||||
|
paths:
|
||||||
|
- path: /api/v1
|
||||||
|
pathType: Prefix
|
||||||
|
backend:
|
||||||
|
service:
|
||||||
|
name: checkmate-server
|
||||||
|
port:
|
||||||
|
number: {{ .Values.server.port }}
|
||||||
|
{{- end }}
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: checkmate-server-nginx-cm
|
||||||
|
data:
|
||||||
|
default.conf: |
|
||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
listen [::]:80;
|
||||||
|
|
||||||
|
server_name checkmate-demo.bluewavelabs.ca;
|
||||||
|
server_tokens off;
|
||||||
|
|
||||||
|
location /.well-known/acme-challenge/ {
|
||||||
|
root /var/www/certbot;
|
||||||
|
}
|
||||||
|
|
||||||
|
location / {
|
||||||
|
root /usr/share/nginx/html;
|
||||||
|
index index.html index.htm;
|
||||||
|
try_files $uri $uri/ /index.html;
|
||||||
|
}
|
||||||
|
|
||||||
|
# location /api/ {
|
||||||
|
# proxy_pass http://{{ .Values.server.ingress.host }}:5000/api/;
|
||||||
|
# proxy_http_version 1.1;
|
||||||
|
# proxy_set_header Host $host;
|
||||||
|
# proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
# proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
|
# }
|
||||||
|
|
||||||
|
location /api-docs/ {
|
||||||
|
proxy_pass http://{{ .Values.server.ingress.host }}:5000/api-docs/;
|
||||||
|
proxy_http_version 1.1;
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: checkmate-server
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
app: checkmate-server
|
||||||
|
ports:
|
||||||
|
- port: {{ .Values.server.port }}
|
||||||
@@ -0,0 +1,70 @@
|
|||||||
|
client:
|
||||||
|
image: ghcr.io/bluewave-labs/checkmate-client:v3.2.0
|
||||||
|
port: 80
|
||||||
|
protocol: http
|
||||||
|
ingress:
|
||||||
|
enabled: true
|
||||||
|
host: change_me
|
||||||
|
className: nginx
|
||||||
|
annotations: {}
|
||||||
|
# Example annotations for cert-manager:
|
||||||
|
# annotations:
|
||||||
|
# cert-manager.io/cluster-issuer: "letsencrypt-prod"
|
||||||
|
tls:
|
||||||
|
enabled: false
|
||||||
|
# secretName: {{ .Release.Name }}-client-tls # Optional; defaults to <release>-client-tls if omitted
|
||||||
|
# Note: when enabling TLS, also set client.protocol: https and add
|
||||||
|
# a cert-manager issuer annotation (e.g. cert-manager.io/cluster-issuer: "letsencrypt-prod").
|
||||||
|
# The secret will be automatically created by cert-manager when using the cert-manager.io/cluster-issuer annotation
|
||||||
|
|
||||||
|
server:
|
||||||
|
image: ghcr.io/bluewave-labs/checkmate-backend:v3.2.0
|
||||||
|
port: 52345
|
||||||
|
protocol: http
|
||||||
|
ingress:
|
||||||
|
enabled: true
|
||||||
|
host: change_me
|
||||||
|
className: nginx
|
||||||
|
annotations: {}
|
||||||
|
# Example annotations for cert-manager:
|
||||||
|
# annotations:
|
||||||
|
# cert-manager.io/cluster-issuer: "letsencrypt-prod"
|
||||||
|
tls:
|
||||||
|
enabled: false
|
||||||
|
# secretName: {{ .Release.Name }}-server-tls # Optional; defaults to <release>-server-tls if omitted
|
||||||
|
# Note: when enabling TLS, also set server.protocol: https and add
|
||||||
|
# a cert-manager issuer annotation (e.g. cert-manager.io/cluster-issuer: "letsencrypt-prod").
|
||||||
|
# The secret will be automatically created by cert-manager when using the cert-manager.io/cluster-issuer annotation
|
||||||
|
|
||||||
|
redis:
|
||||||
|
enabled: false
|
||||||
|
image: redis:7.2
|
||||||
|
port: 6379
|
||||||
|
|
||||||
|
mongodb:
|
||||||
|
image: ghcr.io/bluewave-labs/checkmate-mongo:v3.2.0
|
||||||
|
port: 27017
|
||||||
|
|
||||||
|
secrets:
|
||||||
|
JWT_SECRET: change_me
|
||||||
|
# REFRESH_TOKEN_SECRET: change_me
|
||||||
|
# SYSTEM_EMAIL_ADDRESS: test@example.com
|
||||||
|
# SYSTEM_EMAIL_PASSWORD: change_me
|
||||||
|
# SYSTEM_EMAIL_HOST: smtp.example.com
|
||||||
|
# SYSTEM_EMAIL_PORT: "587"
|
||||||
|
# PAGESPEED_API_KEY: change_me
|
||||||
|
DB_CONNECTION_STRING: mongodb://checkmate-mongodb.namespace.svc:27017/uptime_db
|
||||||
|
CLIENT_HOST: change_me
|
||||||
|
# REDIS_HOST: redis
|
||||||
|
# REDIS_PORT: "6379"
|
||||||
|
# DB_TYPE: MongoDB
|
||||||
|
# TOKEN_TTL: 99d
|
||||||
|
# REFRESH_TOKEN_TTL: 99d
|
||||||
|
|
||||||
|
persistence:
|
||||||
|
mongo:
|
||||||
|
size: 5Gi
|
||||||
|
storageClass: ""
|
||||||
|
redis:
|
||||||
|
size: 1Gi
|
||||||
|
storageClass: ""
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
VITE_APP_API_BASE_URL=UPTIME_APP_API_BASE_URL
|
VITE_APP_API_BASE_URL=UPTIME_APP_API_BASE_URL
|
||||||
|
VITE_APP_API_V2_BASE_URL=UPTIME_APP_API_V2_BASE_URL
|
||||||
VITE_APP_CLIENT_HOST=UPTIME_APP_CLIENT_HOST
|
VITE_APP_CLIENT_HOST=UPTIME_APP_CLIENT_HOST
|
||||||
VITE_APP_LOG_LEVEL=UPTIME_APP_LOG_LEVEL
|
VITE_APP_LOG_LEVEL=UPTIME_APP_LOG_LEVEL
|
||||||
@@ -29,3 +29,4 @@ dist-ssr
|
|||||||
# Scripts
|
# Scripts
|
||||||
*.sh
|
*.sh
|
||||||
!env.sh
|
!env.sh
|
||||||
|
.env.development
|
||||||
+1
-1
@@ -18,7 +18,7 @@
|
|||||||
<div id="root"></div>
|
<div id="root"></div>
|
||||||
<script
|
<script
|
||||||
type="module"
|
type="module"
|
||||||
src="/src/main.jsx"
|
src="/src/main.tsx"
|
||||||
></script>
|
></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
Generated
+1273
-1742
File diff suppressed because it is too large.
Load diff
+24
-22
@@ -5,32 +5,40 @@
|
|||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
"build": "vite build",
|
"build": "tsc -b && vite build",
|
||||||
"build-dev": "vite build --mode development",
|
"build-dev": "tsc -b && vite build --mode development",
|
||||||
"lint": "eslint . --ext js,jsx --report-unused-disable-directives --max-warnings 0",
|
"lint": "eslint . --ext js,jsx --report-unused-disable-directives --max-warnings 0",
|
||||||
"preview": "vite preview",
|
"preview": "vite preview",
|
||||||
"format": "prettier --write .",
|
"format": "prettier --write .",
|
||||||
"format-check": "prettier --check ."
|
"format-check": "prettier --check ."
|
||||||
},
|
},
|
||||||
|
"lint-staged": {
|
||||||
|
"**/*": "npm run format"
|
||||||
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@emotion/react": "^11.13.3",
|
"@emotion/react": "^11.13.3",
|
||||||
"@emotion/styled": "^11.13.0",
|
"@emotion/styled": "^11.13.0",
|
||||||
"@hello-pangea/dnd": "^18.0.0",
|
"@hello-pangea/dnd": "^18.0.0",
|
||||||
"@mui/icons-material": "6.4.11",
|
"@hookform/resolvers": "5.2.2",
|
||||||
"@mui/lab": "6.0.0-dev.240424162023-9968b4889d",
|
"@mui/lab": "7.0.0",
|
||||||
"@mui/material": "6.4.11",
|
"@mui/material": "7.3.7",
|
||||||
"@mui/x-charts": "^7.5.1",
|
"@mui/x-charts": "7.29.1",
|
||||||
"@mui/x-date-pickers": "7.29.0",
|
"@mui/x-date-pickers": "7.29.4",
|
||||||
"@reduxjs/toolkit": "2.7.0",
|
"@reduxjs/toolkit": "2.7.0",
|
||||||
"axios": "^1.7.4",
|
"axios": "^1.7.4",
|
||||||
"dayjs": "1.11.13",
|
"dayjs": "1.11.13",
|
||||||
"flag-icons": "7.3.2",
|
"flag-icons": "7.3.2",
|
||||||
"html2canvas": "^1.4.1",
|
"html2canvas": "^1.4.1",
|
||||||
"i18next": "^24.2.2",
|
"human-interval": "2.0.1",
|
||||||
|
"i18next": "25.4.2",
|
||||||
"joi": "17.13.3",
|
"joi": "17.13.3",
|
||||||
"mui-color-input": "^6.0.0",
|
"lucide-react": "^0.562.0",
|
||||||
|
"mui-color-input": "^7.0.0",
|
||||||
|
"pretty-bytes": "^7.1.0",
|
||||||
|
"pretty-ms": "^9.3.0",
|
||||||
"react": "18.3.1",
|
"react": "18.3.1",
|
||||||
"react-dom": "^18.2.0",
|
"react-dom": "^18.2.0",
|
||||||
|
"react-hook-form": "^7.63.0",
|
||||||
"react-i18next": "^15.4.0",
|
"react-i18next": "^15.4.0",
|
||||||
"react-icons": "5.5.0",
|
"react-icons": "5.5.0",
|
||||||
"react-redux": "9.2.0",
|
"react-redux": "9.2.0",
|
||||||
@@ -39,17 +47,12 @@
|
|||||||
"react-toastify": "^10.0.5",
|
"react-toastify": "^10.0.5",
|
||||||
"recharts": "2.15.2",
|
"recharts": "2.15.2",
|
||||||
"redux-persist": "6.0.0",
|
"redux-persist": "6.0.0",
|
||||||
"vite-plugin-svgr": "^4.2.0"
|
"swr": "^2.3.6",
|
||||||
},
|
"vite-plugin-svgr": "^4.2.0",
|
||||||
"unusedDepencies": {
|
"zod": "^4.1.11"
|
||||||
"@solana/wallet-adapter-base": "0.9.25",
|
|
||||||
"@solana/wallet-adapter-material-ui": "0.16.35",
|
|
||||||
"@solana/wallet-adapter-react": "0.15.37",
|
|
||||||
"@solana/wallet-adapter-react-ui": "0.9.37",
|
|
||||||
"@solana/wallet-adapter-wallets": "0.19.34",
|
|
||||||
"@solana/web3.js": "1.98.0"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@types/node": "24.5.2",
|
||||||
"@types/react": "^18.2.66",
|
"@types/react": "^18.2.66",
|
||||||
"@types/react-dom": "^18.2.22",
|
"@types/react-dom": "^18.2.22",
|
||||||
"@vitejs/plugin-react": "^4.2.1",
|
"@vitejs/plugin-react": "^4.2.1",
|
||||||
@@ -57,10 +60,9 @@
|
|||||||
"eslint-plugin-react": "^7.34.1",
|
"eslint-plugin-react": "^7.34.1",
|
||||||
"eslint-plugin-react-hooks": "^5.0.0",
|
"eslint-plugin-react-hooks": "^5.0.0",
|
||||||
"eslint-plugin-react-refresh": "^0.4.6",
|
"eslint-plugin-react-refresh": "^0.4.6",
|
||||||
|
"lint-staged": "^16.2.7",
|
||||||
"prettier": "^3.3.3",
|
"prettier": "^3.3.3",
|
||||||
"vite": "6.3.5"
|
"typescript": "5.9.3",
|
||||||
},
|
"vite": "6.3.6"
|
||||||
"optionalDependencies": {
|
|
||||||
"@rollup/rollup-linux-arm64-musl": "4.41.0"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,41 +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 WalletProvider from "./Components/WalletProvider";
|
|
||||||
import AppLayout from "./Components/Layouts/AppLayout";
|
|
||||||
|
|
||||||
function App() {
|
|
||||||
const mode = useSelector((state) => state.ui.mode);
|
|
||||||
|
|
||||||
// Cleanup
|
|
||||||
useEffect(() => {
|
|
||||||
return () => {
|
|
||||||
logger.cleanup();
|
|
||||||
networkService.cleanup();
|
|
||||||
};
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
return (
|
|
||||||
/* Extract Themeprovider, baseline and global styles to Styles */
|
|
||||||
<ThemeProvider theme={mode === "light" ? lightTheme : darkTheme}>
|
|
||||||
<WalletProvider>
|
|
||||||
<CssBaseline />
|
|
||||||
|
|
||||||
<AppLayout>
|
|
||||||
<Routes />
|
|
||||||
</AppLayout>
|
|
||||||
<ToastContainer />
|
|
||||||
</WalletProvider>
|
|
||||||
</ThemeProvider>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
export default App;
|
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
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 lightTheme from "./Utils/Theme/lightTheme";
|
||||||
|
import darkTheme from "./Utils/Theme/darkTheme";
|
||||||
|
import { CssBaseline, GlobalStyles } from "@mui/material";
|
||||||
|
import { Routes } from "./Routes";
|
||||||
|
import AppLayout from "@/Components/v2/layout/AppLayout";
|
||||||
|
import type { RootState } from "@/Types/state";
|
||||||
|
|
||||||
|
function App() {
|
||||||
|
const mode = useSelector((state: RootState) => state.ui.mode);
|
||||||
|
|
||||||
|
const theme = mode === "light" ? lightTheme : darkTheme;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<ThemeProvider theme={theme}>
|
||||||
|
<CssBaseline />
|
||||||
|
<GlobalStyles
|
||||||
|
styles={{
|
||||||
|
body: {
|
||||||
|
// @ts-ignore
|
||||||
|
backgroundColor: theme.palette.background.main,
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<AppLayout>
|
||||||
|
<Routes />
|
||||||
|
</AppLayout>
|
||||||
|
<ToastContainer
|
||||||
|
newestOnTop={true}
|
||||||
|
theme={mode}
|
||||||
|
style={
|
||||||
|
{
|
||||||
|
"--toastify-color-progress-light": "#7C8BA1",
|
||||||
|
"--toastify-color-progress-dark": "#7C8BA1",
|
||||||
|
} as CSSProperties
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</ThemeProvider>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default App;
|
||||||
@@ -1,224 +0,0 @@
|
|||||||
// Components
|
|
||||||
import IconButton from "@mui/material/IconButton";
|
|
||||||
import Menu from "@mui/material/Menu";
|
|
||||||
import MenuItem from "@mui/material/MenuItem";
|
|
||||||
import Settings from "../../assets/icons/settings-bold.svg?react";
|
|
||||||
import Dialog from "../../Components/Dialog";
|
|
||||||
|
|
||||||
// Utils
|
|
||||||
import { useState } from "react";
|
|
||||||
import { useTheme } from "@emotion/react";
|
|
||||||
import { useNavigate } from "react-router-dom";
|
|
||||||
import { createToast } from "../../Utils/toastUtils";
|
|
||||||
|
|
||||||
import PropTypes from "prop-types";
|
|
||||||
import { usePauseMonitor, useDeleteMonitor } from "../../Hooks/monitorHooks";
|
|
||||||
|
|
||||||
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,
|
|
||||||
},
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Settings />
|
|
||||||
</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) => {
|
|
||||||
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;
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
.alert {
|
|
||||||
margin: 0;
|
|
||||||
width: fit-content;
|
|
||||||
}
|
|
||||||
.alert,
|
|
||||||
.alert button,
|
|
||||||
.alert .MuiTypography-root {
|
|
||||||
font-size: var(--env-var-font-size-medium);
|
|
||||||
}
|
|
||||||
@@ -1,127 +0,0 @@
|
|||||||
import PropTypes from "prop-types";
|
|
||||||
import { useTheme } from "@emotion/react";
|
|
||||||
import { Box, Button, IconButton, Stack, Typography } from "@mui/material";
|
|
||||||
import InfoOutlinedIcon from "@mui/icons-material/InfoOutlined";
|
|
||||||
import ErrorOutlineOutlinedIcon from "@mui/icons-material/ErrorOutlineOutlined";
|
|
||||||
import WarningAmberOutlinedIcon from "@mui/icons-material/WarningAmberOutlined";
|
|
||||||
import CloseIcon from "@mui/icons-material/Close";
|
|
||||||
import "./index.css";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Icons mapping for different alert variants.
|
|
||||||
* @type {Object<string, JSX.Element>}
|
|
||||||
*/
|
|
||||||
|
|
||||||
const icons = {
|
|
||||||
info: <InfoOutlinedIcon />,
|
|
||||||
error: <ErrorOutlineOutlinedIcon />,
|
|
||||||
warning: <WarningAmberOutlinedIcon />,
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @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",
|
|
||||||
},
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<CloseIcon
|
|
||||||
sx={{
|
|
||||||
fontSize: "20px",
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</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,71 +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 }) => {
|
|
||||||
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
|
|
||||||
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,
|
|
||||||
};
|
|
||||||
|
|
||||||
export default Avatar;
|
|
||||||
@@ -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";
|
|
||||||
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;
|
|
||||||
@@ -1,181 +0,0 @@
|
|||||||
import { useTheme } from "@emotion/react";
|
|
||||||
import { Box, Stack, Tooltip, Typography } from "@mui/material";
|
|
||||||
import { formatDateWithTz } from "../../../Utils/timeUtils";
|
|
||||||
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} // CAIO_REVIEW
|
|
||||||
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;
|
|
||||||
@@ -1,106 +0,0 @@
|
|||||||
// Components
|
|
||||||
import { Typography, Stack } from "@mui/material";
|
|
||||||
import PropTypes from "prop-types";
|
|
||||||
import { useTheme } from "@emotion/react";
|
|
||||||
import IconBox from "../../IconBox";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* `EmptyView` is a functional React component that displays an empty state view with an optional icon, header, and message.
|
|
||||||
*
|
|
||||||
* @component
|
|
||||||
* @param {Object} props - The properties that define the `EmptyView` component.
|
|
||||||
* @param {React.ReactNode} [props.icon] - An optional icon to display at the top of the empty view.
|
|
||||||
* @param {string} [props.header] - An optional header text displayed next to the icon.
|
|
||||||
* @param {string} [props.message="No Data"] - The message to be displayed in the empty view.
|
|
||||||
* @param {'h1' | 'h2' | 'h3'} [props.headingLevel="h2"] - The heading level for the message text.
|
|
||||||
* @param {string} [props.justifyContent="flex-start"] - The CSS `justify-content` value to align elements vertically.
|
|
||||||
* @param {string} [props.height="100%"] - The height of the empty view container.
|
|
||||||
*
|
|
||||||
* @example
|
|
||||||
* // Example usage of EmptyView component:
|
|
||||||
* <EmptyView
|
|
||||||
* icon={<SomeIcon />}
|
|
||||||
* header="Average Response Time"
|
|
||||||
* message="No Response Time Available"
|
|
||||||
* headingLevel="h2"
|
|
||||||
* justifyContent="center"
|
|
||||||
* height="50%"
|
|
||||||
* />
|
|
||||||
*
|
|
||||||
* @returns {React.Element} The `EmptyView` component with customizable icon, header, and message.
|
|
||||||
*/
|
|
||||||
|
|
||||||
const EmptyView = ({
|
|
||||||
icon,
|
|
||||||
header,
|
|
||||||
message = "No Data",
|
|
||||||
headingLevel = "h2",
|
|
||||||
justifyContent = "flex-start",
|
|
||||||
height = "100%",
|
|
||||||
}) => {
|
|
||||||
const theme = useTheme();
|
|
||||||
return (
|
|
||||||
<Stack
|
|
||||||
flex={1}
|
|
||||||
direction="row"
|
|
||||||
sx={{
|
|
||||||
backgroundColor: theme.palette.primary.main,
|
|
||||||
|
|
||||||
border: 1,
|
|
||||||
borderStyle: "solid",
|
|
||||||
borderColor: theme.palette.primary.lowContrast,
|
|
||||||
borderRadius: 2,
|
|
||||||
borderTopRightRadius: 4,
|
|
||||||
borderBottomRightRadius: 4,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Stack
|
|
||||||
flex={1}
|
|
||||||
alignItems="center"
|
|
||||||
sx={{
|
|
||||||
padding: theme.spacing(8),
|
|
||||||
justifyContent,
|
|
||||||
gap: theme.spacing(8),
|
|
||||||
height,
|
|
||||||
"& h2": {
|
|
||||||
color: theme.palette.primary.contrastTextSecondary,
|
|
||||||
fontSize: 15,
|
|
||||||
fontWeight: 500,
|
|
||||||
},
|
|
||||||
|
|
||||||
"& tspan, & text": {
|
|
||||||
fill: theme.palette.primary.contrastTextTertiary,
|
|
||||||
},
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Stack
|
|
||||||
alignSelf="flex-start"
|
|
||||||
direction="row"
|
|
||||||
alignItems="center"
|
|
||||||
gap={theme.spacing(6)}
|
|
||||||
>
|
|
||||||
{icon && <IconBox>{icon}</IconBox>}
|
|
||||||
{header && <Typography component="h2">{header}</Typography>}
|
|
||||||
</Stack>
|
|
||||||
<Stack
|
|
||||||
flex={1}
|
|
||||||
justifyContent="center"
|
|
||||||
alignItems="center"
|
|
||||||
>
|
|
||||||
<Typography component={headingLevel}>{message}</Typography>
|
|
||||||
</Stack>
|
|
||||||
</Stack>
|
|
||||||
</Stack>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
EmptyView.propTypes = {
|
|
||||||
message: PropTypes.string,
|
|
||||||
icon: PropTypes.node,
|
|
||||||
header: PropTypes.string,
|
|
||||||
headingLevel: PropTypes.oneOf(["h1", "h2", "h3"]),
|
|
||||||
justifyContent: PropTypes.string,
|
|
||||||
height: PropTypes.string,
|
|
||||||
};
|
|
||||||
|
|
||||||
export default EmptyView;
|
|
||||||
@@ -1,104 +0,0 @@
|
|||||||
import { Stack, Typography } from "@mui/material";
|
|
||||||
import { useTheme } from "@emotion/react";
|
|
||||||
import IconBox from "../../IconBox";
|
|
||||||
import EmptyView from "./EmptyView";
|
|
||||||
import PropTypes from "prop-types";
|
|
||||||
|
|
||||||
const ChartBox = ({
|
|
||||||
children,
|
|
||||||
icon,
|
|
||||||
header,
|
|
||||||
height = "300px",
|
|
||||||
justifyContent = "space-between",
|
|
||||||
Legend,
|
|
||||||
borderRadiusRight = 4,
|
|
||||||
sx,
|
|
||||||
noDataMessage,
|
|
||||||
isEmpty = false,
|
|
||||||
}) => {
|
|
||||||
const theme = useTheme();
|
|
||||||
if (isEmpty) {
|
|
||||||
return (
|
|
||||||
<EmptyView
|
|
||||||
icon={icon}
|
|
||||||
header={header}
|
|
||||||
message={noDataMessage}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
return (
|
|
||||||
<Stack
|
|
||||||
flex={1}
|
|
||||||
direction="row"
|
|
||||||
sx={{
|
|
||||||
backgroundColor: theme.palette.primary.main,
|
|
||||||
|
|
||||||
border: 1,
|
|
||||||
borderStyle: "solid",
|
|
||||||
borderColor: theme.palette.primary.lowContrast,
|
|
||||||
borderRadius: 2,
|
|
||||||
borderTopRightRadius: borderRadiusRight,
|
|
||||||
borderBottomRightRadius: borderRadiusRight,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Stack
|
|
||||||
flex={1}
|
|
||||||
sx={{
|
|
||||||
padding: theme.spacing(8),
|
|
||||||
justifyContent,
|
|
||||||
gap: theme.spacing(8),
|
|
||||||
height,
|
|
||||||
minWidth: 250,
|
|
||||||
"& h2": {
|
|
||||||
color: theme.palette.primary.contrastTextSecondary,
|
|
||||||
fontSize: 15,
|
|
||||||
fontWeight: 500,
|
|
||||||
},
|
|
||||||
"& .MuiBox-root:not(.area-tooltip) p": {
|
|
||||||
color: theme.palette.primary.contrastTextTertiary,
|
|
||||||
fontSize: 13,
|
|
||||||
},
|
|
||||||
"& .MuiBox-root > span": {
|
|
||||||
color: theme.palette.primary.contrastText,
|
|
||||||
fontSize: 20,
|
|
||||||
"& span": {
|
|
||||||
opacity: 0.8,
|
|
||||||
marginLeft: 2,
|
|
||||||
fontSize: 15,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
"& tspan, & text": {
|
|
||||||
fill: theme.palette.primary.contrastTextTertiary,
|
|
||||||
},
|
|
||||||
"& path": {
|
|
||||||
transition: "fill 300ms ease, stroke-width 400ms ease",
|
|
||||||
},
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Stack
|
|
||||||
alignSelf="flex-start"
|
|
||||||
direction="row"
|
|
||||||
alignItems="center"
|
|
||||||
gap={theme.spacing(6)}
|
|
||||||
>
|
|
||||||
{icon && <IconBox>{icon}</IconBox>}
|
|
||||||
{header && <Typography component="h2">{header}</Typography>}
|
|
||||||
</Stack>
|
|
||||||
{children}
|
|
||||||
</Stack>
|
|
||||||
{Legend && Legend}
|
|
||||||
</Stack>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default ChartBox;
|
|
||||||
|
|
||||||
ChartBox.propTypes = {
|
|
||||||
children: PropTypes.node,
|
|
||||||
icon: PropTypes.node,
|
|
||||||
header: PropTypes.string,
|
|
||||||
height: PropTypes.string,
|
|
||||||
noDataMessage: PropTypes.string,
|
|
||||||
isEmpty: PropTypes.bool,
|
|
||||||
};
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
.radial-chart {
|
|
||||||
position: relative;
|
|
||||||
display: inline-block;
|
|
||||||
}
|
|
||||||
|
|
||||||
.radial-chart-base {
|
|
||||||
opacity: 0.3;
|
|
||||||
}
|
|
||||||
|
|
||||||
.radial-chart-progress {
|
|
||||||
transform: rotate(-90deg);
|
|
||||||
transform-origin: center;
|
|
||||||
transition: stroke-dashoffset 1.5s ease-in-out;
|
|
||||||
}
|
|
||||||
@@ -1,119 +0,0 @@
|
|||||||
import { useTheme } from "@emotion/react";
|
|
||||||
import { useEffect, useState, useMemo } from "react";
|
|
||||||
import { Box, Typography } from "@mui/material";
|
|
||||||
import PropTypes from "prop-types";
|
|
||||||
import "./index.css";
|
|
||||||
|
|
||||||
const MINIMUM_VALUE = 0;
|
|
||||||
const MAXIMUM_VALUE = 100;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A Performant SVG based circular gauge
|
|
||||||
*
|
|
||||||
* @component
|
|
||||||
* @param {Object} props - Component properties
|
|
||||||
* @param {number} [props.progress=0] - Progress percentage (0-100)
|
|
||||||
* @param {number} [props.radius=60] - Radius of the gauge circle
|
|
||||||
* @param {number} [props.strokeWidth=15] - Width of the gauge stroke
|
|
||||||
* @param {number} [props.threshold=50] - Threshold for color change
|
|
||||||
*
|
|
||||||
* @example
|
|
||||||
* <CustomGauge
|
|
||||||
* progress={75}
|
|
||||||
* radius={50}
|
|
||||||
* strokeWidth={10}
|
|
||||||
* threshold={50}
|
|
||||||
* />
|
|
||||||
*
|
|
||||||
* @returns {React.ReactElement} Rendered CustomGauge component
|
|
||||||
*/
|
|
||||||
const CustomGauge = ({ progress = 0, radius = 70, strokeWidth = 15, threshold = 50 }) => {
|
|
||||||
const theme = useTheme();
|
|
||||||
// Calculate the length of the stroke for the circle
|
|
||||||
const { circumference, totalSize, strokeLength } = useMemo(
|
|
||||||
() => ({
|
|
||||||
circumference: 2 * Math.PI * radius,
|
|
||||||
totalSize: radius * 2 + strokeWidth * 2,
|
|
||||||
strokeLength: (progress / 100) * (2 * Math.PI * radius),
|
|
||||||
}),
|
|
||||||
[radius, strokeWidth, progress]
|
|
||||||
);
|
|
||||||
|
|
||||||
// Handle initial animation
|
|
||||||
const [offset, setOffset] = useState(circumference);
|
|
||||||
useEffect(() => {
|
|
||||||
setOffset(circumference);
|
|
||||||
const timer = setTimeout(() => {
|
|
||||||
setOffset(circumference - strokeLength);
|
|
||||||
}, 100);
|
|
||||||
|
|
||||||
return () => clearTimeout(timer);
|
|
||||||
}, [progress, circumference, strokeLength]);
|
|
||||||
|
|
||||||
const progressWithinRange = Math.max(MINIMUM_VALUE, Math.min(progress, MAXIMUM_VALUE));
|
|
||||||
|
|
||||||
const fillColor =
|
|
||||||
progressWithinRange > threshold
|
|
||||||
? theme.palette.error.lowContrast // CAIO_REVIEW
|
|
||||||
: theme.palette.accent.main; // CAIO_REVIEW
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Box
|
|
||||||
className="radial-chart"
|
|
||||||
width={radius}
|
|
||||||
height={radius}
|
|
||||||
sx={{ backgroundColor: theme.palette.primary.main, borderRadius: "50%" }}
|
|
||||||
>
|
|
||||||
<svg
|
|
||||||
viewBox={`0 0 ${totalSize} ${totalSize}`}
|
|
||||||
width={radius}
|
|
||||||
height={radius}
|
|
||||||
>
|
|
||||||
<circle
|
|
||||||
className="radial-chart-base"
|
|
||||||
stroke={theme.palette.secondary.light} // CAIO_REVIEW
|
|
||||||
strokeWidth={strokeWidth}
|
|
||||||
fill="none"
|
|
||||||
cx={totalSize / 2} // Center the circle
|
|
||||||
cy={totalSize / 2} // Center the circle
|
|
||||||
r={radius}
|
|
||||||
/>
|
|
||||||
<circle
|
|
||||||
className="radial-chart-progress"
|
|
||||||
stroke={fillColor}
|
|
||||||
strokeWidth={strokeWidth}
|
|
||||||
strokeDasharray={`${circumference} ${circumference}`}
|
|
||||||
strokeDashoffset={offset}
|
|
||||||
strokeLinecap="round"
|
|
||||||
fill="none"
|
|
||||||
cx={totalSize / 2}
|
|
||||||
cy={totalSize / 2}
|
|
||||||
r={radius}
|
|
||||||
/>
|
|
||||||
</svg>
|
|
||||||
|
|
||||||
<Typography
|
|
||||||
className="radial-chart-text"
|
|
||||||
style={{
|
|
||||||
position: "absolute",
|
|
||||||
top: "50%",
|
|
||||||
left: "50%",
|
|
||||||
transform: "translate(-50%, -50%)",
|
|
||||||
...theme.typography.h2,
|
|
||||||
fill: theme.typography.h2.color,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{`${progressWithinRange.toFixed(1)}%`}
|
|
||||||
</Typography>
|
|
||||||
</Box>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default CustomGauge;
|
|
||||||
|
|
||||||
CustomGauge.propTypes = {
|
|
||||||
progress: PropTypes.number,
|
|
||||||
radius: PropTypes.number,
|
|
||||||
strokeWidth: PropTypes.number,
|
|
||||||
threshold: PropTypes.number,
|
|
||||||
};
|
|
||||||
@@ -1,181 +0,0 @@
|
|||||||
// Components
|
|
||||||
import { Stack, Box, Tooltip, Typography } from "@mui/material";
|
|
||||||
|
|
||||||
// Utils
|
|
||||||
import { useTheme } from "@emotion/react";
|
|
||||||
import { useState, useEffect } from "react";
|
|
||||||
import PropTypes from "prop-types";
|
|
||||||
import { formatDateWithTz } from "../../../Utils/timeUtils";
|
|
||||||
import { useSelector } from "react-redux";
|
|
||||||
|
|
||||||
const PlaceholderCheck = ({ daysToShow }) => {
|
|
||||||
const theme = useTheme();
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Box
|
|
||||||
width={`calc(30vw / ${daysToShow})`}
|
|
||||||
height="100%"
|
|
||||||
backgroundColor={theme.palette.primary.lowContrast}
|
|
||||||
sx={{
|
|
||||||
borderRadius: theme.spacing(1.5),
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
PlaceholderCheck.propTypes = {
|
|
||||||
daysToShow: PropTypes.number,
|
|
||||||
};
|
|
||||||
|
|
||||||
const Check = ({ check, daysToShow }) => {
|
|
||||||
const [animate, setAnimate] = useState(false);
|
|
||||||
|
|
||||||
const theme = useTheme();
|
|
||||||
useEffect(() => {
|
|
||||||
setAnimate(true);
|
|
||||||
}, []);
|
|
||||||
const uiTimezone = useSelector((state) => state.ui.timezone);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Tooltip
|
|
||||||
title={
|
|
||||||
<>
|
|
||||||
<Typography>
|
|
||||||
{formatDateWithTz(check._id, "ddd, MMMM D, YYYY", uiTimezone)}
|
|
||||||
</Typography>
|
|
||||||
<Box mt={theme.spacing(2)}>
|
|
||||||
<Stack
|
|
||||||
display="inline-flex"
|
|
||||||
direction="row"
|
|
||||||
justifyContent="space-between"
|
|
||||||
gap={theme.spacing(4)}
|
|
||||||
>
|
|
||||||
<Typography
|
|
||||||
component="span"
|
|
||||||
sx={{ opacity: 0.8 }}
|
|
||||||
>
|
|
||||||
Uptime percentage
|
|
||||||
</Typography>
|
|
||||||
<Typography component="span">
|
|
||||||
{check.upPercentage.toFixed(2)}
|
|
||||||
<Typography
|
|
||||||
component="span"
|
|
||||||
sx={{ opacity: 0.8 }}
|
|
||||||
>
|
|
||||||
{" "}
|
|
||||||
%
|
|
||||||
</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={`calc(30vw / ${daysToShow})`}
|
|
||||||
height="100%"
|
|
||||||
backgroundColor={theme.palette.error.lowContrast}
|
|
||||||
sx={{
|
|
||||||
borderRadius: theme.spacing(1.5),
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Box
|
|
||||||
position="absolute"
|
|
||||||
bottom={0}
|
|
||||||
width="100%"
|
|
||||||
height={`${animate ? check.upPercentage : 0}%`}
|
|
||||||
backgroundColor={theme.palette.success.lowContrast}
|
|
||||||
sx={{
|
|
||||||
borderRadius: theme.spacing(1.5),
|
|
||||||
transition: "height 600ms cubic-bezier(0.4, 0, 0.2, 1)",
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</Box>
|
|
||||||
</Tooltip>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
Check.propTypes = {
|
|
||||||
check: PropTypes.object,
|
|
||||||
daysToShow: PropTypes.number,
|
|
||||||
};
|
|
||||||
|
|
||||||
const DePINStatusPageBarChart = ({ checks = [], daysToShow = 30 }) => {
|
|
||||||
if (checks.length !== daysToShow) {
|
|
||||||
const placeholders = Array(daysToShow - checks.length).fill("placeholder");
|
|
||||||
checks = [...checks, ...placeholders];
|
|
||||||
}
|
|
||||||
return (
|
|
||||||
<Stack
|
|
||||||
direction="row"
|
|
||||||
justifyContent="space-between"
|
|
||||||
width="100%"
|
|
||||||
flexWrap="nowrap"
|
|
||||||
height="50px"
|
|
||||||
>
|
|
||||||
{checks.map((check) => {
|
|
||||||
if (check === "placeholder") {
|
|
||||||
return (
|
|
||||||
<PlaceholderCheck
|
|
||||||
key={Math.random()}
|
|
||||||
daysToShow={daysToShow}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
return (
|
|
||||||
<Check
|
|
||||||
key={Math.random()}
|
|
||||||
check={check}
|
|
||||||
daysToShow={daysToShow}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
})}
|
|
||||||
</Stack>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
DePINStatusPageBarChart.propTypes = {
|
|
||||||
checks: PropTypes.array,
|
|
||||||
daysToShow: PropTypes.number,
|
|
||||||
};
|
|
||||||
|
|
||||||
export default DePINStatusPageBarChart;
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
import { Stack, Typography } from "@mui/material";
|
|
||||||
import { useTheme } from "@emotion/react";
|
|
||||||
import IconBox from "../../IconBox";
|
|
||||||
import PropTypes from "prop-types";
|
|
||||||
|
|
||||||
const LegendBox = ({ children, icon, header, sx }) => {
|
|
||||||
const theme = useTheme();
|
|
||||||
return (
|
|
||||||
<Stack
|
|
||||||
direction="column"
|
|
||||||
gap={theme.spacing(4)}
|
|
||||||
borderRadius={theme.spacing(8)}
|
|
||||||
sx={{
|
|
||||||
...sx,
|
|
||||||
"& label": { pl: theme.spacing(6) },
|
|
||||||
borderLeftStyle: "solid",
|
|
||||||
borderLeftWidth: 1,
|
|
||||||
borderLeftColor: theme.palette.primary.lowContrast,
|
|
||||||
backgroundColor: theme.palette.primary.main,
|
|
||||||
padding: theme.spacing(8),
|
|
||||||
background: `linear-gradient(325deg, ${theme.palette.tertiary.main} 20%, ${theme.palette.primary.main} 45%)`,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Stack
|
|
||||||
direction="row"
|
|
||||||
gap={theme.spacing(6)}
|
|
||||||
>
|
|
||||||
<IconBox>{icon}</IconBox>
|
|
||||||
<Typography component="h2">{header}</Typography>
|
|
||||||
</Stack>
|
|
||||||
{children}
|
|
||||||
</Stack>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
LegendBox.propTypes = {
|
|
||||||
children: PropTypes.node,
|
|
||||||
icon: PropTypes.node,
|
|
||||||
header: PropTypes.string,
|
|
||||||
};
|
|
||||||
|
|
||||||
export default LegendBox;
|
|
||||||
Whitespace-only changes.
@@ -1,222 +0,0 @@
|
|||||||
import PropTypes from "prop-types";
|
|
||||||
import {
|
|
||||||
AreaChart,
|
|
||||||
Area,
|
|
||||||
XAxis,
|
|
||||||
Tooltip,
|
|
||||||
CartesianGrid,
|
|
||||||
ResponsiveContainer,
|
|
||||||
Text,
|
|
||||||
} from "recharts";
|
|
||||||
import { Box, Stack, Typography } from "@mui/material";
|
|
||||||
import { useTheme } from "@emotion/react";
|
|
||||||
import { useMemo, useState } from "react";
|
|
||||||
import { useSelector } from "react-redux";
|
|
||||||
import { formatDateWithTz } from "../../../Utils/timeUtils";
|
|
||||||
import {
|
|
||||||
tooltipDateFormatLookup,
|
|
||||||
tickDateFormatLookup,
|
|
||||||
} from "../Utils/chartUtilFunctions";
|
|
||||||
|
|
||||||
import "./index.css";
|
|
||||||
const CustomToolTip = ({ active, payload, label, dateRange }) => {
|
|
||||||
const format = tooltipDateFormatLookup(dateRange);
|
|
||||||
const uiTimezone = useSelector((state) => state.ui.timezone);
|
|
||||||
const theme = useTheme();
|
|
||||||
if (active && payload && payload.length) {
|
|
||||||
const responseTime = payload[0]?.payload?.originalAvgResponseTime
|
|
||||||
? payload[0]?.payload?.originalAvgResponseTime
|
|
||||||
: (payload[0]?.payload?.avgResponseTime ?? 0);
|
|
||||||
return (
|
|
||||||
<Box
|
|
||||||
className="area-tooltip"
|
|
||||||
sx={{
|
|
||||||
backgroundColor: theme.palette.primary.main,
|
|
||||||
border: 1,
|
|
||||||
borderColor: theme.palette.primary.lowContrast,
|
|
||||||
borderRadius: theme.shape.borderRadius,
|
|
||||||
py: theme.spacing(2),
|
|
||||||
px: theme.spacing(4),
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Typography
|
|
||||||
sx={{
|
|
||||||
color: theme.palette.primary.contrastTextTertiary,
|
|
||||||
fontSize: 12,
|
|
||||||
fontWeight: 500,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{formatDateWithTz(label, format, uiTimezone)}
|
|
||||||
</Typography>
|
|
||||||
<Box mt={theme.spacing(1)}>
|
|
||||||
<Box
|
|
||||||
display="inline-block"
|
|
||||||
width={theme.spacing(4)}
|
|
||||||
height={theme.spacing(4)}
|
|
||||||
backgroundColor={theme.palette.primary.main}
|
|
||||||
sx={{ borderRadius: "50%" }}
|
|
||||||
/>
|
|
||||||
<Stack
|
|
||||||
display="inline-flex"
|
|
||||||
direction="row"
|
|
||||||
justifyContent="space-between"
|
|
||||||
ml={theme.spacing(3)}
|
|
||||||
sx={{
|
|
||||||
"& span": {
|
|
||||||
color: theme.palette.primary.contrastTextTertiary,
|
|
||||||
fontSize: 11,
|
|
||||||
fontWeight: 500,
|
|
||||||
},
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Typography
|
|
||||||
component="span"
|
|
||||||
sx={{ opacity: 0.8 }}
|
|
||||||
>
|
|
||||||
Response time:
|
|
||||||
</Typography>
|
|
||||||
<Typography
|
|
||||||
ml={theme.spacing(4)}
|
|
||||||
component="span"
|
|
||||||
>
|
|
||||||
{Math.floor(responseTime)}
|
|
||||||
<Typography
|
|
||||||
component="span"
|
|
||||||
sx={{ opacity: 0.8 }}
|
|
||||||
>
|
|
||||||
{" "}
|
|
||||||
ms
|
|
||||||
</Typography>
|
|
||||||
</Typography>
|
|
||||||
</Stack>
|
|
||||||
</Box>
|
|
||||||
{/* Display original value */}
|
|
||||||
</Box>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
};
|
|
||||||
|
|
||||||
CustomToolTip.propTypes = {
|
|
||||||
active: PropTypes.bool,
|
|
||||||
payload: PropTypes.arrayOf(
|
|
||||||
PropTypes.shape({
|
|
||||||
value: PropTypes.number,
|
|
||||||
payload: PropTypes.shape({
|
|
||||||
_id: PropTypes.string,
|
|
||||||
avgResponseTime: PropTypes.number,
|
|
||||||
originalAvgResponseTime: PropTypes.number,
|
|
||||||
}),
|
|
||||||
})
|
|
||||||
),
|
|
||||||
label: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
||||||
dateRange: PropTypes.string,
|
|
||||||
};
|
|
||||||
const CustomTick = ({ x, y, payload, dateRange }) => {
|
|
||||||
const format = tickDateFormatLookup(dateRange);
|
|
||||||
const theme = useTheme();
|
|
||||||
const uiTimezone = useSelector((state) => state.ui.timezone);
|
|
||||||
return (
|
|
||||||
<Text
|
|
||||||
x={x}
|
|
||||||
y={y + 10}
|
|
||||||
textAnchor="middle"
|
|
||||||
fill={theme.palette.primary.contrastTextTertiary}
|
|
||||||
fontSize={11}
|
|
||||||
fontWeight={400}
|
|
||||||
>
|
|
||||||
{formatDateWithTz(payload?.value, format, uiTimezone)}
|
|
||||||
</Text>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
CustomTick.propTypes = {
|
|
||||||
x: PropTypes.number,
|
|
||||||
y: PropTypes.number,
|
|
||||||
payload: PropTypes.object,
|
|
||||||
index: PropTypes.number,
|
|
||||||
dateRange: PropTypes.string,
|
|
||||||
};
|
|
||||||
|
|
||||||
const MonitorDetailsAreaChart = ({ checks, dateRange }) => {
|
|
||||||
const theme = useTheme();
|
|
||||||
const memoizedChecks = useMemo(() => checks, [checks[0]]);
|
|
||||||
const [isHovered, setIsHovered] = useState(false);
|
|
||||||
return (
|
|
||||||
<ResponsiveContainer
|
|
||||||
width="100%"
|
|
||||||
minWidth={25}
|
|
||||||
height={220}
|
|
||||||
>
|
|
||||||
<AreaChart
|
|
||||||
width="100%"
|
|
||||||
height="100%"
|
|
||||||
data={memoizedChecks}
|
|
||||||
margin={{
|
|
||||||
top: 10,
|
|
||||||
right: 0,
|
|
||||||
left: 0,
|
|
||||||
bottom: 0,
|
|
||||||
}}
|
|
||||||
onMouseMove={() => setIsHovered(true)}
|
|
||||||
onMouseLeave={() => setIsHovered(false)}
|
|
||||||
>
|
|
||||||
<CartesianGrid
|
|
||||||
stroke={theme.palette.primary.lowContrast}
|
|
||||||
strokeWidth={1}
|
|
||||||
strokeOpacity={1}
|
|
||||||
fill="transparent"
|
|
||||||
vertical={false}
|
|
||||||
/>
|
|
||||||
<defs>
|
|
||||||
<linearGradient
|
|
||||||
id="colorUv"
|
|
||||||
x1="0"
|
|
||||||
y1="0"
|
|
||||||
x2="0"
|
|
||||||
y2="1"
|
|
||||||
>
|
|
||||||
<stop
|
|
||||||
offset="0%"
|
|
||||||
stopColor={theme.palette.accent.main}
|
|
||||||
stopOpacity={0.8}
|
|
||||||
/>
|
|
||||||
<stop
|
|
||||||
offset="100%"
|
|
||||||
stopColor={theme.palette.accent.light}
|
|
||||||
stopOpacity={0}
|
|
||||||
/>
|
|
||||||
</linearGradient>
|
|
||||||
</defs>
|
|
||||||
<XAxis
|
|
||||||
stroke={theme.palette.primary.lowContrast}
|
|
||||||
dataKey="_id"
|
|
||||||
tick={<CustomTick dateRange={dateRange} />}
|
|
||||||
axisLine={false}
|
|
||||||
tickLine={false}
|
|
||||||
height={20}
|
|
||||||
/>
|
|
||||||
<Tooltip
|
|
||||||
cursor={{ stroke: theme.palette.primary.lowContrast }}
|
|
||||||
content={<CustomToolTip dateRange={dateRange} />}
|
|
||||||
wrapperStyle={{ pointerEvents: "none" }}
|
|
||||||
/>
|
|
||||||
<Area
|
|
||||||
type="monotone"
|
|
||||||
dataKey="avgResponseTime"
|
|
||||||
stroke={theme.palette.accent.main} // CAIO_REVIEW
|
|
||||||
fill="url(#colorUv)"
|
|
||||||
strokeWidth={isHovered ? 2.5 : 1.5}
|
|
||||||
activeDot={{ stroke: theme.palette.accent.main, r: 5 }} // CAIO_REVIEW
|
|
||||||
/>
|
|
||||||
</AreaChart>
|
|
||||||
</ResponsiveContainer>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
MonitorDetailsAreaChart.propTypes = {
|
|
||||||
checks: PropTypes.array,
|
|
||||||
dateRange: PropTypes.string,
|
|
||||||
};
|
|
||||||
|
|
||||||
export default MonitorDetailsAreaChart;
|
|
||||||
@@ -1,211 +0,0 @@
|
|||||||
import { useTheme } from "@emotion/react";
|
|
||||||
import { Box, Stack, Tooltip, Typography } from "@mui/material";
|
|
||||||
import { formatDateWithTz } from "../../../Utils/timeUtils";
|
|
||||||
import { useEffect, useState } from "react";
|
|
||||||
import { useSelector } from "react-redux";
|
|
||||||
import PropTypes from "prop-types";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A customizable Bar component that renders a colored bar with optional children.
|
|
||||||
* @component
|
|
||||||
*
|
|
||||||
* @param {string} width The width of the bar (e.g., "100px").
|
|
||||||
* @param {string} height The height of the bar (e.g., "50px").
|
|
||||||
* @param {string} backgroundColor The background color of the bar (e.g., "#FF5733").
|
|
||||||
* @param {string} [borderRadius] Optional border radius for the bar (e.g., "8px").
|
|
||||||
* @param {node} children The content to be rendered inside the bar.
|
|
||||||
* @returns {JSX.Element} The Bar component.
|
|
||||||
*/
|
|
||||||
|
|
||||||
const Bar = ({ width, height, backgroundColor, borderRadius, children }) => {
|
|
||||||
const theme = useTheme();
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Box
|
|
||||||
position="relative"
|
|
||||||
width={width}
|
|
||||||
height={height}
|
|
||||||
backgroundColor={backgroundColor}
|
|
||||||
sx={{
|
|
||||||
borderRadius: borderRadius || theme.spacing(1.5),
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{children}
|
|
||||||
</Box>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
Bar.propTypes = {
|
|
||||||
width: PropTypes.string.isRequired,
|
|
||||||
height: PropTypes.string.isRequired,
|
|
||||||
backgroundColor: PropTypes.string.isRequired,
|
|
||||||
borderRadius: PropTypes.string,
|
|
||||||
children: PropTypes.node,
|
|
||||||
};
|
|
||||||
|
|
||||||
/* TODO add prop validation and jsdocs */
|
|
||||||
const StatusPageBarChart = ({ checks = [] }) => {
|
|
||||||
const theme = useTheme();
|
|
||||||
const [animate, setAnimate] = useState(false);
|
|
||||||
const uiTimezone = useSelector((state) => state.ui.timezone);
|
|
||||||
|
|
||||||
const barWidth = {
|
|
||||||
xs: "calc(60% / 25)",
|
|
||||||
xl: "calc(40% / 25)",
|
|
||||||
};
|
|
||||||
|
|
||||||
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"
|
|
||||||
justifyContent="space-between"
|
|
||||||
width="100%"
|
|
||||||
flexWrap="nowrap"
|
|
||||||
height="50px"
|
|
||||||
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
|
|
||||||
<Bar
|
|
||||||
key={`${check}-${index}`}
|
|
||||||
width={barWidth}
|
|
||||||
height="100%"
|
|
||||||
backgroundColor={theme.palette.primary.lowContrast}
|
|
||||||
/>
|
|
||||||
) : (
|
|
||||||
<Tooltip
|
|
||||||
title={
|
|
||||||
<>
|
|
||||||
<Typography>
|
|
||||||
{formatDateWithTz(
|
|
||||||
check.createdAt,
|
|
||||||
"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,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Bar
|
|
||||||
width={barWidth}
|
|
||||||
height="100%"
|
|
||||||
backgroundColor={theme.palette.primary.lowContrast}
|
|
||||||
>
|
|
||||||
<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)",
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</Bar>
|
|
||||||
</Tooltip>
|
|
||||||
)
|
|
||||||
)}
|
|
||||||
</Stack>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default StatusPageBarChart;
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
export const tooltipDateFormatLookup = (dateRange) => {
|
|
||||||
const dateFormatLookup = {
|
|
||||||
day: "ddd. MMMM D, YYYY, hh:mm A",
|
|
||||||
week: "ddd. MMMM D, YYYY, hh:mm A",
|
|
||||||
month: "ddd. MMMM D, YYYY",
|
|
||||||
};
|
|
||||||
const format = dateFormatLookup[dateRange];
|
|
||||||
if (format === undefined) {
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
return format;
|
|
||||||
};
|
|
||||||
|
|
||||||
export const tickDateFormatLookup = (dateRange) => {
|
|
||||||
const tickFormatLookup = {
|
|
||||||
recent: "h:mm A",
|
|
||||||
day: "h:mm A",
|
|
||||||
week: "MM/D, h:mm A",
|
|
||||||
month: "ddd. M/D",
|
|
||||||
};
|
|
||||||
const format = tickFormatLookup[dateRange];
|
|
||||||
if (format === undefined) {
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
return format;
|
|
||||||
};
|
|
||||||
@@ -1,292 +0,0 @@
|
|||||||
import PropTypes from "prop-types";
|
|
||||||
import { useSelector } from "react-redux";
|
|
||||||
import { useTheme } from "@mui/material";
|
|
||||||
import { Text } from "recharts";
|
|
||||||
import { formatDateWithTz } from "../../../Utils/timeUtils";
|
|
||||||
import { Box, Stack, Typography } from "@mui/material";
|
|
||||||
import { tickDateFormatLookup, tooltipDateFormatLookup } from "./chartUtilFunctions";
|
|
||||||
/**
|
|
||||||
* Custom tick component for rendering time with timezone.
|
|
||||||
*
|
|
||||||
* @param {Object} props - The properties object.
|
|
||||||
* @param {number} props.x - The x-coordinate for the tick.
|
|
||||||
* @param {number} props.y - The y-coordinate for the tick.
|
|
||||||
* @param {Object} props.payload - The payload object containing tick data.
|
|
||||||
* @param {number} props.index - The index of the tick.
|
|
||||||
* @returns {JSX.Element} The rendered tick component.
|
|
||||||
*/
|
|
||||||
export const TzTick = ({ x, y, payload, index, dateRange }) => {
|
|
||||||
const theme = useTheme();
|
|
||||||
const uiTimezone = useSelector((state) => state.ui.timezone);
|
|
||||||
const format = tickDateFormatLookup(dateRange);
|
|
||||||
return (
|
|
||||||
<Text
|
|
||||||
x={x}
|
|
||||||
y={y + 10}
|
|
||||||
textAnchor="middle"
|
|
||||||
fill={theme.palette.primary.contrastTextTertiary}
|
|
||||||
fontSize={11}
|
|
||||||
fontWeight={400}
|
|
||||||
>
|
|
||||||
{formatDateWithTz(payload?.value, format, uiTimezone)}
|
|
||||||
</Text>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
TzTick.propTypes = {
|
|
||||||
x: PropTypes.number,
|
|
||||||
y: PropTypes.number,
|
|
||||||
payload: PropTypes.object,
|
|
||||||
index: PropTypes.number,
|
|
||||||
dateRange: PropTypes.string,
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Custom tick component for rendering percentage values.
|
|
||||||
*
|
|
||||||
* @param {Object} props - The properties object.
|
|
||||||
* @param {number} props.x - The x-coordinate for the tick.
|
|
||||||
* @param {number} props.y - The y-coordinate for the tick.
|
|
||||||
* @param {Object} props.payload - The payload object containing tick data.
|
|
||||||
* @param {number} props.index - The index of the tick.
|
|
||||||
* @returns {JSX.Element|null} The rendered tick component or null for the first tick.
|
|
||||||
*/
|
|
||||||
export const PercentTick = ({ x, y, payload, index }) => {
|
|
||||||
const theme = useTheme();
|
|
||||||
if (index === 0) return null;
|
|
||||||
return (
|
|
||||||
<Text
|
|
||||||
x={x - 20}
|
|
||||||
y={y}
|
|
||||||
textAnchor="middle"
|
|
||||||
fill={theme.palette.primary.contrastTextTertiary}
|
|
||||||
fontSize={11}
|
|
||||||
fontWeight={400}
|
|
||||||
>
|
|
||||||
{`${(payload?.value * 100).toFixed()}%`}
|
|
||||||
</Text>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
PercentTick.propTypes = {
|
|
||||||
x: PropTypes.number,
|
|
||||||
y: PropTypes.number,
|
|
||||||
payload: PropTypes.object,
|
|
||||||
index: PropTypes.number,
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Converts a decimal value to a formatted percentage string.
|
|
||||||
*
|
|
||||||
* @param {number} value - The decimal value to convert (e.g., 0.75)
|
|
||||||
* @returns {string} Formatted percentage string (e.g., "75.00%") or original input if not a number
|
|
||||||
*
|
|
||||||
* @example
|
|
||||||
* getFormattedPercentage(0.7543) // Returns "75.43%"
|
|
||||||
* getFormattedPercentage(1) // Returns "100.00%"
|
|
||||||
* getFormattedPercentage("test") // Returns "test"
|
|
||||||
*/
|
|
||||||
const getFormattedPercentage = (value) => {
|
|
||||||
if (typeof value !== "number") return value;
|
|
||||||
return `${(value * 100).toFixed(2)}.%`;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Custom tooltip component for displaying infrastructure data.
|
|
||||||
*
|
|
||||||
* @param {Object} props - The properties object.
|
|
||||||
* @param {boolean} props.active - Indicates if the tooltip is active.
|
|
||||||
* @param {Array} props.payload - The payload array containing tooltip data.
|
|
||||||
* @param {string} props.label - The label for the tooltip.
|
|
||||||
* @param {string} props.yKey - The key for the y-axis data.
|
|
||||||
* @param {string} props.yLabel - The label for the y-axis data.
|
|
||||||
* @param {string} props.dotColor - The color of the dot in the tooltip.
|
|
||||||
* @returns {JSX.Element|null} The rendered tooltip component or null if inactive.
|
|
||||||
*/
|
|
||||||
export const InfrastructureTooltip = ({
|
|
||||||
active,
|
|
||||||
payload,
|
|
||||||
label,
|
|
||||||
yKey,
|
|
||||||
yIdx = -1,
|
|
||||||
yLabel,
|
|
||||||
dotColor,
|
|
||||||
dateRange,
|
|
||||||
}) => {
|
|
||||||
const uiTimezone = useSelector((state) => state.ui.timezone);
|
|
||||||
const theme = useTheme();
|
|
||||||
|
|
||||||
const format = tooltipDateFormatLookup(dateRange);
|
|
||||||
if (active && payload && payload.length) {
|
|
||||||
const [hardwareType, metric] = yKey.split(".");
|
|
||||||
return (
|
|
||||||
<Box
|
|
||||||
className="area-tooltip"
|
|
||||||
sx={{
|
|
||||||
backgroundColor: theme.palette.primary.main,
|
|
||||||
border: 1,
|
|
||||||
borderColor: theme.palette.primary.lowContrast,
|
|
||||||
borderRadius: theme.shape.borderRadius,
|
|
||||||
py: theme.spacing(2),
|
|
||||||
px: theme.spacing(4),
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Typography
|
|
||||||
sx={{
|
|
||||||
color: theme.palette.primary.contrastTextTertiary,
|
|
||||||
fontSize: 12,
|
|
||||||
fontWeight: 500,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{formatDateWithTz(label, format, uiTimezone)}
|
|
||||||
</Typography>
|
|
||||||
<Box mt={theme.spacing(1)}>
|
|
||||||
<Box
|
|
||||||
display="inline-block"
|
|
||||||
width={theme.spacing(4)}
|
|
||||||
height={theme.spacing(4)}
|
|
||||||
backgroundColor={dotColor}
|
|
||||||
sx={{ borderRadius: "50%" }}
|
|
||||||
/>
|
|
||||||
<Stack
|
|
||||||
display="inline-flex"
|
|
||||||
direction="row"
|
|
||||||
justifyContent="space-between"
|
|
||||||
ml={theme.spacing(3)}
|
|
||||||
sx={{
|
|
||||||
"& span": {
|
|
||||||
color: theme.palette.primary.contrastTextTertiary,
|
|
||||||
fontSize: 11,
|
|
||||||
fontWeight: 500,
|
|
||||||
},
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Typography
|
|
||||||
component="span"
|
|
||||||
sx={{ opacity: 0.8 }}
|
|
||||||
>
|
|
||||||
{yIdx >= 0
|
|
||||||
? `${yLabel} ${getFormattedPercentage(payload[0].payload[hardwareType][yIdx][metric])}`
|
|
||||||
: `${yLabel} ${getFormattedPercentage(payload[0].payload[yKey])}`}
|
|
||||||
</Typography>
|
|
||||||
</Stack>
|
|
||||||
</Box>
|
|
||||||
{/* Display original value */}
|
|
||||||
</Box>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
};
|
|
||||||
|
|
||||||
InfrastructureTooltip.propTypes = {
|
|
||||||
active: PropTypes.bool,
|
|
||||||
payload: PropTypes.array,
|
|
||||||
label: PropTypes.oneOfType([
|
|
||||||
PropTypes.instanceOf(Date),
|
|
||||||
PropTypes.string,
|
|
||||||
PropTypes.number,
|
|
||||||
]),
|
|
||||||
yKey: PropTypes.string,
|
|
||||||
yIdx: PropTypes.number,
|
|
||||||
yLabel: PropTypes.string,
|
|
||||||
dotColor: PropTypes.string,
|
|
||||||
dateRange: PropTypes.string,
|
|
||||||
};
|
|
||||||
|
|
||||||
export const TemperatureTooltip = ({
|
|
||||||
active,
|
|
||||||
payload,
|
|
||||||
label,
|
|
||||||
keys,
|
|
||||||
dotColor,
|
|
||||||
dateRange,
|
|
||||||
}) => {
|
|
||||||
const uiTimezone = useSelector((state) => state.ui.timezone);
|
|
||||||
const theme = useTheme();
|
|
||||||
const format = tooltipDateFormatLookup(dateRange);
|
|
||||||
const formatCoreKey = (key) => {
|
|
||||||
return key.replace(/^core(\d+)$/, "Core $1");
|
|
||||||
};
|
|
||||||
if (active && payload && payload.length) {
|
|
||||||
return (
|
|
||||||
<Box
|
|
||||||
className="area-tooltip"
|
|
||||||
sx={{
|
|
||||||
backgroundColor: theme.palette.primary.main,
|
|
||||||
border: 1,
|
|
||||||
borderColor: theme.palette.primary.lowContrast,
|
|
||||||
borderRadius: theme.shape.borderRadius,
|
|
||||||
py: theme.spacing(2),
|
|
||||||
px: theme.spacing(4),
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Typography
|
|
||||||
sx={{
|
|
||||||
color: theme.palette.primary.contrastTextTertiary,
|
|
||||||
fontSize: 12,
|
|
||||||
fontWeight: 500,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{formatDateWithTz(label, format, uiTimezone)}
|
|
||||||
</Typography>
|
|
||||||
|
|
||||||
<Stack direction="column">
|
|
||||||
{keys.map((key) => {
|
|
||||||
return (
|
|
||||||
<Stack
|
|
||||||
key={key}
|
|
||||||
display="inline-flex"
|
|
||||||
direction="row"
|
|
||||||
justifyContent="space-between"
|
|
||||||
ml={theme.spacing(3)}
|
|
||||||
sx={{
|
|
||||||
"& span": {
|
|
||||||
color: theme.palette.primary.contrastTextTertiary,
|
|
||||||
fontSize: 11,
|
|
||||||
fontWeight: 500,
|
|
||||||
},
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Stack
|
|
||||||
direction="row"
|
|
||||||
alignItems="center"
|
|
||||||
gap={theme.spacing(2)}
|
|
||||||
>
|
|
||||||
<Box
|
|
||||||
display="inline-block"
|
|
||||||
width={theme.spacing(4)}
|
|
||||||
height={theme.spacing(4)}
|
|
||||||
backgroundColor={dotColor}
|
|
||||||
sx={{ borderRadius: "50%" }}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<Typography
|
|
||||||
component="span"
|
|
||||||
sx={{ opacity: 0.8 }}
|
|
||||||
>
|
|
||||||
{`${formatCoreKey(key)}: ${payload[0].payload[key]} °C`}
|
|
||||||
</Typography>
|
|
||||||
</Stack>
|
|
||||||
<Typography component="span"></Typography>
|
|
||||||
</Stack>
|
|
||||||
);
|
|
||||||
})}
|
|
||||||
</Stack>
|
|
||||||
</Box>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
};
|
|
||||||
|
|
||||||
TemperatureTooltip.propTypes = {
|
|
||||||
active: PropTypes.bool,
|
|
||||||
keys: PropTypes.array,
|
|
||||||
payload: PropTypes.array,
|
|
||||||
label: PropTypes.oneOfType([
|
|
||||||
PropTypes.instanceOf(Date),
|
|
||||||
PropTypes.string,
|
|
||||||
PropTypes.number,
|
|
||||||
]),
|
|
||||||
dotColor: PropTypes.string,
|
|
||||||
dateRange: PropTypes.string,
|
|
||||||
};
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
/**
|
|
||||||
* Creates an SVG gradient definition for use in charts
|
|
||||||
* @param {Object} params - The gradient parameters
|
|
||||||
* @param {string} [params.id="colorUv"] - Unique identifier for the gradient
|
|
||||||
* @param {string} params.startColor - Starting color of the gradient (hex, rgb, or color name)
|
|
||||||
* @param {string} params.endColor - Ending color of the gradient (hex, rgb, or color name)
|
|
||||||
* @param {number} [params.startOpacity=0.8] - Starting opacity (0-1)
|
|
||||||
* @param {number} [params.endOpacity=0] - Ending opacity (0-1)
|
|
||||||
* @param {('vertical'|'horizontal')} [params.direction="vertical"] - Direction of the gradient
|
|
||||||
* @returns {JSX.Element} SVG gradient definition element
|
|
||||||
* @example
|
|
||||||
* createCustomGradient({
|
|
||||||
* startColor: "#1976D2",
|
|
||||||
* endColor: "#42A5F5",
|
|
||||||
* direction: "horizontal"
|
|
||||||
* })
|
|
||||||
*/
|
|
||||||
|
|
||||||
export const createGradient = ({
|
|
||||||
id,
|
|
||||||
startColor,
|
|
||||||
endColor,
|
|
||||||
startOpacity = 0.8,
|
|
||||||
endOpacity = 0,
|
|
||||||
direction = "vertical", // or "horizontal"
|
|
||||||
}) => (
|
|
||||||
<defs>
|
|
||||||
<linearGradient
|
|
||||||
id={id}
|
|
||||||
x1={direction === "vertical" ? "0" : "0"}
|
|
||||||
y1={direction === "vertical" ? "0" : "0"}
|
|
||||||
x2={direction === "vertical" ? "0" : "1"}
|
|
||||||
y2={direction === "vertical" ? "1" : "0"}
|
|
||||||
>
|
|
||||||
<stop
|
|
||||||
offset="0%"
|
|
||||||
stopColor={startColor}
|
|
||||||
stopOpacity={startOpacity}
|
|
||||||
/>
|
|
||||||
<stop
|
|
||||||
offset="100%"
|
|
||||||
stopColor={endColor}
|
|
||||||
stopOpacity={endOpacity}
|
|
||||||
/>
|
|
||||||
</linearGradient>
|
|
||||||
</defs>
|
|
||||||
);
|
|
||||||
@@ -1,73 +0,0 @@
|
|||||||
import "./check.css";
|
|
||||||
import PropTypes from "prop-types";
|
|
||||||
import CheckGrey from "../../assets/icons/check.svg?react";
|
|
||||||
import CheckOutlined from "../../assets/icons/check-outlined.svg?react";
|
|
||||||
import { Box, Stack, Typography } from "@mui/material";
|
|
||||||
import { useTheme } from "@emotion/react";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* `Check` is a functional React component that displays a check icon and a label.
|
|
||||||
*
|
|
||||||
* @component
|
|
||||||
* @param {Object} props - The properties that define the `Check` component.
|
|
||||||
* @param {string} props.text - The text to be displayed as the label next to the check icon.
|
|
||||||
* @param {'info' | 'error' | 'success'} [props.variant='info'] - The variant of the check component, affecting its styling.
|
|
||||||
* @param {boolean} [props.outlined] - Whether the check icon should be outlined or not.
|
|
||||||
*
|
|
||||||
* @example
|
|
||||||
* // To use this component, import it and use it in your JSX like this:
|
|
||||||
* <Check text="Your Text Here" />
|
|
||||||
*
|
|
||||||
* @returns {React.Element} The `Check` component with a check icon and a label, defined by the `text` prop.
|
|
||||||
*/
|
|
||||||
const Check = ({ text, noHighlightText, variant = "info", outlined = false }) => {
|
|
||||||
const theme = useTheme();
|
|
||||||
const colors = {
|
|
||||||
success: theme.palette.success.main,
|
|
||||||
error: theme.palette.error.main,
|
|
||||||
info: theme.palette.info.border,
|
|
||||||
};
|
|
||||||
return (
|
|
||||||
<Stack
|
|
||||||
direction="row"
|
|
||||||
className="check"
|
|
||||||
gap={outlined ? theme.spacing(6) : theme.spacing(4)}
|
|
||||||
alignItems="center"
|
|
||||||
>
|
|
||||||
{outlined ? (
|
|
||||||
<CheckOutlined alt="check" />
|
|
||||||
) : (
|
|
||||||
<Box
|
|
||||||
lineHeight={0}
|
|
||||||
sx={{
|
|
||||||
"& svg > path": { fill: colors[variant] },
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<CheckGrey alt="form checks" />
|
|
||||||
</Box>
|
|
||||||
)}
|
|
||||||
<Typography
|
|
||||||
component="span"
|
|
||||||
sx={{
|
|
||||||
color:
|
|
||||||
variant === "info"
|
|
||||||
? theme.palette.primary.contrastTextTertiary
|
|
||||||
: colors[variant],
|
|
||||||
opacity: 0.8,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{noHighlightText && <Typography component="span">{noHighlightText}</Typography>}{" "}
|
|
||||||
{text}
|
|
||||||
</Typography>
|
|
||||||
</Stack>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
Check.propTypes = {
|
|
||||||
text: PropTypes.oneOfType([PropTypes.string, PropTypes.element]).isRequired,
|
|
||||||
noHighlightText: PropTypes.string,
|
|
||||||
variant: PropTypes.oneOf(["info", "error", "success"]),
|
|
||||||
outlined: PropTypes.bool,
|
|
||||||
};
|
|
||||||
|
|
||||||
export default Check;
|
|
||||||
Whitespace-only changes.
@@ -1,29 +0,0 @@
|
|||||||
import { Box } from "@mui/material";
|
|
||||||
import PropTypes from "prop-types";
|
|
||||||
import { useTheme } from "@emotion/react";
|
|
||||||
const CircularCount = ({ count }) => {
|
|
||||||
const theme = useTheme();
|
|
||||||
return (
|
|
||||||
<Box
|
|
||||||
component="span"
|
|
||||||
color={theme.palette.tertiary.contrastText}
|
|
||||||
border={2}
|
|
||||||
borderColor={theme.palette.accent.main}
|
|
||||||
backgroundColor={theme.palette.tertiary.main}
|
|
||||||
sx={{
|
|
||||||
padding: ".25em .75em",
|
|
||||||
borderRadius: "50rem",
|
|
||||||
fontSize: "12px",
|
|
||||||
fontWeight: 500,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{count}
|
|
||||||
</Box>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
CircularCount.propTypes = {
|
|
||||||
count: PropTypes.number,
|
|
||||||
};
|
|
||||||
|
|
||||||
export default CircularCount;
|
|
||||||
@@ -1,213 +0,0 @@
|
|||||||
import { useState } from "react";
|
|
||||||
import { styled, alpha } from "@mui/material/styles";
|
|
||||||
import Box from "@mui/material/Box";
|
|
||||||
import AppBar from "@mui/material/AppBar";
|
|
||||||
import Toolbar from "@mui/material/Toolbar";
|
|
||||||
import Button from "@mui/material/Button";
|
|
||||||
import IconButton from "@mui/material/IconButton";
|
|
||||||
import Container from "@mui/material/Container";
|
|
||||||
import MenuItem from "@mui/material/MenuItem";
|
|
||||||
import Drawer from "@mui/material/Drawer";
|
|
||||||
import MenuIcon from "@mui/icons-material/Menu";
|
|
||||||
import CloseRoundedIcon from "@mui/icons-material/CloseRounded";
|
|
||||||
import ThemeSwitch from "../ThemeSwitch";
|
|
||||||
import { useTheme } from "@mui/material/styles";
|
|
||||||
import { useSelector } from "react-redux";
|
|
||||||
import { useLocation, useNavigate } from "react-router-dom";
|
|
||||||
|
|
||||||
const StyledToolbar = styled(Toolbar)(({ theme, mode }) => ({
|
|
||||||
display: "flex",
|
|
||||||
alignItems: "center",
|
|
||||||
justifyContent: "space-between",
|
|
||||||
flexShrink: 0,
|
|
||||||
borderRadius: `calc(${theme.shape.borderRadius}px + 4px)`,
|
|
||||||
backdropFilter: "blur(24px)",
|
|
||||||
border: "1px solid",
|
|
||||||
borderColor:
|
|
||||||
mode === "light"
|
|
||||||
? alpha(theme.palette.common.black, 0.1)
|
|
||||||
: alpha(theme.palette.common.white, 0.1),
|
|
||||||
backgroundColor:
|
|
||||||
mode === "light"
|
|
||||||
? alpha(theme.palette.common.white, 0.4)
|
|
||||||
: alpha(theme.palette.common.black, 0.4),
|
|
||||||
boxShadow: theme.shadows[3],
|
|
||||||
padding: "8px 12px",
|
|
||||||
}));
|
|
||||||
|
|
||||||
const StyledMenuItem = styled(MenuItem)(({ theme }) => ({
|
|
||||||
fontSize: "1.1rem",
|
|
||||||
margin: theme.spacing(4, 2),
|
|
||||||
}));
|
|
||||||
|
|
||||||
const AppAppBar = () => {
|
|
||||||
const [open, setOpen] = useState(false);
|
|
||||||
const theme = useTheme();
|
|
||||||
const mode = useSelector((state) => state.ui.mode);
|
|
||||||
const location = useLocation();
|
|
||||||
const navigate = useNavigate();
|
|
||||||
|
|
||||||
const logoSrc =
|
|
||||||
mode === "light" ? "/images/prism-black.png" : "/images/prism-white.png";
|
|
||||||
|
|
||||||
const toggleDrawer = (newOpen) => () => {
|
|
||||||
setOpen(newOpen);
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleScroll = (id) => {
|
|
||||||
if (location.pathname === "/") {
|
|
||||||
const element = document.getElementById(id);
|
|
||||||
if (element) {
|
|
||||||
element.scrollIntoView({ behavior: "smooth" });
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
navigate(`/#${id}`);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<AppBar
|
|
||||||
position="fixed"
|
|
||||||
sx={{
|
|
||||||
boxShadow: 0,
|
|
||||||
bgcolor: "transparent",
|
|
||||||
backgroundImage: "none",
|
|
||||||
border: "none",
|
|
||||||
mt: "calc(var(--template-frame-height, 0px) + 28px)",
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Container maxWidth="lg">
|
|
||||||
<StyledToolbar
|
|
||||||
variant="dense"
|
|
||||||
disableGutters
|
|
||||||
mode={mode}
|
|
||||||
>
|
|
||||||
<Box sx={{ flexGrow: 1, display: "flex", alignItems: "center", px: 0 }}>
|
|
||||||
<img
|
|
||||||
src={logoSrc}
|
|
||||||
alt="Prism Logo"
|
|
||||||
style={{
|
|
||||||
height: "auto",
|
|
||||||
width: "auto",
|
|
||||||
marginRight: "10px",
|
|
||||||
maxHeight: "32px",
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
<Box sx={{ display: { xs: "none", md: "flex" } }}>
|
|
||||||
<Button
|
|
||||||
variant="text"
|
|
||||||
color="info"
|
|
||||||
size="large"
|
|
||||||
onClick={() => handleScroll("features")}
|
|
||||||
>
|
|
||||||
Features
|
|
||||||
</Button>
|
|
||||||
<Button
|
|
||||||
variant="text"
|
|
||||||
color="info"
|
|
||||||
size="large"
|
|
||||||
onClick={() => handleScroll("highlights")}
|
|
||||||
>
|
|
||||||
Highlights
|
|
||||||
</Button>
|
|
||||||
<Button
|
|
||||||
variant="text"
|
|
||||||
color="info"
|
|
||||||
size="large"
|
|
||||||
onClick={() => handleScroll("faq")}
|
|
||||||
>
|
|
||||||
FAQ
|
|
||||||
</Button>
|
|
||||||
<Button
|
|
||||||
variant="text"
|
|
||||||
color="info"
|
|
||||||
size="large"
|
|
||||||
href="https://uprock.com/blog"
|
|
||||||
>
|
|
||||||
Blog
|
|
||||||
</Button>
|
|
||||||
</Box>
|
|
||||||
</Box>
|
|
||||||
<Box
|
|
||||||
sx={{
|
|
||||||
display: { xs: "none", md: "flex" },
|
|
||||||
gap: 1,
|
|
||||||
alignItems: "center",
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{/* <Button color="primary" variant="text" size="small">
|
|
||||||
Sign in
|
|
||||||
</Button>
|
|
||||||
<Button color="primary" variant="contained" size="small">
|
|
||||||
Sign up
|
|
||||||
</Button> */}
|
|
||||||
</Box>
|
|
||||||
<Box
|
|
||||||
sx={{
|
|
||||||
display: { xs: "flex", md: "none" },
|
|
||||||
|
|
||||||
gap: 1,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<IconButton
|
|
||||||
aria-label="Menu button"
|
|
||||||
onClick={toggleDrawer(true)}
|
|
||||||
>
|
|
||||||
<MenuIcon sx={{ color: theme.palette.text.primary }} />
|
|
||||||
</IconButton>
|
|
||||||
<Drawer
|
|
||||||
anchor="top"
|
|
||||||
open={open}
|
|
||||||
onClose={toggleDrawer(false)}
|
|
||||||
PaperProps={{
|
|
||||||
sx: {
|
|
||||||
top: 0,
|
|
||||||
marginTop: 0,
|
|
||||||
borderRadius: 0,
|
|
||||||
backgroundColor: theme.palette.background.paper,
|
|
||||||
},
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Box sx={{ p: 4, backgroundColor: theme.palette.background.main }}>
|
|
||||||
<Box
|
|
||||||
sx={{
|
|
||||||
display: "flex",
|
|
||||||
justifyContent: "flex-end",
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<IconButton onClick={toggleDrawer(false)}>
|
|
||||||
<CloseRoundedIcon sx={{ color: theme.palette.text.primary }} />
|
|
||||||
</IconButton>
|
|
||||||
</Box>
|
|
||||||
|
|
||||||
<StyledMenuItem>Features</StyledMenuItem>
|
|
||||||
<StyledMenuItem>Testimonials</StyledMenuItem>
|
|
||||||
<StyledMenuItem>Highlights</StyledMenuItem>
|
|
||||||
<StyledMenuItem>FAQ</StyledMenuItem>
|
|
||||||
<StyledMenuItem
|
|
||||||
component="a"
|
|
||||||
href="https://uprock.com/blog"
|
|
||||||
>
|
|
||||||
Blog
|
|
||||||
</StyledMenuItem>
|
|
||||||
{/* <MenuItem>
|
|
||||||
<Button color="primary" variant="contained" fullWidth>
|
|
||||||
Sign up
|
|
||||||
</Button>
|
|
||||||
</MenuItem>
|
|
||||||
<MenuItem>
|
|
||||||
<Button color="primary" variant="outlined" fullWidth>
|
|
||||||
Sign in
|
|
||||||
</Button>
|
|
||||||
</MenuItem> */}
|
|
||||||
</Box>
|
|
||||||
</Drawer>
|
|
||||||
</Box>
|
|
||||||
<ThemeSwitch />
|
|
||||||
</StyledToolbar>
|
|
||||||
</Container>
|
|
||||||
</AppBar>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default AppAppBar;
|
|
||||||
@@ -1,255 +0,0 @@
|
|||||||
import * as React from "react";
|
|
||||||
import Box from "@mui/material/Box";
|
|
||||||
import Container from "@mui/material/Container";
|
|
||||||
import IconButton from "@mui/material/IconButton";
|
|
||||||
import Link from "@mui/material/Link";
|
|
||||||
import Stack from "@mui/material/Stack";
|
|
||||||
import Typography from "@mui/material/Typography";
|
|
||||||
import { FaFacebook, FaLinkedin, FaGithub, FaTwitter, FaEnvelope } from "react-icons/fa";
|
|
||||||
|
|
||||||
function Copyright() {
|
|
||||||
return (
|
|
||||||
<Typography sx={{ color: "text.secondary", mt: 1 }}>
|
|
||||||
{"Copyright © "}
|
|
||||||
<Link
|
|
||||||
color="text.secondary"
|
|
||||||
href="https://prism.uprock.com/"
|
|
||||||
>
|
|
||||||
UpRock
|
|
||||||
</Link>
|
|
||||||
|
|
||||||
{new Date().getFullYear()}
|
|
||||||
</Typography>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
export default function Footer() {
|
|
||||||
return (
|
|
||||||
<Container
|
|
||||||
sx={{
|
|
||||||
display: "flex",
|
|
||||||
flexDirection: "column",
|
|
||||||
alignItems: "center",
|
|
||||||
gap: { xs: 4, sm: 8 },
|
|
||||||
py: { xs: 24, sm: 24 },
|
|
||||||
px: { xs: 12, sm: 12 },
|
|
||||||
textAlign: { sm: "center", md: "left" },
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Box
|
|
||||||
sx={{
|
|
||||||
display: "flex",
|
|
||||||
justifyContent: "space-between",
|
|
||||||
pt: { xs: 4, sm: 8 },
|
|
||||||
width: "100%",
|
|
||||||
borderColor: "divider",
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<div>
|
|
||||||
<Link
|
|
||||||
color="text.secondary"
|
|
||||||
href="https://uprock.com/privacy-policy"
|
|
||||||
>
|
|
||||||
Privacy Policy
|
|
||||||
</Link>
|
|
||||||
<Typography sx={{ display: "inline", mx: 0.5, opacity: 0.5 }}>
|
|
||||||
•
|
|
||||||
</Typography>
|
|
||||||
<Link
|
|
||||||
color="text.secondary"
|
|
||||||
href="https://uprock.com/terms-of-use"
|
|
||||||
>
|
|
||||||
Terms of Service
|
|
||||||
</Link>
|
|
||||||
<Copyright />
|
|
||||||
</div>
|
|
||||||
<Stack
|
|
||||||
direction="row"
|
|
||||||
spacing={1}
|
|
||||||
useFlexGap
|
|
||||||
sx={{ justifyContent: "left", color: "text.secondary" }}
|
|
||||||
>
|
|
||||||
<IconButton
|
|
||||||
color="inherit"
|
|
||||||
size="small"
|
|
||||||
href="mailto:prism@uprock.com?subject=Interested%20in%20UpRock%20Prism"
|
|
||||||
aria-label="Contact Us"
|
|
||||||
sx={{ alignSelf: "center" }}
|
|
||||||
>
|
|
||||||
<FaEnvelope />
|
|
||||||
</IconButton>
|
|
||||||
<IconButton
|
|
||||||
color="inherit"
|
|
||||||
size="small"
|
|
||||||
href="https://facebook.com/uprockcom"
|
|
||||||
aria-label="Facebook"
|
|
||||||
sx={{ alignSelf: "center" }}
|
|
||||||
>
|
|
||||||
<FaFacebook />
|
|
||||||
</IconButton>
|
|
||||||
<IconButton
|
|
||||||
color="inherit"
|
|
||||||
size="small"
|
|
||||||
href="https://x.com/uprockcom"
|
|
||||||
aria-label="X"
|
|
||||||
sx={{ alignSelf: "center" }}
|
|
||||||
>
|
|
||||||
<FaTwitter />
|
|
||||||
</IconButton>
|
|
||||||
<IconButton
|
|
||||||
color="inherit"
|
|
||||||
size="small"
|
|
||||||
href="https://www.linkedin.com/company/uprock/"
|
|
||||||
aria-label="LinkedIn"
|
|
||||||
sx={{ alignSelf: "center" }}
|
|
||||||
>
|
|
||||||
<FaLinkedin />
|
|
||||||
</IconButton>
|
|
||||||
<IconButton
|
|
||||||
color="inherit"
|
|
||||||
size="small"
|
|
||||||
href="https://github.com/uprockcom"
|
|
||||||
aria-label="GitHub"
|
|
||||||
sx={{ alignSelf: "center" }}
|
|
||||||
>
|
|
||||||
<FaGithub />
|
|
||||||
</IconButton>
|
|
||||||
</Stack>
|
|
||||||
</Box>
|
|
||||||
|
|
||||||
<Box
|
|
||||||
sx={{
|
|
||||||
display: "flex",
|
|
||||||
flexDirection: "column",
|
|
||||||
alignItems: "center",
|
|
||||||
mt: 4,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Typography
|
|
||||||
variant="h2"
|
|
||||||
sx={{ color: "text.secondary" }}
|
|
||||||
>
|
|
||||||
Made with ❤️ by
|
|
||||||
<Link
|
|
||||||
href="https://uprock.com"
|
|
||||||
color="inherit"
|
|
||||||
sx={{ mx: 0.5 }}
|
|
||||||
>
|
|
||||||
UpRock
|
|
||||||
</Link>
|
|
||||||
&
|
|
||||||
<Link
|
|
||||||
href="https://bluewavelabs.ca"
|
|
||||||
color="inherit"
|
|
||||||
sx={{ mx: 0.5 }}
|
|
||||||
>
|
|
||||||
Bluewave Labs
|
|
||||||
</Link>
|
|
||||||
</Typography>
|
|
||||||
<Box
|
|
||||||
sx={{
|
|
||||||
display: "flex",
|
|
||||||
alignItems: "center",
|
|
||||||
mt: 2,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Typography
|
|
||||||
variant="h2"
|
|
||||||
sx={{ color: "text.secondary", mr: 1 }}
|
|
||||||
>
|
|
||||||
Built on
|
|
||||||
</Typography>
|
|
||||||
<svg
|
|
||||||
id="Layer_1"
|
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
|
||||||
xmlnsXlink="http://www.w3.org/1999/xlink"
|
|
||||||
x="0px"
|
|
||||||
y="0px"
|
|
||||||
viewBox="0 0 397.7 311.7"
|
|
||||||
xmlSpace="preserve"
|
|
||||||
width="15"
|
|
||||||
height="15"
|
|
||||||
>
|
|
||||||
<style type="text/css">
|
|
||||||
{`.st0{fill:url(#SVGID_1_);}
|
|
||||||
.st1{fill:url(#SVGID_2_);}
|
|
||||||
.st2{fill:url(#SVGID_3_);}`}
|
|
||||||
</style>
|
|
||||||
<linearGradient
|
|
||||||
id="SVGID_1_"
|
|
||||||
gradientUnits="userSpaceOnUse"
|
|
||||||
x1="360.8791"
|
|
||||||
y1="351.4553"
|
|
||||||
x2="141.213"
|
|
||||||
y2="-69.2936"
|
|
||||||
gradientTransform="matrix(1 0 0 -1 0 314)"
|
|
||||||
>
|
|
||||||
<stop
|
|
||||||
offset="0"
|
|
||||||
style={{ stopColor: "rgb(0, 255, 163)" }}
|
|
||||||
/>
|
|
||||||
<stop
|
|
||||||
offset="1"
|
|
||||||
style={{ stopColor: "rgb(220, 31, 255)" }}
|
|
||||||
/>
|
|
||||||
</linearGradient>
|
|
||||||
<path
|
|
||||||
className="st0"
|
|
||||||
d="M64.6,237.9c2.4-2.4,5.7-3.8,9.2-3.8h317.4c5.8,0,8.7,7,4.6,11.1l-62.7,62.7c-2.4,2.4-5.7,3.8-9.2,3.8H6.5 c-5.8,0-8.7-7-4.6-11.1L64.6,237.9z"
|
|
||||||
/>
|
|
||||||
<linearGradient
|
|
||||||
id="SVGID_2_"
|
|
||||||
gradientUnits="userSpaceOnUse"
|
|
||||||
x1="264.8291"
|
|
||||||
y1="401.6014"
|
|
||||||
x2="45.163"
|
|
||||||
y2="-19.1475"
|
|
||||||
gradientTransform="matrix(1 0 0 -1 0 314)"
|
|
||||||
>
|
|
||||||
<stop
|
|
||||||
offset="0"
|
|
||||||
style={{ stopColor: "rgb(0, 255, 163)" }}
|
|
||||||
/>
|
|
||||||
<stop
|
|
||||||
offset="1"
|
|
||||||
style={{ stopColor: "rgb(220, 31, 255)" }}
|
|
||||||
/>
|
|
||||||
</linearGradient>
|
|
||||||
<path
|
|
||||||
className="st1"
|
|
||||||
d="M64.6,3.8C67.1,1.4,70.4,0,73.8,0h317.4c5.8,0,8.7,7,4.6,11.1l-62.7,62.7c-2.4,2.4-5.7,3.8-9.2,3.8H6.5 c-5.8,0-8.7-7-4.6-11.1L64.6,3.8z"
|
|
||||||
/>
|
|
||||||
<linearGradient
|
|
||||||
id="SVGID_3_"
|
|
||||||
gradientUnits="userSpaceOnUse"
|
|
||||||
x1="312.5484"
|
|
||||||
y1="376.688"
|
|
||||||
x2="92.8822"
|
|
||||||
y2="-44.061"
|
|
||||||
gradientTransform="matrix(1 0 0 -1 0 314)"
|
|
||||||
>
|
|
||||||
<stop
|
|
||||||
offset="0"
|
|
||||||
style={{ stopColor: "rgb(0, 255, 163)" }}
|
|
||||||
/>
|
|
||||||
<stop
|
|
||||||
offset="1"
|
|
||||||
style={{ stopColor: "rgb(220, 31, 255)" }}
|
|
||||||
/>
|
|
||||||
</linearGradient>
|
|
||||||
<path
|
|
||||||
className="st2"
|
|
||||||
d="M333.1,120.1c-2.4-2.4-5.7-3.8-9.2-3.8H6.5c-5.8,0-8.7,7-4.6,11.1l62.7,62.7c2.4,2.4,5.7,3.8,9.2,3.8h317.4 c5.8,0,8.7-7,4.6-11.1L333.1,120.1z"
|
|
||||||
/>
|
|
||||||
</svg>
|
|
||||||
<Typography
|
|
||||||
variant="h2"
|
|
||||||
sx={{ color: "text.secondary", ml: 1 }}
|
|
||||||
>
|
|
||||||
Solana
|
|
||||||
</Typography>
|
|
||||||
</Box>
|
|
||||||
</Box>
|
|
||||||
</Container>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,58 +0,0 @@
|
|||||||
import { Box, Stack, Typography } from "@mui/material";
|
|
||||||
import PropTypes from "prop-types";
|
|
||||||
import { useTheme } from "@emotion/react";
|
|
||||||
import ConfigBox from "../ConfigBox";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ConfigRow is a styled container used to layout content in a row format with specific padding, border, and spacing.
|
|
||||||
* It serves as the wrapper for ConfigBox, with the left section displaying the title and description,
|
|
||||||
* and the right section displaying the children.
|
|
||||||
*
|
|
||||||
* @component
|
|
||||||
* @example
|
|
||||||
* return (
|
|
||||||
* <ConfigBox>
|
|
||||||
* <div>Left content (Title + Description)</div>
|
|
||||||
* <div>Right content (Children)</div>
|
|
||||||
* </ConfigBox>
|
|
||||||
* );
|
|
||||||
*/
|
|
||||||
|
|
||||||
const ConfigRow = ({ title, description, children }) => {
|
|
||||||
const theme = useTheme();
|
|
||||||
|
|
||||||
return (
|
|
||||||
<ConfigBox>
|
|
||||||
<Box>
|
|
||||||
<Typography
|
|
||||||
component="h2"
|
|
||||||
variant="h2"
|
|
||||||
>
|
|
||||||
{title}
|
|
||||||
</Typography>
|
|
||||||
{description && (
|
|
||||||
<Typography
|
|
||||||
variant="body2"
|
|
||||||
mt={theme.spacing(2)}
|
|
||||||
>
|
|
||||||
{description}
|
|
||||||
</Typography>
|
|
||||||
)}
|
|
||||||
</Box>
|
|
||||||
<Stack
|
|
||||||
gap={theme.spacing(15)}
|
|
||||||
mt={theme.spacing(4)}
|
|
||||||
>
|
|
||||||
{children}
|
|
||||||
</Stack>
|
|
||||||
</ConfigBox>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
ConfigRow.propTypes = {
|
|
||||||
title: PropTypes.string.isRequired,
|
|
||||||
description: PropTypes.string,
|
|
||||||
children: PropTypes.node,
|
|
||||||
};
|
|
||||||
|
|
||||||
export default ConfigRow;
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
import PropTypes from "prop-types";
|
|
||||||
|
|
||||||
const Dot = ({ color = "gray", size = "4px", style }) => {
|
|
||||||
return (
|
|
||||||
<span
|
|
||||||
style={{
|
|
||||||
content: '""',
|
|
||||||
width: size,
|
|
||||||
height: size,
|
|
||||||
borderRadius: "50%",
|
|
||||||
backgroundColor: color,
|
|
||||||
opacity: 0.8,
|
|
||||||
...style,
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
Dot.propTypes = {
|
|
||||||
color: PropTypes.string,
|
|
||||||
size: PropTypes.string,
|
|
||||||
};
|
|
||||||
|
|
||||||
export default Dot;
|
|
||||||
@@ -1,44 +0,0 @@
|
|||||||
[class*="fallback__"] {
|
|
||||||
width: fit-content;
|
|
||||||
margin: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
[class*="fallback__"] h1.MuiTypography-root {
|
|
||||||
font-size: var(--env-var-font-size-large);
|
|
||||||
font-weight: 600;
|
|
||||||
}
|
|
||||||
|
|
||||||
[class*="fallback__"] button.MuiButtonBase-root,
|
|
||||||
[class*="fallback__"] .check {
|
|
||||||
width: max-content;
|
|
||||||
}
|
|
||||||
|
|
||||||
[class*="fallback__"] button.MuiButtonBase-root {
|
|
||||||
min-height: 34px;
|
|
||||||
}
|
|
||||||
|
|
||||||
[class*="fallback__"] .check span.MuiTypography-root,
|
|
||||||
[class*="fallback__"] button.MuiButtonBase-root {
|
|
||||||
font-size: var(--env-var-font-size-medium);
|
|
||||||
}
|
|
||||||
|
|
||||||
[class*="fallback__"] .background-pattern-svg {
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
left: 50%;
|
|
||||||
transform: translate(-50%, -50%);
|
|
||||||
z-index: 0;
|
|
||||||
|
|
||||||
width: 100%;
|
|
||||||
max-width: 800px;
|
|
||||||
height: 100%;
|
|
||||||
max-height: 800px;
|
|
||||||
|
|
||||||
background-position: center;
|
|
||||||
background-size: cover;
|
|
||||||
background-repeat: no-repeat;
|
|
||||||
}
|
|
||||||
|
|
||||||
.fallback__status > .MuiStack-root {
|
|
||||||
margin-left: var(--env-var-spacing-2);
|
|
||||||
}
|
|
||||||
@@ -1,212 +0,0 @@
|
|||||||
import PropTypes from "prop-types";
|
|
||||||
import { useTheme } from "@emotion/react";
|
|
||||||
import { Box, Button, Stack, Typography, Link } from "@mui/material";
|
|
||||||
import { Link as RouterLink } from "react-router-dom";
|
|
||||||
import Skeleton from "../../assets/Images/create-placeholder.svg?react";
|
|
||||||
import SkeletonDark from "../../assets/Images/create-placeholder-dark.svg?react";
|
|
||||||
import Background from "../../assets/Images/background-grid.svg?react";
|
|
||||||
import Check from "../Check/Check";
|
|
||||||
import { useNavigate } from "react-router-dom";
|
|
||||||
import { useSelector } from "react-redux";
|
|
||||||
import Alert from "../Alert";
|
|
||||||
import { useTranslation } from "react-i18next";
|
|
||||||
import "./index.css";
|
|
||||||
import { useFetchSettings } from "../../Hooks/settingsHooks";
|
|
||||||
import { useState } from "react";
|
|
||||||
/**
|
|
||||||
* Fallback component to display a fallback UI with a title, a list of checks, and a navigation button.
|
|
||||||
*
|
|
||||||
* @param {Object} props - The component props.
|
|
||||||
* @param {string} props.title - The title to be displayed in the fallback UI.
|
|
||||||
* @param {Array<string>} props.checks - An array of strings representing the checks to display.
|
|
||||||
* @param {string} [props.link="/"] - The link to navigate to.
|
|
||||||
* @param {boolean} [props.vowelStart=false] - Whether the title starts with a vowel.
|
|
||||||
* @param {boolean} [props.showPageSpeedWarning=false] - Whether to show the PageSpeed API warning.
|
|
||||||
* @returns {JSX.Element} The rendered fallback UI.
|
|
||||||
*/
|
|
||||||
|
|
||||||
const Fallback = ({
|
|
||||||
title,
|
|
||||||
checks,
|
|
||||||
link = "/",
|
|
||||||
isAdmin,
|
|
||||||
vowelStart = false,
|
|
||||||
showPageSpeedWarning = false,
|
|
||||||
}) => {
|
|
||||||
const theme = useTheme();
|
|
||||||
const navigate = useNavigate();
|
|
||||||
const mode = useSelector((state) => state.ui.mode);
|
|
||||||
const { t } = useTranslation();
|
|
||||||
const [settingsData, setSettingsData] = useState(undefined);
|
|
||||||
|
|
||||||
const [isLoading, error] = useFetchSettings({
|
|
||||||
setSettingsData,
|
|
||||||
setIsApiKeySet: () => {},
|
|
||||||
setIsEmailPasswordSet: () => {},
|
|
||||||
});
|
|
||||||
// Custom warning message with clickable link
|
|
||||||
const renderWarningMessage = () => {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
{t("pageSpeedWarning")}{" "}
|
|
||||||
<Link
|
|
||||||
component={RouterLink}
|
|
||||||
to="/settings"
|
|
||||||
sx={{
|
|
||||||
textDecoration: "underline",
|
|
||||||
color: "inherit",
|
|
||||||
fontWeight: "inherit",
|
|
||||||
"&:hover": {
|
|
||||||
textDecoration: "underline",
|
|
||||||
},
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{t("pageSpeedLearnMoreLink")}
|
|
||||||
</Link>{" "}
|
|
||||||
{t("pageSpeedAddApiKey")}
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
return (
|
|
||||||
<Box
|
|
||||||
position="relative"
|
|
||||||
sx={{
|
|
||||||
height: "100%",
|
|
||||||
width: "100%",
|
|
||||||
display: "flex",
|
|
||||||
justifyContent: "center",
|
|
||||||
alignItems: "center",
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Box
|
|
||||||
border={1}
|
|
||||||
borderColor={theme.palette.primary.lowContrast}
|
|
||||||
borderRadius={theme.shape.borderRadius}
|
|
||||||
backgroundColor={theme.palette.primary.main}
|
|
||||||
overflow="hidden"
|
|
||||||
sx={{
|
|
||||||
display: "flex",
|
|
||||||
borderStyle: "dashed",
|
|
||||||
height: {
|
|
||||||
sm: "50vh",
|
|
||||||
md: "70vh",
|
|
||||||
lg: "60vh",
|
|
||||||
xl: "55vh",
|
|
||||||
},
|
|
||||||
width: {
|
|
||||||
sm: "90%",
|
|
||||||
md: "50%",
|
|
||||||
lg: "40%",
|
|
||||||
},
|
|
||||||
padding: theme.spacing(10),
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Stack
|
|
||||||
className={`fallback__${title?.trim().split(" ")[0]}`}
|
|
||||||
alignItems="center"
|
|
||||||
gap={theme.spacing(20)}
|
|
||||||
>
|
|
||||||
{mode === "light" ? (
|
|
||||||
<Skeleton style={{ zIndex: 1 }} />
|
|
||||||
) : (
|
|
||||||
<SkeletonDark style={{ zIndex: 1 }} />
|
|
||||||
)}
|
|
||||||
<Box
|
|
||||||
className="background-pattern-svg"
|
|
||||||
sx={{
|
|
||||||
"& svg g g:last-of-type path": {
|
|
||||||
stroke: theme.palette.primary.lowContrast,
|
|
||||||
},
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Background style={{ width: "100%" }} />
|
|
||||||
</Box>
|
|
||||||
<Stack
|
|
||||||
gap={theme.spacing(4)}
|
|
||||||
maxWidth={theme.spacing(180)}
|
|
||||||
zIndex={1}
|
|
||||||
>
|
|
||||||
<Typography
|
|
||||||
alignSelf="center"
|
|
||||||
component="h1"
|
|
||||||
marginY={theme.spacing(4)}
|
|
||||||
color={theme.palette.primary.contrastTextTertiary}
|
|
||||||
>
|
|
||||||
{vowelStart ? "An" : "A"} {title} is used to:
|
|
||||||
</Typography>
|
|
||||||
{checks?.map((check, index) => (
|
|
||||||
<Check
|
|
||||||
text={check}
|
|
||||||
key={`${title.trim().split(" ")[0]}-${index}`}
|
|
||||||
outlined={true}
|
|
||||||
/>
|
|
||||||
))}
|
|
||||||
</Stack>
|
|
||||||
{/* TODO - display a different fallback if user is not an admin*/}
|
|
||||||
{isAdmin && (
|
|
||||||
<>
|
|
||||||
<Button
|
|
||||||
variant="contained"
|
|
||||||
color="accent"
|
|
||||||
sx={{ alignSelf: "center" }}
|
|
||||||
onClick={() => navigate(link)}
|
|
||||||
>
|
|
||||||
Let's create your first {title}
|
|
||||||
</Button>
|
|
||||||
{/* Bulk create of uptime monitors */}
|
|
||||||
{title === "uptime monitor" && (
|
|
||||||
<Button
|
|
||||||
variant="contained"
|
|
||||||
color="accent"
|
|
||||||
sx={{ alignSelf: "center" }}
|
|
||||||
onClick={() => navigate("/uptime/bulk-import")}
|
|
||||||
>
|
|
||||||
{t("bulkImport.fallbackPage")}
|
|
||||||
</Button>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{/* Warning box for PageSpeed monitor */}
|
|
||||||
{title === "pagespeed monitor" && showPageSpeedWarning && (
|
|
||||||
<Box sx={{ width: "80%", maxWidth: "600px", zIndex: 1 }}>
|
|
||||||
<Box
|
|
||||||
sx={{
|
|
||||||
"& .alert.row-stack": {
|
|
||||||
backgroundColor: theme.palette.warningSecondary.main,
|
|
||||||
borderColor: theme.palette.warningSecondary.lowContrast,
|
|
||||||
"& .MuiTypography-root": {
|
|
||||||
color: theme.palette.warningSecondary.contrastText,
|
|
||||||
},
|
|
||||||
"& .MuiBox-root > svg": {
|
|
||||||
color: theme.palette.warningSecondary.contrastText,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{settingsData?.pagespeedKeySet === false && (
|
|
||||||
<Alert
|
|
||||||
variant="warning"
|
|
||||||
hasIcon={true}
|
|
||||||
body={renderWarningMessage()}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
</Box>
|
|
||||||
</Box>
|
|
||||||
)}
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
</Stack>
|
|
||||||
</Box>
|
|
||||||
</Box>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
Fallback.propTypes = {
|
|
||||||
title: PropTypes.string.isRequired,
|
|
||||||
checks: PropTypes.arrayOf(PropTypes.string).isRequired,
|
|
||||||
link: PropTypes.string,
|
|
||||||
isAdmin: PropTypes.bool,
|
|
||||||
vowelStart: PropTypes.bool,
|
|
||||||
showPageSpeedWarning: PropTypes.bool,
|
|
||||||
};
|
|
||||||
|
|
||||||
export default Fallback;
|
|
||||||
@@ -1,99 +0,0 @@
|
|||||||
import { Checkbox, FormControl, ListItemText, MenuItem, Select } from "@mui/material";
|
|
||||||
import { useTheme } from "@emotion/react";
|
|
||||||
import PropTypes from "prop-types";
|
|
||||||
import AddCircleOutlineIcon from "@mui/icons-material/AddCircleOutline";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A reusable filter header component that displays a dropdown menu with selectable options.
|
|
||||||
*
|
|
||||||
* @component
|
|
||||||
* @param {Object} props - The component props.
|
|
||||||
* @param {string} props.header - The header text to display when no options are selected.
|
|
||||||
* @param {Array} props.options - An array of options to display in the dropdown menu. Each option should have a `value` and `label`.
|
|
||||||
* @param {Array} [props.value] - The currently selected values.
|
|
||||||
* @param {Function} props.onChange - The callback function to handle changes in the selected values.
|
|
||||||
* @param {boolean} [props.multiple=true] - Whether multiple options can be selected.
|
|
||||||
* @returns {JSX.Element} The rendered FilterHeader component.
|
|
||||||
*/
|
|
||||||
|
|
||||||
const FilterHeader = ({ header, options, value, onChange, multiple = true }) => {
|
|
||||||
const theme = useTheme();
|
|
||||||
|
|
||||||
const controlledValue = value === undefined ? [] : value; // Ensure value is always treated as an array for controlled component purposes
|
|
||||||
|
|
||||||
return (
|
|
||||||
<FormControl
|
|
||||||
sx={{ minWidth: "10%" }}
|
|
||||||
size="small"
|
|
||||||
>
|
|
||||||
<Select
|
|
||||||
multiple={multiple}
|
|
||||||
IconComponent={(props) => (
|
|
||||||
<AddCircleOutlineIcon
|
|
||||||
{...props}
|
|
||||||
sx={{ fontSize: "medium" }}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
displayEmpty
|
|
||||||
value={controlledValue}
|
|
||||||
onChange={onChange}
|
|
||||||
renderValue={(selected) => {
|
|
||||||
if (!selected?.length) {
|
|
||||||
return header;
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
header +
|
|
||||||
" | " +
|
|
||||||
selected
|
|
||||||
.map((value) => options.find((option) => option.value === value)?.label)
|
|
||||||
.filter(Boolean)
|
|
||||||
.join(", ")
|
|
||||||
);
|
|
||||||
}}
|
|
||||||
MenuProps={{
|
|
||||||
anchorOrigin: {
|
|
||||||
vertical: "bottom",
|
|
||||||
horizontal: "left",
|
|
||||||
},
|
|
||||||
transformOrigin: {
|
|
||||||
vertical: "top",
|
|
||||||
horizontal: "left",
|
|
||||||
},
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{options.map((option) => (
|
|
||||||
<MenuItem
|
|
||||||
key={option.value}
|
|
||||||
value={option.value}
|
|
||||||
sx={{
|
|
||||||
height: theme.spacing(17),
|
|
||||||
padding: 0,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Checkbox
|
|
||||||
checked={controlledValue.includes(option.value)}
|
|
||||||
size="small"
|
|
||||||
/>
|
|
||||||
<ListItemText primary={option.label} />
|
|
||||||
</MenuItem>
|
|
||||||
))}
|
|
||||||
</Select>
|
|
||||||
</FormControl>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
FilterHeader.propTypes = {
|
|
||||||
header: PropTypes.string.isRequired,
|
|
||||||
options: PropTypes.arrayOf(
|
|
||||||
PropTypes.shape({
|
|
||||||
value: PropTypes.string.isRequired,
|
|
||||||
label: PropTypes.string.isRequired,
|
|
||||||
})
|
|
||||||
).isRequired,
|
|
||||||
value: PropTypes.arrayOf(PropTypes.string),
|
|
||||||
onChange: PropTypes.func.isRequired,
|
|
||||||
multiple: PropTypes.bool,
|
|
||||||
};
|
|
||||||
|
|
||||||
export default FilterHeader;
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
import { Typography } from "@mui/material";
|
|
||||||
import { useTheme } from "@emotion/react";
|
|
||||||
import { useTranslation } from "react-i18next";
|
|
||||||
|
|
||||||
const NetworkError = () => {
|
|
||||||
const theme = useTheme();
|
|
||||||
const { t } = useTranslation();
|
|
||||||
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<Typography
|
|
||||||
variant="h1"
|
|
||||||
marginY={theme.spacing(4)}
|
|
||||||
color={theme.palette.primary.contrastTextTertiary}
|
|
||||||
>
|
|
||||||
{t("common.toasts.networkError")}
|
|
||||||
</Typography>
|
|
||||||
<Typography>{t("common.toasts.checkConnection")}</Typography>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default NetworkError;
|
|
||||||
@@ -1,78 +0,0 @@
|
|||||||
import { useTheme } from "@emotion/react";
|
|
||||||
import { Box, Stack } from "@mui/material";
|
|
||||||
import Skeleton from "../../assets/Images/create-placeholder.svg?react";
|
|
||||||
import SkeletonDark from "../../assets/Images/create-placeholder-dark.svg?react";
|
|
||||||
import Background from "../../assets/Images/background-grid.svg?react";
|
|
||||||
import { useSelector } from "react-redux";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Fallback component to display a fallback UI for network errors
|
|
||||||
*
|
|
||||||
* @returns {JSX.Element} The rendered fallback UI.
|
|
||||||
*/
|
|
||||||
|
|
||||||
const GenericFallback = ({ children }) => {
|
|
||||||
const theme = useTheme();
|
|
||||||
const mode = useSelector((state) => state.ui.mode);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Box
|
|
||||||
padding={theme.spacing(16)}
|
|
||||||
position="relative"
|
|
||||||
border={1}
|
|
||||||
borderColor={theme.palette.primary.lowContrast}
|
|
||||||
borderRadius={theme.shape.borderRadius}
|
|
||||||
backgroundColor={theme.palette.primary.main}
|
|
||||||
overflow="hidden"
|
|
||||||
sx={{
|
|
||||||
borderStyle: "dashed",
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Stack
|
|
||||||
alignItems="center"
|
|
||||||
gap={theme.spacing(20)}
|
|
||||||
sx={{
|
|
||||||
width: "fit-content",
|
|
||||||
margin: "auto",
|
|
||||||
marginTop: "100px",
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{mode === "light" ? (
|
|
||||||
<Skeleton style={{ zIndex: 1 }} />
|
|
||||||
) : (
|
|
||||||
<SkeletonDark style={{ zIndex: 1 }} />
|
|
||||||
)}
|
|
||||||
<Box
|
|
||||||
sx={{
|
|
||||||
"& svg g g:last-of-type path": {
|
|
||||||
stroke: theme.palette.primary.lowContrast,
|
|
||||||
},
|
|
||||||
position: "absolute",
|
|
||||||
top: "0",
|
|
||||||
left: "50%",
|
|
||||||
transform: "translate(-50%, -50%)",
|
|
||||||
width: "100%",
|
|
||||||
maxWidth: "800px",
|
|
||||||
height: "100%",
|
|
||||||
maxHeight: "800px",
|
|
||||||
backgroundPosition: "center",
|
|
||||||
backgroundSize: "cover",
|
|
||||||
backgroundRepeat: "no-repeat",
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Background style={{ width: "100%" }} />
|
|
||||||
</Box>
|
|
||||||
<Stack
|
|
||||||
gap={theme.spacing(4)}
|
|
||||||
alignItems="center"
|
|
||||||
maxWidth={"300px"}
|
|
||||||
zIndex={1}
|
|
||||||
>
|
|
||||||
{children}
|
|
||||||
</Stack>
|
|
||||||
</Stack>
|
|
||||||
</Box>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default GenericFallback;
|
|
||||||
@@ -1,49 +0,0 @@
|
|||||||
import { useEffect, useState } from "react";
|
|
||||||
import { useNavigate } from "react-router-dom";
|
|
||||||
|
|
||||||
import { logger } from "../../Utils/Logger";
|
|
||||||
import { networkService } from "../../main";
|
|
||||||
|
|
||||||
const withAdminCheck = (WrappedComponent) => {
|
|
||||||
const WithAdminCheck = (props) => {
|
|
||||||
const navigate = useNavigate();
|
|
||||||
const [isChecking, setIsChecking] = useState(true);
|
|
||||||
const [superAdminExists, setSuperAdminExists] = useState(false);
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
networkService
|
|
||||||
.doesSuperAdminExist()
|
|
||||||
.then((response) => {
|
|
||||||
if (response?.data?.data === true) {
|
|
||||||
navigate("/login");
|
|
||||||
} else {
|
|
||||||
setSuperAdminExists(false);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch((error) => {
|
|
||||||
logger.error(error);
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
setIsChecking(false);
|
|
||||||
});
|
|
||||||
}, [navigate]);
|
|
||||||
|
|
||||||
if (isChecking) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<WrappedComponent
|
|
||||||
{...props}
|
|
||||||
superAdminExists={superAdminExists}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
const wrappedComponentName =
|
|
||||||
WrappedComponent.displayName || WrappedComponent.name || "Component";
|
|
||||||
WithAdminCheck.displayName = `WithAdminCheck(${wrappedComponentName})`;
|
|
||||||
|
|
||||||
return WithAdminCheck;
|
|
||||||
};
|
|
||||||
|
|
||||||
export default withAdminCheck;
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
import { Typography } from "@mui/material";
|
|
||||||
import PropTypes from "prop-types";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A heading component that renders text with a specific heading level.
|
|
||||||
*
|
|
||||||
* @param {Object} props - The properties passed to the Heading component.
|
|
||||||
* @param {('h1'|'h2'|'h3')} props.component - The heading level for the component.
|
|
||||||
* @param {Object} props.style - Custom styles to apply to the heading.
|
|
||||||
* @param {string} props.children - The content to display inside the heading.
|
|
||||||
* @returns {JSX.Element} The Typography component with specified heading properties.
|
|
||||||
*/
|
|
||||||
|
|
||||||
function Heading({ component, style, children }) {
|
|
||||||
return (
|
|
||||||
<Typography
|
|
||||||
component={component}
|
|
||||||
variant="h2"
|
|
||||||
fontWeight={600}
|
|
||||||
style={style}
|
|
||||||
>
|
|
||||||
{children}
|
|
||||||
</Typography>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
Heading.propTypes = {
|
|
||||||
component: PropTypes.oneOf(["h1", "h2", "h3"]).isRequired,
|
|
||||||
style: PropTypes.object,
|
|
||||||
children: PropTypes.string.isRequired,
|
|
||||||
};
|
|
||||||
export { Heading };
|
|
||||||
@@ -1,56 +0,0 @@
|
|||||||
import { Stack, Typography } from "@mui/material";
|
|
||||||
import PropTypes from "prop-types";
|
|
||||||
import { useTheme } from "@emotion/react";
|
|
||||||
import Dot from "../Dot";
|
|
||||||
/**
|
|
||||||
* Host component.
|
|
||||||
* This subcomponent receives a params object and displays the host details.
|
|
||||||
*
|
|
||||||
* @component
|
|
||||||
* @param {Object} params - An object containing the following properties:
|
|
||||||
* @param {string} params.url - The URL of the host.
|
|
||||||
* @param {string} params.title - The name of the host.
|
|
||||||
* @param {string} params.percentageColor - The color of the percentage text.
|
|
||||||
* @param {number} params.percentage - The percentage to display.
|
|
||||||
* @returns {React.ElementType} Returns a div element with the host details.
|
|
||||||
*/
|
|
||||||
const Host = ({ url, title, percentageColor, percentage, showURL }) => {
|
|
||||||
const theme = useTheme();
|
|
||||||
return (
|
|
||||||
<Stack>
|
|
||||||
<Stack
|
|
||||||
direction="row"
|
|
||||||
position="relative"
|
|
||||||
alignItems="center"
|
|
||||||
gap={theme.spacing(4)}
|
|
||||||
>
|
|
||||||
{title}
|
|
||||||
{percentageColor && percentage && (
|
|
||||||
<>
|
|
||||||
<Dot />
|
|
||||||
<Typography
|
|
||||||
component="span"
|
|
||||||
sx={{
|
|
||||||
color: percentageColor,
|
|
||||||
fontWeight: 500,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{percentage}%
|
|
||||||
</Typography>
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
</Stack>
|
|
||||||
{showURL && <span style={{ opacity: 0.6 }}>{url}</span>}
|
|
||||||
</Stack>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
Host.propTypes = {
|
|
||||||
title: PropTypes.string,
|
|
||||||
percentageColor: PropTypes.string,
|
|
||||||
percentage: PropTypes.string,
|
|
||||||
url: PropTypes.string,
|
|
||||||
showURL: PropTypes.bool,
|
|
||||||
};
|
|
||||||
|
|
||||||
export default Host;
|
|
||||||
@@ -1,67 +0,0 @@
|
|||||||
import PropTypes from "prop-types";
|
|
||||||
import { useTheme } from "@mui/material";
|
|
||||||
import { BaseLabel } from "../Label";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @component
|
|
||||||
* @param {Object} props
|
|
||||||
* @param {number} props.status - The http status for the label
|
|
||||||
* @param {Styles} props.customStyles - CSS Styles passed from parent component
|
|
||||||
* @returns {JSX.Element}
|
|
||||||
* @example
|
|
||||||
* // Render a http status label
|
|
||||||
* <HttpStatusLabel status={404} />
|
|
||||||
*/
|
|
||||||
|
|
||||||
const DEFAULT_CODE = 9999; // Default code for unknown status
|
|
||||||
|
|
||||||
const handleStatusCode = (status) => {
|
|
||||||
if (status) {
|
|
||||||
return status;
|
|
||||||
}
|
|
||||||
return DEFAULT_CODE;
|
|
||||||
};
|
|
||||||
|
|
||||||
const getRoundedStatusCode = (status) => {
|
|
||||||
return Math.floor(status / 100) * 100;
|
|
||||||
};
|
|
||||||
|
|
||||||
const HttpStatusLabel = ({ status, customStyles }) => {
|
|
||||||
const theme = useTheme();
|
|
||||||
const colors = {
|
|
||||||
400: {
|
|
||||||
color: theme.palette.warning.main,
|
|
||||||
borderColor: theme.palette.warning.lowContrast,
|
|
||||||
},
|
|
||||||
500: {
|
|
||||||
color: theme.palette.error.main,
|
|
||||||
borderColor: theme.palette.error.lowContrast,
|
|
||||||
},
|
|
||||||
default: {
|
|
||||||
color: theme.palette.primary.contrastText,
|
|
||||||
borderColor: theme.palette.primary.contrastText,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
const statusCode = handleStatusCode(status);
|
|
||||||
|
|
||||||
const { borderColor, color } =
|
|
||||||
colors[getRoundedStatusCode(statusCode)] || colors.default;
|
|
||||||
return (
|
|
||||||
<BaseLabel
|
|
||||||
label={String(statusCode)}
|
|
||||||
styles={{
|
|
||||||
color: color,
|
|
||||||
borderColor: borderColor,
|
|
||||||
...customStyles,
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
HttpStatusLabel.propTypes = {
|
|
||||||
status: PropTypes.number,
|
|
||||||
customStyles: PropTypes.object,
|
|
||||||
};
|
|
||||||
|
|
||||||
export { HttpStatusLabel };
|
|
||||||
@@ -1,77 +0,0 @@
|
|||||||
import { Box, styled } from "@mui/material";
|
|
||||||
import PropTypes from "prop-types";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* IconBox - A styled box component for rendering icons with consistent sizing and styling
|
|
||||||
*
|
|
||||||
* @component
|
|
||||||
* @param {Object} [props] - Configuration options for the IconBox
|
|
||||||
* @param {number} [props.height=34] - Height of the icon box
|
|
||||||
* @param {number} [props.width=34] - Width of the icon box
|
|
||||||
* @param {number} [props.minWidth=34] - Minimum width of the icon box
|
|
||||||
* @param {number} [props.borderRadius=4] - Border radius of the icon box
|
|
||||||
* @param {number} [props.svgWidth=20] - Width of the SVG icon
|
|
||||||
* @param {number} [props.svgHeight=20] - Height of the SVG icon
|
|
||||||
*
|
|
||||||
* @example
|
|
||||||
* // Basic usage
|
|
||||||
* <IconBox>
|
|
||||||
* <SomeIcon />
|
|
||||||
* </IconBox>
|
|
||||||
*
|
|
||||||
* @example
|
|
||||||
* // Customized usage
|
|
||||||
* <IconBox
|
|
||||||
* height={40}
|
|
||||||
* width={40}
|
|
||||||
* svgWidth={24}
|
|
||||||
* svgHeight={24}
|
|
||||||
* >
|
|
||||||
* <CustomIcon />
|
|
||||||
* </IconBox>
|
|
||||||
*
|
|
||||||
* @returns {React.ReactElement} A styled box containing an icon
|
|
||||||
*/
|
|
||||||
const IconBox = styled(Box)(
|
|
||||||
({
|
|
||||||
theme,
|
|
||||||
height = 34,
|
|
||||||
width = 34,
|
|
||||||
minWidth = 34,
|
|
||||||
borderRadius = 4,
|
|
||||||
svgWidth = 20,
|
|
||||||
svgHeight = 20,
|
|
||||||
}) => ({
|
|
||||||
height: height,
|
|
||||||
minWidth: minWidth,
|
|
||||||
width: width,
|
|
||||||
position: "relative",
|
|
||||||
border: 1,
|
|
||||||
borderStyle: "solid",
|
|
||||||
borderColor: theme.palette.primary.lowContrast,
|
|
||||||
borderRadius: borderRadius,
|
|
||||||
backgroundColor: theme.palette.tertiary.main,
|
|
||||||
"& svg": {
|
|
||||||
position: "absolute",
|
|
||||||
top: "50%",
|
|
||||||
left: "50%",
|
|
||||||
transform: "translate(-50%, -50%)",
|
|
||||||
width: svgWidth,
|
|
||||||
height: svgHeight,
|
|
||||||
"& path": {
|
|
||||||
stroke: theme.palette.primary.contrastTextTertiary,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
);
|
|
||||||
|
|
||||||
IconBox.propTypes = {
|
|
||||||
height: PropTypes.number,
|
|
||||||
width: PropTypes.number,
|
|
||||||
minWidth: PropTypes.number,
|
|
||||||
borderRadius: PropTypes.number,
|
|
||||||
svgWidth: PropTypes.number,
|
|
||||||
svgHeight: PropTypes.number,
|
|
||||||
};
|
|
||||||
|
|
||||||
export default IconBox;
|
|
||||||
@@ -1,72 +0,0 @@
|
|||||||
import { Box } from "@mui/material";
|
|
||||||
import PropTypes from "prop-types";
|
|
||||||
|
|
||||||
const isValidBase64Image = (data) => {
|
|
||||||
return /^[A-Za-z0-9+/=]+$/.test(data);
|
|
||||||
};
|
|
||||||
|
|
||||||
const Image = ({
|
|
||||||
shouldRender = true,
|
|
||||||
src,
|
|
||||||
alt,
|
|
||||||
width = "auto",
|
|
||||||
height = "auto",
|
|
||||||
minWidth = "auto",
|
|
||||||
minHeight = "auto",
|
|
||||||
maxWidth = "auto",
|
|
||||||
maxHeight = "auto",
|
|
||||||
base64,
|
|
||||||
placeholder,
|
|
||||||
sx,
|
|
||||||
}) => {
|
|
||||||
if (shouldRender === false) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (typeof src !== "undefined" && typeof base64 !== "undefined") {
|
|
||||||
console.warn("base64 takes precedence over src and overwrites it");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (typeof base64 !== "undefined" && isValidBase64Image(base64)) {
|
|
||||||
src = `data:image/png;base64,${base64}`;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (
|
|
||||||
typeof src === "undefined" &&
|
|
||||||
typeof base64 === "undefined" &&
|
|
||||||
typeof placeholder !== "undefined"
|
|
||||||
) {
|
|
||||||
src = placeholder;
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Box
|
|
||||||
component="img"
|
|
||||||
src={src}
|
|
||||||
alt={alt}
|
|
||||||
minWidth={minWidth}
|
|
||||||
minHeight={minHeight}
|
|
||||||
maxWidth={maxWidth}
|
|
||||||
maxHeight={maxHeight}
|
|
||||||
width={width}
|
|
||||||
height={height}
|
|
||||||
sx={{ ...sx }}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
Image.propTypes = {
|
|
||||||
shouldRender: PropTypes.bool,
|
|
||||||
src: PropTypes.string,
|
|
||||||
alt: PropTypes.string.isRequired,
|
|
||||||
width: PropTypes.string,
|
|
||||||
height: PropTypes.string,
|
|
||||||
minWidth: PropTypes.string,
|
|
||||||
minHeight: PropTypes.string,
|
|
||||||
maxWidth: PropTypes.string,
|
|
||||||
maxHeight: PropTypes.string,
|
|
||||||
base64: PropTypes.string,
|
|
||||||
sx: PropTypes.object,
|
|
||||||
};
|
|
||||||
|
|
||||||
export default Image;
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
import { RowContainer } from "../StandardContainer";
|
|
||||||
import { Stack, Typography } from "@mui/material";
|
|
||||||
import Image from "../Image";
|
|
||||||
|
|
||||||
import { useTheme } from "@mui/material/styles";
|
|
||||||
|
|
||||||
const InfoBox = ({
|
|
||||||
img,
|
|
||||||
icon: Icon,
|
|
||||||
alt,
|
|
||||||
heading,
|
|
||||||
headingLevel = 2,
|
|
||||||
subHeading,
|
|
||||||
subHeadingLevel = "",
|
|
||||||
sx,
|
|
||||||
}) => {
|
|
||||||
const theme = useTheme();
|
|
||||||
return (
|
|
||||||
<RowContainer sx={{ ...sx }}>
|
|
||||||
{img && (
|
|
||||||
<Image
|
|
||||||
src={img}
|
|
||||||
height={"30px"}
|
|
||||||
width={"30px"}
|
|
||||||
alt={alt}
|
|
||||||
sx={{ marginRight: theme.spacing(8) }}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
{Icon && (
|
|
||||||
<Icon sx={{ width: "30px", height: "30px", marginRight: theme.spacing(8) }} />
|
|
||||||
)}
|
|
||||||
<Stack>
|
|
||||||
<Typography variant={`h${headingLevel}`}>{heading}</Typography>
|
|
||||||
<Typography variant={subHeadingLevel ? `h${subHeadingLevel}` : "body1"}>
|
|
||||||
{subHeading}
|
|
||||||
</Typography>
|
|
||||||
</Stack>
|
|
||||||
</RowContainer>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default InfoBox;
|
|
||||||
Whitespace-only changes.
Whitespace-only changes.
@@ -1,6 +0,0 @@
|
|||||||
.label {
|
|
||||||
display: inline-flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
line-height: normal;
|
|
||||||
}
|
|
||||||
@@ -1,174 +0,0 @@
|
|||||||
import PropTypes from "prop-types";
|
|
||||||
import { Box } from "@mui/material";
|
|
||||||
import { useTheme } from "@mui/material";
|
|
||||||
import "./index.css";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @typedef {Object} Styles
|
|
||||||
* @param {string} [color] - The text color
|
|
||||||
* @param {string} [backgroundColor] - The background color
|
|
||||||
* @param {string} [borderColor] - The border color
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @component
|
|
||||||
* @param {Object} props
|
|
||||||
* @param {string} props.label - The label of the label
|
|
||||||
* @param {Styles} props.styles - CSS Styles passed from parent component
|
|
||||||
* @param {React.ReactNode} children - Children passed from parent component
|
|
||||||
* @returns {JSX.Element}
|
|
||||||
*/
|
|
||||||
|
|
||||||
const BaseLabel = ({ label, styles, children }) => {
|
|
||||||
const theme = useTheme();
|
|
||||||
// Grab the default borderRadius from the theme to match button style
|
|
||||||
const { borderRadius } = theme.shape;
|
|
||||||
// Calculate padding for the label to mimic button. Appears to scale correctly, not 100% sure though.
|
|
||||||
const padding = theme.spacing(3, 5);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Box
|
|
||||||
className="label"
|
|
||||||
sx={{
|
|
||||||
borderRadius: borderRadius,
|
|
||||||
border: `1px solid ${theme.palette.primary.lowContrast}`,
|
|
||||||
color: theme.palette.primary.contrastText,
|
|
||||||
padding: padding,
|
|
||||||
...styles,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{children}
|
|
||||||
{label}
|
|
||||||
</Box>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
BaseLabel.propTypes = {
|
|
||||||
label: PropTypes.string.isRequired,
|
|
||||||
styles: PropTypes.shape({
|
|
||||||
color: PropTypes.string,
|
|
||||||
backgroundColor: PropTypes.string,
|
|
||||||
}),
|
|
||||||
children: PropTypes.node,
|
|
||||||
};
|
|
||||||
|
|
||||||
// Produces a lighter color based on a hex color and a percent
|
|
||||||
// lightenColor("#067647", 20) will produce a color 20% lighter than #067647
|
|
||||||
const lightenColor = (color, percent) => {
|
|
||||||
let r = parseInt(color.substring(1, 3), 16);
|
|
||||||
let g = parseInt(color.substring(3, 5), 16);
|
|
||||||
let b = parseInt(color.substring(5, 7), 16);
|
|
||||||
|
|
||||||
const amt = Math.round((255 * percent) / 100);
|
|
||||||
|
|
||||||
r = r + amt <= 255 ? r + amt : 255;
|
|
||||||
g = g + amt <= 255 ? g + amt : 255;
|
|
||||||
b = b + amt <= 255 ? b + amt : 255;
|
|
||||||
|
|
||||||
r = r.toString(16).padStart(2, "0");
|
|
||||||
g = g.toString(16).padStart(2, "0");
|
|
||||||
b = b.toString(16).padStart(2, "0");
|
|
||||||
|
|
||||||
return `#${r}${g}${b}`;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @component
|
|
||||||
* @param {Object} props
|
|
||||||
* @param {string} props.label - The label of the label
|
|
||||||
* @param {string} props.color - The color of the label, specified in #RRGGBB format
|
|
||||||
* @returns {JSX.Element}
|
|
||||||
* @example
|
|
||||||
* // Render a red label
|
|
||||||
* <ColoredLabel label="Label" color="#FF0000" />
|
|
||||||
*/
|
|
||||||
|
|
||||||
const ColoredLabel = ({ label, color }) => {
|
|
||||||
const theme = useTheme();
|
|
||||||
// If an invalid color is passed, default to the labelGray color
|
|
||||||
if (typeof color !== "string" || !/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/.test(color)) {
|
|
||||||
color = theme.palette.primary.lowContrast;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Calculate lighter shades for border and bg
|
|
||||||
const borderColor = lightenColor(color, 20);
|
|
||||||
const bgColor = lightenColor(color, 75);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<BaseLabel
|
|
||||||
label={label}
|
|
||||||
styles={{
|
|
||||||
color: color,
|
|
||||||
borderColor: borderColor,
|
|
||||||
backgroundColor: bgColor,
|
|
||||||
}}
|
|
||||||
></BaseLabel>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
ColoredLabel.propTypes = {
|
|
||||||
label: PropTypes.string.isRequired,
|
|
||||||
color: PropTypes.string.isRequired,
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @component
|
|
||||||
* @param {Object} props
|
|
||||||
* @param {'up' | 'down' | 'paused' | 'pending' | 'cannot resolve' | 'published' | 'unpublished'} props.status - The status for the label
|
|
||||||
* @param {string} props.text - The text of the label
|
|
||||||
* @returns {JSX.Element}
|
|
||||||
* @example
|
|
||||||
* // Render an active label
|
|
||||||
* <StatusLabel status="up" text="Active" />
|
|
||||||
*/
|
|
||||||
|
|
||||||
const statusToTheme = {
|
|
||||||
up: "success",
|
|
||||||
down: "error",
|
|
||||||
paused: "warning",
|
|
||||||
pending: "warning",
|
|
||||||
"cannot resolve": "error",
|
|
||||||
published: "success",
|
|
||||||
unpublished: "error",
|
|
||||||
};
|
|
||||||
|
|
||||||
const StatusLabel = ({ status, text, customStyles }) => {
|
|
||||||
const theme = useTheme();
|
|
||||||
|
|
||||||
const themeColor = statusToTheme[status];
|
|
||||||
|
|
||||||
return (
|
|
||||||
<BaseLabel
|
|
||||||
label={text}
|
|
||||||
styles={{
|
|
||||||
color: theme.palette[themeColor].main,
|
|
||||||
borderColor: theme.palette[themeColor].lowContrast,
|
|
||||||
...customStyles,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Box
|
|
||||||
width={7}
|
|
||||||
height={7}
|
|
||||||
bgcolor={theme.palette[themeColor].lowContrast}
|
|
||||||
borderRadius="50%"
|
|
||||||
marginRight="5px"
|
|
||||||
/>
|
|
||||||
</BaseLabel>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
StatusLabel.propTypes = {
|
|
||||||
status: PropTypes.oneOf([
|
|
||||||
"up",
|
|
||||||
"down",
|
|
||||||
"paused",
|
|
||||||
"pending",
|
|
||||||
"cannot resolve",
|
|
||||||
"published",
|
|
||||||
"unpublished",
|
|
||||||
]),
|
|
||||||
text: PropTypes.string,
|
|
||||||
customStyles: PropTypes.object,
|
|
||||||
};
|
|
||||||
|
|
||||||
export { BaseLabel, ColoredLabel, StatusLabel };
|
|
||||||
@@ -6,10 +6,17 @@ import { useSelector } from "react-redux";
|
|||||||
import { useDispatch } from "react-redux";
|
import { useDispatch } from "react-redux";
|
||||||
import { setLanguage } from "../Features/UI/uiSlice";
|
import { setLanguage } from "../Features/UI/uiSlice";
|
||||||
|
|
||||||
|
const langMap = {
|
||||||
|
cs: "cz",
|
||||||
|
ja: "jp",
|
||||||
|
uk: "ua",
|
||||||
|
vi: "vn",
|
||||||
|
};
|
||||||
|
|
||||||
const LanguageSelector = () => {
|
const LanguageSelector = () => {
|
||||||
const { i18n } = useTranslation();
|
const { i18n } = useTranslation();
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
const { language } = useSelector((state) => state.ui);
|
const { language = "en" } = useSelector((state) => state.ui);
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
const handleChange = (event) => {
|
const handleChange = (event) => {
|
||||||
const newLang = event.target.value;
|
const newLang = event.target.value;
|
||||||
@@ -23,30 +30,44 @@ const LanguageSelector = () => {
|
|||||||
value={language}
|
value={language}
|
||||||
onChange={handleChange}
|
onChange={handleChange}
|
||||||
size="small"
|
size="small"
|
||||||
sx={{ minWidth: 80 }}
|
sx={{
|
||||||
|
minWidth: 80,
|
||||||
|
"& .MuiSelect-select": {
|
||||||
|
display: "flex",
|
||||||
|
alignItems: "center",
|
||||||
|
justifyContent: "center",
|
||||||
|
},
|
||||||
|
"& .MuiSelect-icon": {
|
||||||
|
alignSelf: "center",
|
||||||
|
},
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
{languages.map((lang) => {
|
{languages.map((lang) => {
|
||||||
let parsedLang = lang === "en" ? "gb" : lang;
|
let parsedLang = lang === "en" ? "gb" : lang;
|
||||||
|
|
||||||
// Fix for Czech
|
|
||||||
if (parsedLang === "cs") {
|
|
||||||
parsedLang = "cz";
|
|
||||||
}
|
|
||||||
if (parsedLang.includes("-")) {
|
if (parsedLang.includes("-")) {
|
||||||
parsedLang = parsedLang.split("-")[1].toLowerCase();
|
parsedLang = parsedLang.split("-")[1].toLowerCase();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
parsedLang = langMap[parsedLang] || parsedLang;
|
||||||
|
|
||||||
const flag = parsedLang ? `fi fi-${parsedLang}` : null;
|
const flag = parsedLang ? `fi fi-${parsedLang}` : null;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<MenuItem
|
<MenuItem
|
||||||
key={lang}
|
key={lang}
|
||||||
value={lang}
|
value={lang}
|
||||||
|
sx={{
|
||||||
|
display: "flex",
|
||||||
|
justifyContent: "center",
|
||||||
|
alignItems: "center",
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
<Stack
|
<Stack
|
||||||
direction="row"
|
direction="row"
|
||||||
spacing={theme.spacing(2)}
|
spacing={theme.spacing(2)}
|
||||||
alignItems="center"
|
alignItems="center"
|
||||||
|
justifyContent="center"
|
||||||
>
|
>
|
||||||
<Box
|
<Box
|
||||||
component="span"
|
component="span"
|
||||||
|
|||||||
@@ -1,31 +0,0 @@
|
|||||||
import Box from "@mui/material/Box";
|
|
||||||
import PropTypes from "prop-types";
|
|
||||||
import { useTheme } from "@emotion/react";
|
|
||||||
import BackgroundSVG from "../../../assets/Images/background.svg";
|
|
||||||
import { useSelector } from "react-redux";
|
|
||||||
|
|
||||||
const AppLayout = ({ children }) => {
|
|
||||||
const theme = useTheme();
|
|
||||||
const ui = useSelector((state) => state.ui);
|
|
||||||
return (
|
|
||||||
<Box
|
|
||||||
sx={{
|
|
||||||
minHeight: "100vh",
|
|
||||||
backgroundColor: theme.palette.primaryBackground.main,
|
|
||||||
backgroundImage: ui?.mode === "dark" ? `url("${BackgroundSVG}")` : "none",
|
|
||||||
backgroundSize: "100% 100%",
|
|
||||||
backgroundPosition: "center",
|
|
||||||
backgroundRepeat: "no-repeat",
|
|
||||||
color: theme.palette.primary.contrastText,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{children}
|
|
||||||
</Box>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
AppLayout.propTypes = {
|
|
||||||
children: PropTypes.node,
|
|
||||||
};
|
|
||||||
|
|
||||||
export default AppLayout;
|
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
.home-layout {
|
|
||||||
position: relative;
|
|
||||||
min-height: 100vh;
|
|
||||||
margin: 0 auto;
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* TODO go for this approach for responsiveness. The aside needs to be taken care of */
|
|
||||||
/* @media (max-width: 1000px) {
|
|
||||||
.home-layout {
|
|
||||||
flex-direction: column !important;
|
|
||||||
}
|
|
||||||
} */
|
|
||||||
|
|
||||||
.home-layout aside {
|
|
||||||
position: sticky;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
height: 100vh;
|
|
||||||
max-width: var(--env-var-side-bar-width);
|
|
||||||
}
|
|
||||||
|
|
||||||
.home-layout > div {
|
|
||||||
min-height: calc(100vh - var(--env-var-spacing-2) * 2);
|
|
||||||
flex: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.home-content-wrapper {
|
|
||||||
padding: var(--env-var-spacing-2);
|
|
||||||
max-width: 1400px;
|
|
||||||
margin: 0 auto;
|
|
||||||
flex: 1;
|
|
||||||
}
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
import Sidebar from "../../Sidebar";
|
|
||||||
import { Outlet } from "react-router";
|
|
||||||
import { Stack } from "@mui/material";
|
|
||||||
|
|
||||||
import "./index.css";
|
|
||||||
|
|
||||||
const HomeLayout = () => {
|
|
||||||
return (
|
|
||||||
<Stack
|
|
||||||
className="home-layout"
|
|
||||||
flexDirection="row"
|
|
||||||
gap={14}
|
|
||||||
>
|
|
||||||
<Sidebar />
|
|
||||||
<Stack className="home-content-wrapper">
|
|
||||||
<Outlet />
|
|
||||||
</Stack>
|
|
||||||
</Stack>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default HomeLayout;
|
|
||||||
@@ -1,116 +0,0 @@
|
|||||||
import * as React from "react";
|
|
||||||
import Button from "@mui/material/Button";
|
|
||||||
import ButtonGroup from "@mui/material/ButtonGroup";
|
|
||||||
import ArrowDropDownIcon from "@mui/icons-material/ArrowDropDown";
|
|
||||||
import ClickAwayListener from "@mui/material/ClickAwayListener";
|
|
||||||
import Grow from "@mui/material/Grow";
|
|
||||||
import Paper from "@mui/material/Paper";
|
|
||||||
import Popper from "@mui/material/Popper";
|
|
||||||
import MenuItem from "@mui/material/MenuItem";
|
|
||||||
import MenuList from "@mui/material/MenuList";
|
|
||||||
import { useNavigate } from "react-router-dom";
|
|
||||||
import { useTranslation } from "react-i18next";
|
|
||||||
import { createToast } from "../../Utils/toastUtils";
|
|
||||||
import { useExportMonitors } from "../../Hooks/monitorHooks";
|
|
||||||
|
|
||||||
const MonitorActions = ({ isLoading }) => {
|
|
||||||
const [open, setOpen] = React.useState(false);
|
|
||||||
const anchorRef = React.useRef(null);
|
|
||||||
const [selectedIndex, setSelectedIndex] = React.useState(0);
|
|
||||||
const navigate = useNavigate();
|
|
||||||
const { t } = useTranslation();
|
|
||||||
const [exportMonitors, isExporting] = useExportMonitors();
|
|
||||||
|
|
||||||
const options = [t("monitorActions.import"), t("monitorActions.export")];
|
|
||||||
|
|
||||||
const handleClick = async () => {
|
|
||||||
if (selectedIndex === 0) {
|
|
||||||
// Import
|
|
||||||
navigate("/uptime/bulk-import");
|
|
||||||
} else {
|
|
||||||
// Export
|
|
||||||
const [success, error] = await exportMonitors();
|
|
||||||
if (!success) {
|
|
||||||
createToast({ body: error || t("export.failed") });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleMenuItemClick = (event, index) => {
|
|
||||||
setSelectedIndex(index);
|
|
||||||
setOpen(false);
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleToggle = () => {
|
|
||||||
setOpen((prevOpen) => !prevOpen);
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleClose = (event) => {
|
|
||||||
if (anchorRef.current && anchorRef.current.contains(event.target)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
setOpen(false);
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<React.Fragment>
|
|
||||||
<ButtonGroup
|
|
||||||
variant="contained"
|
|
||||||
color="accent"
|
|
||||||
ref={anchorRef}
|
|
||||||
aria-label="Monitor actions"
|
|
||||||
disabled={isLoading || isExporting}
|
|
||||||
>
|
|
||||||
<Button onClick={handleClick}>{options[selectedIndex]}</Button>
|
|
||||||
<Button
|
|
||||||
size="small"
|
|
||||||
aria-controls={open ? "split-button-menu" : undefined}
|
|
||||||
aria-expanded={open ? "true" : undefined}
|
|
||||||
aria-label="select monitor action"
|
|
||||||
aria-haspopup="menu"
|
|
||||||
onClick={handleToggle}
|
|
||||||
>
|
|
||||||
<ArrowDropDownIcon />
|
|
||||||
</Button>
|
|
||||||
</ButtonGroup>
|
|
||||||
<Popper
|
|
||||||
sx={{ zIndex: 1 }}
|
|
||||||
open={open}
|
|
||||||
anchorEl={anchorRef.current}
|
|
||||||
role={undefined}
|
|
||||||
transition
|
|
||||||
disablePortal
|
|
||||||
>
|
|
||||||
{({ TransitionProps, placement }) => (
|
|
||||||
<Grow
|
|
||||||
{...TransitionProps}
|
|
||||||
style={{
|
|
||||||
transformOrigin: placement === "bottom" ? "center top" : "center bottom",
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Paper>
|
|
||||||
<ClickAwayListener onClickAway={handleClose}>
|
|
||||||
<MenuList
|
|
||||||
id="split-button-menu"
|
|
||||||
autoFocusItem
|
|
||||||
>
|
|
||||||
{options.map((option, index) => (
|
|
||||||
<MenuItem
|
|
||||||
key={option}
|
|
||||||
selected={index === selectedIndex}
|
|
||||||
onClick={(event) => handleMenuItemClick(event, index)}
|
|
||||||
>
|
|
||||||
{option}
|
|
||||||
</MenuItem>
|
|
||||||
))}
|
|
||||||
</MenuList>
|
|
||||||
</ClickAwayListener>
|
|
||||||
</Paper>
|
|
||||||
</Grow>
|
|
||||||
)}
|
|
||||||
</Popper>
|
|
||||||
</React.Fragment>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default MonitorActions;
|
|
||||||
@@ -1,52 +0,0 @@
|
|||||||
import { Stack, Typography } from "@mui/material";
|
|
||||||
import PropTypes from "prop-types";
|
|
||||||
import { useTheme } from "@emotion/react";
|
|
||||||
import SkeletonLayout from "./skeleton";
|
|
||||||
|
|
||||||
const MonitorCountHeader = ({
|
|
||||||
isLoading = false,
|
|
||||||
monitorCount,
|
|
||||||
heading = "monitors",
|
|
||||||
sx,
|
|
||||||
children,
|
|
||||||
}) => {
|
|
||||||
const theme = useTheme();
|
|
||||||
if (isLoading) return <SkeletonLayout />;
|
|
||||||
|
|
||||||
if (monitorCount === 1) {
|
|
||||||
heading = "monitor";
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Stack
|
|
||||||
direction="row"
|
|
||||||
alignItems="center"
|
|
||||||
display="flex"
|
|
||||||
width="fit-content"
|
|
||||||
height={theme.spacing(18)}
|
|
||||||
gap={theme.spacing(2)}
|
|
||||||
mt={theme.spacing(2)}
|
|
||||||
px={theme.spacing(4)}
|
|
||||||
pt={theme.spacing(2)}
|
|
||||||
pb={theme.spacing(3)}
|
|
||||||
borderRadius={theme.spacing(1)}
|
|
||||||
sx={{
|
|
||||||
...sx,
|
|
||||||
backgroundColor: theme.palette.secondary.main,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{monitorCount} <Typography component="h2">{heading}</Typography>
|
|
||||||
{children}
|
|
||||||
</Stack>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
MonitorCountHeader.propTypes = {
|
|
||||||
isLoading: PropTypes.bool,
|
|
||||||
monitorCount: PropTypes.number,
|
|
||||||
heading: PropTypes.string,
|
|
||||||
children: PropTypes.node,
|
|
||||||
sx: PropTypes.object,
|
|
||||||
};
|
|
||||||
|
|
||||||
export default MonitorCountHeader;
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
import { Stack, Skeleton } from "@mui/material";
|
|
||||||
import { useTheme } from "@emotion/react";
|
|
||||||
|
|
||||||
const SkeletonLayout = () => {
|
|
||||||
const theme = useTheme();
|
|
||||||
return (
|
|
||||||
<Stack
|
|
||||||
direction="row"
|
|
||||||
alignItems="center"
|
|
||||||
gap={theme.spacing(2)}
|
|
||||||
>
|
|
||||||
<Skeleton
|
|
||||||
variant="text"
|
|
||||||
width={100}
|
|
||||||
height={32}
|
|
||||||
/>
|
|
||||||
<Skeleton
|
|
||||||
variant="circular"
|
|
||||||
width={40}
|
|
||||||
height={40}
|
|
||||||
/>
|
|
||||||
</Stack>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default SkeletonLayout;
|
|
||||||
@@ -1,45 +0,0 @@
|
|||||||
import { Stack, Button } from "@mui/material";
|
|
||||||
import { useNavigate } from "react-router-dom";
|
|
||||||
import PropTypes from "prop-types";
|
|
||||||
import { useTranslation } from "react-i18next";
|
|
||||||
import { useTheme } from "@emotion/react";
|
|
||||||
import MonitorActions from "../MonitorActions";
|
|
||||||
|
|
||||||
const CreateMonitorHeader = ({ isAdmin, label, isLoading = true, path, bulkPath }) => {
|
|
||||||
const navigate = useNavigate();
|
|
||||||
const { t } = useTranslation();
|
|
||||||
const theme = useTheme();
|
|
||||||
|
|
||||||
// Use the provided label or fall back to the translated default
|
|
||||||
|
|
||||||
if (!isAdmin) return null;
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Stack
|
|
||||||
direction="row"
|
|
||||||
justifyContent="end"
|
|
||||||
alignItems="center"
|
|
||||||
gap={theme.spacing(6)}
|
|
||||||
>
|
|
||||||
<Button
|
|
||||||
loading={isLoading}
|
|
||||||
variant="contained"
|
|
||||||
color="accent"
|
|
||||||
onClick={() => navigate(path)}
|
|
||||||
>
|
|
||||||
{label || t("createNew")}
|
|
||||||
</Button>
|
|
||||||
{/* {bulkPath && <MonitorActions isLoading={isLoading} />} */}
|
|
||||||
</Stack>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default CreateMonitorHeader;
|
|
||||||
|
|
||||||
CreateMonitorHeader.propTypes = {
|
|
||||||
isAdmin: PropTypes.bool.isRequired,
|
|
||||||
isLoading: PropTypes.bool,
|
|
||||||
path: PropTypes.string.isRequired,
|
|
||||||
label: PropTypes.string,
|
|
||||||
bulkPath: PropTypes.string,
|
|
||||||
};
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
import { Stack, Skeleton } from "@mui/material";
|
|
||||||
|
|
||||||
const SkeletonLayout = () => {
|
|
||||||
return (
|
|
||||||
<Stack
|
|
||||||
direction="row"
|
|
||||||
justifyContent="end"
|
|
||||||
alignItems="center"
|
|
||||||
>
|
|
||||||
<Skeleton
|
|
||||||
variant="rectangular"
|
|
||||||
width={100}
|
|
||||||
height={36}
|
|
||||||
/>
|
|
||||||
</Stack>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default SkeletonLayout;
|
|
||||||
@@ -1,141 +0,0 @@
|
|||||||
import Stack from "@mui/material/Stack";
|
|
||||||
import Status from "./status";
|
|
||||||
import Skeleton from "./skeleton";
|
|
||||||
import Button from "@mui/material/Button";
|
|
||||||
import { Tooltip } from "@mui/material";
|
|
||||||
import SettingsOutlinedIcon from "@mui/icons-material/SettingsOutlined";
|
|
||||||
import PauseOutlinedIcon from "@mui/icons-material/PauseOutlined";
|
|
||||||
import PlayArrowOutlinedIcon from "@mui/icons-material/PlayArrowOutlined";
|
|
||||||
import EmailIcon from "@mui/icons-material/Email";
|
|
||||||
|
|
||||||
// Utils
|
|
||||||
import PropTypes from "prop-types";
|
|
||||||
import { useNavigate } from "react-router-dom";
|
|
||||||
import { useTheme } from "@mui/material/styles";
|
|
||||||
import { usePauseMonitor } from "../../Hooks/monitorHooks";
|
|
||||||
import { useSendTestEmail } from "../../Hooks/useSendTestEmail";
|
|
||||||
import { useTranslation } from "react-i18next";
|
|
||||||
import { useTestAllNotifications } from "../../Hooks/useNotifications";
|
|
||||||
/**
|
|
||||||
* MonitorDetailsControlHeader component displays the control header for monitor details.
|
|
||||||
* It includes status display, pause/resume button, and a configure button for admins.
|
|
||||||
*
|
|
||||||
* @component
|
|
||||||
* @param {Object} props - Component props
|
|
||||||
* @param {string} props.path - The base path for navigation
|
|
||||||
* @param {boolean} [props.isLoading=false] - Flag indicating if the data is loading
|
|
||||||
* @param {boolean} [props.isAdmin=false] - Flag indicating if the user is an admin
|
|
||||||
* @param {Object} props.monitor - The monitor object containing details
|
|
||||||
* @param {Function} props.triggerUpdate - Function to trigger an update
|
|
||||||
* @returns {JSX.Element} The rendered component
|
|
||||||
*/
|
|
||||||
const MonitorDetailsControlHeader = ({
|
|
||||||
path,
|
|
||||||
isLoading = false,
|
|
||||||
isAdmin = false,
|
|
||||||
monitor,
|
|
||||||
triggerUpdate,
|
|
||||||
}) => {
|
|
||||||
const navigate = useNavigate();
|
|
||||||
const theme = useTheme();
|
|
||||||
const { t } = useTranslation();
|
|
||||||
const [pauseMonitor, isPausing, error] = usePauseMonitor();
|
|
||||||
|
|
||||||
const isTestNotificationsDisabled = monitor?.notifications?.length === 0;
|
|
||||||
|
|
||||||
const tooltipTitle = isTestNotificationsDisabled ? t("testNotificationsDisabled") : "";
|
|
||||||
|
|
||||||
// const [isSending, emailError, sendTestEmail] = useSendTestEmail();
|
|
||||||
|
|
||||||
const [testAllNotifications, isSending, errorAllNotifications] =
|
|
||||||
useTestAllNotifications();
|
|
||||||
|
|
||||||
if (isLoading) {
|
|
||||||
return <Skeleton />;
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Stack
|
|
||||||
direction="row"
|
|
||||||
justifyContent="space-between"
|
|
||||||
>
|
|
||||||
<Status monitor={monitor} />
|
|
||||||
|
|
||||||
<Stack
|
|
||||||
direction="row"
|
|
||||||
gap={theme.spacing(2)}
|
|
||||||
>
|
|
||||||
<Tooltip
|
|
||||||
key={monitor?._id}
|
|
||||||
placement="bottom"
|
|
||||||
title={tooltipTitle}
|
|
||||||
>
|
|
||||||
<span>
|
|
||||||
<Button
|
|
||||||
variant="contained"
|
|
||||||
color="secondary"
|
|
||||||
loading={isSending}
|
|
||||||
startIcon={<EmailIcon />}
|
|
||||||
disabled={isTestNotificationsDisabled}
|
|
||||||
onClick={() => {
|
|
||||||
testAllNotifications({ monitorId: monitor?._id });
|
|
||||||
}}
|
|
||||||
sx={{
|
|
||||||
whiteSpace: "nowrap",
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{t("sendTestNotifications")}
|
|
||||||
</Button>
|
|
||||||
</span>
|
|
||||||
</Tooltip>
|
|
||||||
<Button
|
|
||||||
variant="contained"
|
|
||||||
color="secondary"
|
|
||||||
onClick={(e) => {
|
|
||||||
navigate(`/incidents/${monitor?._id}`);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{t("menu.incidents")}
|
|
||||||
</Button>
|
|
||||||
{isAdmin && (
|
|
||||||
<Button
|
|
||||||
variant="contained"
|
|
||||||
color="secondary"
|
|
||||||
loading={isPausing}
|
|
||||||
startIcon={
|
|
||||||
monitor?.isActive ? <PauseOutlinedIcon /> : <PlayArrowOutlinedIcon />
|
|
||||||
}
|
|
||||||
onClick={() => {
|
|
||||||
pauseMonitor({
|
|
||||||
monitorId: monitor?._id,
|
|
||||||
triggerUpdate,
|
|
||||||
});
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{monitor?.isActive ? "Pause" : "Resume"}
|
|
||||||
</Button>
|
|
||||||
)}
|
|
||||||
{isAdmin && (
|
|
||||||
<Button
|
|
||||||
variant="contained"
|
|
||||||
color="secondary"
|
|
||||||
startIcon={<SettingsOutlinedIcon />}
|
|
||||||
onClick={() => navigate(`/${path}/configure/${monitor._id}`)}
|
|
||||||
>
|
|
||||||
Configure
|
|
||||||
</Button>
|
|
||||||
)}
|
|
||||||
</Stack>
|
|
||||||
</Stack>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
MonitorDetailsControlHeader.propTypes = {
|
|
||||||
path: PropTypes.string,
|
|
||||||
isLoading: PropTypes.bool,
|
|
||||||
isAdmin: PropTypes.bool,
|
|
||||||
monitor: PropTypes.object,
|
|
||||||
triggerUpdate: PropTypes.func,
|
|
||||||
};
|
|
||||||
|
|
||||||
export default MonitorDetailsControlHeader;
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
import { Stack, Skeleton } from "@mui/material";
|
|
||||||
|
|
||||||
const SkeletonLayout = () => {
|
|
||||||
return (
|
|
||||||
<Stack
|
|
||||||
direction="row"
|
|
||||||
justifyContent="space-between"
|
|
||||||
>
|
|
||||||
<Skeleton
|
|
||||||
height={40}
|
|
||||||
variant="rounded"
|
|
||||||
width="15%"
|
|
||||||
/>
|
|
||||||
<Skeleton
|
|
||||||
height={40}
|
|
||||||
variant="rounded"
|
|
||||||
width="15%"
|
|
||||||
/>
|
|
||||||
</Stack>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default SkeletonLayout;
|
|
||||||
@@ -1,51 +0,0 @@
|
|||||||
// Components
|
|
||||||
import Stack from "@mui/material/Stack";
|
|
||||||
import PulseDot from "../../Components/Animated/PulseDot";
|
|
||||||
import Typography from "@mui/material/Typography";
|
|
||||||
import Dot from "../../Components/Dot";
|
|
||||||
// Utils
|
|
||||||
import { formatDurationRounded } from "../../Utils/timeUtils";
|
|
||||||
import PropTypes from "prop-types";
|
|
||||||
import { useTheme } from "@emotion/react";
|
|
||||||
import { useMonitorUtils } from "../../Hooks/useMonitorUtils";
|
|
||||||
import { formatMonitorUrl } from "../../Utils/utils";
|
|
||||||
/**
|
|
||||||
* Status component displays the status information of a monitor.
|
|
||||||
* It includes the monitor's name, URL, and check interval.
|
|
||||||
*
|
|
||||||
* @component
|
|
||||||
* @param {Object} props - Component props
|
|
||||||
* @param {Object} props.monitor - The monitor object containing details
|
|
||||||
* @param {string} props.monitor.name - The name of the monitor
|
|
||||||
* @param {string} props.monitor.url - The URL of the monitor
|
|
||||||
* @param {number} props.monitor.interval - The interval at which the monitor checks
|
|
||||||
* @returns {JSX.Element} The rendered component
|
|
||||||
*/
|
|
||||||
const Status = ({ monitor }) => {
|
|
||||||
const theme = useTheme();
|
|
||||||
const { statusColor, determineState } = useMonitorUtils();
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Stack>
|
|
||||||
<Typography variant="monitorName">{monitor?.name}</Typography>
|
|
||||||
<Stack
|
|
||||||
direction="row"
|
|
||||||
alignItems={"center"}
|
|
||||||
gap={theme.spacing(4)}
|
|
||||||
>
|
|
||||||
<PulseDot color={statusColor[determineState(monitor)]} />
|
|
||||||
<Typography variant="monitorUrl">{formatMonitorUrl(monitor?.url)}</Typography>
|
|
||||||
<Dot />
|
|
||||||
<Typography>
|
|
||||||
Checking every {formatDurationRounded(monitor?.interval)}.
|
|
||||||
</Typography>
|
|
||||||
</Stack>
|
|
||||||
</Stack>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
Status.propTypes = {
|
|
||||||
monitor: PropTypes.object,
|
|
||||||
};
|
|
||||||
|
|
||||||
export default Status;
|
|
||||||
@@ -1,85 +0,0 @@
|
|||||||
import { Stack, Typography, Button, ButtonGroup } from "@mui/material";
|
|
||||||
import { useTheme } from "@emotion/react";
|
|
||||||
import SkeletonLayout from "./skeleton";
|
|
||||||
import PropTypes from "prop-types";
|
|
||||||
|
|
||||||
const MonitorTimeFrameHeader = ({
|
|
||||||
isLoading = false,
|
|
||||||
hasDateRange = true,
|
|
||||||
dateRange,
|
|
||||||
setDateRange,
|
|
||||||
}) => {
|
|
||||||
const theme = useTheme();
|
|
||||||
|
|
||||||
if (isLoading) {
|
|
||||||
return <SkeletonLayout />;
|
|
||||||
}
|
|
||||||
|
|
||||||
let timeFramePicker = null;
|
|
||||||
|
|
||||||
if (hasDateRange) {
|
|
||||||
timeFramePicker = (
|
|
||||||
<ButtonGroup sx={{ height: 32 }}>
|
|
||||||
<Button
|
|
||||||
variant="group"
|
|
||||||
filled={(dateRange === "recent").toString()}
|
|
||||||
onClick={() => setDateRange("recent")}
|
|
||||||
>
|
|
||||||
Recent
|
|
||||||
</Button>
|
|
||||||
<Button
|
|
||||||
variant="group"
|
|
||||||
filled={(dateRange === "day").toString()}
|
|
||||||
onClick={() => setDateRange("day")}
|
|
||||||
>
|
|
||||||
Day
|
|
||||||
</Button>
|
|
||||||
<Button
|
|
||||||
variant="group"
|
|
||||||
filled={(dateRange === "week").toString()}
|
|
||||||
onClick={() => setDateRange("week")}
|
|
||||||
>
|
|
||||||
Week
|
|
||||||
</Button>
|
|
||||||
<Button
|
|
||||||
variant="group"
|
|
||||||
filled={(dateRange === "month").toString()}
|
|
||||||
onClick={() => setDateRange("month")}
|
|
||||||
>
|
|
||||||
Month
|
|
||||||
</Button>
|
|
||||||
</ButtonGroup>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Stack
|
|
||||||
direction="row"
|
|
||||||
justifyContent="flex-end"
|
|
||||||
alignItems="center"
|
|
||||||
gap={theme.spacing(4)}
|
|
||||||
>
|
|
||||||
<Typography variant="body2">
|
|
||||||
Showing statistics for past{" "}
|
|
||||||
{dateRange === "recent"
|
|
||||||
? "2 hours"
|
|
||||||
: dateRange === "day"
|
|
||||||
? "24 hours"
|
|
||||||
: dateRange === "week"
|
|
||||||
? "7 days"
|
|
||||||
: "30 days"}
|
|
||||||
.
|
|
||||||
</Typography>
|
|
||||||
{timeFramePicker}
|
|
||||||
</Stack>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
MonitorTimeFrameHeader.propTypes = {
|
|
||||||
isLoading: PropTypes.bool,
|
|
||||||
hasDateRange: PropTypes.bool,
|
|
||||||
dateRange: PropTypes.string,
|
|
||||||
setDateRange: PropTypes.func,
|
|
||||||
};
|
|
||||||
|
|
||||||
export default MonitorTimeFrameHeader;
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
import { Stack, Skeleton } from "@mui/material";
|
|
||||||
|
|
||||||
const SkeletonLayout = () => {
|
|
||||||
return (
|
|
||||||
<Stack
|
|
||||||
direction="row"
|
|
||||||
justifyContent="space-between"
|
|
||||||
>
|
|
||||||
<Skeleton
|
|
||||||
variant="rounded"
|
|
||||||
width="20%"
|
|
||||||
height={34}
|
|
||||||
/>
|
|
||||||
<Skeleton
|
|
||||||
variant="rounded"
|
|
||||||
width="20%"
|
|
||||||
height={34}
|
|
||||||
/>
|
|
||||||
</Stack>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default SkeletonLayout;
|
|
||||||
@@ -1,106 +0,0 @@
|
|||||||
// Components
|
|
||||||
import Stack from "@mui/material/Stack";
|
|
||||||
import Typography from "@mui/material/Typography";
|
|
||||||
import Divider from "@mui/material/Divider";
|
|
||||||
import DeleteOutlineRoundedIcon from "@mui/icons-material/DeleteOutlineRounded";
|
|
||||||
import Search from "../Inputs/Search";
|
|
||||||
|
|
||||||
// Utils
|
|
||||||
import { useState, useEffect } from "react";
|
|
||||||
import { useTheme } from "@mui/material/styles";
|
|
||||||
import PropTypes from "prop-types";
|
|
||||||
|
|
||||||
const NotificationConfig = ({ notifications, setMonitor, setNotifications }) => {
|
|
||||||
// Local state
|
|
||||||
const [notificationsSearch, setNotificationsSearch] = useState("");
|
|
||||||
const [selectedNotifications, setSelectedNotifications] = useState([]);
|
|
||||||
|
|
||||||
const handleSearch = (value) => {
|
|
||||||
setSelectedNotifications(value);
|
|
||||||
setMonitor((prev) => {
|
|
||||||
return {
|
|
||||||
...prev,
|
|
||||||
notifications: value.map((notification) => notification._id),
|
|
||||||
};
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
// Handlers
|
|
||||||
const handleDelete = (id) => {
|
|
||||||
const updatedNotifications = selectedNotifications.filter(
|
|
||||||
(notification) => notification._id !== id
|
|
||||||
);
|
|
||||||
|
|
||||||
setSelectedNotifications(updatedNotifications);
|
|
||||||
setMonitor((prev) => {
|
|
||||||
return {
|
|
||||||
...prev,
|
|
||||||
notifications: updatedNotifications.map((notification) => notification._id),
|
|
||||||
};
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
// Setup
|
|
||||||
const theme = useTheme();
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (setNotifications) {
|
|
||||||
const toSet = setNotifications.map((notification) => {
|
|
||||||
return notifications.find((n) => n._id === notification);
|
|
||||||
});
|
|
||||||
setSelectedNotifications(toSet);
|
|
||||||
}
|
|
||||||
}, [setNotifications, notifications]);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Stack gap={theme.spacing(6)}>
|
|
||||||
<Search
|
|
||||||
type="notifications"
|
|
||||||
label="Notifications"
|
|
||||||
options={notifications}
|
|
||||||
filteredBy="notificationName"
|
|
||||||
multiple={true}
|
|
||||||
value={selectedNotifications}
|
|
||||||
inputValue={notificationsSearch}
|
|
||||||
handleInputChange={setNotificationsSearch}
|
|
||||||
handleChange={(value) => {
|
|
||||||
handleSearch(value);
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
<Stack
|
|
||||||
flex={1}
|
|
||||||
width="100%"
|
|
||||||
>
|
|
||||||
{selectedNotifications.map((notification, index) => (
|
|
||||||
<Stack
|
|
||||||
direction="row"
|
|
||||||
alignItems="center"
|
|
||||||
key={notification._id}
|
|
||||||
width="100%"
|
|
||||||
>
|
|
||||||
<Typography
|
|
||||||
flexGrow={1} // <-- This will take up all available horizontal space
|
|
||||||
>
|
|
||||||
{notification.notificationName}
|
|
||||||
</Typography>
|
|
||||||
<DeleteOutlineRoundedIcon
|
|
||||||
onClick={() => {
|
|
||||||
handleDelete(notification._id);
|
|
||||||
}}
|
|
||||||
sx={{ cursor: "pointer" }}
|
|
||||||
/>
|
|
||||||
{index < selectedNotifications.length - 1 && <Divider />}
|
|
||||||
</Stack>
|
|
||||||
))}
|
|
||||||
</Stack>
|
|
||||||
</Stack>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
NotificationConfig.propTypes = {
|
|
||||||
notifications: PropTypes.array,
|
|
||||||
setMonitor: PropTypes.func,
|
|
||||||
setNotifications: PropTypes.array,
|
|
||||||
};
|
|
||||||
|
|
||||||
export default NotificationConfig;
|
|
||||||
-419
@@ -1,419 +0,0 @@
|
|||||||
import { useState, useMemo, useEffect, useCallback } from "react";
|
|
||||||
import { useTranslation } from "react-i18next";
|
|
||||||
import PropTypes from "prop-types";
|
|
||||||
|
|
||||||
import {
|
|
||||||
Dialog,
|
|
||||||
DialogContent,
|
|
||||||
DialogActions,
|
|
||||||
Button,
|
|
||||||
Typography,
|
|
||||||
Box,
|
|
||||||
Tabs,
|
|
||||||
Tab,
|
|
||||||
Stack,
|
|
||||||
} from "@mui/material";
|
|
||||||
import { useTheme } from "@emotion/react";
|
|
||||||
import TabPanel from "./TabPanel";
|
|
||||||
import TabComponent from "./TabComponent";
|
|
||||||
import useNotifications from "../Hooks/useNotification";
|
|
||||||
|
|
||||||
// Define constants for notification types to avoid magic values
|
|
||||||
const NOTIFICATION_TYPES = {
|
|
||||||
SLACK: "slack",
|
|
||||||
DISCORD: "discord",
|
|
||||||
TELEGRAM: "telegram",
|
|
||||||
WEBHOOK: "webhook",
|
|
||||||
};
|
|
||||||
|
|
||||||
// Define constants for field IDs
|
|
||||||
const FIELD_IDS = {
|
|
||||||
WEBHOOK: "webhook",
|
|
||||||
TOKEN: "token",
|
|
||||||
CHAT_ID: "chatId",
|
|
||||||
URL: "url",
|
|
||||||
};
|
|
||||||
|
|
||||||
const NotificationIntegrationModal = ({
|
|
||||||
open,
|
|
||||||
onClose,
|
|
||||||
monitor,
|
|
||||||
setMonitor,
|
|
||||||
// Optional prop to configure available notification types
|
|
||||||
notificationTypes = null,
|
|
||||||
}) => {
|
|
||||||
const { t } = useTranslation();
|
|
||||||
const theme = useTheme();
|
|
||||||
const [tabValue, setTabValue] = useState(0);
|
|
||||||
|
|
||||||
const [loading, _, sendTestNotification] = useNotifications();
|
|
||||||
|
|
||||||
// Helper to get the field state key with error handling
|
|
||||||
const getFieldKey = useCallback(
|
|
||||||
(typeId, fieldId) => {
|
|
||||||
if (typeof typeId !== "string" || typeId === "") {
|
|
||||||
throw new Error(t("errorInvalidTypeId"));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (typeof fieldId !== "string" || fieldId === "") {
|
|
||||||
throw new Error(t("errorInvalidFieldId"));
|
|
||||||
}
|
|
||||||
|
|
||||||
return `${typeId}${fieldId.charAt(0).toUpperCase() + fieldId.slice(1)}`;
|
|
||||||
},
|
|
||||||
[t]
|
|
||||||
);
|
|
||||||
|
|
||||||
// Define notification types
|
|
||||||
const DEFAULT_NOTIFICATION_TYPES = [
|
|
||||||
{
|
|
||||||
id: NOTIFICATION_TYPES.SLACK,
|
|
||||||
label: t("notifications.slack.label"),
|
|
||||||
description: t("notifications.slack.description"),
|
|
||||||
fields: [
|
|
||||||
{
|
|
||||||
id: FIELD_IDS.WEBHOOK,
|
|
||||||
label: t("notifications.slack.webhookLabel"),
|
|
||||||
placeholder: t("notifications.slack.webhookPlaceholder"),
|
|
||||||
type: "text",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: NOTIFICATION_TYPES.DISCORD,
|
|
||||||
label: t("notifications.discord.label"),
|
|
||||||
description: t("notifications.discord.description"),
|
|
||||||
fields: [
|
|
||||||
{
|
|
||||||
id: FIELD_IDS.WEBHOOK,
|
|
||||||
label: t("notifications.discord.webhookLabel"),
|
|
||||||
placeholder: t("notifications.discord.webhookPlaceholder"),
|
|
||||||
type: "text",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: NOTIFICATION_TYPES.TELEGRAM,
|
|
||||||
label: t("notifications.telegram.label"),
|
|
||||||
description: t("notifications.telegram.description"),
|
|
||||||
fields: [
|
|
||||||
{
|
|
||||||
id: FIELD_IDS.TOKEN,
|
|
||||||
label: t("notifications.telegram.tokenLabel"),
|
|
||||||
placeholder: t("notifications.telegram.tokenPlaceholder"),
|
|
||||||
type: "text",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: FIELD_IDS.CHAT_ID,
|
|
||||||
label: t("notifications.telegram.chatIdLabel"),
|
|
||||||
placeholder: t("notifications.telegram.chatIdPlaceholder"),
|
|
||||||
type: "text",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: NOTIFICATION_TYPES.WEBHOOK,
|
|
||||||
label: t("notifications.webhook.label"),
|
|
||||||
description: t("notifications.webhook.description"),
|
|
||||||
fields: [
|
|
||||||
{
|
|
||||||
id: FIELD_IDS.URL,
|
|
||||||
label: t("notifications.webhook.urlLabel"),
|
|
||||||
placeholder: t("notifications.webhook.urlPlaceholder"),
|
|
||||||
type: "text",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
// Use provided notification types or default to our translated ones
|
|
||||||
const activeNotificationTypes = notificationTypes || DEFAULT_NOTIFICATION_TYPES;
|
|
||||||
|
|
||||||
// Memoized function to initialize integrations state
|
|
||||||
const initialIntegrationsState = useMemo(() => {
|
|
||||||
const state = {};
|
|
||||||
|
|
||||||
activeNotificationTypes.forEach((type) => {
|
|
||||||
// Add enabled flag for each notification type
|
|
||||||
state[type.id] = false;
|
|
||||||
|
|
||||||
// Add state for each field in the notification type
|
|
||||||
type.fields.forEach((field) => {
|
|
||||||
const fieldKey = getFieldKey(type.id, field.id);
|
|
||||||
state[fieldKey] = "";
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
return state;
|
|
||||||
}, [activeNotificationTypes, getFieldKey]); // Only recompute when these dependencies change
|
|
||||||
|
|
||||||
const [integrations, setIntegrations] = useState(initialIntegrationsState);
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (open) {
|
|
||||||
const extractNotificationValues = () => {
|
|
||||||
const values = {};
|
|
||||||
|
|
||||||
if (!monitor?.notifications || !Array.isArray(monitor.notifications)) {
|
|
||||||
return values;
|
|
||||||
}
|
|
||||||
|
|
||||||
monitor.notifications.forEach((notification) => {
|
|
||||||
// Handle notification based on its structure
|
|
||||||
if (notification.type === "webhook" && notification.platform) {
|
|
||||||
if (typeof notification.config === "undefined") return;
|
|
||||||
const platform = notification.platform;
|
|
||||||
values[platform] = true; // Set platform as enabled
|
|
||||||
|
|
||||||
// Extract configuration based on platform
|
|
||||||
switch (platform) {
|
|
||||||
case NOTIFICATION_TYPES.SLACK:
|
|
||||||
case NOTIFICATION_TYPES.DISCORD:
|
|
||||||
if (notification.config.webhookUrl) {
|
|
||||||
values[getFieldKey(platform, FIELD_IDS.WEBHOOK)] =
|
|
||||||
notification.config.webhookUrl;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case NOTIFICATION_TYPES.TELEGRAM:
|
|
||||||
if (notification.config.botToken) {
|
|
||||||
values[getFieldKey(platform, FIELD_IDS.TOKEN)] =
|
|
||||||
notification.config.botToken;
|
|
||||||
}
|
|
||||||
if (notification.config.chatId) {
|
|
||||||
values[getFieldKey(platform, FIELD_IDS.CHAT_ID)] =
|
|
||||||
notification.config.chatId;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case NOTIFICATION_TYPES.WEBHOOK:
|
|
||||||
if (notification.config.webhookUrl) {
|
|
||||||
values[getFieldKey(platform, FIELD_IDS.URL)] =
|
|
||||||
notification.config.webhookUrl;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
return values;
|
|
||||||
};
|
|
||||||
|
|
||||||
const extractedValues = extractNotificationValues();
|
|
||||||
setIntegrations((prev) => ({
|
|
||||||
...prev,
|
|
||||||
...extractedValues,
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
}, [open, monitor, getFieldKey]);
|
|
||||||
|
|
||||||
const handleChangeTab = (event, newValue) => {
|
|
||||||
setTabValue(newValue);
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleIntegrationChange = (type, checked) => {
|
|
||||||
setIntegrations((prev) => ({
|
|
||||||
...prev,
|
|
||||||
[type]: checked,
|
|
||||||
}));
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleInputChange = (type, value) => {
|
|
||||||
setIntegrations((prev) => ({
|
|
||||||
...prev,
|
|
||||||
[type]: value,
|
|
||||||
}));
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleTestNotification = async (type) => {
|
|
||||||
// Get the notification type details
|
|
||||||
const notificationType = activeNotificationTypes.find((t) => t.id === type);
|
|
||||||
|
|
||||||
if (typeof notificationType === "undefined") {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Prepare config object based on notification type
|
|
||||||
const config = {};
|
|
||||||
|
|
||||||
// Add each field value to the config object
|
|
||||||
notificationType.fields.forEach((field) => {
|
|
||||||
const fieldKey = getFieldKey(type, field.id);
|
|
||||||
config[field.id] = integrations[fieldKey];
|
|
||||||
});
|
|
||||||
|
|
||||||
await sendTestNotification(type, config);
|
|
||||||
};
|
|
||||||
|
|
||||||
// In NotificationIntegrationModal.jsx, update the handleSave function:
|
|
||||||
|
|
||||||
const handleSave = () => {
|
|
||||||
// Get existing notifications
|
|
||||||
const notifications = [...(monitor?.notifications || [])];
|
|
||||||
|
|
||||||
// Get all notification types IDs
|
|
||||||
const existingTypes = activeNotificationTypes.map((type) => type.id);
|
|
||||||
|
|
||||||
// Filter out notifications that are configurable in this modal
|
|
||||||
const filteredNotifications = notifications.filter((notification) => {
|
|
||||||
if (notification.platform) {
|
|
||||||
return !existingTypes.includes(notification.platform);
|
|
||||||
}
|
|
||||||
|
|
||||||
return !existingTypes.includes(notification.type);
|
|
||||||
});
|
|
||||||
|
|
||||||
// Add each enabled notification with its configured fields
|
|
||||||
activeNotificationTypes.forEach((type) => {
|
|
||||||
if (integrations[type.id]) {
|
|
||||||
let notificationObject = {
|
|
||||||
type: "webhook",
|
|
||||||
platform: type.id, // Set platform to identify the specific service
|
|
||||||
config: {},
|
|
||||||
};
|
|
||||||
|
|
||||||
// Configure based on notification type
|
|
||||||
switch (type.id) {
|
|
||||||
case "slack":
|
|
||||||
case "discord":
|
|
||||||
notificationObject.config.webhookUrl =
|
|
||||||
integrations[getFieldKey(type.id, "webhook")];
|
|
||||||
break;
|
|
||||||
case "telegram":
|
|
||||||
notificationObject.config.botToken =
|
|
||||||
integrations[getFieldKey(type.id, "token")];
|
|
||||||
notificationObject.config.chatId =
|
|
||||||
integrations[getFieldKey(type.id, "chatId")];
|
|
||||||
break;
|
|
||||||
case "webhook":
|
|
||||||
notificationObject.config.webhookUrl =
|
|
||||||
integrations[getFieldKey(type.id, "url")];
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
filteredNotifications.push(notificationObject);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// Update monitor with new notifications
|
|
||||||
setMonitor((prev) => ({
|
|
||||||
...prev,
|
|
||||||
notifications: filteredNotifications,
|
|
||||||
}));
|
|
||||||
|
|
||||||
onClose();
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Dialog
|
|
||||||
open={open}
|
|
||||||
onClose={onClose}
|
|
||||||
fullWidth
|
|
||||||
maxWidth="md"
|
|
||||||
sx={{
|
|
||||||
"& .MuiDialog-paper": {
|
|
||||||
width: `calc(80% - ${theme.spacing(40)})`,
|
|
||||||
maxWidth: `${theme.breakpoints.values.md - 70}px`,
|
|
||||||
},
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<DialogContent>
|
|
||||||
<Stack
|
|
||||||
direction="row"
|
|
||||||
sx={{
|
|
||||||
height: `calc(30vh - ${theme.spacing(20)})`,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{/* Left sidebar with tabs */}
|
|
||||||
<Box
|
|
||||||
sx={{
|
|
||||||
borderRight: 1,
|
|
||||||
borderColor: theme.palette.primary.lowContrast,
|
|
||||||
width: "30%",
|
|
||||||
maxWidth: theme.spacing(120),
|
|
||||||
pr: theme.spacing(10),
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Typography variant="h2">
|
|
||||||
{t("notifications.addOrEditNotifications")}
|
|
||||||
</Typography>
|
|
||||||
|
|
||||||
<Tabs
|
|
||||||
orientation="vertical"
|
|
||||||
variant="scrollable"
|
|
||||||
value={tabValue}
|
|
||||||
onChange={handleChangeTab}
|
|
||||||
aria-label="Notification tabs"
|
|
||||||
>
|
|
||||||
{activeNotificationTypes.map((type) => (
|
|
||||||
<Tab
|
|
||||||
key={type.id}
|
|
||||||
label={type.label}
|
|
||||||
orientation="vertical"
|
|
||||||
disableRipple
|
|
||||||
/>
|
|
||||||
))}
|
|
||||||
</Tabs>
|
|
||||||
</Box>
|
|
||||||
|
|
||||||
{/* Right side content */}
|
|
||||||
<Box
|
|
||||||
sx={{
|
|
||||||
flex: 1,
|
|
||||||
pl: theme.spacing(7.5),
|
|
||||||
overflowY: "auto",
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{activeNotificationTypes.map((type, index) => (
|
|
||||||
<TabPanel
|
|
||||||
key={type.id}
|
|
||||||
value={tabValue}
|
|
||||||
index={index}
|
|
||||||
>
|
|
||||||
<TabComponent
|
|
||||||
type={type}
|
|
||||||
integrations={integrations}
|
|
||||||
handleIntegrationChange={handleIntegrationChange}
|
|
||||||
handleInputChange={handleInputChange}
|
|
||||||
handleTestNotification={handleTestNotification}
|
|
||||||
isLoading={loading}
|
|
||||||
/>
|
|
||||||
</TabPanel>
|
|
||||||
))}
|
|
||||||
</Box>
|
|
||||||
</Stack>
|
|
||||||
</DialogContent>
|
|
||||||
<DialogActions
|
|
||||||
sx={{
|
|
||||||
p: theme.spacing(4),
|
|
||||||
display: "flex",
|
|
||||||
justifyContent: "flex-end",
|
|
||||||
mb: theme.spacing(5),
|
|
||||||
mr: theme.spacing(5),
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Button
|
|
||||||
variant="contained"
|
|
||||||
color="accent"
|
|
||||||
onClick={handleSave}
|
|
||||||
loading={loading}
|
|
||||||
sx={{
|
|
||||||
width: "auto",
|
|
||||||
minWidth: theme.spacing(60),
|
|
||||||
px: theme.spacing(8),
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{t("commonSave")}
|
|
||||||
</Button>
|
|
||||||
</DialogActions>
|
|
||||||
</Dialog>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
NotificationIntegrationModal.propTypes = {
|
|
||||||
open: PropTypes.bool.isRequired,
|
|
||||||
onClose: PropTypes.func.isRequired,
|
|
||||||
monitor: PropTypes.object.isRequired,
|
|
||||||
setMonitor: PropTypes.func.isRequired,
|
|
||||||
notificationTypes: PropTypes.array,
|
|
||||||
};
|
|
||||||
|
|
||||||
export default NotificationIntegrationModal;
|
|
||||||
Loaded 100 of 918 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user