mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 15:59:52 +03:00
Compare commits
1844 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9233f0dfcc | ||
|
|
292f743b14 | ||
|
|
dd6dfffd57 | ||
|
|
ec705a5307 | ||
|
|
f45f071710 | ||
|
|
f3858546de | ||
|
|
de40cb8920 | ||
|
|
8ddf1315eb | ||
|
|
00d5b16de7 | ||
|
|
0b02bb417a | ||
|
|
d68260411d | ||
|
|
7227937660 | ||
|
|
e66e2c40a6 | ||
|
|
39bc0d5fb2 | ||
|
|
50e73e2a04 | ||
|
|
efa9875744 | ||
|
|
8182b0e95a | ||
|
|
6091621858 | ||
|
|
ba568581ff | ||
|
|
c78190c3a0 | ||
|
|
84c968e053 | ||
|
|
6b7da4068c | ||
|
|
e3e14e7a66 | ||
|
|
997ced3938 | ||
|
|
b18da9064b | ||
|
|
b3ee5f4d9a | ||
|
|
5398abb074 | ||
|
|
65397d3e1e | ||
|
|
887d53528b | ||
|
|
1603eafbb2 | ||
|
|
33bcb54aaf | ||
|
|
d36f87707a | ||
|
|
226c1fd6c5 | ||
|
|
74b961ab29 | ||
|
|
e4358ba489 | ||
|
|
26522cb061 | ||
|
|
be128da9e0 | ||
|
|
381afcbb6d | ||
|
|
1dc008855e | ||
|
|
bbf4431b5f | ||
|
|
c38ad8e382 | ||
|
|
1416bad9cc | ||
|
|
0e0e9eccf1 | ||
|
|
032a631b61 | ||
|
|
5d0f6b665b | ||
|
|
4bbf096350 | ||
|
|
e1a950ec21 | ||
|
|
ede8e7dfce | ||
|
|
9d155d6a0e | ||
|
|
1fa92eec57 | ||
|
|
7fc28fd1bb | ||
|
|
dd338f5f4b | ||
|
|
486bc5ac28 | ||
|
|
68215f37f5 | ||
|
|
4449d3fce8 | ||
|
|
cbb20439ed | ||
|
|
ec357b71f1 | ||
|
|
5acdb4dc31 | ||
|
|
dd959a7316 | ||
|
|
0b6dbe8bfa | ||
|
|
78e6263a2e | ||
|
|
3b2a4d1eb4 | ||
|
|
485195e035 | ||
|
|
d735f397d8 | ||
|
|
5e41481e27 | ||
|
|
d52c54d6fb | ||
|
|
36c85eed5e | ||
|
|
b09deb1494 | ||
|
|
cb4cce119b | ||
|
|
7e174a1b7d | ||
|
|
1f08940e47 | ||
|
|
8db5724b77 | ||
|
|
a21352ae4f | ||
|
|
a38f4978fa | ||
|
|
4f05ddab93 | ||
|
|
bbbeb155f0 | ||
|
|
f6238cd6ab | ||
|
|
d658b67e93 | ||
|
|
e2c675d9a5 | ||
|
|
3e3a600a60 | ||
|
|
1f0d2b147b | ||
|
|
285b0dc01d | ||
|
|
172153b840 | ||
|
|
ce71b8b5f6 | ||
|
|
d72d2b33bd | ||
|
|
d15fbe7801 | ||
|
|
caab1cae39 | ||
|
|
dced355a29 | ||
|
|
f133fdfb1c | ||
|
|
80ea1e95ee | ||
|
|
4098cef279 | ||
|
|
d0aac18b88 | ||
|
|
7bb35812ff | ||
|
|
ad49267b29 | ||
|
|
88404bcb56 | ||
|
|
33af6ec57e | ||
|
|
4b3a0bf4e2 | ||
|
|
508dd399be | ||
|
|
8b2466dcde | ||
|
|
c754d19015 | ||
|
|
ad680de897 | ||
|
|
78ae4d7a7d | ||
|
|
74acf2fe0f | ||
|
|
bab9fd8ec4 | ||
|
|
cfce36c212 | ||
|
|
5c6d6da4f9 | ||
|
|
5005d06507 | ||
|
|
9a09062a84 | ||
|
|
6dc993a276 | ||
|
|
c45ceec33b | ||
|
|
c28de99907 | ||
|
|
b587c08768 | ||
|
|
71043963e7 | ||
|
|
04b17a15bb | ||
|
|
4aa9d11574 | ||
|
|
56b5739cfc | ||
|
|
bb1704ed7a | ||
|
|
9163fc74d4 | ||
|
|
49113edeff | ||
|
|
718ede8439 | ||
|
|
5ee49d8dad | ||
|
|
c19885d730 | ||
|
|
d2e64468d5 | ||
|
|
e3b6a3308f | ||
|
|
c3f88ae0c8 | ||
|
|
31a5868864 | ||
|
|
4cb50a1dff | ||
|
|
2062703565 | ||
|
|
5e00f07fd8 | ||
|
|
3bf2110df1 | ||
|
|
c3ff60dced | ||
|
|
7cf3b8f1a9 | ||
|
|
4536d60e3e | ||
|
|
2f1ea4da67 | ||
|
|
34f6b412f6 | ||
|
|
b16a16d100 | ||
|
|
55750844ea | ||
|
|
6c09134552 | ||
|
|
8fa74c63c9 | ||
|
|
275ac351fe | ||
|
|
b728827324 | ||
|
|
2db99a3e32 | ||
|
|
263c011a7b | ||
|
|
8eeebb0cef | ||
|
|
f055e53987 | ||
|
|
6dce5f5931 | ||
|
|
14cfbf78bd | ||
|
|
6de577839b | ||
|
|
bfcdf3ef98 | ||
|
|
ffa7ddebb8 | ||
|
|
29838a433a | ||
|
|
1f1422bedd | ||
|
|
d41e634611 | ||
|
|
22cc890cab | ||
|
|
15e940bd2d | ||
|
|
c788f53bb9 | ||
|
|
10f1c5781e | ||
|
|
75b0869a77 | ||
|
|
c4c341922b | ||
|
|
43b4adc618 | ||
|
|
bad982dbdd | ||
|
|
5d45064c2d | ||
|
|
6390f4aa48 | ||
|
|
bb94d56bd0 | ||
|
|
14f3d9ab12 | ||
|
|
d9ecf0efb8 | ||
|
|
9b66b02e46 | ||
|
|
feca878fdd | ||
|
|
f53fd74873 | ||
|
|
bbaf892523 | ||
|
|
451b3abddf | ||
|
|
ba03add3d3 | ||
|
|
a41de7ed1c | ||
|
|
28de5bb097 | ||
|
|
d08a1224e2 | ||
|
|
327cf7ec75 | ||
|
|
83438129a2 | ||
|
|
9b3b7fc8ff | ||
|
|
8000497302 | ||
|
|
84589a4b40 | ||
|
|
067129f5a9 | ||
|
|
ffcf98b06b | ||
|
|
b2f001e416 | ||
|
|
44c31c9c61 | ||
|
|
8aa659eee2 | ||
|
|
51bf163149 | ||
|
|
d5c02f6b94 | ||
|
|
55fa968afb | ||
|
|
a9aac33a46 | ||
|
|
1f45506b37 | ||
|
|
9d9d88b171 | ||
|
|
291da3f7fe | ||
|
|
70cfbc3715 | ||
|
|
9d80c2cea7 | ||
|
|
a7f7959f91 | ||
|
|
082268d9fc | ||
|
|
945ef2f1b0 | ||
|
|
1f1feed3ae | ||
|
|
290890f6e7 | ||
|
|
b7bfd803eb | ||
|
|
2151905d46 | ||
|
|
fdde118af1 | ||
|
|
5f9ba2e04b | ||
|
|
ca871f654b | ||
|
|
3c91ac27dc | ||
|
|
94b4cb0baf | ||
|
|
1b956c6ad7 | ||
|
|
b9b79bbd9a | ||
|
|
9802581301 | ||
|
|
c1f39fbf57 | ||
|
|
f66e7712c3 | ||
|
|
2bb6d985cc | ||
|
|
d300ed38ea | ||
|
|
9cbb810fe4 | ||
|
|
cfa486d8cc | ||
|
|
ab1924d266 | ||
|
|
d6de0f6fa8 | ||
|
|
d1afea104e | ||
|
|
fae8cf83cd | ||
|
|
5a69ac074f | ||
|
|
15f0560005 | ||
|
|
6f7fa6abd9 | ||
|
|
cbd55b0366 | ||
|
|
f1dbd3018d | ||
|
|
502613b433 | ||
|
|
2bdc0d59cf | ||
|
|
ce0ee49ebf | ||
|
|
bc3bdb1221 | ||
|
|
3bea7576b5 | ||
|
|
d70b5d7dc0 | ||
|
|
eb30c1e5c7 | ||
|
|
17cbd2623f | ||
|
|
dc27a44c0c | ||
|
|
f72b02ab0b | ||
|
|
c0946f1e0c | ||
|
|
575fdcb8cd | ||
|
|
783ea7901c | ||
|
|
44e6bb79a2 | ||
|
|
ab3b9f13b5 | ||
|
|
dc6e7f7b1b | ||
|
|
94b75dda24 | ||
|
|
a529879889 | ||
|
|
4b7bbb3d50 | ||
|
|
88c98efd94 | ||
|
|
147be12583 | ||
|
|
137e047205 | ||
|
|
4bd6db31c0 | ||
|
|
1350638fb3 | ||
|
|
b6de431a56 | ||
|
|
1aef27da33 | ||
|
|
1e78979ed0 | ||
|
|
ba90ebda4c | ||
|
|
7c1bade54d | ||
|
|
a46b394714 | ||
|
|
6dff1136c5 | ||
|
|
ccbb56d403 | ||
|
|
4f3a7e5451 | ||
|
|
e4cda4087e | ||
|
|
6eeb8de02c | ||
|
|
29c4fec90a | ||
|
|
5c9ba8de43 | ||
|
|
2358f6a9c9 | ||
|
|
7097279dca | ||
|
|
c3eb553425 | ||
|
|
24f64fac6b | ||
|
|
4cdd5e9f20 | ||
|
|
de9e261807 | ||
|
|
c26793c68d | ||
|
|
11fd833cdb | ||
|
|
2b21a0c31f | ||
|
|
7e888f6408 | ||
|
|
bba70ce852 | ||
|
|
e96b5af0c8 | ||
|
|
5f5e786c0e | ||
|
|
8d66e43117 | ||
|
|
ccbc809ecf | ||
|
|
e67fde24f1 | ||
|
|
923494fdce | ||
|
|
73bff2cabe | ||
|
|
c20fc5a345 | ||
|
|
f71c62f167 | ||
|
|
bdaf9e6dc6 | ||
|
|
a2730fb17c | ||
|
|
5061ddf38e | ||
|
|
1735c036cc | ||
|
|
fa703db41e | ||
|
|
9665f4136a | ||
|
|
abeef2be4a | ||
|
|
995420354e | ||
|
|
1af1a1863a | ||
|
|
fd04f8be5a | ||
|
|
ccc9e6dcfb | ||
|
|
9e23710c6d | ||
|
|
3878a3ee0b | ||
|
|
0c9d0a4d15 | ||
|
|
739c007c95 | ||
|
|
6f27253441 | ||
|
|
b900932574 | ||
|
|
0903b31fcf | ||
|
|
d080f5db0f | ||
|
|
5029a1625e | ||
|
|
2950f167aa | ||
|
|
afdf9a3dfb | ||
|
|
132ca9d106 | ||
|
|
990d75d42a | ||
|
|
1c48aa8444 | ||
|
|
67e07813cb | ||
|
|
7fbeed88a9 | ||
|
|
9053e7ac88 | ||
|
|
e3c94cc1f7 | ||
|
|
e8d6c4d451 | ||
|
|
ba1813c767 | ||
|
|
bcd8992abc | ||
|
|
557b532f74 | ||
|
|
d450464a1a | ||
|
|
5d10b28433 | ||
|
|
eafe358deb | ||
|
|
048bd877da | ||
|
|
7f18dd942f | ||
|
|
424234ec48 | ||
|
|
4168a08276 | ||
|
|
996063d76d | ||
|
|
085f5ff22f | ||
|
|
5b5dc6a8cc | ||
|
|
4103bad8de | ||
|
|
d6a8563cc7 | ||
|
|
c9ef0bcd7b | ||
|
|
6b978759ca | ||
|
|
bc31d54028 | ||
|
|
7bad0e04b1 | ||
|
|
7144c746c6 | ||
|
|
d5592e5662 | ||
|
|
12b027110e | ||
|
|
644896faff | ||
|
|
f41f7c0769 | ||
|
|
68f1a891ca | ||
|
|
b186311968 | ||
|
|
c21b594cf0 | ||
|
|
21ec46843a | ||
|
|
4da827501a | ||
|
|
5d0c7bfd32 | ||
|
|
d583409af4 | ||
|
|
559e607601 | ||
|
|
276b27d8a6 | ||
|
|
2134f42cfd | ||
|
|
88135d2750 | ||
|
|
1b1a4bcad4 | ||
|
|
af8e82a860 | ||
|
|
c8d5e37b44 | ||
|
|
781fe03b5d | ||
|
|
702103aa66 | ||
|
|
d2503431c6 | ||
|
|
dccdf18226 | ||
|
|
a92f287256 | ||
|
|
a193d67f11 | ||
|
|
6873e113bb | ||
|
|
77860d9d05 | ||
|
|
de97010cfb | ||
|
|
89245c7af7 | ||
|
|
d51745774f | ||
|
|
deda1daa04 | ||
|
|
8594c4a7eb | ||
|
|
d0d73aa5e2 | ||
|
|
1f43bb201c | ||
|
|
6e92d31f5d | ||
|
|
ae4070b7f2 | ||
|
|
ee2ac18b69 | ||
|
|
85ce697dad | ||
|
|
82eb79ce40 | ||
|
|
c76b4b9ede | ||
|
|
9c2e814e16 | ||
|
|
2e9499ea90 | ||
|
|
52296bfed1 | ||
|
|
a53d54a1d6 | ||
|
|
81cf08b723 | ||
|
|
f192d7dffc | ||
|
|
5425896988 | ||
|
|
9e2be00b5c | ||
|
|
06004ce478 | ||
|
|
5bda018d25 | ||
|
|
b12729a874 | ||
|
|
d3a84e02e4 | ||
|
|
9865c84df5 | ||
|
|
33d2cb9a49 | ||
|
|
37c121e8de | ||
|
|
9dd0bf01e2 | ||
|
|
92ac601072 | ||
|
|
dfd7647838 | ||
|
|
058246e2ce | ||
|
|
8ed789892b | ||
|
|
57775af24b | ||
|
|
845681b6dc | ||
|
|
ea2c9cbc9a | ||
|
|
96bb3013a3 | ||
|
|
aeee37fdae | ||
|
|
551497bfeb | ||
|
|
57057cac0e | ||
|
|
dccd9f09e7 | ||
|
|
b91e474343 | ||
|
|
f25262c191 | ||
|
|
723662a6bc | ||
|
|
757fcd3ea4 | ||
|
|
ec3e28436d | ||
|
|
6a291ef1e2 | ||
|
|
1e529a9e19 | ||
|
|
05d393e7fe | ||
|
|
c757ace2b4 | ||
|
|
5ab066de5f | ||
|
|
b0ae22d493 | ||
|
|
03a6abcfc6 | ||
|
|
e58491ed97 | ||
|
|
1e92ae05c0 | ||
|
|
513b6181a4 | ||
|
|
05b54bc6f5 | ||
|
|
1d4634a76c | ||
|
|
342cf12ae7 | ||
|
|
6883dbbce1 | ||
|
|
a3d3706b89 | ||
|
|
da911e374a | ||
|
|
26904f4e0e | ||
|
|
ec5601f3ca | ||
|
|
a2ee2a5e6b | ||
|
|
78d5f8b76d | ||
|
|
dd0cc00004 | ||
|
|
825836c447 | ||
|
|
4996eb9e3c | ||
|
|
0bc3a3c34e | ||
|
|
ca5bc313ee | ||
|
|
069df92dbf | ||
|
|
bdce4ee9f9 | ||
|
|
756a136124 | ||
|
|
4809ef3537 | ||
|
|
2c056d6807 | ||
|
|
90af466a2f | ||
|
|
20cbbcd9f4 | ||
|
|
036953044e | ||
|
|
499456fa77 | ||
|
|
22d9705412 | ||
|
|
663c853aff | ||
|
|
103ffa4761 | ||
|
|
3baedf01d1 | ||
|
|
bfad6d34b5 | ||
|
|
2aa2564078 | ||
|
|
6561bb5a6c | ||
|
|
ac75176292 | ||
|
|
1005079f71 | ||
|
|
e0e07a9deb | ||
|
|
c65005e5a6 | ||
|
|
64f2f82e0c | ||
|
|
98495c8114 | ||
|
|
d0ac0b7804 | ||
|
|
e45c31345e | ||
|
|
23cd677133 | ||
|
|
805c1298fb | ||
|
|
5199edff1e | ||
|
|
f3adc13c6d | ||
|
|
40f5f7026d | ||
|
|
b8b96763cf | ||
|
|
80b94fcd00 | ||
|
|
8d09d3c654 | ||
|
|
03564b3a82 | ||
|
|
a7569256d0 | ||
|
|
b0d4a094c1 | ||
|
|
1b232adc72 | ||
|
|
ed81e095ee | ||
|
|
76734b77f1 | ||
|
|
d8284ec09f | ||
|
|
6e982acde8 | ||
|
|
db6f8eaba1 | ||
|
|
eb7ad7163f | ||
|
|
6a478eec5e | ||
|
|
1dc08d6399 | ||
|
|
c3cfed5ac3 | ||
|
|
aba1dc93d9 | ||
|
|
d9bbf35afc | ||
|
|
dec3abfab9 | ||
|
|
bb98f13b19 | ||
|
|
8b10970e03 | ||
|
|
b859ab9d78 | ||
|
|
26208103fc | ||
|
|
d150b017e3 | ||
|
|
49414adfd2 | ||
|
|
5c675c7ce7 | ||
|
|
f16aaf7874 | ||
|
|
d80831e708 | ||
|
|
3e3e7156ec | ||
|
|
dbb2a365cb | ||
|
|
52a8c7288d | ||
|
|
42f6bf6182 | ||
|
|
9d4d3738ff | ||
|
|
1647a6d0a7 | ||
|
|
e5e058672d | ||
|
|
f5cd8e2523 | ||
|
|
fd2cc8aff1 | ||
|
|
f244fb837b | ||
|
|
b4848ab7f9 | ||
|
|
0fa60f0502 | ||
|
|
8d290317d7 | ||
|
|
cb5c8f3a85 | ||
|
|
5a0f4c1462 | ||
|
|
e4445413fd | ||
|
|
9be13eb0b9 | ||
|
|
2c7eeeca7b | ||
|
|
b59a552288 | ||
|
|
def67899ed | ||
|
|
ea0870c180 | ||
|
|
379d57ca8e | ||
|
|
761df2b4cc | ||
|
|
56e1f02f69 | ||
|
|
f921ef4708 | ||
|
|
f11dc9bc25 | ||
|
|
0ebfcd7238 | ||
|
|
5fb9cd142f | ||
|
|
7d5e112efb | ||
|
|
e82dd816de | ||
|
|
887a245d82 | ||
|
|
2f706b33fa | ||
|
|
dcbdb04009 | ||
|
|
008903cbbd | ||
|
|
b67113fc1f | ||
|
|
3afbe832cc | ||
|
|
9adfa0ecfc | ||
|
|
f081d7fd3c | ||
|
|
394a3253aa | ||
|
|
13890d2835 | ||
|
|
6fd3e567cd | ||
|
|
b6d8e55b00 | ||
|
|
e6d3d347ab | ||
|
|
c159ce7eb9 | ||
|
|
65c9bf22dc | ||
|
|
87dfffeddb | ||
|
|
8d6c676fed | ||
|
|
324d27896b | ||
|
|
8c94ce99b2 | ||
|
|
fd5fcf356f | ||
|
|
0dde5a9d2b | ||
|
|
73f7603c1d | ||
|
|
5faffc3886 | ||
|
|
d09d5a7dbe | ||
|
|
b906fecdff | ||
|
|
a6e4122e44 | ||
|
|
e663ecb458 | ||
|
|
95876e28bf | ||
|
|
348932d929 | ||
|
|
bd28516324 | ||
|
|
d1fc050bed | ||
|
|
bace01e4f7 | ||
|
|
0a56ee7dbb | ||
|
|
c90be99216 | ||
|
|
a0a431e0e2 | ||
|
|
4489e7149c | ||
|
|
ec81420894 | ||
|
|
619dd0c99d | ||
|
|
9f5a5108fb | ||
|
|
974510b2c7 | ||
|
|
f2f10f0c79 | ||
|
|
39cbcd4d6f | ||
|
|
1accdfcafb | ||
|
|
e37bbe420c | ||
|
|
58c4455076 | ||
|
|
a413ffb9d2 | ||
|
|
1f96622e74 | ||
|
|
9527cf6abf | ||
|
|
13f0bc3296 | ||
|
|
58a0ec9cca | ||
|
|
fe385de342 | ||
|
|
ae5fb26387 | ||
|
|
cd67ab03ff | ||
|
|
94f134f3fe | ||
|
|
ca95e44a81 | ||
|
|
ecc045b2a8 | ||
|
|
9c205a07c5 | ||
|
|
c414354708 | ||
|
|
ddacd2d9d7 | ||
|
|
987fcb4a5a | ||
|
|
4c70da28e6 | ||
|
|
246684f28c | ||
|
|
e450a0e096 | ||
|
|
90d2144588 | ||
|
|
4302d314cf | ||
|
|
22322a55ed | ||
|
|
d09c0436e0 | ||
|
|
9b619216cb | ||
|
|
fe0a855618 | ||
|
|
3bca7c9a13 | ||
|
|
87887494a5 | ||
|
|
614a8cb14b | ||
|
|
da6e64e89f | ||
|
|
87d0db0b5c | ||
|
|
c756df90fc | ||
|
|
d3053d8ce2 | ||
|
|
4c728cf777 | ||
|
|
17b90af972 | ||
|
|
a0339f5ae2 | ||
|
|
732aaffbb6 | ||
|
|
d50606ce13 | ||
|
|
777c9db0f6 | ||
|
|
815397dba6 | ||
|
|
01f361e7cd | ||
|
|
1278776297 | ||
|
|
a3a8e515bf | ||
|
|
96af9afc83 | ||
|
|
c841c8c284 | ||
|
|
d6ee8ccb2d | ||
|
|
a7930d8403 | ||
|
|
eeeb889ba7 | ||
|
|
f1f4147628 | ||
|
|
42118e0169 | ||
|
|
b67d69a5c8 | ||
|
|
d8144c901d | ||
|
|
e9d9cf7e48 | ||
|
|
0867d7fe0e | ||
|
|
b646331adc | ||
|
|
30109a54ce | ||
|
|
e85ca7dcd3 | ||
|
|
faf05ceb72 | ||
|
|
049e37ba82 | ||
|
|
d187ee23ea | ||
|
|
20b0c9653d | ||
|
|
022b667858 | ||
|
|
1b4af09185 | ||
|
|
58ca4efd42 | ||
|
|
f1bb183017 | ||
|
|
081c11c503 | ||
|
|
d54843635a | ||
|
|
12638275fa | ||
|
|
25c50435ca | ||
|
|
e1c61cfadb | ||
|
|
06fd860964 | ||
|
|
ab4e1f63c5 | ||
|
|
fb998a7e6a | ||
|
|
dbbbfc1170 | ||
|
|
eb432d9acb | ||
|
|
23f65b9eb2 | ||
|
|
c11ea4fe0d | ||
|
|
6b1cfffb6f | ||
|
|
918c0315eb | ||
|
|
106517fc8b | ||
|
|
96070d6b42 | ||
|
|
b22473d0d0 | ||
|
|
ef842b6c52 | ||
|
|
e9415c1708 | ||
|
|
0114efc66f | ||
|
|
84e7847c16 | ||
|
|
3f935942ea | ||
|
|
8f45322b7b | ||
|
|
6e095c1085 | ||
|
|
acaceefc89 | ||
|
|
21c3a4bee8 | ||
|
|
a959af80b5 | ||
|
|
e0d7e7698e | ||
|
|
dbf9912c5a | ||
|
|
fc057d18c9 | ||
|
|
326f05d63f | ||
|
|
eda203e350 | ||
|
|
f9038b9180 | ||
|
|
506aacbd83 | ||
|
|
63e31d672b | ||
|
|
0d5d353e99 | ||
|
|
766ec6a6e4 | ||
|
|
872effb297 | ||
|
|
fb13b79a76 | ||
|
|
706daeb678 | ||
|
|
9d6af82f9c | ||
|
|
2bc37027dd | ||
|
|
e70b6b210e | ||
|
|
df8a36c695 | ||
|
|
702af4b1c8 | ||
|
|
cd15e11ce3 | ||
|
|
ca8b236ccb | ||
|
|
06b057f4a2 | ||
|
|
0158c9b434 | ||
|
|
368728d12b | ||
|
|
c1cab103aa | ||
|
|
d9da85638c | ||
|
|
a25989d213 | ||
|
|
6bfe4fe258 | ||
|
|
e7cbb8cc77 | ||
|
|
06354efa76 | ||
|
|
345f05b23f | ||
|
|
f0489cb918 | ||
|
|
d0b265985b | ||
|
|
82f0902fa4 | ||
|
|
1dcb44f81a | ||
|
|
9bbc421407 | ||
|
|
54f335946e | ||
|
|
d95d8278de | ||
|
|
c813339945 | ||
|
|
cc44bc9d7f | ||
|
|
4cd655fb36 | ||
|
|
70efa4f4e6 | ||
|
|
5845c37672 | ||
|
|
a020a48e63 | ||
|
|
a56c847790 | ||
|
|
9ae81779ff | ||
|
|
df4aa64883 | ||
|
|
70f94322ee | ||
|
|
c2ccb4edda | ||
|
|
f42fafb25f | ||
|
|
0bccf9d358 | ||
|
|
d3f105d9b9 | ||
|
|
5c240316ee | ||
|
|
2fde0c6d8c | ||
|
|
76d78f34ee | ||
|
|
3efb3a99e9 | ||
|
|
65dfc3b878 | ||
|
|
b820aad3fc | ||
|
|
09d4cae6f4 | ||
|
|
85308e52a7 | ||
|
|
4f42ae7efc | ||
|
|
7cc2eac79d | ||
|
|
e3487b4845 | ||
|
|
354b2facf7 | ||
|
|
0d381fd5e9 | ||
|
|
65b7d64e92 | ||
|
|
e79115d719 | ||
|
|
be4f49e96d | ||
|
|
6b24a71ad7 | ||
|
|
1ccacdc600 | ||
|
|
3ea71e1dfb | ||
|
|
d8e324a005 | ||
|
|
7122e878a5 | ||
|
|
c8848a9e76 | ||
|
|
84499dab35 | ||
|
|
e9c695f76a | ||
|
|
029ade8dd6 | ||
|
|
0ebb509205 | ||
|
|
9fa59310d2 | ||
|
|
1f8e6cc82b | ||
|
|
1a4ce643fc | ||
|
|
763337db3f | ||
|
|
f6c5a4d064 | ||
|
|
a20b6b59c9 | ||
|
|
9a708a263c | ||
|
|
c78a42e42f | ||
|
|
df555acc0e | ||
|
|
bf1ce5150a | ||
|
|
b499d908ab | ||
|
|
029ef56edd | ||
|
|
70f52ce484 | ||
|
|
a087974acb | ||
|
|
f96b13c3cd | ||
|
|
9cf89ee6f6 | ||
|
|
a5be7f4e38 | ||
|
|
d367c20a13 | ||
|
|
97132a4758 | ||
|
|
308b8fb779 | ||
|
|
79e0b80e51 | ||
|
|
f79258f645 | ||
|
|
8d3bcde8d6 | ||
|
|
8ee70a1263 | ||
|
|
fb940269de | ||
|
|
ec02e55635 | ||
|
|
f87f18ca8e | ||
|
|
94afd8a3a6 | ||
|
|
0d69a0a3db | ||
|
|
beae2a2587 | ||
|
|
a3a29132ab | ||
|
|
cdc04f987c | ||
|
|
ba2ded1a5a | ||
|
|
d0a779b185 | ||
|
|
d12879b07b | ||
|
|
d0bcbb8d1b | ||
|
|
97257ac821 | ||
|
|
d5e19fdf5b | ||
|
|
9c1d08c057 | ||
|
|
c4f4a440ac | ||
|
|
8ebefebb0a | ||
|
|
3b86d1b5aa | ||
|
|
505e339406 | ||
|
|
297134dd81 | ||
|
|
02989ec4b3 | ||
|
|
9573869c7c | ||
|
|
295bbed4ae | ||
|
|
c81e3e832a | ||
|
|
a018432b81 | ||
|
|
6bc8a4b6c5 | ||
|
|
32dcd7313b | ||
|
|
387c9c63f1 | ||
|
|
ca30b8233b | ||
|
|
c3757f95e5 | ||
|
|
66fbd2b359 | ||
|
|
4420ae33b8 | ||
|
|
d707e92d59 | ||
|
|
273526dc16 | ||
|
|
ebc5cfa2d8 | ||
|
|
13430de3ba | ||
|
|
78dee6c7fe | ||
|
|
43db536878 | ||
|
|
c765a274b2 | ||
|
|
8101fcf95d | ||
|
|
69568abb8a | ||
|
|
a14b43dbe2 | ||
|
|
2fedd6da15 | ||
|
|
fc3224c9ea | ||
|
|
39feb25600 | ||
|
|
eddbacf5a7 | ||
|
|
4e5b460447 | ||
|
|
0e172ff06d | ||
|
|
40fa1d47bc | ||
|
|
70fe08a3c8 | ||
|
|
b840e2a6b5 | ||
|
|
422657fbf7 | ||
|
|
da596a01b9 | ||
|
|
96d2fd2393 | ||
|
|
42c9aeeed6 | ||
|
|
a9b32d8ba7 | ||
|
|
30da267db0 | ||
|
|
84f643e461 | ||
|
|
6298fab94f | ||
|
|
9639f9cee6 | ||
|
|
4af1de4093 | ||
|
|
2c90a2c3aa | ||
|
|
254d4dd02d | ||
|
|
4eceeea4d1 | ||
|
|
efa5eb273c | ||
|
|
8a05e11297 | ||
|
|
1238e89084 | ||
|
|
1c48d12167 | ||
|
|
1fab47acd5 | ||
|
|
0e563e91b1 | ||
|
|
43b1a4572a | ||
|
|
bf18718b9a | ||
|
|
8790d81e03 | ||
|
|
0e5cb2df8e | ||
|
|
46c5913000 | ||
|
|
c35433856f | ||
|
|
67f898bbec | ||
|
|
449c01d345 | ||
|
|
cec1fce745 | ||
|
|
a02d4ab259 | ||
|
|
a22783a3e4 | ||
|
|
9524ec1317 | ||
|
|
64a7108e6d | ||
|
|
cf4818f09c | ||
|
|
98fb970dac | ||
|
|
d162206f75 | ||
|
|
1609b76f0a | ||
|
|
794b3c0471 | ||
|
|
e7bcc380e3 | ||
|
|
fe12f1903d | ||
|
|
41ec4b9bcf | ||
|
|
f64dd00cce | ||
|
|
5ef2f8292c | ||
|
|
ae3ead6b10 | ||
|
|
874f686882 | ||
|
|
383c30f649 | ||
|
|
0b2c95fc4e | ||
|
|
eacdd62cc8 | ||
|
|
a692eb557d | ||
|
|
99b6acfc07 | ||
|
|
fa486c8b60 | ||
|
|
b19b3e5869 | ||
|
|
e6bfd90235 | ||
|
|
072fe526ea | ||
|
|
18e9b99413 | ||
|
|
e65f5072fe | ||
|
|
435218888a | ||
|
|
3e7b743dfa | ||
|
|
c693ef6307 | ||
|
|
e4447ee1b9 | ||
|
|
356390c92b | ||
|
|
ab6893adeb | ||
|
|
55133b028a | ||
|
|
1fbd69b718 | ||
|
|
97239268ac | ||
|
|
10bf065a2a | ||
|
|
107106d759 | ||
|
|
622a5db8d1 | ||
|
|
1e082f941a | ||
|
|
8824f4f3da | ||
|
|
f8bf6b5cc8 | ||
|
|
be844a5184 | ||
|
|
6ec67f7417 | ||
|
|
2c468c7225 | ||
|
|
af7cd7b009 | ||
|
|
cba081379e | ||
|
|
a9064baefc | ||
|
|
31627bb704 | ||
|
|
c4cfabfbaf | ||
|
|
9d25f8049c | ||
|
|
2d50f18dcf | ||
|
|
89b0711464 | ||
|
|
34cb3ad375 | ||
|
|
d2609e4291 | ||
|
|
77a8857e2f | ||
|
|
53d3bda326 | ||
|
|
570588f498 | ||
|
|
60e1a93966 | ||
|
|
3115fae807 | ||
|
|
c2767a866f | ||
|
|
60714b0b0b | ||
|
|
c32cdf5d98 | ||
|
|
c1598f3d4e | ||
|
|
94c45891b4 | ||
|
|
9d3426877d | ||
|
|
d3d9a9300b | ||
|
|
472b97e89e | ||
|
|
a47e0e8266 | ||
|
|
f412ddc716 | ||
|
|
859c5950f4 | ||
|
|
b9f63bcfb1 | ||
|
|
86b79a2685 | ||
|
|
c502aa7d1c | ||
|
|
7f587070e5 | ||
|
|
e121b480ef | ||
|
|
22668d76ee | ||
|
|
2c0c5ba425 | ||
|
|
6670dfdf07 | ||
|
|
b426f4f904 | ||
|
|
e8387b363f | ||
|
|
a6e0280ac1 | ||
|
|
5ab22af9c3 | ||
|
|
4263860760 | ||
|
|
9a3668c16b | ||
|
|
3a538a97d6 | ||
|
|
c637dcbbd8 | ||
|
|
6c68f2950a | ||
|
|
9310f606ad | ||
|
|
7ea6c542cf | ||
|
|
5b4c5b063d | ||
|
|
8afb5b3a7c | ||
|
|
8fbe2199f4 | ||
|
|
62a5254add | ||
|
|
ab5ba6fc80 | ||
|
|
f9d46904f6 | ||
|
|
6545dbd483 | ||
|
|
353853af14 | ||
|
|
6fef3990a7 | ||
|
|
571f5577d1 | ||
|
|
e2de89c763 | ||
|
|
c481e1fe0f | ||
|
|
9034c16e27 | ||
|
|
95927fc5d8 | ||
|
|
4023d7856b | ||
|
|
8307753d53 | ||
|
|
c7fb339ee9 | ||
|
|
ca50c5178a | ||
|
|
33e58ec45a | ||
|
|
e175b5a5a2 | ||
|
|
6072606918 | ||
|
|
3a04e891b4 | ||
|
|
862cc8d982 | ||
|
|
fc29a3ad95 | ||
|
|
ae9af3bf0b | ||
|
|
1bdaaf0d0e | ||
|
|
f3e99f9092 | ||
|
|
ba315f2159 | ||
|
|
1863e57f5b | ||
|
|
a0454943a7 | ||
|
|
a3130d498e | ||
|
|
3168438d6f | ||
|
|
9202d799c6 | ||
|
|
c9f10fb5cc | ||
|
|
b3fde5a2da | ||
|
|
8339fc735c | ||
|
|
3e2f7a5976 | ||
|
|
9c732ae19f | ||
|
|
7e26c0633a | ||
|
|
226a557d5c | ||
|
|
08021138ae | ||
|
|
b16fa6d5c0 | ||
|
|
6203eedbe5 | ||
|
|
db8c30ddbb | ||
|
|
0e9202ae4d | ||
|
|
85f6628718 | ||
|
|
8dab64b9bb | ||
|
|
8b521aa572 | ||
|
|
663fd22e03 | ||
|
|
1f933fb26a | ||
|
|
0faa56f5ff | ||
|
|
9c2aac31b6 | ||
|
|
fdab56936f | ||
|
|
c0aa263f2b | ||
|
|
6c151654cc | ||
|
|
87c9d4d823 | ||
|
|
fd53999777 | ||
|
|
ce60bd10b6 | ||
|
|
ee0492771d | ||
|
|
964e75e191 | ||
|
|
cb16be6b1d | ||
|
|
84a2a7340c | ||
|
|
a383925661 | ||
|
|
c49928bf3b | ||
|
|
02fc57961b | ||
|
|
9923b60d64 | ||
|
|
f243162724 | ||
|
|
b35ab94509 | ||
|
|
4f399b51f5 | ||
|
|
9e14b34e1f | ||
|
|
bf54ee2e9d | ||
|
|
9d2ed1cdbd | ||
|
|
db9237451f | ||
|
|
6277fbbea1 | ||
|
|
1b21e02b7a | ||
|
|
1a5b012545 | ||
|
|
f4aa4ed912 | ||
|
|
d075ee3111 | ||
|
|
5917238a62 | ||
|
|
b2429e3cff | ||
|
|
90aa385326 | ||
|
|
39d9eec890 | ||
|
|
cfff3a4b4a | ||
|
|
5abbec9dea | ||
|
|
7b6ca7cd73 | ||
|
|
b3f0ba348a | ||
|
|
5d2f648d03 | ||
|
|
e00da5a721 | ||
|
|
ca7bea3f24 | ||
|
|
d344924a3c | ||
|
|
7f405e5212 | ||
|
|
c2f38396eb | ||
|
|
501726c6ad | ||
|
|
d07f18bd41 | ||
|
|
931782df1c | ||
|
|
8e65e31ed6 | ||
|
|
221e28c996 | ||
|
|
579c869688 | ||
|
|
8a4decd48b | ||
|
|
66b3572dfe | ||
|
|
7172ed303e | ||
|
|
883c81320b | ||
|
|
7ad1251c89 | ||
|
|
75317d278d | ||
|
|
5438d7bbd9 | ||
|
|
8dc5f0a5ac | ||
|
|
9c38987dd4 | ||
|
|
0c6c7f999f | ||
|
|
2ae5d4dcf5 | ||
|
|
473b870035 | ||
|
|
5e9e995e4b | ||
|
|
270b81fafd | ||
|
|
191e47eb14 | ||
|
|
dc9c21fc65 | ||
|
|
1afa21c199 | ||
|
|
7dc65a8c98 | ||
|
|
20ff1725e7 | ||
|
|
a0759f68b2 | ||
|
|
08135baae6 | ||
|
|
bf40d8feaf | ||
|
|
2c54cafdb6 | ||
|
|
3ff75db00a | ||
|
|
469677aba5 | ||
|
|
da2c81818e | ||
|
|
c1a71afd77 | ||
|
|
7fe2b843e6 | ||
|
|
2c490e4148 | ||
|
|
6241999d2f | ||
|
|
6b315d52a8 | ||
|
|
0143e89e27 | ||
|
|
7130513593 | ||
|
|
a721826821 | ||
|
|
53e3600af7 | ||
|
|
43d838548b | ||
|
|
5b6c0317f6 | ||
|
|
9fe0ee119b | ||
|
|
c70d0352ea | ||
|
|
9a8449e4fe | ||
|
|
fa166483bb | ||
|
|
986b4df997 | ||
|
|
fbec88f6c8 | ||
|
|
adc88d53d3 | ||
|
|
ab17dd5812 | ||
|
|
cc42ac3584 | ||
|
|
4bba52a09e | ||
|
|
00abae10ac | ||
|
|
eafec3045d | ||
|
|
343d0a7baa | ||
|
|
b688f6f7d0 | ||
|
|
9cc03948fa | ||
|
|
c80d5c6bbf | ||
|
|
271b36c602 | ||
|
|
b2a885bf3f | ||
|
|
c0c33d80c7 | ||
|
|
9ff497914e | ||
|
|
726b4fcc0b | ||
|
|
56860da4af | ||
|
|
929a97622c | ||
|
|
09d25c04bc | ||
|
|
15f5f55833 | ||
|
|
a243b0a853 | ||
|
|
d76a838165 | ||
|
|
22595b0f24 | ||
|
|
9f6bbac8ce | ||
|
|
101f94bea6 | ||
|
|
52847b06f4 | ||
|
|
3c9cad2717 | ||
|
|
3acb9c456e | ||
|
|
615e86d177 | ||
|
|
9d7820d155 | ||
|
|
275044bd78 | ||
|
|
2f21c896a6 | ||
|
|
04a374c380 | ||
|
|
4b3b9524ef | ||
|
|
9e293136b9 | ||
|
|
45cda9b0cc | ||
|
|
cd5fef6891 | ||
|
|
a9a11f464b | ||
|
|
2a4288e11d | ||
|
|
47410ce6cc | ||
|
|
f9207ecd0f | ||
|
|
fdefd02812 | ||
|
|
4cdeef212d | ||
|
|
258db5c7e8 | ||
|
|
b59ef15cae | ||
|
|
94f5d4d503 | ||
|
|
9ed2a99f50 | ||
|
|
9f86444e0a | ||
|
|
7bad5d10d8 | ||
|
|
f23bf270d0 | ||
|
|
8839909425 | ||
|
|
ec1b0b3641 | ||
|
|
5882218cff | ||
|
|
cffc2695dd | ||
|
|
49eb049533 | ||
|
|
4009a1a25c | ||
|
|
eec4d7863d | ||
|
|
0d79138e0b | ||
|
|
75914da36a | ||
|
|
cf876acc5d | ||
|
|
6d6cb755e2 | ||
|
|
555b1ad996 | ||
|
|
15a8d6dbf1 | ||
|
|
c3256824b2 | ||
|
|
9c68142a0d | ||
|
|
b496f7731a | ||
|
|
d203092ba7 | ||
|
|
f771bb8043 | ||
|
|
f9b2a71b86 | ||
|
|
8479be5bd4 | ||
|
|
4eddad2cf1 | ||
|
|
8b31e8a9c4 | ||
|
|
d5245f7e7c | ||
|
|
56bb5433a0 | ||
|
|
3d8396a35a | ||
|
|
1a58f76ab7 | ||
|
|
4279962e59 | ||
|
|
503df0842b | ||
|
|
4a93adb1f8 | ||
|
|
2674b3a20e | ||
|
|
3d072f73b7 | ||
|
|
4fc5932899 | ||
|
|
077c20fd34 | ||
|
|
d9716ceb42 | ||
|
|
51af4b32d2 | ||
|
|
08cae822f1 | ||
|
|
30d6fc0fc1 | ||
|
|
462bf81be1 | ||
|
|
26758b965d | ||
|
|
917e4f5cbf | ||
|
|
f02621d1d8 | ||
|
|
45e0998172 | ||
|
|
755368440b | ||
|
|
728ccaefa7 | ||
|
|
ecaa0ec4bb | ||
|
|
d94eb26fa8 | ||
|
|
9774661a40 | ||
|
|
38128f7864 | ||
|
|
1f8213e315 | ||
|
|
fce9a25280 | ||
|
|
b2de5d47dd | ||
|
|
77f583f91f | ||
|
|
4a56726f61 | ||
|
|
4f3dacf81a | ||
|
|
14593f6a51 | ||
|
|
ae16d01734 | ||
|
|
6069af3e90 | ||
|
|
4c2408dfda | ||
|
|
0bd122b643 | ||
|
|
d747ba0b14 | ||
|
|
91484fd09f | ||
|
|
d427a4bd6c | ||
|
|
b455827c17 | ||
|
|
b6363957a8 | ||
|
|
ad27f76c4a | ||
|
|
eeec7142c7 | ||
|
|
efd758d627 | ||
|
|
608d5e332d | ||
|
|
cf4fa9e76d | ||
|
|
2ebb77ff37 | ||
|
|
744154ccf4 | ||
|
|
90c38d0403 | ||
|
|
55d7ef1036 | ||
|
|
7c37c9a4c8 | ||
|
|
54d09ceb51 | ||
|
|
84e21ab992 | ||
|
|
cb9ddb299a | ||
|
|
9e5fdb7cb1 | ||
|
|
97c1d6d73a | ||
|
|
0f0fc2a8f7 | ||
|
|
c41344e2a5 | ||
|
|
07b438f6f0 | ||
|
|
2bf7bf3071 | ||
|
|
5096964825 | ||
|
|
b96c2a731c | ||
|
|
4f1b768b6c | ||
|
|
d3002ce415 | ||
|
|
a5ba70a6d7 | ||
|
|
4118a576de | ||
|
|
4bcbcf4e3a | ||
|
|
9775cc796a | ||
|
|
d269029bb1 | ||
|
|
786a94b448 | ||
|
|
80c87c8c43 | ||
|
|
39d78fb444 | ||
|
|
ac1de4c995 | ||
|
|
6f347bd49e | ||
|
|
cc31143a6c | ||
|
|
86430c6408 | ||
|
|
1cc031b27b | ||
|
|
592c5ca778 | ||
|
|
bad6346e7a | ||
|
|
cf10791c95 | ||
|
|
3f68c0001e | ||
|
|
07ec5c3b12 | ||
|
|
2d8f97ff35 | ||
|
|
28ae1ae3d4 | ||
|
|
b9e1c0ba56 | ||
|
|
317cc8eeee | ||
|
|
3ddee386b2 | ||
|
|
9f946f3514 | ||
|
|
904198013e | ||
|
|
ac7c7cee84 | ||
|
|
6c3d33d4a1 | ||
|
|
3853c6ca18 | ||
|
|
f3b7d33372 | ||
|
|
7a67577aa1 | ||
|
|
fe3e02cb2e | ||
|
|
821d7845f0 | ||
|
|
f7709e19fd | ||
|
|
fdfc5e0e68 | ||
|
|
b331a07b69 | ||
|
|
f5bf566e66 | ||
|
|
f80d796333 | ||
|
|
afd55c52e5 | ||
|
|
b4cc300190 | ||
|
|
03af305761 | ||
|
|
079f4e5ac0 | ||
|
|
ff075a4f56 | ||
|
|
b031e1a232 | ||
|
|
175412774c | ||
|
|
d0efe8eb47 | ||
|
|
be0d5557a6 | ||
|
|
24f6fcd2d4 | ||
|
|
9bef53c16c | ||
|
|
9b70985d32 | ||
|
|
a0a3d8ef3a | ||
|
|
4ae406b3e1 | ||
|
|
51f2009a2c | ||
|
|
8d172e0b57 | ||
|
|
4a132e769c | ||
|
|
786110359a | ||
|
|
3b5560b741 | ||
|
|
0351f4fbb3 | ||
|
|
a695f85359 | ||
|
|
d0aa601301 | ||
|
|
508e98e3b6 | ||
|
|
1227772696 | ||
|
|
0aa5c73635 | ||
|
|
afda97870a | ||
|
|
d56cdeec77 | ||
|
|
657914db26 | ||
|
|
0495aecf4c | ||
|
|
f539a236f1 | ||
|
|
52a9e500df | ||
|
|
df0da84b9f | ||
|
|
daaad1ce42 | ||
|
|
26b7075696 | ||
|
|
b526734e4b | ||
|
|
eaca7df527 | ||
|
|
1413bb7fbf | ||
|
|
5a09de002a | ||
|
|
5634f46bd5 | ||
|
|
a2f8435204 | ||
|
|
f076829b9b | ||
|
|
47aab98964 | ||
|
|
4f696a4947 | ||
|
|
828e769b3b | ||
|
|
69dc26005a | ||
|
|
6bbe2687ef | ||
|
|
f19bf17d21 | ||
|
|
d09e2237ee | ||
|
|
10830dee36 | ||
|
|
5f7f670517 | ||
|
|
c1edbbf047 | ||
|
|
7168f6c75e | ||
|
|
57582aa90d | ||
|
|
732dced999 | ||
|
|
eb9df59f15 | ||
|
|
e247b9e5f9 | ||
|
|
c1fd964344 | ||
|
|
f206ce7114 | ||
|
|
7438385729 | ||
|
|
142ca1e32c | ||
|
|
cde761fadd | ||
|
|
16eb3f021d | ||
|
|
9c15ddf952 | ||
|
|
24216d7b4f | ||
|
|
833ddf15d5 | ||
|
|
63a94dcef1 | ||
|
|
807bf4c061 | ||
|
|
a4ba130e5f | ||
|
|
d06145bb3a | ||
|
|
935e04b266 | ||
|
|
35fec3150b | ||
|
|
493238e696 | ||
|
|
cffc44b471 | ||
|
|
fcab3b1d46 | ||
|
|
1badaa725e | ||
|
|
76579c426e | ||
|
|
5f69395522 | ||
|
|
9ceec6e306 | ||
|
|
a67913d660 | ||
|
|
7da6b1925d | ||
|
|
fb05558ab9 | ||
|
|
33835fef7b | ||
|
|
f1f089baa0 | ||
|
|
d8f32d6ade | ||
|
|
ca04ebccd2 | ||
|
|
d11a67527f | ||
|
|
625fb41352 | ||
|
|
e0e90e3cab | ||
|
|
4c4a6f668d | ||
|
|
b7d8447f73 | ||
|
|
18651bdaf4 | ||
|
|
9046a6578a | ||
|
|
4219842088 | ||
|
|
3b41d6fff6 | ||
|
|
b2eaca27de | ||
|
|
9ccb04489b | ||
|
|
6b164b5487 | ||
|
|
073493cba2 | ||
|
|
7f5e0f7244 | ||
|
|
7bb6f55153 | ||
|
|
7f21bea8a6 | ||
|
|
802e7a080f | ||
|
|
a7c1a75996 | ||
|
|
70803b1a6d | ||
|
|
005b9a88c3 | ||
|
|
7214b5beea | ||
|
|
e2163546fe | ||
|
|
17bc9c231a | ||
|
|
0b4e9da5d5 | ||
|
|
002fa82afb | ||
|
|
482baef360 | ||
|
|
20b876bdd6 | ||
|
|
d00ac1fa86 | ||
|
|
02e5b6e975 | ||
|
|
1f17eda56f | ||
|
|
718f9a4f11 | ||
|
|
668276e7d0 | ||
|
|
3de769c7e7 | ||
|
|
984bbd493d | ||
|
|
74eabba641 | ||
|
|
81d54ca69f | ||
|
|
ddee63b718 | ||
|
|
99743e8e0f | ||
|
|
7d11539827 | ||
|
|
7079098810 | ||
|
|
e12ac26406 | ||
|
|
64e755bc15 | ||
|
|
a65b6bf19d | ||
|
|
5143040ba9 | ||
|
|
01c75ad5c0 | ||
|
|
43d0197a60 | ||
|
|
35013a71d4 | ||
|
|
381acbf00f | ||
|
|
47fb13aa4a | ||
|
|
f5aca6aa93 | ||
|
|
95f4670b47 | ||
|
|
acc2412742 | ||
|
|
77df8cc69b | ||
|
|
eaf651a4e2 | ||
|
|
3d1a050e22 | ||
|
|
2db053ab04 | ||
|
|
915418eca8 | ||
|
|
508a707c6e | ||
|
|
233d82805b | ||
|
|
8c4e5e5185 | ||
|
|
d3ca556914 | ||
|
|
325a92f40d | ||
|
|
a89481cf14 | ||
|
|
65be8ba6f7 | ||
|
|
a2b9b9e0c8 | ||
|
|
20bd5327f8 | ||
|
|
4ac045afcf | ||
|
|
4569ee50a5 | ||
|
|
cd2ea1d5fc | ||
|
|
ab34f7c056 | ||
|
|
a27a5ebf4c | ||
|
|
be20fcf021 | ||
|
|
f62317a338 | ||
|
|
d27243eb34 | ||
|
|
8f5e26acd1 | ||
|
|
e02f20d74e | ||
|
|
b0111d6653 | ||
|
|
a38d8c14fa | ||
|
|
77e1898512 | ||
|
|
29110e96e5 | ||
|
|
02e2b51814 | ||
|
|
e9588cc7a1 | ||
|
|
3d8e1b8f86 | ||
|
|
312f969364 | ||
|
|
0f41079803 | ||
|
|
7f30e8dadc | ||
|
|
9cd20cfc05 | ||
|
|
1343bbf6ea | ||
|
|
90c39d1f85 | ||
|
|
92da61376b | ||
|
|
69976c2caf | ||
|
|
3c6fd0c83a | ||
|
|
b0a09747d4 | ||
|
|
b65866217a | ||
|
|
611e3b1243 | ||
|
|
84d3d42306 | ||
|
|
61e2739ef7 | ||
|
|
a3391afd27 | ||
|
|
ce9b7d1468 | ||
|
|
1b86314a14 | ||
|
|
b2a0519f83 | ||
|
|
3dec4bda8c | ||
|
|
5de529cbb2 | ||
|
|
4fd1d8e08a | ||
|
|
0847ccc602 | ||
|
|
969803569e | ||
|
|
6532abd870 | ||
|
|
07dabb4ceb | ||
|
|
1c6a683015 | ||
|
|
bb38458ac4 | ||
|
|
53de2ca25b | ||
|
|
5a9122f8be | ||
|
|
dc84f91044 | ||
|
|
4be6626470 | ||
|
|
7e4494aae1 | ||
|
|
50e54e6a1c | ||
|
|
30b111b986 | ||
|
|
a63f2e6131 | ||
|
|
51d487b938 | ||
|
|
96180c837d | ||
|
|
da20cf1ed2 | ||
|
|
bffad5e3c8 | ||
|
|
74287ebb99 | ||
|
|
8b40c92f7e | ||
|
|
5f6033cac1 | ||
|
|
24582407d4 | ||
|
|
22c9e3ee1f | ||
|
|
cb2c898b7e | ||
|
|
c0bf623266 | ||
|
|
18f22d3951 | ||
|
|
e2dad610b0 | ||
|
|
5ed3cbee2e | ||
|
|
27712badb6 | ||
|
|
72c032adff | ||
|
|
7197df9812 | ||
|
|
898e2e5f21 | ||
|
|
cde3b7541f | ||
|
|
822f55497e | ||
|
|
7c16870294 | ||
|
|
e368f422f4 | ||
|
|
9d9ac4ed9e | ||
|
|
d7576ebda1 | ||
|
|
fd810ff01c | ||
|
|
999a05f7ff | ||
|
|
a19f2f19c5 | ||
|
|
f54ccd40e6 | ||
|
|
5893487d4a | ||
|
|
3c8e20d4e4 | ||
|
|
bf68a5523b | ||
|
|
9c5c27152c | ||
|
|
c229371c68 | ||
|
|
805cef68a2 | ||
|
|
09addcb975 | ||
|
|
409d382ff9 | ||
|
|
27bfc14438 | ||
|
|
6c20a5f4f9 | ||
|
|
ffd61a9f67 | ||
|
|
4f2da0347c | ||
|
|
3c13c144d5 | ||
|
|
d4eaedef3d | ||
|
|
a8f1892d48 | ||
|
|
e347ac5742 | ||
|
|
5f2a9b093d | ||
|
|
e821e8d082 | ||
|
|
05f56be2d8 | ||
|
|
88f78f6541 | ||
|
|
234533f241 | ||
|
|
b1f72b0e3e | ||
|
|
a3022f6f20 | ||
|
|
95f7583511 | ||
|
|
578ba386e6 | ||
|
|
df7be9d11e | ||
|
|
72a59917fb | ||
|
|
9406c76e55 | ||
|
|
ea550b1656 | ||
|
|
d20741c0f0 | ||
|
|
91b7fd59d1 | ||
|
|
95e81ad824 | ||
|
|
316832fc4f | ||
|
|
23b6d81c47 | ||
|
|
8284520733 | ||
|
|
57f53818e1 | ||
|
|
7bca3fb2ed | ||
|
|
ae4a1358af | ||
|
|
95e3a11a11 | ||
|
|
f1a859c650 | ||
|
|
8d9fd95e85 | ||
|
|
452921d198 | ||
|
|
3e0f6f55fb | ||
|
|
0e480bbd94 | ||
|
|
7a079d866f | ||
|
|
af2710125e | ||
|
|
fb3de2e36d | ||
|
|
bf40222105 | ||
|
|
e1419edb15 | ||
|
|
131b936a69 | ||
|
|
5850a82d80 | ||
|
|
b76b6be3d1 | ||
|
|
b8f69eeaa8 | ||
|
|
d78fb53845 | ||
|
|
54889fec41 | ||
|
|
2c5c4d6e04 | ||
|
|
e6a44c9c82 | ||
|
|
7cba52d77e | ||
|
|
a79a67e4b2 | ||
|
|
01bace4048 | ||
|
|
d5f8419157 | ||
|
|
40a7026d4c | ||
|
|
47cb296cc4 | ||
|
|
be27033d41 | ||
|
|
3001a2d66f | ||
|
|
becaff0711 | ||
|
|
aaab9f409f | ||
|
|
068bb5cbeb | ||
|
|
337c07d7bc | ||
|
|
c387f65b4a | ||
|
|
df13081f97 | ||
|
|
50f6d0ab26 | ||
|
|
fb7bafdb87 | ||
|
|
b3472c3919 | ||
|
|
4f47712d52 | ||
|
|
547ccb96c9 | ||
|
|
7f3ff434ea | ||
|
|
aad4b0ade3 | ||
|
|
d587f44ec9 | ||
|
|
f30d3cf637 | ||
|
|
8fed47f39b | ||
|
|
48cedbd0fb | ||
|
|
752530a381 | ||
|
|
45fc6daa4a | ||
|
|
e17ce9c3b5 | ||
|
|
2657b9d1a5 | ||
|
|
b77a56ade2 | ||
|
|
4d5f588748 | ||
|
|
6582ba6317 | ||
|
|
b3453d9d02 | ||
|
|
e4b73140c8 | ||
|
|
235f789228 | ||
|
|
c029cf79f7 | ||
|
|
0b796a85a8 | ||
|
|
d8191f79a4 | ||
|
|
6a259f7cca | ||
|
|
22a2b92022 | ||
|
|
25616ae3b4 | ||
|
|
372aee30cd | ||
|
|
0c5023323a | ||
|
|
2d1126b9e4 | ||
|
|
3ecf92fa41 | ||
|
|
50befd8991 | ||
|
|
676268d7af | ||
|
|
f2457a7050 | ||
|
|
ded90dc4ce | ||
|
|
cddadcfae2 | ||
|
|
3113d392ac | ||
|
|
6433d5f744 | ||
|
|
f42c265714 | ||
|
|
d6711ac850 | ||
|
|
9d7c2de1d5 | ||
|
|
b1e1c44e77 | ||
|
|
85f54dd210 | ||
|
|
eea32ad134 | ||
|
|
4f24035082 | ||
|
|
0b0b1d9ca4 | ||
|
|
98828ed848 | ||
|
|
7b0f7cd32c | ||
|
|
67cb778039 | ||
|
|
9f49afae0a | ||
|
|
49c7c7aa2d | ||
|
|
42d89d1d10 | ||
|
|
24fae0d03e | ||
|
|
2c337f1d03 | ||
|
|
fcc521d5ed | ||
|
|
91005876eb | ||
|
|
da5b4aa79d | ||
|
|
ced440392b | ||
|
|
33d7ba1fda | ||
|
|
a6095fc305 | ||
|
|
84cc964a7a | ||
|
|
9e856b28a9 | ||
|
|
9378fdf2b6 | ||
|
|
6a134dda1f | ||
|
|
4f927ee571 | ||
|
|
b111869422 | ||
|
|
89a249eae4 | ||
|
|
7942d52843 | ||
|
|
b6310302d2 | ||
|
|
87774e73e1 | ||
|
|
548b5ff4a1 | ||
|
|
80fedf3fa3 | ||
|
|
8523cdffa3 | ||
|
|
29f2335935 | ||
|
|
eba6324d18 | ||
|
|
c3874d7c95 | ||
|
|
3086342d2b | ||
|
|
f836209249 | ||
|
|
d4b06cf0c0 | ||
|
|
54199affc1 | ||
|
|
4d88c6a90b | ||
|
|
906813b8f5 | ||
|
|
30d1e7ecb4 | ||
|
|
8fab4e29bf | ||
|
|
252554ea87 | ||
|
|
ba3d49172c | ||
|
|
6ef8ff757a | ||
|
|
fcc2c0b3de | ||
|
|
16e390f849 | ||
|
|
a31cf53863 | ||
|
|
09d8a6360b | ||
|
|
b1f59d4727 | ||
|
|
d8add7edcb | ||
|
|
1a71921fd6 | ||
|
|
6d12fff4fe | ||
|
|
769301c804 | ||
|
|
6a828e9ca5 | ||
|
|
2516d2d6de | ||
|
|
e92a3ad025 | ||
|
|
5686094151 | ||
|
|
915749dd69 | ||
|
|
258bc2b544 | ||
|
|
a9748f5b46 | ||
|
|
56f1c7946e | ||
|
|
88a427578f | ||
|
|
0ebd9e1fe1 | ||
|
|
bea0b4ba01 | ||
|
|
f8bee9b5c5 | ||
|
|
500e089b97 | ||
|
|
2adef52abf | ||
|
|
e01bfe1bdf | ||
|
|
418b1b3d68 | ||
|
|
401929d992 | ||
|
|
ee34dd72f7 | ||
|
|
b214d7a662 | ||
|
|
079a40cd32 | ||
|
|
adebea1561 | ||
|
|
28bf7c3225 | ||
|
|
78b2efd148 | ||
|
|
11590061a3 | ||
|
|
09847ee33c | ||
|
|
db34785be0 | ||
|
|
538a9cf642 | ||
|
|
d0346e436a | ||
|
|
442202d978 | ||
|
|
3b2a89d9f4 | ||
|
|
0bf366ac75 | ||
|
|
c62e73d21e | ||
|
|
2889899bfd | ||
|
|
f18ac2e48b | ||
|
|
1d259d14c8 | ||
|
|
b8c07e31cf | ||
|
|
3f27ed7b18 | ||
|
|
d7678b340f | ||
|
|
b697356465 | ||
|
|
1b9a2f21d2 | ||
|
|
e26451fcc0 | ||
|
|
17db542775 | ||
|
|
dd865a2db5 | ||
|
|
834c7cb87f | ||
|
|
a9a015cb5b | ||
|
|
94a71998a7 | ||
|
|
aa212924bc | ||
|
|
edef2f1bf6 | ||
|
|
912f53762e | ||
|
|
02c04c8f41 | ||
|
|
3ad90a6e34 | ||
|
|
0f83870db0 | ||
|
|
7529f3a73e | ||
|
|
77d559ac8c | ||
|
|
1311cad913 | ||
|
|
4d1ba9bede | ||
|
|
6b07651ed3 | ||
|
|
50ddfc0437 | ||
|
|
c0ac485772 | ||
|
|
8d4ae6971d | ||
|
|
88d0dfee2d | ||
|
|
551a479c6b | ||
|
|
3f85541c9a | ||
|
|
74cdb610d8 | ||
|
|
165dd3b418 | ||
|
|
7421f3e345 | ||
|
|
d00559bcd5 | ||
|
|
9774051fab | ||
|
|
c50692bae0 | ||
|
|
6348283001 | ||
|
|
1cbd34d94e | ||
|
|
f9d768a7a7 | ||
|
|
6c1bfccfaf | ||
|
|
2ca0a0c634 | ||
|
|
30ce3f1dc3 | ||
|
|
15541c52ce | ||
|
|
20c3e8c7bd | ||
|
|
59797fb89c | ||
|
|
849cc85398 | ||
|
|
dd318a1c8e | ||
|
|
2edf2a4231 | ||
|
|
d58ee1e693 | ||
|
|
088cb7fe40 | ||
|
|
38498a5587 | ||
|
|
6e3b30b03c | ||
|
|
4e9cf72816 | ||
|
|
7eb1f061b7 | ||
|
|
5e4f5916f2 | ||
|
|
1450737d94 | ||
|
|
bfd20e559e | ||
|
|
98a7932dee | ||
|
|
19e26d0d64 | ||
|
|
1715218864 | ||
|
|
e503c6cd79 | ||
|
|
9515e3d00b | ||
|
|
53e25ae213 | ||
|
|
4863ecc329 | ||
|
|
b5892f5b5e | ||
|
|
d16502c872 | ||
|
|
e29fb9ba8a | ||
|
|
2ee0411582 | ||
|
|
f210466cb1 | ||
|
|
6af28b1c29 | ||
|
|
049be2484e | ||
|
|
8f438e8045 | ||
|
|
a8382dd6ce | ||
|
|
c55385d6d8 | ||
|
|
87e6691433 | ||
|
|
aa9ba65f70 | ||
|
|
39fef48915 | ||
|
|
362fead7e8 | ||
|
|
e809ed3743 | ||
|
|
dc8c322b42 | ||
|
|
c5688ab632 | ||
|
|
d5d75eee63 | ||
|
|
6ec16733c3 | ||
|
|
ce2b2658ad | ||
|
|
3a866b1aea | ||
|
|
1cf938e16a | ||
|
|
1df427366f | ||
|
|
f97cdcb4d6 | ||
|
|
15c682cd1e | ||
|
|
008983be26 | ||
|
|
2f01000665 | ||
|
|
616955daef | ||
|
|
e22b191a48 | ||
|
|
8930c52ada | ||
|
|
6d94335079 | ||
|
|
f2e0b193af | ||
|
|
5b55902cd9 | ||
|
|
694f647a2c | ||
|
|
fc1cb00523 | ||
|
|
2fda59d7db | ||
|
|
a95837404a | ||
|
|
c6db2a1adf | ||
|
|
f6d22732a0 | ||
|
|
220a69938f | ||
|
|
d438866864 | ||
|
|
2e0ed9ce9f | ||
|
|
5de3b69e2c | ||
|
|
dfd6798377 | ||
|
|
074ae2a5a1 | ||
|
|
77f6a18075 | ||
|
|
0762d9e124 | ||
|
|
37dae04715 | ||
|
|
f299a7ad14 | ||
|
|
ba295385ab | ||
|
|
33adf518ae | ||
|
|
93885d0dd5 | ||
|
|
747cda79db | ||
|
|
f3cfc38adc | ||
|
|
dd3a0a706d | ||
|
|
37d001e7b5 | ||
|
|
add09e5a1c | ||
|
|
561d1c0e55 | ||
|
|
239ba335b1 | ||
|
|
ec83123090 | ||
|
|
4f6d5164a4 | ||
|
|
ae1e2eccd2 | ||
|
|
d7bc821bbe | ||
|
|
f8579f7c96 | ||
|
|
046a9ef6f2 | ||
|
|
64e15542a2 | ||
|
|
7dec674452 | ||
|
|
0f48d3e72c | ||
|
|
1f793c49ae | ||
|
|
e581539cf9 | ||
|
|
736eee79df | ||
|
|
7a0fe3819b | ||
|
|
65c9bf7e52 | ||
|
|
1e61b5670e | ||
|
|
6c2bae6296 | ||
|
|
358d6010b0 | ||
|
|
82978a25c5 | ||
|
|
3519696bae | ||
|
|
bd33df2cc7 | ||
|
|
5f44eb14ad | ||
|
|
fb94cf953a | ||
|
|
d7486218bc | ||
|
|
59913cdc4b | ||
|
|
2d7449aeba | ||
|
|
3ea53a8012 | ||
|
|
48cd12ec3d | ||
|
|
7c71ed2dc6 | ||
|
|
24d8ccc52f | ||
|
|
05cd96f2be | ||
|
|
75795ab1e9 | ||
|
|
bb1602f179 | ||
|
|
ac268f0f73 | ||
|
|
d924567e5f | ||
|
|
109d8df782 | ||
|
|
0aaa35098d | ||
|
|
6f57beab28 | ||
|
|
5b26e27834 | ||
|
|
8429f650aa | ||
|
|
3eb2202117 | ||
|
|
c217a40710 | ||
|
|
4a7308c5bb | ||
|
|
5fba51103e | ||
|
|
95a9808f35 | ||
|
|
c09e180c48 | ||
|
|
b09b650c1d | ||
|
|
44a41b963d | ||
|
|
0510189f54 | ||
|
|
16b3cf764d | ||
|
|
c634c39874 | ||
|
|
ae0846e877 | ||
|
|
40e7e1b418 | ||
|
|
e2a5853dde | ||
|
|
e419e67cb0 | ||
|
|
3356a4ce14 | ||
|
|
26a4347155 |
152
.clang-tidy
Normal file
152
.clang-tidy
Normal file
@@ -0,0 +1,152 @@
|
|||||||
|
---
|
||||||
|
Checks: >-
|
||||||
|
*,
|
||||||
|
-abseil-*,
|
||||||
|
-android-*,
|
||||||
|
-boost-*,
|
||||||
|
-bugprone-branch-clone,
|
||||||
|
-bugprone-narrowing-conversions,
|
||||||
|
-bugprone-signed-char-misuse,
|
||||||
|
-bugprone-too-small-loop-variable,
|
||||||
|
-cert-dcl50-cpp,
|
||||||
|
-cert-err58-cpp,
|
||||||
|
-cert-oop57-cpp,
|
||||||
|
-cert-str34-c,
|
||||||
|
-clang-analyzer-optin.cplusplus.UninitializedObject,
|
||||||
|
-clang-analyzer-osx.*,
|
||||||
|
-clang-diagnostic-delete-abstract-non-virtual-dtor,
|
||||||
|
-clang-diagnostic-delete-non-abstract-non-virtual-dtor,
|
||||||
|
-clang-diagnostic-shadow-field,
|
||||||
|
-clang-diagnostic-sign-compare,
|
||||||
|
-clang-diagnostic-unused-variable,
|
||||||
|
-clang-diagnostic-unused-const-variable,
|
||||||
|
-cppcoreguidelines-avoid-c-arrays,
|
||||||
|
-cppcoreguidelines-avoid-goto,
|
||||||
|
-cppcoreguidelines-avoid-magic-numbers,
|
||||||
|
-cppcoreguidelines-init-variables,
|
||||||
|
-cppcoreguidelines-macro-usage,
|
||||||
|
-cppcoreguidelines-narrowing-conversions,
|
||||||
|
-cppcoreguidelines-non-private-member-variables-in-classes,
|
||||||
|
-cppcoreguidelines-owning-memory,
|
||||||
|
-cppcoreguidelines-pro-bounds-array-to-pointer-decay,
|
||||||
|
-cppcoreguidelines-pro-bounds-constant-array-index,
|
||||||
|
-cppcoreguidelines-pro-bounds-pointer-arithmetic,
|
||||||
|
-cppcoreguidelines-pro-type-const-cast,
|
||||||
|
-cppcoreguidelines-pro-type-cstyle-cast,
|
||||||
|
-cppcoreguidelines-pro-type-member-init,
|
||||||
|
-cppcoreguidelines-pro-type-reinterpret-cast,
|
||||||
|
-cppcoreguidelines-pro-type-static-cast-downcast,
|
||||||
|
-cppcoreguidelines-pro-type-union-access,
|
||||||
|
-cppcoreguidelines-pro-type-vararg,
|
||||||
|
-cppcoreguidelines-special-member-functions,
|
||||||
|
-fuchsia-default-arguments,
|
||||||
|
-fuchsia-multiple-inheritance,
|
||||||
|
-fuchsia-overloaded-operator,
|
||||||
|
-fuchsia-statically-constructed-objects,
|
||||||
|
-fuchsia-default-arguments-declarations,
|
||||||
|
-fuchsia-default-arguments-calls,
|
||||||
|
-google-build-using-namespace,
|
||||||
|
-google-explicit-constructor,
|
||||||
|
-google-readability-braces-around-statements,
|
||||||
|
-google-readability-casting,
|
||||||
|
-google-readability-todo,
|
||||||
|
-google-runtime-references,
|
||||||
|
-hicpp-*,
|
||||||
|
-llvm-else-after-return,
|
||||||
|
-llvm-header-guard,
|
||||||
|
-llvm-include-order,
|
||||||
|
-llvm-qualified-auto,
|
||||||
|
-llvmlibc-*,
|
||||||
|
-misc-non-private-member-variables-in-classes,
|
||||||
|
-misc-no-recursion,
|
||||||
|
-misc-unused-parameters,
|
||||||
|
-modernize-avoid-c-arrays,
|
||||||
|
-modernize-return-braced-init-list,
|
||||||
|
-modernize-use-auto,
|
||||||
|
-modernize-use-default-member-init,
|
||||||
|
-modernize-use-equals-default,
|
||||||
|
-modernize-use-trailing-return-type,
|
||||||
|
-mpi-*,
|
||||||
|
-objc-*,
|
||||||
|
-readability-braces-around-statements,
|
||||||
|
-readability-const-return-type,
|
||||||
|
-readability-convert-member-functions-to-static,
|
||||||
|
-readability-else-after-return,
|
||||||
|
-readability-implicit-bool-conversion,
|
||||||
|
-readability-isolate-declaration,
|
||||||
|
-readability-magic-numbers,
|
||||||
|
-readability-make-member-function-const,
|
||||||
|
-readability-named-parameter,
|
||||||
|
-readability-qualified-auto,
|
||||||
|
-readability-redundant-access-specifiers,
|
||||||
|
-readability-redundant-member-init,
|
||||||
|
-readability-redundant-string-init,
|
||||||
|
-readability-uppercase-literal-suffix,
|
||||||
|
-readability-use-anyofallof,
|
||||||
|
-warnings-as-errors
|
||||||
|
WarningsAsErrors: '*'
|
||||||
|
AnalyzeTemporaryDtors: false
|
||||||
|
FormatStyle: google
|
||||||
|
CheckOptions:
|
||||||
|
- key: google-readability-braces-around-statements.ShortStatementLines
|
||||||
|
value: '1'
|
||||||
|
- key: google-readability-function-size.StatementThreshold
|
||||||
|
value: '800'
|
||||||
|
- key: google-readability-namespace-comments.ShortNamespaceLines
|
||||||
|
value: '10'
|
||||||
|
- key: google-readability-namespace-comments.SpacesBeforeComments
|
||||||
|
value: '2'
|
||||||
|
- key: modernize-loop-convert.MaxCopySize
|
||||||
|
value: '16'
|
||||||
|
- key: modernize-loop-convert.MinConfidence
|
||||||
|
value: reasonable
|
||||||
|
- key: modernize-loop-convert.NamingStyle
|
||||||
|
value: CamelCase
|
||||||
|
- key: modernize-pass-by-value.IncludeStyle
|
||||||
|
value: llvm
|
||||||
|
- key: modernize-replace-auto-ptr.IncludeStyle
|
||||||
|
value: llvm
|
||||||
|
- key: modernize-use-nullptr.NullMacros
|
||||||
|
value: 'NULL'
|
||||||
|
- key: readability-identifier-naming.LocalVariableCase
|
||||||
|
value: 'lower_case'
|
||||||
|
- key: readability-identifier-naming.ClassCase
|
||||||
|
value: 'CamelCase'
|
||||||
|
- key: readability-identifier-naming.StructCase
|
||||||
|
value: 'CamelCase'
|
||||||
|
- key: readability-identifier-naming.EnumCase
|
||||||
|
value: 'CamelCase'
|
||||||
|
- key: readability-identifier-naming.EnumConstantCase
|
||||||
|
value: 'UPPER_CASE'
|
||||||
|
- key: readability-identifier-naming.StaticConstantCase
|
||||||
|
value: 'UPPER_CASE'
|
||||||
|
- key: readability-identifier-naming.StaticVariableCase
|
||||||
|
value: 'UPPER_CASE'
|
||||||
|
- key: readability-identifier-naming.GlobalConstantCase
|
||||||
|
value: 'UPPER_CASE'
|
||||||
|
- key: readability-identifier-naming.ParameterCase
|
||||||
|
value: 'lower_case'
|
||||||
|
- key: readability-identifier-naming.PrivateMemberPrefix
|
||||||
|
value: 'NO_PRIVATE_MEMBERS_ALWAYS_USE_PROTECTED'
|
||||||
|
- key: readability-identifier-naming.PrivateMethodPrefix
|
||||||
|
value: 'NO_PRIVATE_METHODS_ALWAYS_USE_PROTECTED'
|
||||||
|
- key: readability-identifier-naming.ClassMemberCase
|
||||||
|
value: 'lower_case'
|
||||||
|
- key: readability-identifier-naming.ClassMemberCase
|
||||||
|
value: 'lower_case'
|
||||||
|
- key: readability-identifier-naming.ProtectedMemberCase
|
||||||
|
value: 'lower_case'
|
||||||
|
- key: readability-identifier-naming.ProtectedMemberSuffix
|
||||||
|
value: '_'
|
||||||
|
- key: readability-identifier-naming.FunctionCase
|
||||||
|
value: 'lower_case'
|
||||||
|
- key: readability-identifier-naming.ClassMethodCase
|
||||||
|
value: 'lower_case'
|
||||||
|
- key: readability-identifier-naming.ProtectedMethodCase
|
||||||
|
value: 'lower_case'
|
||||||
|
- key: readability-identifier-naming.ProtectedMethodSuffix
|
||||||
|
value: '_'
|
||||||
|
- key: readability-identifier-naming.VirtualMethodCase
|
||||||
|
value: 'lower_case'
|
||||||
|
- key: readability-identifier-naming.VirtualMethodSuffix
|
||||||
|
value: ''
|
||||||
61
.github/ISSUE_TEMPLATE/bug_report.md
vendored
61
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@@ -1,35 +1,50 @@
|
|||||||
---
|
---
|
||||||
name: Bug report
|
name: Problem Report
|
||||||
about: Create a report to help us improve
|
about: Create a Report to help us improve
|
||||||
title: ''
|
|
||||||
labels: bug
|
|
||||||
assignees: ''
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
*Before creating a new issue please check that you have:*
|
<!-- Thanks for reporting a problem for this project. READ THIS FIRST:
|
||||||
|
|
||||||
* *searched the existing [issues](https://github.com/emsesp/EMS-ESP32/issues) (both open and closed)*
|
Please DO NOT OPEN AN ISSUE if your EMS-ESP version is not the latest from the dev branch, please update your device before submitting your issue. Your problem might already be solved. The latest precompiled binaries of EMS-ESP can be downloaded from https://github.com/emsesp/EMS-ESP32/releases/tag/latest
|
||||||
* *searched the [documentation help section](https://emsesp.github.io/docs)*
|
|
||||||
|
|
||||||
*Completing this template will help developers and contributors to address the issue. Try to be as specific and extensive as possible. If the information provided is not enough the issue will likely be closed.*
|
Please take a few minutes to complete the requested information below.
|
||||||
|
|
||||||
*You can now remove this line and the above ones. Text in italic is meant to be replaced by your own words. If any of the sections below are not relevant to the issue (for instance, the screenshots) then you can delete them.*
|
-->
|
||||||
|
|
||||||
**Bug description**
|
### PROBLEM DESCRIPTION
|
||||||
*A clear and concise description of what the bug is. Mention which EMS-ESP version you're using.*
|
|
||||||
|
|
||||||
**Steps to reproduce**
|
_A clear and concise description of what the problem is._
|
||||||
*Steps to reproduce the behavior.*
|
|
||||||
|
|
||||||
**Expected behavior**
|
### REQUESTED INFORMATION
|
||||||
*A clear and concise description of what you expected to happen.*
|
|
||||||
|
|
||||||
**Screenshots**
|
_Make sure your have performed every step and checked the applicable boxes before submitting your issue. Thank you!_
|
||||||
*If applicable, add screenshots to help explain your problem.*
|
|
||||||
|
|
||||||
**Device information**
|
- [ ] Searched the problem in [issues](https://github.com/emsesp/EMS-ESP32/issues)
|
||||||
*Copy-paste here the information as it is outputted by the device. You can get this information by from http://ems-esp.local/api?device=system&cmd=info*
|
- [ ] Searched the problem in [discussions](https://github.com/emsesp/EMS-ESP32/discussions)
|
||||||
|
- [ ] Searched the problem in the [docs](https://emsesp.github.io/docs/Troubleshooting/)
|
||||||
|
- [ ] Searched the problem in the [chat](https://discord.gg/3J3GgnzpyT)
|
||||||
|
- [ ] Provide the output of http://ems-esp.local/api/system :
|
||||||
|
|
||||||
**Additional context**
|
```lua
|
||||||
*Add any other context about the problem here.*
|
System information output here:
|
||||||
|
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
### TO REPRODUCE
|
||||||
|
|
||||||
|
_Steps to reproduce the behavior:_
|
||||||
|
|
||||||
|
### EXPECTED BEHAVIOUR
|
||||||
|
|
||||||
|
_A clear and concise description of what you expected to happen._
|
||||||
|
|
||||||
|
### SCREENSHOTS
|
||||||
|
|
||||||
|
_If applicable, add screenshots to help explain your problem._
|
||||||
|
|
||||||
|
### ADDITIONAL CONTEXT
|
||||||
|
|
||||||
|
_Add any other context about the problem here._
|
||||||
|
|
||||||
|
**(Please, remember to close the issue when the problem has been addressed)**
|
||||||
|
|||||||
11
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
11
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
blank_issues_enabled: false
|
||||||
|
contact_links:
|
||||||
|
- name: EMS-ESP Docs
|
||||||
|
url: https://emsesp.github.io/docs/
|
||||||
|
about: All the information related to EMS-ESP.
|
||||||
|
- name: EMS-ESP Discussions and Support
|
||||||
|
url: https://github.com/emsesp/EMS-ESP32/discussions
|
||||||
|
about: EMS-ESP usage Questions, Feature Requests and Projects.
|
||||||
|
- name: EMS-ESP Users Chat
|
||||||
|
url: https://discord.gg/3J3GgnzpyT
|
||||||
|
about: Chat for feedback, questions and troubleshooting.
|
||||||
26
.github/ISSUE_TEMPLATE/feature_request.md
vendored
26
.github/ISSUE_TEMPLATE/feature_request.md
vendored
@@ -1,26 +0,0 @@
|
|||||||
---
|
|
||||||
name: Feature request
|
|
||||||
about: Suggest an idea for this project
|
|
||||||
title: ''
|
|
||||||
labels: enhancement
|
|
||||||
assignees: ''
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
*Before creating a new feature request please check that you have searched the existing [issues](https://github.com/emsesp/EMS-ESP32/issues) (both open and closed)*
|
|
||||||
|
|
||||||
*Completing this template will help developers and contributors evaluating the feature. If the information provided is not enough the issue will likely be closed.*
|
|
||||||
|
|
||||||
*You can now remove this line and the above ones. Text in italic is meant to be replaced by your own words. If any of the sections below are not relevant to the request then you can delete them.*
|
|
||||||
|
|
||||||
**Is your feature request related to a problem? Please describe.**
|
|
||||||
*A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]*
|
|
||||||
|
|
||||||
**Describe the solution you'd like**
|
|
||||||
*A clear and concise description of what you want to happen.*
|
|
||||||
|
|
||||||
**Describe alternatives you've considered**
|
|
||||||
*A clear and concise description of any alternative solutions or features you've considered.*
|
|
||||||
|
|
||||||
**Additional context**
|
|
||||||
*Add any other context or screenshots about the feature request here.*
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
---
|
|
||||||
name: Questions & Troubleshooting
|
|
||||||
about: Anything not a bug or feature request
|
|
||||||
title: ''
|
|
||||||
labels: question
|
|
||||||
assignees: ''
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
*Before creating a new issue please check that you have:*
|
|
||||||
|
|
||||||
* *searched the existing [issues](https://github.com/emsesp/EMS-ESP32/issues) (both open and closed)*
|
|
||||||
* *searched the [documentation help section](https://emsesp.github.io/docs)*
|
|
||||||
|
|
||||||
*Completing this template will help developers and contributors help you. Try to be as specific and extensive as possible. If the information provided is not enough the issue will likely be closed.*
|
|
||||||
|
|
||||||
*You can now remove this line and the above ones. Text in italic is meant to be replaced by your own words. If any of the sections below are not relevant to the issue (for instance, the screenshots) then you can delete them.*
|
|
||||||
|
|
||||||
**Question**
|
|
||||||
*A clear and concise description of what the problem/doubt is.*
|
|
||||||
|
|
||||||
**Screenshots**
|
|
||||||
*If applicable, add screenshots to help explain your problem.*
|
|
||||||
|
|
||||||
**Device information**
|
|
||||||
*Copy-paste here the information as it is outputted by the device. You can get this information from http://ems-esp.local/api?device=system&cmd=info*
|
|
||||||
|
|
||||||
**Additional context**
|
|
||||||
*Add any other context about the problem here.*
|
|
||||||
14
.github/workflows/pre_release.yml
vendored
14
.github/workflows/pre_release.yml
vendored
@@ -14,9 +14,9 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
- uses: actions/setup-python@v2
|
- uses: actions/setup-python@v4
|
||||||
- uses: actions/setup-node@v2
|
- uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: '16'
|
node-version: '16'
|
||||||
|
|
||||||
@@ -24,19 +24,19 @@ jobs:
|
|||||||
id: build_info
|
id: build_info
|
||||||
run: |
|
run: |
|
||||||
version=`grep -E '^#define EMSESP_APP_VERSION' ./src/version.h | awk -F'"' '{print $2}'`
|
version=`grep -E '^#define EMSESP_APP_VERSION' ./src/version.h | awk -F'"' '{print $2}'`
|
||||||
echo "::set-output name=version::$version"
|
echo "VERSION=$version" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Install PlatformIO
|
- name: Install PlatformIO
|
||||||
run: |
|
run: |
|
||||||
python -m pip install --upgrade pip
|
python -m pip install --upgrade pip
|
||||||
pip install -U platformio
|
pip install -U platformio
|
||||||
platformio upgrade
|
|
||||||
platformio update
|
|
||||||
|
|
||||||
- name: Build WebUI
|
- name: Build WebUI
|
||||||
run: |
|
run: |
|
||||||
cd interface
|
cd interface
|
||||||
npm ci
|
npm ci
|
||||||
|
npx typesafe-i18n --no-watch
|
||||||
|
sed -i "s/= 'pl'/= 'en'/" ./src/i18n/i18n-util.ts
|
||||||
npm run build
|
npm run build
|
||||||
|
|
||||||
- name: Build firmware
|
- name: Build firmware
|
||||||
@@ -48,7 +48,7 @@ jobs:
|
|||||||
uses: "marvinpinto/action-automatic-releases@latest"
|
uses: "marvinpinto/action-automatic-releases@latest"
|
||||||
with:
|
with:
|
||||||
repo_token: "${{ secrets.GITHUB_TOKEN }}"
|
repo_token: "${{ secrets.GITHUB_TOKEN }}"
|
||||||
title: ESP32 Development Build v${{steps.build_info.outputs.version}}
|
title: Development Build v${{steps.build_info.outputs.VERSION}}
|
||||||
automatic_release_tag: "latest"
|
automatic_release_tag: "latest"
|
||||||
prerelease: true
|
prerelease: true
|
||||||
files: |
|
files: |
|
||||||
|
|||||||
57
.github/workflows/sonar_check.yml
vendored
Normal file
57
.github/workflows/sonar_check.yml
vendored
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
name: Sonar Check
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- dev
|
||||||
|
pull_request:
|
||||||
|
types: [opened, synchronize, reopened]
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
name: Build
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: github.repository_owner == 'emsesp'
|
||||||
|
# if: github.repository == 'emsesp/EMS-ESP32'
|
||||||
|
env:
|
||||||
|
# https://binaries.sonarsource.com/?prefix=Distribution/sonar-scanner-cli/
|
||||||
|
SONAR_SCANNER_VERSION: 4.7.0.2747
|
||||||
|
SONAR_SERVER_URL: "https://sonarcloud.io"
|
||||||
|
BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
|
||||||
|
- name: Set up JDK 11
|
||||||
|
uses: actions/setup-java@v1
|
||||||
|
with:
|
||||||
|
java-version: 11
|
||||||
|
- name: Cache SonarCloud packages
|
||||||
|
uses: actions/cache@v1
|
||||||
|
with:
|
||||||
|
path: ~/.sonar/cache
|
||||||
|
key: ${{ runner.os }}-sonar
|
||||||
|
restore-keys: ${{ runner.os }}-sonar
|
||||||
|
- name: Download and set up sonar-scanner
|
||||||
|
env:
|
||||||
|
SONAR_SCANNER_DOWNLOAD_URL: https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-${{ env.SONAR_SCANNER_VERSION }}-linux.zip
|
||||||
|
run: |
|
||||||
|
mkdir -p $HOME/.sonar
|
||||||
|
curl -sSLo $HOME/.sonar/sonar-scanner.zip ${{ env.SONAR_SCANNER_DOWNLOAD_URL }}
|
||||||
|
unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/
|
||||||
|
echo "$HOME/.sonar/sonar-scanner-${{ env.SONAR_SCANNER_VERSION }}-linux/bin" >> $GITHUB_PATH
|
||||||
|
- name: Download and set up build-wrapper
|
||||||
|
env:
|
||||||
|
BUILD_WRAPPER_DOWNLOAD_URL: ${{ env.SONAR_SERVER_URL }}/static/cpp/build-wrapper-linux-x86.zip
|
||||||
|
run: |
|
||||||
|
curl -sSLo $HOME/.sonar/build-wrapper-linux-x86.zip ${{ env.BUILD_WRAPPER_DOWNLOAD_URL }}
|
||||||
|
unzip -o $HOME/.sonar/build-wrapper-linux-x86.zip -d $HOME/.sonar/
|
||||||
|
echo "$HOME/.sonar/build-wrapper-linux-x86" >> $GITHUB_PATH
|
||||||
|
- name: Run build-wrapper
|
||||||
|
run: |
|
||||||
|
make clean
|
||||||
|
build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} make clean all
|
||||||
|
- name: Run sonar-scanner
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
||||||
|
run: |
|
||||||
|
sonar-scanner
|
||||||
4
.github/workflows/tagged_release.yml
vendored
4
.github/workflows/tagged_release.yml
vendored
@@ -24,12 +24,14 @@ jobs:
|
|||||||
python -m pip install --upgrade pip
|
python -m pip install --upgrade pip
|
||||||
pip install -U platformio
|
pip install -U platformio
|
||||||
platformio upgrade
|
platformio upgrade
|
||||||
platformio update
|
pio pkg update
|
||||||
|
|
||||||
- name: Build WebUI
|
- name: Build WebUI
|
||||||
run: |
|
run: |
|
||||||
cd interface
|
cd interface
|
||||||
npm ci
|
npm ci
|
||||||
|
npx typesafe-i18n --no-watch
|
||||||
|
sed -i "s/= 'pl'/= 'en'/" ./src/i18n/i18n-util.ts
|
||||||
npm run build
|
npm run build
|
||||||
|
|
||||||
- name: Build firmware
|
- name: Build firmware
|
||||||
|
|||||||
19
.gitignore
vendored
19
.gitignore
vendored
@@ -13,7 +13,6 @@ debug.log
|
|||||||
# platformio
|
# platformio
|
||||||
.pio
|
.pio
|
||||||
pio_local.ini
|
pio_local.ini
|
||||||
/.VSCodeCounter
|
|
||||||
|
|
||||||
# OS specific
|
# OS specific
|
||||||
.DS_Store
|
.DS_Store
|
||||||
@@ -27,4 +26,22 @@ emsesp
|
|||||||
/interface/build
|
/interface/build
|
||||||
node_modules
|
node_modules
|
||||||
/interface/.eslintcache
|
/interface/.eslintcache
|
||||||
|
test.sh
|
||||||
|
scripts/__pycache__
|
||||||
|
.temp
|
||||||
|
|
||||||
|
# i18n generated files
|
||||||
|
interface/src/i18n/i18n-react.tsx
|
||||||
|
interface/src/i18n/i18n-types.ts
|
||||||
|
interface/src/i18n/i18n-util.ts
|
||||||
|
interface/src/i18n/i18n-util.sync.ts
|
||||||
|
interface/src/i18n/i18n-util.async.ts
|
||||||
|
|
||||||
|
# sonar
|
||||||
|
.scannerwork/
|
||||||
|
sonar/
|
||||||
|
build_wrapper_output_directory/
|
||||||
|
|
||||||
|
# other build files
|
||||||
|
dump_entities.csv
|
||||||
|
dump_entities.xls*
|
||||||
|
|||||||
373
CHANGELOG.md
373
CHANGELOG.md
@@ -5,10 +5,343 @@ All notable changes to this project will be documented in this file.
|
|||||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
# [3.1.1] June 26 2021
|
# [3.5.1] March 11 2023
|
||||||
|
|
||||||
|
## Added
|
||||||
|
|
||||||
|
- Detect old Tado thermostat, device-id 0x19, no entities
|
||||||
|
- Some more HM200 entities [#500](https://github.com/emsesp/EMS-ESP32/issues/500)
|
||||||
|
- Add entity to force heating off (for systems without thermostat) [#951](https://github.com/emsesp/EMS-ESP32/issues/951)
|
||||||
|
|
||||||
|
## Fixed
|
||||||
|
|
||||||
|
- HA-discovery for analog sensor commands [#1035](https://github.com/emsesp/EMS-ESP32/issues/1035)
|
||||||
|
|
||||||
## Changed
|
## Changed
|
||||||
|
|
||||||
|
- Use byte 0 for detection RC30 active heatingcircuit [#786](https://github.com/emsesp/EMS-ESP32/issues/786)
|
||||||
|
- Write repeated selflowtemp if tx-queue is empty without verify [#954](https://github.com/emsesp/EMS-ESP32/issues/954)
|
||||||
|
- HA discovery recreate after disconnect by device [#1067](https://github.com/emsesp/EMS-ESP32/issues/1067)
|
||||||
|
- File upload: check flash size (overflow) instead of filesize
|
||||||
|
|
||||||
|
|
||||||
|
# [3.5.0] February 6 2023
|
||||||
|
|
||||||
|
## **IMPORTANT! BREAKING CHANGES**
|
||||||
|
|
||||||
|
- When upgrading to v3.5 for the first time from v3.4 on a BBQKees Gateway board you will need to use the [EMS-EPS Flasher](https://github.com/emsesp/EMS-ESP-Flasher/releases) to correctly re-partition the flash. Make sure you backup the settings and customizations from the WebUI (System->Upload/Download) and restore after the upgrade.
|
||||||
|
- Support for multiple EMS-ESPs [#759] has been added as an optional setting for MQTT. When enabled, which is now the default, all MQTT Discovery Entity IDs will include the MQTT base name and the shortname of the EMS-ESP device entity. For example what was previously `sensor.boiler_actual_boiler_temperature` will now become `sensor.ems_esp_boiler_boiltemp`. If you still want to use the old format and retain the history and script compatibility in Home Assistant then set this back to the old format.
|
||||||
|
|
||||||
|
## Added
|
||||||
|
|
||||||
|
- Translations in Web UI and all device entity names (DE, NL, SV, PL, NO, FR) [#22](https://github.com/emsesp/EMS-ESP32/issues/22)
|
||||||
|
- Add support for Lolin C3 mini [#620](https://github.com/emsesp/EMS-ESP32/pull/620)
|
||||||
|
- Add support for ESP32-S2 [#667](https://github.com/emsesp/EMS-ESP32/pull/667)
|
||||||
|
- Add devices: Greenstar 30Ri boiler, Junkers FW500 thermostat, Buderus BC30 controller
|
||||||
|
- Add program memory info
|
||||||
|
- Add mqtt queue and connection infos
|
||||||
|
- Adapt min/max if ems-value is not in this range
|
||||||
|
- Add heat pump settings for inputs and limits [#600](https://github.com/emsesp/EMS-ESP32/issues/600)
|
||||||
|
- Add hybrid heatpump [#500](https://github.com/emsesp/EMS-ESP32/issues/500)
|
||||||
|
- Add translated tags
|
||||||
|
- Add min/max to customization table [#686](https://github.com/emsesp/EMS-ESP32/issues/686)
|
||||||
|
- Add MD5 check [#637](https://github.com/emsesp/EMS-ESP32/issues/637)
|
||||||
|
- Add more bus-ids [#673](https://github.com/emsesp/EMS-ESP32/issues/673)
|
||||||
|
- Use HA connectivity device class for Status, added boot time [#751](https://github.com/emsesp/EMS-ESP32/issues/751)
|
||||||
|
- Add commands for analog sensors outputs
|
||||||
|
- Support for multiple EMS-ESPs with MQTT and HA [[#759](https://github.com/emsesp/EMS-ESP32/issues/759)]
|
||||||
|
- Settings for heatpump silent mode and additional heater [[#802](https://github.com/emsesp/EMS-ESP32/issues/802)] [[#803](https://github.com/emsesp/EMS-ESP32/issues/803)]
|
||||||
|
- Zone module MZ100 [#826](https://github.com/emsesp/EMS-ESP32/issues/826)
|
||||||
|
- Default MQTT hostname is blank [#829](https://github.com/emsesp/EMS-ESP32/issues/829)
|
||||||
|
- wwCurFlow for ems+ devices [#829](https://github.com/emsesp/EMS-ESP32/issues/829)
|
||||||
|
- Add Rego 3000, TR120RF thermostats [#917](https://github.com/emsesp/EMS-ESP32/issues/917)
|
||||||
|
- Add config for ESP32-S3
|
||||||
|
- Add heatpump silent mode and other entities [#896](https://github.com/emsesp/EMS-ESP32/issues/896)
|
||||||
|
- Allow reboot to other partition (factory or asymetric OTA)
|
||||||
|
- Blacklist entities to remove from memory [#891](https://github.com/emsesp/EMS-ESP32/issues/891)
|
||||||
|
- Add boiler pump operating mode [#944](https://github.com/emsesp/EMS-ESP32/issues/944)
|
||||||
|
|
||||||
|
## Fixed
|
||||||
|
|
||||||
|
- Factory Reset not working [#628](https://github.com/emsesp/EMS-ESP32/issues/628)
|
||||||
|
- Valid 4 byte values [#820](https://github.com/emsesp/EMS-ESP32/issues/820)
|
||||||
|
- Commands for multiple thermostats [#826](https://github.com/emsesp/EMS-ESP32/issues/826)
|
||||||
|
- API queries for multiple devices [#865](https://github.com/emsesp/EMS-ESP32/issues/865)
|
||||||
|
- Console crash when using call with command `hcx` only. [#841](https://github.com/emsesp/EMS-ESP32/issues/841)
|
||||||
|
- `heatingPump2Mod` was wrong, changed to absBurnPow [[#908](https://github.com/emsesp/EMS-ESP32/issues/908)
|
||||||
|
- Rounding of web input values
|
||||||
|
- Analog sensor with single gpio number [#915](https://github.com/emsesp/EMS-ESP32/issues/915)
|
||||||
|
- HA dallas and analog configs: remove/rebuild on change [#888](https://github.com/emsesp/EMS-ESP32/issues/888)
|
||||||
|
- Modes and set seltemp for RC30 and RC20 [#932](https://github.com/emsesp/EMS-ESP32/issues/932)
|
||||||
|
|
||||||
|
## Changed
|
||||||
|
|
||||||
|
- Discovery in HomeAssistant don't work with custom base topic. [#596](https://github.com/emsesp/EMS-ESP32/issues/596) Base topic containing `/` are changed to `_`
|
||||||
|
- RF room temperature sensor are shown as thermostat
|
||||||
|
- Render mqtt float json values with trailing zero
|
||||||
|
- Removed flash strings, to increase available heap memory
|
||||||
|
- Reload page after restart button is pressed
|
||||||
|
- Analog/dallas values command as list like ems-devices
|
||||||
|
- Analog/dallas HA-entities based on id
|
||||||
|
- MQTT Base is a mandatory field. Removed MQTT topic length from settings
|
||||||
|
- HA duration class for time entities [[#822](https://github.com/emsesp/EMS-ESP32/issues/822)
|
||||||
|
- AM200 alternative heatsource as class heatsource [[#857](https://github.com/emsesp/EMS-ESP32/issues/857)
|
||||||
|
|
||||||
|
# [3.4.2] September 18 2022
|
||||||
|
|
||||||
|
## Added
|
||||||
|
|
||||||
|
- RC310 additions [#520](https://github.com/emsesp/EMS-ESP32/pull/520)
|
||||||
|
- damping
|
||||||
|
- wwprio for RC310 heating circuits
|
||||||
|
- switchonoptimization for RC310 heating circuits
|
||||||
|
- enum_controlmode for RC310 (new enum list)
|
||||||
|
- nofrostmode, reducemode, reducetemp & noreducetemp for RC310
|
||||||
|
- emergencyops and emergencytemp, wwmaxtemp, wwflowtempoffset and wwcomfort1 for RC310
|
||||||
|
- HM200 hybrid module [#500](https://github.com/emsesp/EMS-ESP32/issues/500)
|
||||||
|
- AM200 alternative heatsource module [#573](https://github.com/emsesp/EMS-ESP32/issues/573)
|
||||||
|
- EM10 error module as gateway [#575](https://github.com/emsesp/EMS-ESP32/issues/575)
|
||||||
|
|
||||||
|
## Fixed
|
||||||
|
|
||||||
|
- fix Table resizing in WebUI [#519](https://github.com/emsesp/EMS-ESP32/issues/519)
|
||||||
|
- allow larger customization files [#570](https://github.com/emsesp/EMS-ESP32/issues/570)
|
||||||
|
- losing entitiy wwcomfort [#581](https://github.com/emsesp/EMS-ESP32/issues/581)
|
||||||
|
|
||||||
|
## Changed
|
||||||
|
|
||||||
|
- Shorten "friendly names" in Home Assistant [#555](https://github.com/emsesp/EMS-ESP32/issues/555)
|
||||||
|
- platformio 2.3.0 (IDF 4, Arduino 2)
|
||||||
|
- remove master-thermostat, support multiple thermostats
|
||||||
|
- merge up- and download in webui [#577](https://github.com/emsesp/EMS-ESP32/issues/577)
|
||||||
|
|
||||||
|
# [3.4.1] May 29 2022
|
||||||
|
|
||||||
|
## Fixed
|
||||||
|
|
||||||
|
- Fix memory leak in api [#524](https://github.com/emsesp/EMS-ESP32/issues/524)
|
||||||
|
|
||||||
|
## Changed
|
||||||
|
|
||||||
|
# [3.4.0] May 23 2022
|
||||||
|
|
||||||
|
## Added
|
||||||
|
|
||||||
|
- WebUI optimizations, updated look&feel and better performance [#124](https://github.com/emsesp/EMS-ESP32/issues/124)
|
||||||
|
- Auto refresh of WebUI after successful firmware upload [#178](https://github.com/emsesp/EMS-ESP32/issues/178)
|
||||||
|
- New Customization Service in WebUI. First feature is the ability to enable/disabled Enitites (device values) from EMS devices [#206](https://github.com/emsesp/EMS-ESP32/issues/206)
|
||||||
|
- Option to disable Telnet Console [#209](https://github.com/emsesp/EMS-ESP32/issues/209)
|
||||||
|
- Added Hide SSID, Max Clients and Preferred Channel to Access Point
|
||||||
|
- Merged in MichaelDvP's changes like Fahrenheit conversion, publish single (for IOBroker) and a few other critical optimizations
|
||||||
|
- Enabled bi-directional read/write with Home Assistant, so values can be changed automatically from the UI without scripting [#265](https://github.com/emsesp/EMS-ESP32/issues/265)
|
||||||
|
- Added GC7000F Boiler [#270](https://github.com/emsesp/EMS-ESP32/issues/270)
|
||||||
|
- Revised LED flash sequence on boot up to show system health (1 flash=no ems, 2 flashes=no wifi) [#224](https://github.com/emsesp/EMS-ESP32/issues/224)
|
||||||
|
- Analog Sensor support [#271](https://github.com/emsesp/EMS-ESP32/issues/271)
|
||||||
|
- Solar cylinder priority [#247](https://github.com/emsesp/EMS-ESP32/issues/247)
|
||||||
|
- Read only mode in Settings, where EMS Tx/Write commands are blocked [#286](https://github.com/emsesp/EMS-ESP32/issues/286)
|
||||||
|
- Added 8700i Boiler device
|
||||||
|
- Added Cascade CM10 Controller device
|
||||||
|
- Add Olimex ESP32-POE-ISO to board profiles plus settings to customize Ethernet modules [#301](https://github.com/emsesp/EMS-ESP32/issues/301)
|
||||||
|
- Help text for string commands in WebUI [#320](https://github.com/emsesp/EMS-ESP32/issues/320)
|
||||||
|
- Germany translations (at compile time)
|
||||||
|
- #entities added to system/info` endpoint [#322](https://github.com/emsesp/EMS-ESP32/issues/322)
|
||||||
|
- analog outputs digital/pwm/dac
|
||||||
|
- remove MQTT retained configs if discovery is disabled
|
||||||
|
- timeout 10 min for MQTT-QoS wait
|
||||||
|
- Moduline 300 auto-temperatures T1-T4, RC300 romminfluencefactor
|
||||||
|
- RC35 parameters [#392](https://github.com/emsesp/EMS-ESP32/issues/392), [#398](https://github.com/emsesp/EMS-ESP32/issues/398)
|
||||||
|
- sync time with thermostat [#386](https://github.com/emsesp/EMS-ESP32/issues/386), [#408](https://github.com/emsesp/EMS-ESP32/issues/408)
|
||||||
|
- set mode has immediate effect [#395](https://github.com/emsesp/EMS-ESP32/issues/395)
|
||||||
|
- min/max in web value setting
|
||||||
|
- Extend customization to select if an entity is to be shown in the WebUI or forced as read-only [#317](https://github.com/emsesp/EMS-ESP32/issues/317)
|
||||||
|
- Added Moduline 400 installation parameters [PR #449 by @kwertie01](https://github.com/emsesp/EMS-ESP32/pull/449)
|
||||||
|
- Read time from IVT-controller [#439](https://github.com/emsesp/EMS-ESP32/issues/439)
|
||||||
|
- Hybrid Heatpump product-id 168 [#459](https://github.com/emsesp/EMS-ESP32/issues/459), thermostat settings
|
||||||
|
- Junkers ISM2 and IPM in warm water mode [#437](https://github.com/emsesp/EMS-ESP32/issues/437)
|
||||||
|
- Added Shower Alert trigger time and cold shot time [#436](https://github.com/emsesp/EMS-ESP32/issues/436)
|
||||||
|
- Improved Table layout in Web UI (searching, filtering, sorting, exporting to CSV)
|
||||||
|
- API fetch individual attributes from an entity [#462](https://github.com/emsesp/EMS-ESP32/issues/462)
|
||||||
|
- Option to disable mDNS
|
||||||
|
- Option for rendering booleans on dashboard [#456](https://github.com/emsesp/EMS-ESP32/issues/456)
|
||||||
|
- Upload customization settings from a file [#256](https://github.com/emsesp/EMS-ESP32/issues/256)
|
||||||
|
|
||||||
|
## Fixed
|
||||||
|
|
||||||
|
- lastcode broke MQTT JSON structure [#228](https://github.com/emsesp/EMS-ESP32/issues/228)
|
||||||
|
- fixed issue with overlapping while reading sequence of EMS1.0 telegrams
|
||||||
|
- fixed redundant telegram readings (because of offset overflow)
|
||||||
|
- added missing RC30/Moduline 400 [#243](https://github.com/emsesp/EMS-ESP32/issues/243)
|
||||||
|
- Correct modes for RC25 [#106](https://github.com/emsesp/EMS-ESP32/issues/106)
|
||||||
|
- Clean up old HA config's in MQTT before publishing data. This will prevent HA giving the 'dict' warnings [#229](https://github.com/emsesp/EMS-ESP32/issues/229)
|
||||||
|
- RC25 temperature setting [#272](https://github.com/emsesp/EMS-ESP32/issues/272)
|
||||||
|
- Buderus RC25 - "hc1 mode type" incorrect value [#273](https://github.com/emsesp/EMS-ESP32/issues/273)
|
||||||
|
- Increased number of Mixers and Heating Circuits [#294](https://github.com/emsesp/EMS-ESP32/issues/294)
|
||||||
|
- Check receive status before removing a telegram fetch [#268](https://github.com/emsesp/EMS-ESP32/issues/268), [#282](https://github.com/emsesp/EMS-ESP32/issues/282)
|
||||||
|
- Fix uploading firmware on OSX [#345](https://github.com/emsesp/EMS-ESP32/issues/345)
|
||||||
|
- Non-nested MQTT would corrupt the json [#354](https://github.com/emsesp/EMS-ESP32/issues/354)
|
||||||
|
- Burner selected max power can have a value higher than 100% [#314](https://github.com/emsesp/EMS-ESP32/issues/314)
|
||||||
|
- some missing fahrenheit calculations
|
||||||
|
- limited number of exclusions [#339](https://github.com/emsesp/EMS-ESP32/issues/339)
|
||||||
|
- MQTT sometimes would not reconnect after a WiFi outage
|
||||||
|
|
||||||
|
## Changed
|
||||||
|
|
||||||
|
- Use flash system to show system health (1 flash=no ems, 2 flashes=no wifi) [#224](https://github.com/emsesp/EMS-ESP32/issues/224)
|
||||||
|
- Renamed Dallas Sensor to Temperature Sensor in UI
|
||||||
|
- Dallas Format removed. Use the name to give each sensor an alias
|
||||||
|
- No longer MQTT subscribes to topic `/thermostat_hc<n>` as it supports a path similar to the API endpoint construct
|
||||||
|
- Show Sensors quality in WebUI
|
||||||
|
- Controller not shown in WebUI dashboard
|
||||||
|
- renamed "Home Assistant Integration" to "MQTT Discovery" in MQTT Settings [#290](https://github.com/emsesp/EMS-ESP32/issues/290)
|
||||||
|
- Show ems tx reads and writes separately
|
||||||
|
- Show ems device handlers separated for received, fetched and pending handlers.
|
||||||
|
- Wired renamed to Ethernet
|
||||||
|
- removed system/pin command, new commands in analogsensors
|
||||||
|
- system/info device-info split to name/version/brand
|
||||||
|
- exclude list uses short-names, possible flags for web/api/mqtt excludes, readonly and favorite (selection not yet implemented)
|
||||||
|
- thermostat clock formate date-time: dd.mm.yyyy hh:mm
|
||||||
|
- RC300 summermode as other thermostats `winter/summer` instead of `off/on`
|
||||||
|
|
||||||
|
## **BREAKING CHANGES:**
|
||||||
|
|
||||||
|
- Settings:
|
||||||
|
- order of Boolean Format has changed in Application Settings - check your settings
|
||||||
|
- Dallas Format setting removed. Now customize name of each Dallas sensor via the UI
|
||||||
|
- MQTT/API
|
||||||
|
- Boiler `wwheat` renamed to `ww3wayon` [#211](https://github.com/emsesp/EMS-ESP32/issues/211)
|
||||||
|
- Boiler `ww` tag renamed to `dhw`. Any custom Home Assistant lovelace dashboards will need updating.
|
||||||
|
- Renamed description of `wwtapactivated` to "turn on/off DHW". Otherwise would have looked like "boiler_dhw_turn_on_off_dhw" in HA.
|
||||||
|
- `/api/system/info` endpoint has updated keys. Now lowercase, no underscores and not capitalized. Replace "handlers" with "handlers received", "handlers fetched" and "handlers pending".
|
||||||
|
|
||||||
|
# [3.3.1] January 20 2022
|
||||||
|
|
||||||
|
- lastcode broke MQTT JSON structure [#228](https://github.com/emsesp/EMS-ESP32/issues/228)
|
||||||
|
- overlapping while reading sequence of EMS1.0 telegrams
|
||||||
|
- redundant telegram readings (because of offset overflow)
|
||||||
|
- added missing RC30/Moduline400 [#243](https://github.com/emsesp/EMS-ESP32/issues/243)
|
||||||
|
- check received status before toggling fetch on empty telegram [#268][#282]
|
||||||
|
|
||||||
|
# [3.3.0] November 28 2021
|
||||||
|
|
||||||
|
## Added
|
||||||
|
|
||||||
|
- Add system commands for syslog level and watch [#98](https://github.com/emsesp/EMS-ESP32/issues/98)
|
||||||
|
- Added pool data to telegrams 0x494 & 0x495 [#102](https://github.com/emsesp/EMS-ESP32/issues/102)
|
||||||
|
- Add RC300 second summermode telegram [#108](https://github.com/emsesp/EMS-ESP32/issues/108)
|
||||||
|
- Add support for the RC25 thermostat [#106](https://github.com/emsesp/EMS-ESP32/issues/106)
|
||||||
|
- Add new command 'entities' for a device, e.g. http://ems-esp/api/boiler/entities to show the shortname, description and HA Entity name (if HA enabled) [#116](https://github.com/emsesp/EMS-ESP32/issues/116)
|
||||||
|
- Support for Junkers program and remote (fb10/fb110) temperature
|
||||||
|
- Home Assistant `state_class` attribute for Wh, kWh, W and KW [#129](https://github.com/emsesp/EMS-ESP32/issues/129)
|
||||||
|
- Add current room influence for RC300 [#136](https://github.com/emsesp/EMS-ESP32/issues/136)
|
||||||
|
- Added Home Assistant device_class to sensor entities
|
||||||
|
- Added another Buderus RC10 thermostat with Product ID 65 [#160](https://github.com/emsesp/EMS-ESP32/issues/160)
|
||||||
|
- Added support for mDNS [#161](https://github.com/emsesp/EMS-ESP32/issues/161)
|
||||||
|
- Added last system ESP32 reset code to log (and `system info` output)
|
||||||
|
- Firmware Checker in WebUI [#168](https://github.com/emsesp/EMS-ESP32/issues/168)
|
||||||
|
- Added new MQTT setting for enabling 'response' topic
|
||||||
|
- Support for non-standard Thermostats like Tado [#174](https://github.com/emsesp/EMS-ESP32/issues/174)
|
||||||
|
- Include MQTT connection status in 'api/system/info'
|
||||||
|
- Include Network status in 'api/system/info' and also the MQTT topic `info` [#202](https://github.com/emsesp/EMS-ESP32/issues/202)
|
||||||
|
- Added Ethernet PHY module as an option in the Board Profile [#210](https://github.com/emsesp/EMS-ESP32/issues/210)
|
||||||
|
|
||||||
|
## Fixed
|
||||||
|
|
||||||
|
- MQTT reconnecting after WiFi reconnect [#99](https://github.com/emsesp/EMS-ESP32/issues/99)
|
||||||
|
- Manually Controlling Solar Circuit [#107](https://github.com/emsesp/EMS-ESP32/issues/107)
|
||||||
|
- Fix thermostat commands not defaulting to the master thermostat [#110](https://github.com/emsesp/EMS-ESP32/issues/110)
|
||||||
|
- Enlarge parse-buffer for long names like `cylinderpumpmodulation`
|
||||||
|
- MQTT not subscribing to all device entities [#166](https://github.com/emsesp/EMS-ESP32/issues/166)
|
||||||
|
- Help fix issues with WebUI unable to fully load UI over Ethernet [#177](https://github.com/emsesp/EMS-ESP32/issues/177)
|
||||||
|
- Shower alert never reset after limit reached when enabled [(PR #185)]
|
||||||
|
- Remove HA entity entries when a device value goes dormant [#196](https://github.com/emsesp/EMS-ESP32/issues/196)
|
||||||
|
- deciphering last error code dates on 0xC2 telegram [#204](https://github.com/emsesp/EMS-ESP32/issues/204)
|
||||||
|
|
||||||
|
## Changed
|
||||||
|
|
||||||
|
- Syslog BOM only for utf-8 messages [#91](https://github.com/emsesp/EMS-ESP32/issues/91)
|
||||||
|
- Check for KM200 by device-id 0x48, remove tx-delay [#90](https://github.com/emsesp/EMS-ESP32/issues/90)
|
||||||
|
- rename `fastheatupfactor` to `fastheatup` and add percent [#122](https://github.com/emsesp/EMS-ESP32/issues/122)
|
||||||
|
- "unit" renamed to "uom" in API call to recall a Device Value
|
||||||
|
- initial backend React changes to replace the class components (HOCs) with React Hooks
|
||||||
|
- Use program-names instead of numbers
|
||||||
|
- Boiler's maintenancemessage always published in MQTT (to prevent HA missing entity)
|
||||||
|
- Unit of Measure 'times' added to MQTT Fails, Rx fails, Rx received, Tx fails, Tx reads & Tx writes
|
||||||
|
- Improved API. Restful HTTP API works in the same way as MQTT calls
|
||||||
|
- Removed settings for MQTT subscribe format [#173](https://github.com/emsesp/EMS-ESP32/issues/173)
|
||||||
|
- Improve Nefit Moduline 200 functionality [#183](https://github.com/emsesp/EMS-ESP32/issues/183)
|
||||||
|
- `status` in the MQTT heartbeat renamed to `bus_status`
|
||||||
|
- Layout changes in the WebUI, showing stripped table rows in Dashboard
|
||||||
|
- Alternative font for log window [#219](https://github.com/emsesp/EMS-ESP32/issues/219)
|
||||||
|
|
||||||
|
## **BREAKING CHANGES**
|
||||||
|
|
||||||
|
- API: "unit" renamed to "uom" in API call to recall a Device Value
|
||||||
|
- HA: `sensor.boiler_boiler_temperature` renamed to `sensor.actual_boiler_temperature`
|
||||||
|
- HA: `binary_sensor.boiler_ww_disinfecting` renamed to `binary_sensor.boiler_ww_disinfection`
|
||||||
|
- HA: # removed from counts in MQTT Fails, Rx fails, Rx received, Tx fails, Tx reads & Tx writes
|
||||||
|
- `txread` renamed to `txreads` and `txwrite` renamed to `txwrites` in MQTT heartbeat payload
|
||||||
|
- 'dallas sensors' in api/system/info moved to the "System" section. Renamed "uptime (seconds)" and "reset reason"
|
||||||
|
- `status` in the MQTT heartbeat renamed to `bus_status`
|
||||||
|
|
||||||
|
# [3.2.1] August 8 2021
|
||||||
|
|
||||||
|
## Added
|
||||||
|
|
||||||
|
- json body in API can now take device, name, cmd, hc and id
|
||||||
|
- added example of how to use API directly to control values from Home Assistant
|
||||||
|
- API calls are shown in debug log (For troubleshooting)
|
||||||
|
|
||||||
|
## Fixed
|
||||||
|
|
||||||
|
- fixed issue with Home Assistant entity naming where boiler's ww was duplicated in entity name
|
||||||
|
- fixed issue where wwSetTemp was written too instead of wwSelTemp
|
||||||
|
|
||||||
|
## Changed
|
||||||
|
|
||||||
|
- fixed case on mqtt names, like 'wwtankmiddletemp'
|
||||||
|
- renamed Product ID to 'EMS Product ID' in Home Assistant
|
||||||
|
- removed brackets around tags, e.g. (hc1) selected room temperature" is now just "hc1 selected room temperature"
|
||||||
|
|
||||||
|
# [3.2.0] August 6 2021
|
||||||
|
|
||||||
|
## Added
|
||||||
|
|
||||||
|
- support for IPv6 (web/api/mqtt, not syslog yet) [#83](https://github.com/emsesp/EMS-ESP32/issues/83)
|
||||||
|
- System Log in Web UI will show current time if the NTP Service is enabled [#82](https://github.com/emsesp/EMS-ESP32/issues/82)
|
||||||
|
- Network settings for Tx-power, WiFi-bandwidth, WiFi-sleepmode [#83](https://github.com/emsesp/EMS-ESP32/issues/83)
|
||||||
|
- optional low CPU clockrate (160 MHz) [#83](https://github.com/emsesp/EMS-ESP32/issues/83)
|
||||||
|
- select format for enumerated values in web
|
||||||
|
- settings for water hysteresis on/off
|
||||||
|
- dallas sensor name editable. `sensorname` console-command, replace sensorid with a unique name [#84](https://github.com/emsesp/EMS-ESP32/issues/84)
|
||||||
|
- 'restart' system command. Can be invoked via API with authentication. [#87](https://github.com/emsesp/EMS-ESP32/issues/87)
|
||||||
|
- add Download button in Web UI for log
|
||||||
|
|
||||||
|
## Fixed
|
||||||
|
|
||||||
|
- set mode allow numbers
|
||||||
|
- Junkers thermostat shows mode as selected by set_mode
|
||||||
|
- HA thermostat mode if bool-format: numbers is selected
|
||||||
|
- Web UI System Log sometimes skipped a few log messages when watching real-time
|
||||||
|
- fix wwactivated [#89](https://github.com/emsesp/EMS-ESP32/issues/89)
|
||||||
|
- don't show commands (like reset) as Device values in the Web or Console
|
||||||
|
|
||||||
|
## Changed
|
||||||
|
|
||||||
|
- removed Rx echo failures counting as incomplete telegrams. Bad telegrams show as Warning and not Errors. [#80](https://github.com/emsesp/EMS-ESP32/issues/80)
|
||||||
|
- add upload_sec to `api/system/info` and removed # from some names to keep consistent with MQTT heartbeat
|
||||||
|
- added debug target to PlatformIO build to help hunt down system crashes
|
||||||
|
- enumerated values always start at zero
|
||||||
|
- maintenance settings for time/date as extra setting
|
||||||
|
- move api/mqtt formats to `settings`, add `enum format`
|
||||||
|
- UI improvements for editing Dallas Sensor details
|
||||||
|
- RESTful GET commands can also require authentication (via bearer access token) for better security
|
||||||
|
- Updated AsyncMqttClient to 0.9.0 and ArduinoJson to 6.18.3
|
||||||
|
- Download buttons for settings and info under the Help tab
|
||||||
|
|
||||||
|
# [3.1.1] June 26 2021
|
||||||
|
|
||||||
|
## Added
|
||||||
|
|
||||||
- new command called `commands` which lists all available commands. `ems-esp/api/{device}/commands`
|
- new command called `commands` which lists all available commands. `ems-esp/api/{device}/commands`
|
||||||
- More Home Assistant icons to match the UOMs
|
- More Home Assistant icons to match the UOMs
|
||||||
- new API. Using secure access tokens and OpenAPI standard. See `doc/EMS-ESP32 API.md` and [#50](https://github.com/emsesp/EMS-ESP32/issues/50)
|
- new API. Using secure access tokens and OpenAPI standard. See `doc/EMS-ESP32 API.md` and [#50](https://github.com/emsesp/EMS-ESP32/issues/50)
|
||||||
@@ -29,7 +362,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
# [3.1.0] May 4 2021
|
# [3.1.0] May 4 2021
|
||||||
|
|
||||||
## Changed
|
## Added
|
||||||
|
|
||||||
- Mock API to simulate an ESP, for testing web
|
- Mock API to simulate an ESP, for testing web
|
||||||
- Able to write values from the Web UI
|
- Able to write values from the Web UI
|
||||||
@@ -55,51 +388,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
## Added
|
## Added
|
||||||
|
|
||||||
- power settings, disabling BLE and turning off Wifi sleep
|
|
||||||
- Rx and Tx counts to Heartbeat MQTT payload
|
|
||||||
- ethernet support
|
|
||||||
- id to info command to show only a heatingcircuit
|
|
||||||
- add sending devices that are not listed to 0x07
|
|
||||||
- extra MQTT boolean option for "ON" and "OFF"
|
|
||||||
- support for chunked MQTT payloads to allow large data sets > 2kb
|
|
||||||
- external Button support (#708) for resetting to factory defaults and other actions
|
|
||||||
- new console set command in `system`, `set board_profile <profile>` for quickly enabling cabled ethernet connections without using the captive wifi portal
|
|
||||||
- added in MQTT nested mode, for thermostat and mixer, like we had back in v2
|
|
||||||
- cascade MC400 (product-id 210) (3.0.0b6), power values for heating sources (3.0.1b1)
|
|
||||||
- values for wwMaxPower, wwFlowtempOffset
|
|
||||||
- RC300 `thermostat temp -1` to clear temporary setpoint in auto mode
|
|
||||||
- syslog port selectable (#744)
|
|
||||||
- individual mqtt commands (#31)
|
- individual mqtt commands (#31)
|
||||||
- board Profiles (#11)
|
- board Profiles (#11)
|
||||||
|
|
||||||
## Fixed
|
## Fixed
|
||||||
|
|
||||||
- telegrams matched to masterthermostat 0x18
|
|
||||||
- multiple roomcontrollers
|
|
||||||
- readback after write with delay (give ems-devices time to set the value)
|
|
||||||
- thermostat ES72/RC20 device 66 to command-set RC20_2
|
|
||||||
- MQTT payloads not adding to queue when MQTT is re-connecting (fixes #369)
|
|
||||||
- fix for HA topics with invalid command formats (#728)
|
|
||||||
- wrong position of values #723, #732
|
|
||||||
- OTA Upload via Web on OSX
|
|
||||||
- Rx and Tx quality % would sometimes show > 100
|
- Rx and Tx quality % would sometimes show > 100
|
||||||
|
|
||||||
## Changed
|
## Changed
|
||||||
|
|
||||||
- changed how telegram parameters are rendered for mqtt, console and web (#632)
|
|
||||||
- split `show values` in smaller packages (edited)
|
|
||||||
- extended length of IP/hostname from 32 to 48 chars (#676)
|
|
||||||
- check flowsensor for `tap_water_active`
|
|
||||||
- mqtt prefixed with `Base`
|
|
||||||
- count Dallas sensor fails
|
|
||||||
- switch from SPIFFS to LITTLEFS
|
|
||||||
- added ID to MQTT payloads which is the Device's product ID and used in HA to identify a unique HA device
|
|
||||||
- increased MQTT buffer and reduced wait time between publishes
|
|
||||||
- updated to the latest ArduinoJson library
|
|
||||||
- some names of mqtt-tags like in v2.2.1
|
|
||||||
- new ESP32 partition side to allow for smoother OTA and fallback
|
|
||||||
- network Gateway IP is optional (#682)emsesp/EMS-ESP
|
|
||||||
- moved to a new GitHub repo https://github.com/emsesp/EMS-ESP32
|
|
||||||
- invert LED changed to Hide LED. Default is off.
|
- invert LED changed to Hide LED. Default is off.
|
||||||
- renamed Scan Network to Scan WiFi Network
|
- renamed Scan Network to Scan WiFi Network
|
||||||
- added version to cmd=settings
|
- added version to cmd=settings
|
||||||
|
|||||||
@@ -1,9 +1,2 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
## Added
|
|
||||||
|
|
||||||
## Fixed
|
|
||||||
|
|
||||||
## Changed
|
|
||||||
|
|
||||||
## Removed
|
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
<img src="/media/EMS-ESP_logo_dark.png" alt="Logo" align="right" height="76"/>
|
|
||||||
|
|
||||||
# Contributing
|
# Contributing
|
||||||
|
|
||||||
**Any contribution helps EMS-ESP get better for the entire community!**
|
**Any contribution helps EMS-ESP get better for the entire community!**
|
||||||
@@ -24,17 +22,17 @@ This document describes rules that are in effect for this repository, meant for
|
|||||||
|
|
||||||
## Triaging of Issues/PR's
|
## Triaging of Issues/PR's
|
||||||
|
|
||||||
1. Any contributor to the project can participate in the triaging process, if he/she chooses to do so.
|
1. Any contributor to the project can participate in the triaging process, if he/she chooses to do so.
|
||||||
2. An issue that needs to be closed, either due to not complying with this policy, or for other reasons, should be closed by a contributor.
|
2. An issue that needs to be closed, either due to not complying with this policy, or for other reasons, should be closed by a contributor.
|
||||||
3. Issues that are accepted should be marked with appropriate labels.
|
3. Issues that are accepted should be marked with appropriate labels.
|
||||||
4. Issues that could impact functionality for many users should be considered severe.
|
4. Issues that could impact functionality for many users should be considered severe.
|
||||||
5. Issues caused by the SDK or chip should not be marked severe, as there usually isn’t much to be done. Common sense should be applied when deciding. Such issues should be documented in the documentation, for reference by users.
|
5. Issues caused by the SDK or chip should not be marked severe, as there usually isn’t much to be done. Common sense should be applied when deciding. Such issues should be documented in the documentation, for reference by users.
|
||||||
6. Issues with feature requests should be discussed for viability/desirability.
|
6. Issues with feature requests should be discussed for viability/desirability.
|
||||||
7. Feature requests or changes that are meant to address a very specific/limited use case, especially if at the expense of increased code complexity, may be denied, or may be required to be redesigned, generalized, or simplified.
|
7. Feature requests or changes that are meant to address a very specific/limited use case, especially if at the expense of increased code complexity, may be denied, or may be required to be redesigned, generalized, or simplified.
|
||||||
8. Feature requests that are not accompanied by a PR:
|
8. Feature requests that are not accompanied by a PR:
|
||||||
* could be closed immediately (denied).
|
- could be closed immediately (denied).
|
||||||
* could be closed after some predetermined period of time (left as candidate for somebody to pick up).
|
- could be closed after some predetermined period of time (left as candidate for somebody to pick up).
|
||||||
9. In some cases, feedback may be requested from the issue reporter, either as additional info for clarification, additional testing, or other. If no feedback is provided, the issue may be closed by a contributor or after 40 days by the STALE bot.
|
9. In some cases, feedback may be requested from the issue reporter, either as additional info for clarification, additional testing, or other. If no feedback is provided, the issue may be closed by a contributor or after 40 days by the STALE bot.
|
||||||
|
|
||||||
## Pull requests
|
## Pull requests
|
||||||
|
|
||||||
@@ -42,24 +40,24 @@ A Pull Request (PR) is the process where code modifications are managed in GitHu
|
|||||||
|
|
||||||
The process is straight-forward.
|
The process is straight-forward.
|
||||||
|
|
||||||
- Read [How to get faster PR reviews](https://github.com/kubernetes/community/blob/master/contributors/guide/pull-requests.md#best-practices-for-faster-reviews) by Kubernetes (but skip step 0)
|
- Read [How to get faster PR reviews](https://github.com/kubernetes/community/blob/master/contributors/guide/pull-requests.md#best-practices-for-faster-reviews) by Kubernetes (but skip step 0)
|
||||||
- Fork the EMS-ESP Repository [git repository](https://github.com/emsesp/EMS-ESP32).
|
- Fork the EMS-ESP Repository [git repository](https://github.com/emsesp/EMS-ESP32).
|
||||||
- Write/Change the code in your Fork for a new feature, bug fix, new sensor, optimization, etc.
|
- Write/Change the code in your Fork for a new feature, bug fix, new sensor, optimization, etc.
|
||||||
- Ensure tests work.
|
- Ensure tests work.
|
||||||
- Create a Pull Request against the [**dev**](https://github.com/emsesp/EMS-ESP32/tree/dev) branch of EMS-ESP.
|
- Create a Pull Request against the [**dev**](https://github.com/emsesp/EMS-ESP32/tree/dev) branch of EMS-ESP.
|
||||||
|
|
||||||
1. All pull requests must be done against the dev branch.
|
1. All pull requests must be done against the dev branch.
|
||||||
2. Make sure code is formatting per the `.clang-format`
|
2. Make sure code is formatting per the `.clang-format`.
|
||||||
3. Only relevant files should be touched (Also beware if your editor has auto-formatting feature enabled).
|
3. Make sure any new code is clearly commented explaining what the function/logic does.
|
||||||
4. Only one feature/fix should be added per PR.
|
4. Only relevant files should be touched (Also beware if your editor has auto-formatting feature enabled).
|
||||||
5. PRs that don't compile (fail in CI Tests) or cause coding errors will not be merged. Please fix the issue. Same goes for PRs that are raised against older commit in dev - you might need to rebase and resolve conflicts.
|
5. Only one feature/fix should be added per PR.
|
||||||
6. All pull requests should undergo peer review by at least one contributor other than the creator, excepts for the owner.
|
6. PRs that don't compile (fail in CI Tests) or cause coding errors will not be merged. Please fix the issue. Same goes for PRs that are raised against older commit in dev - you might need to rebase and resolve conflicts.
|
||||||
7. All pull requests should consider updates to the documentation.
|
7. All pull requests should undergo peer review by at least one contributor other than the creator, excepts for the owner.
|
||||||
8. Pull requests that address an outstanding issue, particularly an issue deemed to be severe, should be given priority.
|
8. All pull requests should consider updates to the documentation.
|
||||||
9. If a PR is accepted, then it should undergo review and updated based on the feedback provided, then merged.
|
9. Pull requests that address an outstanding issue, particularly an issue deemed to be severe, should be given priority.
|
||||||
10. By submitting a PR, it is needed to use the provided PR template and check all boxes, performing the required tasks and accepting the CLA.
|
10. If a PR is accepted, then it should undergo review and updated based on the feedback provided, then merged.
|
||||||
11. Pull requests that don't meet the above will be denied and closed.
|
11. By submitting a PR, it is needed to use the provided PR template and check all boxes, performing the required tasks and accepting the CLA.
|
||||||
|
12. Pull requests that don't meet the above will be denied and closed.
|
||||||
|
|
||||||
## Semantic Commit Messages
|
## Semantic Commit Messages
|
||||||
|
|
||||||
@@ -92,9 +90,9 @@ More Examples:
|
|||||||
|
|
||||||
References:
|
References:
|
||||||
|
|
||||||
- https://www.conventionalcommits.org/
|
- <https://www.conventionalcommits.org/>
|
||||||
|
|
||||||
--------------------------------------
|
---
|
||||||
|
|
||||||
## Contributor License Agreement (CLA)
|
## Contributor License Agreement (CLA)
|
||||||
|
|
||||||
@@ -123,7 +121,7 @@ By making a contribution to this project, I certify that:
|
|||||||
|
|
||||||
This Contributor License Agreement (CLA) was adopted on April 1st, 2019.
|
This Contributor License Agreement (CLA) was adopted on April 1st, 2019.
|
||||||
|
|
||||||
The text of this license is available under the [Creative Commons Attribution-ShareAlike 3.0 Unported License](http://creativecommons.org/licenses/by-sa/3.0/). It is based on the Linux [Developer Certificate Of Origin](http://elinux.org/Developer_Certificate_Of_Origin), but is modified to explicitly use the GPL-3.0 license and not mention sign-off (due to GitHub.com keeps an historial, with your user name, of PRs' commits and all editions on PR's comments).
|
The text of this license is available under the [Creative Commons Attribution-ShareAlike 3.0 Unported License](http://creativecommons.org/licenses/by-sa/3.0/). It is based on the Linux [Developer Certificate Of Origin](http://elinux.org/Developer_Certificate_Of_Origin), but is modified to explicitly use the GPL-3.0 license and not mention sign-off (due to GitHub.com keeps an historial, with your user name, of PRs' commits and all editions on PR's comments).
|
||||||
|
|
||||||
**Why a CLA ?**
|
**Why a CLA ?**
|
||||||
|
|
||||||
@@ -133,9 +131,9 @@ A CLA is a legal document in which you state _you are entitled to contribute the
|
|||||||
|
|
||||||
CLA is a safety because it also ensures that once you have provided a contribution, you cannot try to withdraw permission for its use at a later date. People can therefore use that software, confident that they will not be asked to stop using pieces of the code at a later date.
|
CLA is a safety because it also ensures that once you have provided a contribution, you cannot try to withdraw permission for its use at a later date. People can therefore use that software, confident that they will not be asked to stop using pieces of the code at a later date.
|
||||||
|
|
||||||
A __license__ grants "outbound" rights to the user of project.
|
A **license** grants "outbound" rights to the user of project.
|
||||||
|
|
||||||
A __CLA__ enables a contributor to grant "inbound" rights to a project.
|
A **CLA** enables a contributor to grant "inbound" rights to a project.
|
||||||
|
|
||||||
<Other>
|
<Other>
|
||||||
<A table should be maintained for relating maintainers and components. When triaging, this is essential to figure out if someone in particular should be consulted about specific changes.>
|
<A table should be maintained for relating maintainers and components. When triaging, this is essential to figure out if someone in particular should be consulted about specific changes.>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# GNUMakefile for EMS-ESP
|
# GNUMakefile for EMS-ESP
|
||||||
# (c) 2020 Paul Derbyshire
|
|
||||||
#
|
#
|
||||||
|
|
||||||
NUMJOBS=${NUMJOBS:-" -j4 "}
|
NUMJOBS=${NUMJOBS:-" -j4 "}
|
||||||
MAKEFLAGS+="j "
|
MAKEFLAGS+="j "
|
||||||
#----------------------------------------------------------------------
|
#----------------------------------------------------------------------
|
||||||
@@ -17,23 +17,30 @@ MAKEFLAGS+="j "
|
|||||||
#TARGET := $(notdir $(CURDIR))
|
#TARGET := $(notdir $(CURDIR))
|
||||||
TARGET := emsesp
|
TARGET := emsesp
|
||||||
BUILD := build
|
BUILD := build
|
||||||
SOURCES := src src/* lib_standalone lib/uuid-common/src lib/uuid-console/src lib/uuid-log/src src/devices lib/ArduinoJson/src lib/PButton
|
SOURCES := src src/* lib_standalone lib/uuid-common/src lib/uuid-console/src lib/uuid-log/src src/devices lib/ArduinoJson/src lib/PButton lib/semver
|
||||||
INCLUDES := src lib_standalone lib/ArduinoJson/src lib/uuid-common/src lib/uuid-console/src lib/uuid-log/src lib/uuid-telnet/src lib/uuid-syslog/src lib/* src/devices
|
INCLUDES := src lib_standalone lib/ArduinoJson/src lib/uuid-common/src lib/uuid-console/src lib/uuid-log/src lib/uuid-telnet/src lib/uuid-syslog/src lib/semver lib/* src/devices
|
||||||
LIBRARIES :=
|
LIBRARIES :=
|
||||||
|
|
||||||
CPPCHECK = cppcheck
|
CPPCHECK = cppcheck
|
||||||
|
# CHECKFLAGS = -q --force --std=c++17
|
||||||
CHECKFLAGS = -q --force --std=c++11
|
CHECKFLAGS = -q --force --std=c++11
|
||||||
|
|
||||||
#----------------------------------------------------------------------
|
#----------------------------------------------------------------------
|
||||||
# Languages Standard
|
# Languages Standard
|
||||||
#----------------------------------------------------------------------
|
#----------------------------------------------------------------------
|
||||||
|
# C_STANDARD := -std=c17
|
||||||
|
# CXX_STANDARD := -std=c++17
|
||||||
C_STANDARD := -std=c11
|
C_STANDARD := -std=c11
|
||||||
CXX_STANDARD := -std=c++11
|
CXX_STANDARD := -std=c++11
|
||||||
|
|
||||||
#----------------------------------------------------------------------
|
#----------------------------------------------------------------------
|
||||||
# Defined Symbols
|
# Defined Symbols
|
||||||
#----------------------------------------------------------------------
|
#----------------------------------------------------------------------
|
||||||
DEFINES += -DARDUINOJSON_ENABLE_STD_STRING=1 -DARDUINOJSON_ENABLE_ARDUINO_STRING -DEMSESP_DEBUG -DEMSESP_STANDALONE -DEMSESP_DEFAULT_BOARD_PROFILE=\"LOLIN\"
|
DEFINES += -DARDUINOJSON_ENABLE_STD_STRING=1 -DARDUINOJSON_ENABLE_PROGMEM=1 -DARDUINOJSON_ENABLE_ARDUINO_STRING -DARDUINOJSON_USE_DOUBLE=0
|
||||||
|
DEFINES += -DEMSESP_DEBUG -DEMSESP_STANDALONE -DEMSESP_USE_SERIAL
|
||||||
|
DEFINES += $(ARGS)
|
||||||
|
|
||||||
|
DEFAULTS = -DEMSESP_DEFAULT_LOCALE=\"en\" -DEMSESP_DEFAULT_TX_MODE=8 -DEMSESP_DEFAULT_VERSION=\"3.5.0b11\" -DEMSESP_DEFAULT_BOARD_PROFILE=\"S32\"
|
||||||
|
|
||||||
#----------------------------------------------------------------------
|
#----------------------------------------------------------------------
|
||||||
# Sources & Files
|
# Sources & Files
|
||||||
@@ -66,15 +73,15 @@ CXX := /usr/bin/g++
|
|||||||
# CXXFLAGS C++ Compiler Flags
|
# CXXFLAGS C++ Compiler Flags
|
||||||
# LDFLAGS Linker Flags
|
# LDFLAGS Linker Flags
|
||||||
#----------------------------------------------------------------------
|
#----------------------------------------------------------------------
|
||||||
CPPFLAGS += $(DEFINES) $(INCLUDE)
|
CPPFLAGS += $(DEFINES) $(DEFAULTS) $(INCLUDE)
|
||||||
CPPFLAGS += -ggdb
|
CPPFLAGS += -ggdb
|
||||||
CPPFLAGS += -g3
|
CPPFLAGS += -g3
|
||||||
CPPFLAGS += -Os
|
CPPFLAGS += -Os
|
||||||
|
|
||||||
CFLAGS += $(CPPFLAGS)
|
CFLAGS += $(CPPFLAGS)
|
||||||
# CFLAGS += -Wall
|
CFLAGS += -Wall
|
||||||
# CFLAGS += -Wno-unused -Wno-restrict
|
CFLAGS += -Wextra
|
||||||
# CFLAGS += -Wextra
|
CFLAGS += -Wno-unused-parameter
|
||||||
|
|
||||||
CXXFLAGS += $(CFLAGS) -MMD
|
CXXFLAGS += $(CFLAGS) -MMD
|
||||||
|
|
||||||
@@ -113,6 +120,9 @@ COMPILE.cpp = $(CXX) $(CXX_STANDARD) $(CXXFLAGS) $(DEPFLAGS) -c $< -o $@
|
|||||||
#----------------------------------------------------------------------
|
#----------------------------------------------------------------------
|
||||||
# Targets
|
# Targets
|
||||||
#----------------------------------------------------------------------
|
#----------------------------------------------------------------------
|
||||||
|
.PHONY: all
|
||||||
|
.SILENT: $(OUTPUT)
|
||||||
|
|
||||||
all: $(OUTPUT)
|
all: $(OUTPUT)
|
||||||
|
|
||||||
$(OUTPUT): $(OBJS)
|
$(OUTPUT): $(OBJS)
|
||||||
@@ -138,8 +148,9 @@ cppcheck: $(SOURCES)
|
|||||||
run: $(OUTPUT)
|
run: $(OUTPUT)
|
||||||
@$<
|
@$<
|
||||||
|
|
||||||
|
.PHONY: clean
|
||||||
clean:
|
clean:
|
||||||
@$(RM) -r $(BUILD) $(OUTPUT)
|
@$(RM) -rf $(BUILD) $(OUTPUT)
|
||||||
|
|
||||||
help:
|
help:
|
||||||
@echo available targets: all run clean
|
@echo available targets: all run clean
|
||||||
134
README.md
134
README.md
@@ -1,52 +1,61 @@
|
|||||||
# 
|
# 
|
||||||
|
|
||||||
**EMS-ESP** is an open-source firmware for the Espressif ESP8266 and ESP32 microcontroller that communicates with **EMS** (Energy Management System) based equipment from manufacturers like Bosch, Buderus, Nefit, Junkers, Worcester and Sieger.
|
|
||||||
|
|
||||||
This project is the specifically for the ESP32. Compared with the previous ESP8266 (version 2) release it has the following enhancements:
|
|
||||||
|
|
||||||
- Ethernet Support
|
|
||||||
- Pre-configured circuit board layouts
|
|
||||||
- Supports writing EMS values directly from within Web UI
|
|
||||||
- Mock API server for faster offline development and testing
|
|
||||||
- Improved API and MQTT commands
|
|
||||||
- Improvements to Dallas temperature sensors
|
|
||||||
- Embedded log tracing in the Web UI
|
|
||||||
|
|
||||||
[](https://github.com/emsesp/EMS-ESP32/blob/main/CHANGELOG.md)
|
[](https://github.com/emsesp/EMS-ESP32/blob/main/CHANGELOG.md)
|
||||||
[](https://github.com/emsesp/EMS-ESP32/commits/main)
|
[](https://github.com/emsesp/EMS-ESP32/commits/main)
|
||||||
[](LICENSE)
|
[](LICENSE)
|
||||||
|
[](https://sonarcloud.io/summary/new_code?id=emsesp_EMS-ESP32)
|
||||||
[](https://www.codacy.com/gh/emsesp/EMS-ESP32/dashboard?utm_source=github.com&utm_medium=referral&utm_content=emsesp/EMS-ESP32&utm_campaign=Badge_Grade)
|
[](https://www.codacy.com/gh/emsesp/EMS-ESP32/dashboard?utm_source=github.com&utm_medium=referral&utm_content=emsesp/EMS-ESP32&utm_campaign=Badge_Grade)
|
||||||
[](https://github.com/emsesp/EMS-ESP32/releases)
|
[](https://github.com/emsesp/EMS-ESP32/releases)
|
||||||
[](https://discord.gg/3J3GgnzpyT)
|
[](https://discord.gg/3J3GgnzpyT)
|
||||||
|
|
||||||
If you like **EMS-ESP**, please give it a star, or fork it and contribute!
|
|
||||||
|
|
||||||
[](https://github.com/emsesp/EMS-ESP32/stargazers)
|
[](https://github.com/emsesp/EMS-ESP32/stargazers)
|
||||||
[](https://github.com/emsesp/EMS-ES32P/network)
|
[](https://github.com/emsesp/EMS-ES32P/network)
|
||||||
[](https://www.paypal.com/paypalme/prderbyshire/2)
|
[](https://www.paypal.com/paypalme/prderbyshire/2)
|
||||||
|
|
||||||
Note, EMS-ESP requires a small hardware circuit that can convert the EMS bus data to be read by the microcontroller. These can be ordered at <https://bbqkees-electronics.nl> or contact the contributors that can provide the schematic and designs.
|
**EMS-ESP** is an open-source firmware for the Espressif ESP32 microcontroller that communicates with **EMS** (Energy Management System) based equipment from manufacturers like Bosch, Buderus, Nefit, Junkers, Worcester and Sieger. It requires a small gateway circuit to interface with the EMS bus which can be purchased from <https://bbqkees-electronics.nl> or custom built.
|
||||||
|
|
||||||
<img src="media/gateway-integration.jpg" width=40%>
|
## **Features**
|
||||||
|
|
||||||
---
|
- A multi-user, multi-language secure web interface to change settings and monitor incoming data
|
||||||
|
- A console, accessible via Serial and Telnet for more advanced monitoring
|
||||||
# **Features**
|
- Native support for Home Assistant, Domoticz and openHAB via [MQTT Discovery](https://www.home-assistant.io/docs/mqtt/discovery/)
|
||||||
|
|
||||||
- A multi-user secure web interface to change settings and monitor the data
|
|
||||||
- A console, accessible via Serial and Telnet for more monitoring
|
|
||||||
- Native support for Home Assistant via [MQTT Discovery](https://www.home-assistant.io/docs/mqtt/discovery/)
|
|
||||||
- Can run standalone as an independent WiFi Access Point or join an existing WiFi network
|
- Can run standalone as an independent WiFi Access Point or join an existing WiFi network
|
||||||
- Easy first-time configuration via a web Captive Portal
|
- Easy first-time configuration via a web Captive Portal
|
||||||
- Support for more than [80 EMS devices](https://emsesp.github.io/docs/#/Supported-EMS-Devices) (boilers, thermostats, solar modules, mixer modules, heat pumps, gateways)
|
- Support for more than [110 EMS devices](https://emsesp.github.io/docs/#/Supported-EMS-Devices) (boilers, thermostats, solar modules, mixer modules, heat pumps, gateways, switches, heat sources)
|
||||||
|
|
||||||
|
## **Documentation**
|
||||||
|
|
||||||
|
For the complete documentation on how to install, configure and get support visit the [EMS-ESP Wiki](https://emsesp.github.io/docs).
|
||||||
|
|
||||||
|
## **Support**
|
||||||
|
|
||||||
|
To chat with the community reach out on our [Discord Server](https://discord.gg/3J3GgnzpyT).
|
||||||
|
|
||||||
|
If you like **EMS-ESP**, please give it a star, or fork it and contribute or offer a small donation!
|
||||||
|
|
||||||
## **Demo**
|
## **Demo**
|
||||||
|
|
||||||
See a live demo [here](https://ems-esp.derbyshire.nl) using fake data. Log in with any username/password.
|
For a live demo of the Web UI click [here](https://ems-esp.derbyshire.nl) and log in with any username/password.
|
||||||
|
|
||||||
# **Screenshots**
|
## **Contributors ✨**
|
||||||
|
|
||||||
## Web Interface
|
EMS-ESP is a project owned and maintained by [proddy](https://github.com/proddy) and [MichaelDvP](https://github.com/MichaelDvP).
|
||||||
|
|
||||||
|
## **Libraries used**
|
||||||
|
|
||||||
|
- [esp8266-react](https://github.com/rjwats/esp8266-react) by @rjwats for the framework that provides the core of the Web UI
|
||||||
|
- [uuid-\*](https://github.com/nomis/mcu-uuid-console) from @nomis. The console, syslog, telnet and logging are based off these open source libraries
|
||||||
|
- [ArduinoJson](https://github.com/bblanchon/ArduinoJson) for all the JSON
|
||||||
|
- [AsyncMqttClient](https://github.com/marvinroger/async-mqtt-client) for the MQTT client, with custom modifications from @bertmelis and @proddy
|
||||||
|
- ESPAsyncWebServer and AsyncTCP for the Web server and TCP backends, with custom modifications for performance
|
||||||
|
|
||||||
|
## **License**
|
||||||
|
|
||||||
|
This program is licensed under GPL-3.0
|
||||||
|
|
||||||
|
## **Screenshots**
|
||||||
|
|
||||||
|
### Web Interface
|
||||||
|
|
||||||
| | |
|
| | |
|
||||||
| ---------------------------------- | -------------------------------- |
|
| ---------------------------------- | -------------------------------- |
|
||||||
@@ -54,75 +63,10 @@ See a live demo [here](https://ems-esp.derbyshire.nl) using fake data. Log in wi
|
|||||||
| <img src="media/web_devices.png"> | <img src="media/web_mqtt.png"> |
|
| <img src="media/web_devices.png"> | <img src="media/web_mqtt.png"> |
|
||||||
| <img src="media/web_edit.png"> | <img src="media/web_log.png"> |
|
| <img src="media/web_edit.png"> | <img src="media/web_log.png"> |
|
||||||
|
|
||||||
## Telnet Console
|
### Telnet Console
|
||||||
|
|
||||||
<img src="media/console.png" width=80% height=80%>
|
<img src="media/console0.png" width=80% height=80%>
|
||||||
|
|
||||||
## In Home Assistant
|
### In Home Assistant
|
||||||
|
|
||||||
<img src="media/ha_lovelace.png" width=80% height=80%>
|
<img src="media/ha_lovelace.png" width=80% height=80%>
|
||||||
|
|
||||||
# **Installing**
|
|
||||||
|
|
||||||
Refer to the [official documentation](https://emsesp.github.io/docs) to how to install the firmware and configure it. The documentation is being constantly updated as new features and settings are added.
|
|
||||||
|
|
||||||
You can choose to use an pre-built firmware image or compile the code yourself:
|
|
||||||
|
|
||||||
- [Uploading a pre-built firmware build](https://emsesp.github.io/docs/#/Uploading-firmware)
|
|
||||||
- [Building the firmware from source code and flashing manually](https://emsesp.github.io/docs/#/Building-firmware)
|
|
||||||
|
|
||||||
# **Support Information**
|
|
||||||
|
|
||||||
If you're looking for support on **EMS-ESP** there are some options available:
|
|
||||||
|
|
||||||
## Documentation
|
|
||||||
|
|
||||||
- [Official EMS-ESP Documentation](https://emsesp.github.io/docs): For information on how to build and upload the firmware
|
|
||||||
- [FAQ and Troubleshooting](https://emsesp.github.io/docs/#/Troubleshooting): For information on common problems and solutions. See also [BBQKees's wiki](https://bbqkees-electronics.nl/wiki/gateway/troubleshooting.html)
|
|
||||||
|
|
||||||
## Support Community
|
|
||||||
|
|
||||||
- [Discord Server](https://discord.gg/3J3GgnzpyT): For support, troubleshooting and general questions. You have better chances to get fast answers from members of the community
|
|
||||||
- [Search in Issues](https://github.com/emsesp/EMS-ESP32/issues): You might find an answer to your question by searching current or closed issues
|
|
||||||
|
|
||||||
## Developer's Community
|
|
||||||
|
|
||||||
- [Bug Report](https://github.com/emsesp/EMS-ESP32/issues/new?template=bug_report.md): For reporting Bugs
|
|
||||||
- [Feature Request](https://github.com/emsesp/EMS-ESP32/issues/new?template=feature_request.md): For requesting features/functions
|
|
||||||
- [Troubleshooting](https://github.com/emsesp/EMS-ESP32/issues/new?template=questions---troubleshooting.md): As a last resort, you can open new _Troubleshooting & Question_ issue on GitHub if the solution could not be found using the other channels. Just remember: the more info you provide the more chances you'll have to get an accurate answer
|
|
||||||
|
|
||||||
# **Contributors ✨**
|
|
||||||
|
|
||||||
EMS-ESP is a project originally created and owned by [proddy](https://github.com/proddy). Key contributors are:
|
|
||||||
|
|
||||||
<!-- prettier-ignore-start -->
|
|
||||||
<!-- markdownlint-disable -->
|
|
||||||
<table>
|
|
||||||
<tr>
|
|
||||||
<td align="center">
|
|
||||||
<a href="https://github.com/MichaelDvP"><img src="https://avatars.githubusercontent.com/u/59284019?v=3?s=100" width="100px;" alt=""/><br /><sub><b>MichaelDvP</b></sub></a><br /></a> <a href="https://github.com/emsesp/EMS-ESP/commits?author=MichaelDvP" title="v2 Commits">v2</a>
|
|
||||||
<a href="https://github.com/emsesp/EMS-ESP32/commits?author=MichaelDvP" title="v3 Commits">v3</a>
|
|
||||||
</td>
|
|
||||||
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
<!-- markdownlint-restore -->
|
|
||||||
<!-- prettier-ignore-end -->
|
|
||||||
|
|
||||||
You can also contribute to EMS-ESP by
|
|
||||||
|
|
||||||
- providing Pull Requests (Features, Fixes, suggestions)
|
|
||||||
- testing new released features and report issues on your EMS equipment
|
|
||||||
- contributing to missing [Documentation](https://emsesp.github.io/docs)
|
|
||||||
|
|
||||||
# **Libraries used**
|
|
||||||
|
|
||||||
- [esp8266-react](https://github.com/rjwats/esp8266-react) by @rjwats for the framework that provides the core of the Web UI
|
|
||||||
- [uuid-\*](https://github.com/nomis/mcu-uuid-console) from @nomis. The console, syslog, telnet and logging are based off these open source libraries
|
|
||||||
- [ArduinoJson](https://github.com/bblanchon/ArduinoJson) for JSON
|
|
||||||
- [AsyncMqttClient](https://github.com/marvinroger/async-mqtt-client) for the MQTT client, with custom modifications from @bertmelis and @proddy
|
|
||||||
- ESPAsyncWebServer and AsyncTCP for the Web server and TCP backends, with custom modifications for performance
|
|
||||||
|
|
||||||
# **License**
|
|
||||||
|
|
||||||
This program is licensed under GPL-3.0
|
|
||||||
|
|||||||
@@ -3,4 +3,3 @@
|
|||||||
# Firmware Installation
|
# Firmware Installation
|
||||||
|
|
||||||
Follow the instructions in the [documentation](https://emsesp.github.io/docs) on how to install the firmware binaries in the Assets below.
|
Follow the instructions in the [documentation](https://emsesp.github.io/docs) on how to install the firmware binaries in the Assets below.
|
||||||
|
|
||||||
|
|||||||
@@ -5,4 +5,3 @@ This is a snapshot of the current "beta" development code and firmware binaries
|
|||||||
# Firmware Installation
|
# Firmware Installation
|
||||||
|
|
||||||
Follow the instructions in the [documentation](https://emsesp.github.io/docs) on how to install the firmware binaries in the Assets below.
|
Follow the instructions in the [documentation](https://emsesp.github.io/docs) on how to install the firmware binaries in the Assets below.
|
||||||
|
|
||||||
|
|||||||
6
esp32_partition_16M.csv
Normal file
6
esp32_partition_16M.csv
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
# Name, Type, SubType, Offset, Size, Flags
|
||||||
|
nvs, data, nvs, 0x9000, 0x5000,
|
||||||
|
otadata, data, ota, , 0x2000,
|
||||||
|
app0, app, ota_0, , 0x7F0000,
|
||||||
|
app1, app, ota_1, , 0x7F0000,
|
||||||
|
spiffs, data, spiffs, , 64K,
|
||||||
|
6
esp32_partition_4M.csv
Normal file
6
esp32_partition_4M.csv
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
# Name, Type, SubType, Offset, Size, Flags
|
||||||
|
nvs, data, nvs, 0x9000, 0x5000,
|
||||||
|
otadata, data, ota, , 0x2000,
|
||||||
|
app0, app, ota_0, , 0x1F0000,
|
||||||
|
app1, app, ota_1, , 0x1F0000,
|
||||||
|
spiffs, data, spiffs, , 64K,
|
||||||
|
@@ -1,6 +0,0 @@
|
|||||||
# Name, Type, SubType, Offset, Size, Flags
|
|
||||||
nvs, data, nvs, 0x9000, 0x5000,
|
|
||||||
otadata, data, ota, 0xe000, 0x2000,
|
|
||||||
app0, app, ota_0, 0x10000, 0x1F0000,
|
|
||||||
app1, app, ota_1, 0x200000, 0x1F0000,
|
|
||||||
spiffs, data, spiffs, 0x3F0000,0x10000,
|
|
||||||
|
5
esp32_partition_debug.csv
Normal file
5
esp32_partition_debug.csv
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
# Name, Type, SubType, Offset, Size, Flags
|
||||||
|
nvs, data, nvs, 0x9000, 0x5000,
|
||||||
|
otadata, data, ota, 0xE000, 0x2000,
|
||||||
|
app0, app, ota_0, 0x10000, 0x210000,
|
||||||
|
spiffs, data, spiffs, 0x220000, 0x10000,
|
||||||
|
@@ -7,8 +7,8 @@ build_flags =
|
|||||||
|
|
||||||
; Access point settings
|
; Access point settings
|
||||||
-D FACTORY_AP_PROVISION_MODE=AP_MODE_DISCONNECTED
|
-D FACTORY_AP_PROVISION_MODE=AP_MODE_DISCONNECTED
|
||||||
-D FACTORY_AP_SSID=\"ems-esp\" ; 1-64 characters
|
-D FACTORY_AP_SSID=\"ems-esp\"
|
||||||
-D FACTORY_AP_PASSWORD=\"ems-esp-neo\" ; 8-64 characters
|
-D FACTORY_AP_PASSWORD=\"ems-esp-neo\"
|
||||||
-D FACTORY_AP_LOCAL_IP=\"192.168.4.1\"
|
-D FACTORY_AP_LOCAL_IP=\"192.168.4.1\"
|
||||||
-D FACTORY_AP_GATEWAY_IP=\"192.168.4.1\"
|
-D FACTORY_AP_GATEWAY_IP=\"192.168.4.1\"
|
||||||
-D FACTORY_AP_SUBNET_MASK=\"255.255.255.0\"
|
-D FACTORY_AP_SUBNET_MASK=\"255.255.255.0\"
|
||||||
@@ -28,17 +28,17 @@ build_flags =
|
|||||||
; OTA settings
|
; OTA settings
|
||||||
-D FACTORY_OTA_PORT=8266
|
-D FACTORY_OTA_PORT=8266
|
||||||
-D FACTORY_OTA_PASSWORD=\"ems-esp-neo\"
|
-D FACTORY_OTA_PASSWORD=\"ems-esp-neo\"
|
||||||
-D FACTORY_OTA_ENABLED=true
|
-D FACTORY_OTA_ENABLED=false
|
||||||
|
|
||||||
; MQTT settings
|
; MQTT settings
|
||||||
-D FACTORY_MQTT_ENABLED=false
|
-D FACTORY_MQTT_ENABLED=false
|
||||||
-D FACTORY_MQTT_HOST=\"test.mosquitto.org\"
|
-D FACTORY_MQTT_HOST=\"\"
|
||||||
-D FACTORY_MQTT_PORT=1883
|
-D FACTORY_MQTT_PORT=1883
|
||||||
-D FACTORY_MQTT_USERNAME=\"\"
|
-D FACTORY_MQTT_USERNAME=\"\"
|
||||||
-D FACTORY_MQTT_PASSWORD=\"\"
|
-D FACTORY_MQTT_PASSWORD=\"\"
|
||||||
-D FACTORY_MQTT_CLIENT_ID=\"ems-esp\"
|
-D FACTORY_MQTT_CLIENT_ID=\"ems-esp\"
|
||||||
-D FACTORY_MQTT_KEEP_ALIVE=60
|
-D FACTORY_MQTT_KEEP_ALIVE=60
|
||||||
-D FACTORY_MQTT_CLEAN_SESSION=true
|
-D FACTORY_MQTT_CLEAN_SESSION=false
|
||||||
-D FACTORY_MQTT_MAX_TOPIC_LENGTH=128
|
-D FACTORY_MQTT_MAX_TOPIC_LENGTH=128
|
||||||
|
|
||||||
; JWT Secret
|
; JWT Secret
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
# This enables lint extensions
|
||||||
|
EXTEND_ESLINT=true
|
||||||
|
|
||||||
# This is the name of your project. It appears on the sign-in page and in the menu bar.
|
# This is the name of your project. It appears on the sign-in page and in the menu bar.
|
||||||
REACT_APP_PROJECT_NAME=EMS-ESP
|
REACT_APP_PROJECT_NAME=EMS-ESP
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +0,0 @@
|
|||||||
# Change the IP address to that of your ESP device to enable local development of the UI
|
|
||||||
|
|
||||||
# REACT_APP_HTTP_ROOT=http://localhost:3000
|
|
||||||
# REACT_APP_WEB_SOCKET_ROOT=ws://localhost:3000
|
|
||||||
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
# don't ever lint node_modules
|
|
||||||
node_modules
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
{
|
|
||||||
"root": true,
|
|
||||||
"parser": "@typescript-eslint/parser",
|
|
||||||
"plugins": [
|
|
||||||
"@typescript-eslint",
|
|
||||||
"prettier"
|
|
||||||
],
|
|
||||||
"extends": [
|
|
||||||
"eslint:recommended",
|
|
||||||
"plugin:@typescript-eslint/eslint-recommended",
|
|
||||||
"plugin:@typescript-eslint/recommended",
|
|
||||||
"prettier"
|
|
||||||
],
|
|
||||||
"rules": {
|
|
||||||
// 0 = ignore, 1 = warning, 2 = error
|
|
||||||
"no-console": 0,
|
|
||||||
"prettier/prettier": ["error", { endOfLine: "auto" }],
|
|
||||||
"explicit-function-return-type": 0,
|
|
||||||
"@typescript-eslint/explicit-module-boundary-types": 0,
|
|
||||||
"@typescript-eslint/no-var-requires": 0,
|
|
||||||
"@typescript-eslint/ban-types": 0,
|
|
||||||
"@typescript-eslint/no-non-null-asserted-optional-chain": 0,
|
|
||||||
"@typescript-eslint/no-non-null-assertion": 0,
|
|
||||||
"@typescript-eslint/no-explicit-any": 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -2,5 +2,5 @@
|
|||||||
"singleQuote": true,
|
"singleQuote": true,
|
||||||
"semi": true,
|
"semi": true,
|
||||||
"trailingComma": "none",
|
"trailingComma": "none",
|
||||||
"printWidth": 80
|
"printWidth": 120
|
||||||
}
|
}
|
||||||
|
|||||||
5
interface/.typesafe-i18n.json
Normal file
5
interface/.typesafe-i18n.json
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"adapter": "react",
|
||||||
|
"baseLocale": "pl",
|
||||||
|
"$schema": "https://unpkg.com/typesafe-i18n@5.24.2/schema/typesafe-i18n.json"
|
||||||
|
}
|
||||||
@@ -1,52 +1,30 @@
|
|||||||
const ManifestPlugin = require('webpack-manifest-plugin');
|
const { WebpackManifestPlugin } = require('webpack-manifest-plugin');
|
||||||
const WorkboxWebpackPlugin = require('workbox-webpack-plugin');
|
|
||||||
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
||||||
const CompressionPlugin = require('compression-webpack-plugin');
|
|
||||||
const ProgmemGenerator = require('./progmem-generator.js');
|
const ProgmemGenerator = require('./progmem-generator.js');
|
||||||
|
const TerserPlugin = require('terser-webpack-plugin');
|
||||||
|
|
||||||
module.exports = function override(config, env) {
|
module.exports = function override(config, env) {
|
||||||
const hosted = process.env.REACT_APP_HOSTED;
|
const hosted = process.env.REACT_APP_HOSTED;
|
||||||
|
|
||||||
if (env === 'production' && !hosted) {
|
if (env === 'production' && !hosted) {
|
||||||
console.log('Custom webpack...');
|
// rename the ouput file, we need it's path to be short, for embedded FS
|
||||||
|
|
||||||
// rename the output file, we need it's path to be short for LittleFS
|
|
||||||
config.output.filename = 'js/[id].[chunkhash:4].js';
|
config.output.filename = 'js/[id].[chunkhash:4].js';
|
||||||
config.output.chunkFilename = 'js/[id].[chunkhash:4].js';
|
config.output.chunkFilename = 'js/[id].[chunkhash:4].js';
|
||||||
|
|
||||||
// take out the manifest and service worker plugins
|
// take out the manifest plugin
|
||||||
config.plugins = config.plugins.filter(
|
config.plugins = config.plugins.filter((plugin) => !(plugin instanceof WebpackManifestPlugin));
|
||||||
(plugin) => !(plugin instanceof ManifestPlugin)
|
|
||||||
);
|
|
||||||
config.plugins = config.plugins.filter(
|
|
||||||
(plugin) => !(plugin instanceof WorkboxWebpackPlugin.GenerateSW)
|
|
||||||
);
|
|
||||||
|
|
||||||
// shorten css filenames
|
// shorten css filenames
|
||||||
const miniCssExtractPlugin = config.plugins.find(
|
const miniCssExtractPlugin = config.plugins.find((plugin) => plugin instanceof MiniCssExtractPlugin);
|
||||||
(plugin) => plugin instanceof MiniCssExtractPlugin
|
|
||||||
);
|
|
||||||
miniCssExtractPlugin.options.filename = 'css/[id].[contenthash:4].css';
|
miniCssExtractPlugin.options.filename = 'css/[id].[contenthash:4].css';
|
||||||
miniCssExtractPlugin.options.chunkFilename =
|
miniCssExtractPlugin.options.chunkFilename = 'css/[id].[contenthash:4].c.css';
|
||||||
'css/[id].[contenthash:4].c.css';
|
|
||||||
|
// don't emit license file
|
||||||
|
const terserPlugin = config.optimization.minimizer.find((plugin) => plugin instanceof TerserPlugin);
|
||||||
|
terserPlugin.options.extractComments = false;
|
||||||
|
|
||||||
// build progmem data files
|
// build progmem data files
|
||||||
config.plugins.push(
|
config.plugins.push(new ProgmemGenerator({ outputPath: '../lib/framework/WWWData.h', bytesPerLine: 20 }));
|
||||||
new ProgmemGenerator({
|
|
||||||
outputPath: '../lib/framework/WWWData.h',
|
|
||||||
bytesPerLine: 20
|
|
||||||
})
|
|
||||||
);
|
|
||||||
|
|
||||||
// add compression plugin, compress javascript
|
|
||||||
config.plugins.push(
|
|
||||||
new CompressionPlugin({
|
|
||||||
filename: '[path].gz[query]',
|
|
||||||
algorithm: 'gzip',
|
|
||||||
test: /\.(js)$/,
|
|
||||||
deleteOriginalAssets: true
|
|
||||||
})
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
return config;
|
return config;
|
||||||
};
|
};
|
||||||
|
|||||||
41077
interface/package-lock.json
generated
41077
interface/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -1,50 +1,88 @@
|
|||||||
{
|
{
|
||||||
"name": "emsesp-react",
|
"name": "EMS-ESP",
|
||||||
"version": "0.1.0",
|
"version": "3.5.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
|
"proxy": "http://localhost:3080",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@material-ui/core": "^4.11.4",
|
"@emotion/react": "^11.10.5",
|
||||||
"@material-ui/icons": "^4.11.2",
|
"@emotion/styled": "^11.10.5",
|
||||||
"@msgpack/msgpack": "^2.7.0",
|
"@msgpack/msgpack": "^2.8.0",
|
||||||
"@types/lodash": "^4.14.168",
|
"@mui/icons-material": "^5.11.0",
|
||||||
"@types/node": "^15.0.1",
|
"@mui/material": "^5.11.7",
|
||||||
"@types/react": "^17.0.4",
|
"@table-library/react-table-library": "4.0.24",
|
||||||
"@types/react-dom": "^17.0.3",
|
"@types/lodash": "^4.14.191",
|
||||||
"@types/react-material-ui-form-validator": "^2.1.0",
|
"@types/node": "^18.11.19",
|
||||||
"@types/react-router": "^5.1.13",
|
"@types/react": "^18.0.27",
|
||||||
"@types/react-router-dom": "^5.1.7",
|
"@types/react-dom": "^18.0.10",
|
||||||
"compression-webpack-plugin": "^5.0.2",
|
"@types/react-router-dom": "^5.3.3",
|
||||||
"env-cmd": "^10.1.0",
|
"async-validator": "^4.2.5",
|
||||||
"express": "^4.17.1",
|
"axios": "^1.3.2",
|
||||||
"jwt-decode": "^3.1.2",
|
"jwt-decode": "^3.1.2",
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
"mime-types": "^2.1.30",
|
"notistack": "^2.0.8",
|
||||||
"notistack": "^1.0.6",
|
"react": "^18.2.0",
|
||||||
"parse-ms": "^3.0.0",
|
"react-app-rewired": "^2.2.1",
|
||||||
"react": "^17.0.2",
|
"react-dom": "^18.2.0",
|
||||||
"react-dom": "^17.0.2",
|
"react-dropzone": "^14.2.3",
|
||||||
"react-dropzone": "^11.3.2",
|
"react-icons": "^4.7.1",
|
||||||
"react-form-validator-core": "^1.1.1",
|
"react-router-dom": "^6.8.1",
|
||||||
"react-material-ui-form-validator": "^2.1.4",
|
"react-scripts": "5.0.1",
|
||||||
"react-router": "^5.2.0",
|
|
||||||
"react-router-dom": "^5.2.0",
|
|
||||||
"react-scripts": "4.0.3",
|
|
||||||
"sockette": "^2.0.6",
|
"sockette": "^2.0.6",
|
||||||
"typescript": "4.2.4",
|
"typesafe-i18n": "^5.24.0",
|
||||||
"zlib": "^1.0.5"
|
"typescript": "^4.9.5"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "react-app-rewired start",
|
"start": "react-app-rewired start",
|
||||||
"build": "react-app-rewired build",
|
"build": "react-app-rewired build",
|
||||||
|
"test": "react-app-rewired test",
|
||||||
|
"eject": "react-scripts eject",
|
||||||
"format": "prettier --write '**/*.{ts,tsx,js,css,json,md}'",
|
"format": "prettier --write '**/*.{ts,tsx,js,css,json,md}'",
|
||||||
"build-hosted": "env-cmd -f .env.hosted npm run build",
|
"build-hosted": "env-cmd -f .env.hosted npm run build",
|
||||||
"build-localhost": "PUBLIC_URL=/ react-app-rewired build",
|
"build-localhost": "PUBLIC_URL=/ react-app-rewired build",
|
||||||
"mock-api": "nodemon --watch ../mock-api ../mock-api/server.js",
|
"mock-api": "nodemon --watch ../mock-api ../mock-api/server.js",
|
||||||
"standalone": "npm-run-all -p start mock-api",
|
"standalone": "npm-run-all -p start typesafe-i18n mock-api",
|
||||||
"lint": "eslint . --ext .ts,.tsx"
|
"lint": "eslint . --ext .ts,.tsx",
|
||||||
|
"typesafe-i18n": "typesafe-i18n"
|
||||||
},
|
},
|
||||||
"eslintConfig": {
|
"eslintConfig": {
|
||||||
"extends": "react-app"
|
"extends": [
|
||||||
|
"react-app",
|
||||||
|
"react-app/jest"
|
||||||
|
],
|
||||||
|
"rules": {
|
||||||
|
"eol-last": 1,
|
||||||
|
"react/jsx-closing-bracket-location": 1,
|
||||||
|
"react/jsx-closing-tag-location": 1,
|
||||||
|
"react/jsx-wrap-multilines": 1,
|
||||||
|
"react/jsx-curly-newline": 1,
|
||||||
|
"no-multiple-empty-lines": [
|
||||||
|
1,
|
||||||
|
{
|
||||||
|
"max": 1
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"no-trailing-spaces": 1,
|
||||||
|
"semi": 1,
|
||||||
|
"no-extra-semi": 1,
|
||||||
|
"react/jsx-max-props-per-line": [
|
||||||
|
1,
|
||||||
|
{
|
||||||
|
"when": "multiline"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"react/jsx-first-prop-new-line": [
|
||||||
|
1,
|
||||||
|
"multiline"
|
||||||
|
],
|
||||||
|
"@typescript-eslint/no-shadow": 1,
|
||||||
|
"max-len": [
|
||||||
|
1,
|
||||||
|
{
|
||||||
|
"code": 220
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"arrow-parens": 1
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"browserslist": {
|
"browserslist": {
|
||||||
"production": [
|
"production": [
|
||||||
@@ -59,13 +97,8 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"concurrently": "^6.0.1",
|
"nodemon": "^2.0.20",
|
||||||
"eslint-config-prettier": "^8.3.0",
|
|
||||||
"eslint-plugin-prettier": "^3.4.0",
|
|
||||||
"http-proxy-middleware": "^1.1.1",
|
|
||||||
"nodemon": "^2.0.7",
|
|
||||||
"npm-run-all": "^4.1.5",
|
"npm-run-all": "^4.1.5",
|
||||||
"prettier": "^2.0.5",
|
"http-proxy-middleware": "^2.0.6"
|
||||||
"react-app-rewired": "^2.1.8"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,5 @@
|
|||||||
const { resolve, relative, sep } = require('path');
|
const { resolve, relative, sep } = require('path');
|
||||||
const {
|
const { readdirSync, existsSync, unlinkSync, readFileSync, createWriteStream } = require('fs');
|
||||||
readdirSync,
|
|
||||||
existsSync,
|
|
||||||
unlinkSync,
|
|
||||||
readFileSync,
|
|
||||||
createWriteStream
|
|
||||||
} = require('fs');
|
|
||||||
var zlib = require('zlib');
|
var zlib = require('zlib');
|
||||||
var mime = require('mime-types');
|
var mime = require('mime-types');
|
||||||
|
|
||||||
@@ -36,112 +30,91 @@ function cleanAndOpen(path) {
|
|||||||
|
|
||||||
class ProgmemGenerator {
|
class ProgmemGenerator {
|
||||||
constructor(options = {}) {
|
constructor(options = {}) {
|
||||||
const {
|
const { outputPath, bytesPerLine = 20, indent = ' ', includes = ARDUINO_INCLUDES } = options;
|
||||||
outputPath,
|
|
||||||
bytesPerLine = 20,
|
|
||||||
indent = ' ',
|
|
||||||
includes = ARDUINO_INCLUDES
|
|
||||||
} = options;
|
|
||||||
this.options = { outputPath, bytesPerLine, indent, includes };
|
this.options = { outputPath, bytesPerLine, indent, includes };
|
||||||
}
|
}
|
||||||
|
|
||||||
apply(compiler) {
|
apply(compiler) {
|
||||||
compiler.hooks.emit.tapAsync(
|
compiler.hooks.emit.tapAsync({ name: 'ProgmemGenerator' }, (compilation, callback) => {
|
||||||
{ name: 'ProgmemGenerator' },
|
const { outputPath, bytesPerLine, indent, includes } = this.options;
|
||||||
(compilation, callback) => {
|
const fileInfo = [];
|
||||||
const { outputPath, bytesPerLine, indent, includes } = this.options;
|
const writeStream = cleanAndOpen(resolve(compilation.options.context, outputPath));
|
||||||
const fileInfo = [];
|
try {
|
||||||
const writeStream = cleanAndOpen(
|
const writeIncludes = () => {
|
||||||
resolve(compilation.options.context, outputPath)
|
writeStream.write(includes);
|
||||||
);
|
};
|
||||||
try {
|
|
||||||
const writeIncludes = () => {
|
|
||||||
writeStream.write(includes);
|
|
||||||
};
|
|
||||||
|
|
||||||
const writeFile = (relativeFilePath, buffer) => {
|
const writeFile = (relativeFilePath, buffer) => {
|
||||||
const variable = 'ESP_REACT_DATA_' + fileInfo.length;
|
const variable = 'ESP_REACT_DATA_' + fileInfo.length;
|
||||||
const mimeType = mime.lookup(relativeFilePath);
|
const mimeType = mime.lookup(relativeFilePath);
|
||||||
var size = 0;
|
var size = 0;
|
||||||
writeStream.write('const uint8_t ' + variable + '[] PROGMEM = {');
|
writeStream.write('const uint8_t ' + variable + '[] PROGMEM = {');
|
||||||
const zipBuffer = zlib.gzipSync(buffer);
|
const zipBuffer = zlib.gzipSync(buffer);
|
||||||
zipBuffer.forEach((b) => {
|
zipBuffer.forEach((b) => {
|
||||||
if (!(size % bytesPerLine)) {
|
if (!(size % bytesPerLine)) {
|
||||||
writeStream.write('\n');
|
|
||||||
writeStream.write(indent);
|
|
||||||
}
|
|
||||||
writeStream.write(
|
|
||||||
'0x' + ('00' + b.toString(16).toUpperCase()).substr(-2) + ','
|
|
||||||
);
|
|
||||||
size++;
|
|
||||||
});
|
|
||||||
if (size % bytesPerLine) {
|
|
||||||
writeStream.write('\n');
|
writeStream.write('\n');
|
||||||
|
writeStream.write(indent);
|
||||||
}
|
}
|
||||||
writeStream.write('};\n\n');
|
writeStream.write('0x' + ('00' + b.toString(16).toUpperCase()).substr(-2) + ',');
|
||||||
fileInfo.push({
|
size++;
|
||||||
uri: '/' + relativeFilePath.replace(sep, '/'),
|
});
|
||||||
mimeType,
|
if (size % bytesPerLine) {
|
||||||
variable,
|
writeStream.write('\n');
|
||||||
size
|
}
|
||||||
});
|
writeStream.write('};\n\n');
|
||||||
};
|
fileInfo.push({
|
||||||
|
uri: '/' + relativeFilePath.replace(sep, '/'),
|
||||||
|
mimeType,
|
||||||
|
variable,
|
||||||
|
size
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
const writeFiles = () => {
|
const writeFiles = () => {
|
||||||
// process static files
|
// process static files
|
||||||
const buildPath = compilation.options.output.path;
|
const buildPath = compilation.options.output.path;
|
||||||
for (const filePath of getFilesSync(buildPath)) {
|
for (const filePath of getFilesSync(buildPath)) {
|
||||||
const readStream = readFileSync(filePath);
|
const readStream = readFileSync(filePath);
|
||||||
const relativeFilePath = relative(buildPath, filePath);
|
const relativeFilePath = relative(buildPath, filePath);
|
||||||
writeFile(relativeFilePath, readStream);
|
writeFile(relativeFilePath, readStream);
|
||||||
}
|
}
|
||||||
// process assets
|
// process assets
|
||||||
const { assets } = compilation;
|
const { assets } = compilation;
|
||||||
Object.keys(assets).forEach((relativeFilePath) => {
|
Object.keys(assets).forEach((relativeFilePath) => {
|
||||||
writeFile(
|
writeFile(relativeFilePath, coherseToBuffer(assets[relativeFilePath].source()));
|
||||||
relativeFilePath,
|
});
|
||||||
coherseToBuffer(assets[relativeFilePath].source())
|
};
|
||||||
);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
const generateWWWClass = () => {
|
const generateWWWClass = () => {
|
||||||
return `typedef std::function<void(const String& uri, const String& contentType, const uint8_t * content, size_t len)> RouteRegistrationHandler;
|
// eslint-disable-next-line max-len
|
||||||
|
return `typedef std::function<void(const String& uri, const String& contentType, const uint8_t * content, size_t len)> RouteRegistrationHandler;
|
||||||
|
|
||||||
class WWWData {
|
class WWWData {
|
||||||
${indent}public:
|
${indent}public:
|
||||||
${indent.repeat(
|
${indent.repeat(2)}static void registerRoutes(RouteRegistrationHandler handler) {
|
||||||
2
|
|
||||||
)}static void registerRoutes(RouteRegistrationHandler handler) {
|
|
||||||
${fileInfo
|
${fileInfo
|
||||||
.map(
|
.map((file) => `${indent.repeat(3)}handler("${file.uri}", "${file.mimeType}", ${file.variable}, ${file.size});`)
|
||||||
(file) =>
|
|
||||||
`${indent.repeat(3)}handler("${file.uri}", "${file.mimeType}", ${
|
|
||||||
file.variable
|
|
||||||
}, ${file.size});`
|
|
||||||
)
|
|
||||||
.join('\n')}
|
.join('\n')}
|
||||||
${indent.repeat(2)}}
|
${indent.repeat(2)}}
|
||||||
};
|
};
|
||||||
`;
|
`;
|
||||||
};
|
};
|
||||||
|
|
||||||
const writeWWWClass = () => {
|
const writeWWWClass = () => {
|
||||||
writeStream.write(generateWWWClass());
|
writeStream.write(generateWWWClass());
|
||||||
};
|
};
|
||||||
|
|
||||||
writeIncludes();
|
writeIncludes();
|
||||||
writeFiles();
|
writeFiles();
|
||||||
writeWWWClass();
|
writeWWWClass();
|
||||||
|
|
||||||
writeStream.on('finish', () => {
|
writeStream.on('finish', () => {
|
||||||
callback();
|
callback();
|
||||||
});
|
});
|
||||||
} finally {
|
} finally {
|
||||||
writeStream.end();
|
writeStream.end();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
);
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,28 +1,26 @@
|
|||||||
/* Just supporting latin due to size constrains on the esp chip */
|
/*
|
||||||
@font-face {
|
* Just supporting latin due to size constrains on the esp chip
|
||||||
font-family: 'Roboto';
|
*
|
||||||
font-style: normal;
|
* The framework only makes use of 400 (regular) + 500 (medium) weight fonts.
|
||||||
font-weight: 300;
|
*
|
||||||
src: local('Roboto Light'), local('Roboto-Light'),
|
* If using light or strong typography variants you will need to add additional fonts.
|
||||||
url(../fonts/li.woff2) format('woff2');
|
*/
|
||||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
|
|
||||||
U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2212, U+2215;
|
|
||||||
}
|
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'Roboto';
|
font-family: 'Roboto';
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
src: local('Roboto'), local('Roboto-Regular'),
|
src: local('Roboto'), local('Roboto-Regular'), url(../fonts/re.woff2) format('woff2');
|
||||||
url(../fonts/re.woff2) format('woff2');
|
unicode-range: U+0000-00FF, U+0104-0107, U+0118-0119, U+0131, U+0141-0144, U+0152-0153, U+015A-015B, U+0179-017C,
|
||||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
|
U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF,
|
||||||
U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2212, U+2215;
|
U+FFFD;
|
||||||
}
|
}
|
||||||
|
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'Roboto';
|
font-family: 'Roboto';
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
src: local('Roboto Medium'), local('Roboto-Medium'),
|
src: local('Roboto Medium'), local('Roboto-Medium'), url(../fonts/md.woff2) format('woff2');
|
||||||
url(../fonts/me.woff2) format('woff2');
|
unicode-range: U+0000-00FF, U+0104-0107, U+0118-0119, U+0131, U+0141-0144, U+0152-0153, U+015A-015B, U+0179-017C,
|
||||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
|
U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF,
|
||||||
U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2212, U+2215;
|
U+FFFD;
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
BIN
interface/public/fonts/md.woff2
Normal file
BIN
interface/public/fonts/md.woff2
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,16 +1,17 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
<meta
|
||||||
<link rel="stylesheet" href="%PUBLIC_URL%/css/roboto.css">
|
name="viewport"
|
||||||
<link rel="manifest" href="%PUBLIC_URL%/app/manifest.json">
|
content="width=device-width, initial-scale=1, user-scalable=0, maximum-scale=1, minimum-scale=1"
|
||||||
|
/>
|
||||||
|
<link rel="stylesheet" href="%PUBLIC_URL%/css/roboto.css" />
|
||||||
|
<link rel="manifest" href="%PUBLIC_URL%/app/manifest.json" />
|
||||||
<title>EMS-ESP</title>
|
<title>EMS-ESP</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<noscript>
|
<noscript> You need to enable JavaScript to run this app. </noscript>
|
||||||
You need to enable JavaScript to run this app.
|
|
||||||
</noscript>
|
|
||||||
<div id="root"></div>
|
<div id="root"></div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -1,57 +1,62 @@
|
|||||||
import React, { Component, RefObject } from 'react';
|
import { FC, createRef, createContext, useContext, useEffect, useState, RefObject } from 'react';
|
||||||
import { Redirect, Route, Switch } from 'react-router';
|
|
||||||
import { SnackbarProvider } from 'notistack';
|
import { SnackbarProvider } from 'notistack';
|
||||||
|
|
||||||
import { IconButton } from '@material-ui/core';
|
import { IconButton } from '@mui/material';
|
||||||
import CloseIcon from '@material-ui/icons/Close';
|
import CloseIcon from '@mui/icons-material/Close';
|
||||||
|
|
||||||
|
import { FeaturesLoader } from './contexts/features';
|
||||||
|
|
||||||
|
import CustomTheme from './CustomTheme';
|
||||||
import AppRouting from './AppRouting';
|
import AppRouting from './AppRouting';
|
||||||
import CustomMuiTheme from './CustomMuiTheme';
|
|
||||||
import { PROJECT_NAME } from './api';
|
|
||||||
import FeaturesWrapper from './features/FeaturesWrapper';
|
|
||||||
|
|
||||||
// this redirect forces a call to authenticationContext.refresh() which invalidates the JWT if it is invalid.
|
import { localStorageDetector } from 'typesafe-i18n/detectors';
|
||||||
const unauthorizedRedirect = () => <Redirect to="/" />;
|
import TypesafeI18n from './i18n/i18n-react';
|
||||||
|
import { detectLocale } from './i18n/i18n-util';
|
||||||
|
import { loadLocaleAsync } from './i18n/i18n-util.async';
|
||||||
|
|
||||||
class App extends Component {
|
const detectedLocale = detectLocale(localStorageDetector);
|
||||||
notistackRef: RefObject<any> = React.createRef();
|
|
||||||
|
|
||||||
componentDidMount() {
|
const App: FC = () => {
|
||||||
document.title = PROJECT_NAME;
|
const notistackRef: RefObject<any> = createRef();
|
||||||
}
|
|
||||||
|
|
||||||
onClickDismiss = (key: string | number | undefined) => () => {
|
const onClickDismiss = (key: string | number | undefined) => () => {
|
||||||
this.notistackRef.current.closeSnackbar(key);
|
notistackRef.current.closeSnackbar(key);
|
||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
const ColorModeContext = createContext({ toggleColorMode: () => {} });
|
||||||
return (
|
|
||||||
<CustomMuiTheme>
|
const colorMode = useContext(ColorModeContext);
|
||||||
<SnackbarProvider
|
|
||||||
autoHideDuration={3000}
|
const [wasLoaded, setWasLoaded] = useState(false);
|
||||||
maxSnack={3}
|
|
||||||
anchorOrigin={{ vertical: 'bottom', horizontal: 'left' }}
|
useEffect(() => {
|
||||||
ref={this.notistackRef}
|
loadLocaleAsync(detectedLocale).then(() => setWasLoaded(true));
|
||||||
action={(key) => (
|
}, []);
|
||||||
<IconButton onClick={this.onClickDismiss(key)} size="small">
|
|
||||||
<CloseIcon />
|
if (!wasLoaded) return null;
|
||||||
</IconButton>
|
|
||||||
)}
|
return (
|
||||||
>
|
<ColorModeContext.Provider value={colorMode}>
|
||||||
<FeaturesWrapper>
|
<TypesafeI18n locale={detectedLocale}>
|
||||||
<Switch>
|
<CustomTheme>
|
||||||
<Route
|
<SnackbarProvider
|
||||||
exact
|
maxSnack={3}
|
||||||
path="/unauthorized"
|
anchorOrigin={{ vertical: 'bottom', horizontal: 'left' }}
|
||||||
component={unauthorizedRedirect}
|
ref={notistackRef}
|
||||||
/>
|
action={(key) => (
|
||||||
<Route component={AppRouting} />
|
<IconButton onClick={onClickDismiss(key)} size="small">
|
||||||
</Switch>
|
<CloseIcon />
|
||||||
</FeaturesWrapper>
|
</IconButton>
|
||||||
</SnackbarProvider>
|
)}
|
||||||
</CustomMuiTheme>
|
>
|
||||||
);
|
<FeaturesLoader>
|
||||||
}
|
<AppRouting />
|
||||||
}
|
</FeaturesLoader>
|
||||||
|
</SnackbarProvider>
|
||||||
|
</CustomTheme>
|
||||||
|
</TypesafeI18n>
|
||||||
|
</ColorModeContext.Provider>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
export default App;
|
export default App;
|
||||||
|
|||||||
@@ -1,67 +1,77 @@
|
|||||||
import React, { Component } from 'react';
|
import { FC, useContext, useEffect } from 'react';
|
||||||
import { Switch, Redirect } from 'react-router';
|
import { Navigate, Routes, Route, useLocation } from 'react-router-dom';
|
||||||
|
import { useSnackbar, VariantType } from 'notistack';
|
||||||
|
|
||||||
import * as Authentication from './authentication/Authentication';
|
import { useI18nContext } from './i18n/i18n-react';
|
||||||
import AuthenticationWrapper from './authentication/AuthenticationWrapper';
|
|
||||||
import UnauthenticatedRoute from './authentication/UnauthenticatedRoute';
|
import { Authentication, AuthenticationContext } from './contexts/authentication';
|
||||||
import AuthenticatedRoute from './authentication/AuthenticatedRoute';
|
import { FeaturesContext } from './contexts/features';
|
||||||
|
import { RequireAuthenticated, RequireUnauthenticated } from './components';
|
||||||
|
|
||||||
import SignIn from './SignIn';
|
import SignIn from './SignIn';
|
||||||
import ProjectRouting from './project/ProjectRouting';
|
import AuthenticatedRouting from './AuthenticatedRouting';
|
||||||
import NetworkConnection from './network/NetworkConnection';
|
|
||||||
import AccessPoint from './ap/AccessPoint';
|
|
||||||
import NetworkTime from './ntp/NetworkTime';
|
|
||||||
import Security from './security/Security';
|
|
||||||
import System from './system/System';
|
|
||||||
|
|
||||||
import { PROJECT_PATH } from './api';
|
interface SecurityRedirectProps {
|
||||||
import Mqtt from './mqtt/Mqtt';
|
message: string;
|
||||||
import { withFeatures, WithFeaturesProps } from './features/FeaturesContext';
|
variant?: VariantType;
|
||||||
import { Features } from './features/types';
|
signOut?: boolean;
|
||||||
|
|
||||||
export const getDefaultRoute = (features: Features) =>
|
|
||||||
features.project ? `/${PROJECT_PATH}/` : '/network/';
|
|
||||||
class AppRouting extends Component<WithFeaturesProps> {
|
|
||||||
componentDidMount() {
|
|
||||||
Authentication.clearLoginRedirect();
|
|
||||||
}
|
|
||||||
|
|
||||||
render() {
|
|
||||||
const { features } = this.props;
|
|
||||||
return (
|
|
||||||
<AuthenticationWrapper>
|
|
||||||
<Switch>
|
|
||||||
{features.security && (
|
|
||||||
<UnauthenticatedRoute exact path="/" component={SignIn} />
|
|
||||||
)}
|
|
||||||
{features.project && (
|
|
||||||
<AuthenticatedRoute
|
|
||||||
exact
|
|
||||||
path={`/${PROJECT_PATH}/*`}
|
|
||||||
component={ProjectRouting}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
<AuthenticatedRoute
|
|
||||||
exact
|
|
||||||
path="/network/*"
|
|
||||||
component={NetworkConnection}
|
|
||||||
/>
|
|
||||||
<AuthenticatedRoute exact path="/ap/*" component={AccessPoint} />
|
|
||||||
{features.ntp && (
|
|
||||||
<AuthenticatedRoute exact path="/ntp/*" component={NetworkTime} />
|
|
||||||
)}
|
|
||||||
{features.mqtt && (
|
|
||||||
<AuthenticatedRoute exact path="/mqtt/*" component={Mqtt} />
|
|
||||||
)}
|
|
||||||
{features.security && (
|
|
||||||
<AuthenticatedRoute exact path="/security/*" component={Security} />
|
|
||||||
)}
|
|
||||||
<AuthenticatedRoute exact path="/system/*" component={System} />
|
|
||||||
<Redirect to={getDefaultRoute(features)} />
|
|
||||||
</Switch>
|
|
||||||
</AuthenticationWrapper>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default withFeatures(AppRouting);
|
const RootRedirect: FC<SecurityRedirectProps> = ({ message, variant, signOut }) => {
|
||||||
|
const authenticationContext = useContext(AuthenticationContext);
|
||||||
|
const { enqueueSnackbar } = useSnackbar();
|
||||||
|
useEffect(() => {
|
||||||
|
signOut && authenticationContext.signOut(false);
|
||||||
|
enqueueSnackbar(message, { variant });
|
||||||
|
}, [message, variant, signOut, authenticationContext, enqueueSnackbar]);
|
||||||
|
return <Navigate to="/" />;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const RemoveTrailingSlashes = () => {
|
||||||
|
const location = useLocation();
|
||||||
|
return (
|
||||||
|
location.pathname.match('/.*/$') && (
|
||||||
|
<Navigate
|
||||||
|
to={{
|
||||||
|
pathname: location.pathname.replace(/\/+$/, ''),
|
||||||
|
search: location.search
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const AppRouting: FC = () => {
|
||||||
|
const { features } = useContext(FeaturesContext);
|
||||||
|
const { LL } = useI18nContext();
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Authentication>
|
||||||
|
<RemoveTrailingSlashes />
|
||||||
|
<Routes>
|
||||||
|
<Route path="/unauthorized" element={<RootRedirect message={LL.PLEASE_SIGNIN()} signOut />} />
|
||||||
|
<Route path="/fileUpdated" element={<RootRedirect message={LL.UPLOAD_SUCCESSFUL()} variant="success" />} />
|
||||||
|
{features.security && (
|
||||||
|
<Route
|
||||||
|
path="/"
|
||||||
|
element={
|
||||||
|
<RequireUnauthenticated>
|
||||||
|
<SignIn />
|
||||||
|
</RequireUnauthenticated>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
<Route
|
||||||
|
path="/*"
|
||||||
|
element={
|
||||||
|
<RequireAuthenticated>
|
||||||
|
<AuthenticatedRouting />
|
||||||
|
</RequireAuthenticated>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</Routes>
|
||||||
|
</Authentication>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default AppRouting;
|
||||||
|
|||||||
66
interface/src/AuthenticatedRouting.tsx
Normal file
66
interface/src/AuthenticatedRouting.tsx
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
import { FC, useCallback, useContext, useEffect } from 'react';
|
||||||
|
import { Navigate, Routes, Route, useNavigate, useLocation } from 'react-router-dom';
|
||||||
|
import { AxiosError } from 'axios';
|
||||||
|
|
||||||
|
import { FeaturesContext } from './contexts/features';
|
||||||
|
import * as AuthenticationApi from './api/authentication';
|
||||||
|
import { PROJECT_PATH } from './api/env';
|
||||||
|
import { AXIOS } from './api/endpoints';
|
||||||
|
import { Layout, RequireAdmin } from './components';
|
||||||
|
|
||||||
|
import ProjectRouting from './project/ProjectRouting';
|
||||||
|
|
||||||
|
import NetworkConnection from './framework/network/NetworkConnection';
|
||||||
|
import AccessPoint from './framework/ap/AccessPoint';
|
||||||
|
import NetworkTime from './framework/ntp/NetworkTime';
|
||||||
|
import Mqtt from './framework/mqtt/Mqtt';
|
||||||
|
import System from './framework/system/System';
|
||||||
|
import Security from './framework/security/Security';
|
||||||
|
|
||||||
|
const AuthenticatedRouting: FC = () => {
|
||||||
|
const { features } = useContext(FeaturesContext);
|
||||||
|
const location = useLocation();
|
||||||
|
const navigate = useNavigate();
|
||||||
|
|
||||||
|
const handleApiResponseError = useCallback(
|
||||||
|
(error: AxiosError) => {
|
||||||
|
if (error.response && error.response.status === 401) {
|
||||||
|
AuthenticationApi.storeLoginRedirect(location);
|
||||||
|
navigate('/unauthorized');
|
||||||
|
}
|
||||||
|
return Promise.reject(error);
|
||||||
|
},
|
||||||
|
[location, navigate]
|
||||||
|
);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const axiosHandlerId = AXIOS.interceptors.response.use((response) => response, handleApiResponseError);
|
||||||
|
return () => AXIOS.interceptors.response.eject(axiosHandlerId);
|
||||||
|
}, [handleApiResponseError]);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Layout>
|
||||||
|
<Routes>
|
||||||
|
{features.project && <Route path={`/${PROJECT_PATH}/*`} element={<ProjectRouting />} />}
|
||||||
|
<Route path="/network/*" element={<NetworkConnection />} />
|
||||||
|
<Route path="/ap/*" element={<AccessPoint />} />
|
||||||
|
{features.ntp && <Route path="/ntp/*" element={<NetworkTime />} />}
|
||||||
|
{features.mqtt && <Route path="/mqtt/*" element={<Mqtt />} />}
|
||||||
|
{features.security && (
|
||||||
|
<Route
|
||||||
|
path="/security/*"
|
||||||
|
element={
|
||||||
|
<RequireAdmin>
|
||||||
|
<Security />
|
||||||
|
</RequireAdmin>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
<Route path="/system/*" element={<System />} />
|
||||||
|
<Route path="/*" element={<Navigate to={AuthenticationApi.getDefaultRoute(features)} />} />
|
||||||
|
</Routes>
|
||||||
|
</Layout>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default AuthenticatedRouting;
|
||||||
@@ -1,46 +0,0 @@
|
|||||||
import { Component } from 'react';
|
|
||||||
|
|
||||||
import { CssBaseline } from '@material-ui/core';
|
|
||||||
import {
|
|
||||||
MuiThemeProvider,
|
|
||||||
createMuiTheme,
|
|
||||||
StylesProvider
|
|
||||||
} from '@material-ui/core/styles';
|
|
||||||
import { blueGrey, orange, red, green } from '@material-ui/core/colors';
|
|
||||||
|
|
||||||
const theme = createMuiTheme({
|
|
||||||
palette: {
|
|
||||||
type: 'dark',
|
|
||||||
primary: {
|
|
||||||
main: '#33bfff'
|
|
||||||
},
|
|
||||||
secondary: {
|
|
||||||
main: '#3d5afe'
|
|
||||||
},
|
|
||||||
info: {
|
|
||||||
main: blueGrey[500]
|
|
||||||
},
|
|
||||||
warning: {
|
|
||||||
main: orange[500]
|
|
||||||
},
|
|
||||||
error: {
|
|
||||||
main: red[500]
|
|
||||||
},
|
|
||||||
success: {
|
|
||||||
main: green[500]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
export default class CustomMuiTheme extends Component {
|
|
||||||
render() {
|
|
||||||
return (
|
|
||||||
<StylesProvider>
|
|
||||||
<MuiThemeProvider theme={theme}>
|
|
||||||
<CssBaseline />
|
|
||||||
{this.props.children}
|
|
||||||
</MuiThemeProvider>
|
|
||||||
</StylesProvider>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
33
interface/src/CustomTheme.tsx
Normal file
33
interface/src/CustomTheme.tsx
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
import { FC } from 'react';
|
||||||
|
|
||||||
|
import { CssBaseline } from '@mui/material';
|
||||||
|
import { createTheme, responsiveFontSizes, ThemeProvider } from '@mui/material/styles';
|
||||||
|
import { blueGrey, blue } from '@mui/material/colors';
|
||||||
|
|
||||||
|
import { RequiredChildrenProps } from './utils';
|
||||||
|
|
||||||
|
const theme = responsiveFontSizes(
|
||||||
|
createTheme({
|
||||||
|
typography: {
|
||||||
|
fontSize: 13
|
||||||
|
},
|
||||||
|
palette: {
|
||||||
|
mode: 'dark',
|
||||||
|
secondary: {
|
||||||
|
main: blue[500]
|
||||||
|
},
|
||||||
|
info: {
|
||||||
|
main: blueGrey[500]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
|
const CustomTheme: FC<RequiredChildrenProps> = ({ children }) => (
|
||||||
|
<ThemeProvider theme={theme}>
|
||||||
|
<CssBaseline />
|
||||||
|
{children}
|
||||||
|
</ThemeProvider>
|
||||||
|
);
|
||||||
|
|
||||||
|
export default CustomTheme;
|
||||||
@@ -1,165 +1,176 @@
|
|||||||
import React, { Component } from 'react';
|
import { FC, useContext, useState } from 'react';
|
||||||
import { withSnackbar, WithSnackbarProps } from 'notistack';
|
import { ValidateFieldsError } from 'async-validator';
|
||||||
import { TextValidator, ValidatorForm } from 'react-material-ui-form-validator';
|
import { useSnackbar } from 'notistack';
|
||||||
|
|
||||||
import {
|
import { Box, Fab, Paper, Typography, Button } from '@mui/material';
|
||||||
withStyles,
|
import ForwardIcon from '@mui/icons-material/Forward';
|
||||||
createStyles,
|
|
||||||
Theme,
|
|
||||||
WithStyles
|
|
||||||
} from '@material-ui/core/styles';
|
|
||||||
import { Paper, Typography, Fab } from '@material-ui/core';
|
|
||||||
import ForwardIcon from '@material-ui/icons/Forward';
|
|
||||||
|
|
||||||
import {
|
import * as AuthenticationApi from './api/authentication';
|
||||||
withAuthenticationContext,
|
import { PROJECT_NAME } from './api/env';
|
||||||
AuthenticationContextProps
|
import { AuthenticationContext } from './contexts/authentication';
|
||||||
} from './authentication/AuthenticationContext';
|
|
||||||
import { PasswordValidator } from './components';
|
|
||||||
import { PROJECT_NAME, SIGN_IN_ENDPOINT } from './api';
|
|
||||||
|
|
||||||
const styles = (theme: Theme) =>
|
import { extractErrorMessage, onEnterCallback, updateValue } from './utils';
|
||||||
createStyles({
|
import { SignInRequest } from './types';
|
||||||
signInPage: {
|
import { ValidatedTextField } from './components';
|
||||||
display: 'flex',
|
import { SIGN_IN_REQUEST_VALIDATOR, validate } from './validators';
|
||||||
height: '100vh',
|
|
||||||
margin: 'auto',
|
import { I18nContext } from './i18n/i18n-react';
|
||||||
padding: theme.spacing(2),
|
import type { Locales } from './i18n/i18n-types';
|
||||||
justifyContent: 'center',
|
import { loadLocaleAsync } from './i18n/i18n-util.async';
|
||||||
flexDirection: 'column',
|
|
||||||
maxWidth: theme.breakpoints.values.sm
|
import { ReactComponent as NLflag } from './i18n/NL.svg';
|
||||||
},
|
import { ReactComponent as DEflag } from './i18n/DE.svg';
|
||||||
signInPanel: {
|
import { ReactComponent as GBflag } from './i18n/GB.svg';
|
||||||
textAlign: 'center',
|
import { ReactComponent as SVflag } from './i18n/SV.svg';
|
||||||
padding: theme.spacing(2),
|
import { ReactComponent as PLflag } from './i18n/PL.svg';
|
||||||
paddingTop: '200px',
|
import { ReactComponent as NOflag } from './i18n/NO.svg';
|
||||||
backgroundImage: 'url("/app/icon.png")',
|
import { ReactComponent as FRflag } from './i18n/FR.svg';
|
||||||
backgroundRepeat: 'no-repeat',
|
|
||||||
backgroundPosition: '50% ' + theme.spacing(2) + 'px',
|
const SignIn: FC = () => {
|
||||||
backgroundSize: 'auto 150px',
|
const authenticationContext = useContext(AuthenticationContext);
|
||||||
width: '100%'
|
const { enqueueSnackbar } = useSnackbar();
|
||||||
},
|
|
||||||
extendedIcon: {
|
const [signInRequest, setSignInRequest] = useState<SignInRequest>({
|
||||||
marginRight: theme.spacing(0.5)
|
username: '',
|
||||||
},
|
password: ''
|
||||||
button: {
|
|
||||||
marginRight: theme.spacing(2),
|
|
||||||
marginTop: theme.spacing(2)
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
const [processing, setProcessing] = useState<boolean>(false);
|
||||||
|
const [fieldErrors, setFieldErrors] = useState<ValidateFieldsError>();
|
||||||
|
|
||||||
type SignInProps = WithSnackbarProps &
|
const updateLoginRequestValue = updateValue(setSignInRequest);
|
||||||
WithStyles<typeof styles> &
|
|
||||||
AuthenticationContextProps;
|
|
||||||
|
|
||||||
interface SignInState {
|
const validateAndSignIn = async () => {
|
||||||
username: string;
|
setProcessing(true);
|
||||||
password: string;
|
SIGN_IN_REQUEST_VALIDATOR.messages({
|
||||||
processing: boolean;
|
required: LL.IS_REQUIRED('%s')
|
||||||
}
|
});
|
||||||
|
try {
|
||||||
class SignIn extends Component<SignInProps, SignInState> {
|
await validate(SIGN_IN_REQUEST_VALIDATOR, signInRequest);
|
||||||
constructor(props: SignInProps) {
|
signIn();
|
||||||
super(props);
|
} catch (errors: any) {
|
||||||
this.state = {
|
setFieldErrors(errors);
|
||||||
username: '',
|
setProcessing(false);
|
||||||
password: '',
|
}
|
||||||
processing: false
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
updateInputElement = (event: React.ChangeEvent<HTMLInputElement>): void => {
|
|
||||||
const { name, value } = event.currentTarget;
|
|
||||||
this.setState((prevState) => ({
|
|
||||||
...prevState,
|
|
||||||
[name]: value
|
|
||||||
}));
|
|
||||||
};
|
};
|
||||||
|
|
||||||
onSubmit = () => {
|
const signIn = async () => {
|
||||||
const { username, password } = this.state;
|
try {
|
||||||
const { authenticationContext } = this.props;
|
const { data: loginResponse } = await AuthenticationApi.signIn(signInRequest);
|
||||||
this.setState({ processing: true });
|
authenticationContext.signIn(loginResponse.access_token);
|
||||||
fetch(SIGN_IN_ENDPOINT, {
|
} catch (error) {
|
||||||
method: 'POST',
|
if (error.response) {
|
||||||
body: JSON.stringify({ username, password }),
|
if (error.response?.status === 401) {
|
||||||
headers: new Headers({
|
enqueueSnackbar(LL.INVALID_LOGIN(), { variant: 'warning' });
|
||||||
'Content-Type': 'application/json'
|
|
||||||
})
|
|
||||||
})
|
|
||||||
.then((response) => {
|
|
||||||
if (response.status === 200) {
|
|
||||||
return response.json();
|
|
||||||
} else if (response.status === 401) {
|
|
||||||
throw Error('Invalid credentials.');
|
|
||||||
} else {
|
|
||||||
throw Error('Invalid status code: ' + response.status);
|
|
||||||
}
|
}
|
||||||
})
|
} else {
|
||||||
.then((json) => {
|
enqueueSnackbar(extractErrorMessage(error, LL.ERROR()), { variant: 'error' });
|
||||||
authenticationContext.signIn(json.access_token);
|
}
|
||||||
})
|
setProcessing(false);
|
||||||
.catch((error) => {
|
}
|
||||||
this.props.enqueueSnackbar(error.message, {
|
|
||||||
variant: 'warning'
|
|
||||||
});
|
|
||||||
this.setState({ processing: false });
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
const submitOnEnter = onEnterCallback(signIn);
|
||||||
const { username, password, processing } = this.state;
|
|
||||||
const { classes } = this.props;
|
|
||||||
return (
|
|
||||||
<div className={classes.signInPage}>
|
|
||||||
<Paper className={classes.signInPanel}>
|
|
||||||
<Typography variant="h4">{PROJECT_NAME}</Typography>
|
|
||||||
<ValidatorForm onSubmit={this.onSubmit}>
|
|
||||||
<TextValidator
|
|
||||||
disabled={processing}
|
|
||||||
validators={['required']}
|
|
||||||
errorMessages={['Username is required']}
|
|
||||||
name="username"
|
|
||||||
label="Username"
|
|
||||||
fullWidth
|
|
||||||
variant="outlined"
|
|
||||||
value={username}
|
|
||||||
onChange={this.updateInputElement}
|
|
||||||
margin="normal"
|
|
||||||
inputProps={{
|
|
||||||
autoCapitalize: 'none',
|
|
||||||
autoCorrect: 'off'
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
<PasswordValidator
|
|
||||||
disabled={processing}
|
|
||||||
validators={['required']}
|
|
||||||
errorMessages={['Password is required']}
|
|
||||||
name="password"
|
|
||||||
label="Password"
|
|
||||||
fullWidth
|
|
||||||
variant="outlined"
|
|
||||||
value={password}
|
|
||||||
onChange={this.updateInputElement}
|
|
||||||
margin="normal"
|
|
||||||
/>
|
|
||||||
<Fab
|
|
||||||
variant="extended"
|
|
||||||
color="primary"
|
|
||||||
className={classes.button}
|
|
||||||
type="submit"
|
|
||||||
disabled={processing}
|
|
||||||
>
|
|
||||||
<ForwardIcon className={classes.extendedIcon} />
|
|
||||||
Sign In
|
|
||||||
</Fab>
|
|
||||||
</ValidatorForm>
|
|
||||||
</Paper>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export default withAuthenticationContext(
|
const { LL, setLocale, locale } = useContext(I18nContext);
|
||||||
withSnackbar(withStyles(styles)(SignIn))
|
|
||||||
);
|
const selectLocale = async (loc: Locales) => {
|
||||||
|
localStorage.setItem('lang', loc);
|
||||||
|
await loadLocaleAsync(loc);
|
||||||
|
setLocale(loc);
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Box
|
||||||
|
display="flex"
|
||||||
|
height="100vh"
|
||||||
|
margin="auto"
|
||||||
|
padding={2}
|
||||||
|
justifyContent="center"
|
||||||
|
flexDirection="column"
|
||||||
|
maxWidth={(theme) => theme.breakpoints.values.sm}
|
||||||
|
>
|
||||||
|
<Paper
|
||||||
|
sx={(theme) => ({
|
||||||
|
textAlign: 'center',
|
||||||
|
padding: theme.spacing(2),
|
||||||
|
paddingTop: '200px',
|
||||||
|
backgroundImage: 'url("/app/icon.png")',
|
||||||
|
backgroundRepeat: 'no-repeat',
|
||||||
|
backgroundPosition: '50% ' + theme.spacing(2),
|
||||||
|
backgroundSize: 'auto 150px',
|
||||||
|
width: '100%'
|
||||||
|
})}
|
||||||
|
>
|
||||||
|
<Typography variant="h4">{PROJECT_NAME}</Typography>
|
||||||
|
<Box
|
||||||
|
sx={{
|
||||||
|
'& button, & a, & .MuiCard-root': {
|
||||||
|
mt: 0.5,
|
||||||
|
mx: 0.5
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Button size="small" variant={locale === 'en' ? 'contained' : 'outlined'} onClick={() => selectLocale('en')}>
|
||||||
|
<GBflag style={{ width: 24 }} />
|
||||||
|
EN
|
||||||
|
</Button>
|
||||||
|
<Button size="small" variant={locale === 'de' ? 'contained' : 'outlined'} onClick={() => selectLocale('de')}>
|
||||||
|
<DEflag style={{ width: 24 }} />
|
||||||
|
DE
|
||||||
|
</Button>
|
||||||
|
<Button size="small" variant={locale === 'fr' ? 'contained' : 'outlined'} onClick={() => selectLocale('fr')}>
|
||||||
|
<FRflag style={{ width: 24 }} />
|
||||||
|
FR
|
||||||
|
</Button>
|
||||||
|
<Button size="small" variant={locale === 'nl' ? 'contained' : 'outlined'} onClick={() => selectLocale('nl')}>
|
||||||
|
<NLflag style={{ width: 24 }} />
|
||||||
|
NL
|
||||||
|
</Button>
|
||||||
|
<Button size="small" variant={locale === 'no' ? 'contained' : 'outlined'} onClick={() => selectLocale('no')}>
|
||||||
|
<NOflag style={{ width: 24 }} />
|
||||||
|
NO
|
||||||
|
</Button>
|
||||||
|
<Button size="small" variant={locale === 'pl' ? 'contained' : 'outlined'} onClick={() => selectLocale('pl')}>
|
||||||
|
<PLflag style={{ width: 24 }} />
|
||||||
|
PL
|
||||||
|
</Button>
|
||||||
|
<Button size="small" variant={locale === 'sv' ? 'contained' : 'outlined'} onClick={() => selectLocale('sv')}>
|
||||||
|
<SVflag style={{ width: 24 }} />
|
||||||
|
SV
|
||||||
|
</Button>
|
||||||
|
</Box>
|
||||||
|
|
||||||
|
<ValidatedTextField
|
||||||
|
fieldErrors={fieldErrors}
|
||||||
|
disabled={processing}
|
||||||
|
name="username"
|
||||||
|
label={LL.USERNAME(0)}
|
||||||
|
value={signInRequest.username}
|
||||||
|
onChange={updateLoginRequestValue}
|
||||||
|
margin="normal"
|
||||||
|
variant="outlined"
|
||||||
|
fullWidth
|
||||||
|
/>
|
||||||
|
<ValidatedTextField
|
||||||
|
fieldErrors={fieldErrors}
|
||||||
|
disabled={processing}
|
||||||
|
type="password"
|
||||||
|
name="password"
|
||||||
|
label={LL.PASSWORD()}
|
||||||
|
value={signInRequest.password}
|
||||||
|
onChange={updateLoginRequestValue}
|
||||||
|
onKeyDown={submitOnEnter}
|
||||||
|
margin="normal"
|
||||||
|
variant="outlined"
|
||||||
|
fullWidth
|
||||||
|
/>
|
||||||
|
<Fab variant="extended" color="primary" sx={{ mt: 2 }} onClick={validateAndSignIn} disabled={processing}>
|
||||||
|
<ForwardIcon sx={{ mr: 1 }} />
|
||||||
|
{LL.SIGN_IN()}
|
||||||
|
</Fab>
|
||||||
|
</Paper>
|
||||||
|
</Box>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default SignIn;
|
||||||
|
|||||||
@@ -1,8 +0,0 @@
|
|||||||
import { APSettings, APProvisionMode } from './types';
|
|
||||||
|
|
||||||
export const isAPEnabled = ({ provision_mode }: APSettings) => {
|
|
||||||
return (
|
|
||||||
provision_mode === APProvisionMode.AP_MODE_ALWAYS ||
|
|
||||||
provision_mode === APProvisionMode.AP_MODE_DISCONNECTED
|
|
||||||
);
|
|
||||||
};
|
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
import { Component } from 'react';
|
|
||||||
|
|
||||||
import { AP_SETTINGS_ENDPOINT } from '../api';
|
|
||||||
import {
|
|
||||||
restController,
|
|
||||||
RestControllerProps,
|
|
||||||
RestFormLoader,
|
|
||||||
SectionContent
|
|
||||||
} from '../components';
|
|
||||||
|
|
||||||
import APSettingsForm from './APSettingsForm';
|
|
||||||
import { APSettings } from './types';
|
|
||||||
|
|
||||||
type APSettingsControllerProps = RestControllerProps<APSettings>;
|
|
||||||
|
|
||||||
class APSettingsController extends Component<APSettingsControllerProps> {
|
|
||||||
componentDidMount() {
|
|
||||||
this.props.loadData();
|
|
||||||
}
|
|
||||||
|
|
||||||
render() {
|
|
||||||
return (
|
|
||||||
<SectionContent title="Access Point Settings" titleGutter>
|
|
||||||
<RestFormLoader
|
|
||||||
{...this.props}
|
|
||||||
render={(formProps) => <APSettingsForm {...formProps} />}
|
|
||||||
/>
|
|
||||||
</SectionContent>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export default restController(AP_SETTINGS_ENDPOINT, APSettingsController);
|
|
||||||
@@ -1,134 +0,0 @@
|
|||||||
import React, { Fragment } from 'react';
|
|
||||||
import {
|
|
||||||
TextValidator,
|
|
||||||
ValidatorForm,
|
|
||||||
SelectValidator
|
|
||||||
} from 'react-material-ui-form-validator';
|
|
||||||
|
|
||||||
import MenuItem from '@material-ui/core/MenuItem';
|
|
||||||
import SaveIcon from '@material-ui/icons/Save';
|
|
||||||
|
|
||||||
import {
|
|
||||||
PasswordValidator,
|
|
||||||
RestFormProps,
|
|
||||||
FormActions,
|
|
||||||
FormButton
|
|
||||||
} from '../components';
|
|
||||||
|
|
||||||
import { isAPEnabled } from './APModes';
|
|
||||||
import { APSettings, APProvisionMode } from './types';
|
|
||||||
import { isIP } from '../validators';
|
|
||||||
|
|
||||||
type APSettingsFormProps = RestFormProps<APSettings>;
|
|
||||||
|
|
||||||
class APSettingsForm extends React.Component<APSettingsFormProps> {
|
|
||||||
componentDidMount() {
|
|
||||||
ValidatorForm.addValidationRule('isIP', isIP);
|
|
||||||
}
|
|
||||||
|
|
||||||
render() {
|
|
||||||
const { data, handleValueChange, saveData } = this.props;
|
|
||||||
return (
|
|
||||||
<ValidatorForm onSubmit={saveData} ref="APSettingsForm">
|
|
||||||
<SelectValidator
|
|
||||||
name="provision_mode"
|
|
||||||
label="Provide Access Point…"
|
|
||||||
value={data.provision_mode}
|
|
||||||
fullWidth
|
|
||||||
variant="outlined"
|
|
||||||
onChange={handleValueChange('provision_mode')}
|
|
||||||
margin="normal"
|
|
||||||
>
|
|
||||||
<MenuItem value={APProvisionMode.AP_MODE_ALWAYS}>Always</MenuItem>
|
|
||||||
<MenuItem value={APProvisionMode.AP_MODE_DISCONNECTED}>
|
|
||||||
When Network Disconnected
|
|
||||||
</MenuItem>
|
|
||||||
<MenuItem value={APProvisionMode.AP_NEVER}>Never</MenuItem>
|
|
||||||
</SelectValidator>
|
|
||||||
{isAPEnabled(data) && (
|
|
||||||
<Fragment>
|
|
||||||
<TextValidator
|
|
||||||
validators={['required', 'matchRegexp:^.{1,32}$']}
|
|
||||||
errorMessages={[
|
|
||||||
'Access Point SSID is required',
|
|
||||||
'Access Point SSID must be 32 characters or less'
|
|
||||||
]}
|
|
||||||
name="ssid"
|
|
||||||
label="Access Point SSID"
|
|
||||||
fullWidth
|
|
||||||
variant="outlined"
|
|
||||||
value={data.ssid}
|
|
||||||
onChange={handleValueChange('ssid')}
|
|
||||||
margin="normal"
|
|
||||||
/>
|
|
||||||
<PasswordValidator
|
|
||||||
validators={['required', 'matchRegexp:^.{8,64}$']}
|
|
||||||
errorMessages={[
|
|
||||||
'Access Point Password is required',
|
|
||||||
'Access Point Password must be 8-64 characters'
|
|
||||||
]}
|
|
||||||
name="password"
|
|
||||||
label="Access Point Password"
|
|
||||||
fullWidth
|
|
||||||
variant="outlined"
|
|
||||||
value={data.password}
|
|
||||||
onChange={handleValueChange('password')}
|
|
||||||
margin="normal"
|
|
||||||
/>
|
|
||||||
<TextValidator
|
|
||||||
validators={['required', 'isIP']}
|
|
||||||
errorMessages={['Local IP is required', 'Must be an IP address']}
|
|
||||||
name="local_ip"
|
|
||||||
label="Local IP"
|
|
||||||
fullWidth
|
|
||||||
variant="outlined"
|
|
||||||
value={data.local_ip}
|
|
||||||
onChange={handleValueChange('local_ip')}
|
|
||||||
margin="normal"
|
|
||||||
/>
|
|
||||||
<TextValidator
|
|
||||||
validators={['required', 'isIP']}
|
|
||||||
errorMessages={[
|
|
||||||
'Gateway IP is required',
|
|
||||||
'Must be an IP address'
|
|
||||||
]}
|
|
||||||
name="gateway_ip"
|
|
||||||
label="Gateway"
|
|
||||||
fullWidth
|
|
||||||
variant="outlined"
|
|
||||||
value={data.gateway_ip}
|
|
||||||
onChange={handleValueChange('gateway_ip')}
|
|
||||||
margin="normal"
|
|
||||||
/>
|
|
||||||
<TextValidator
|
|
||||||
validators={['required', 'isIP']}
|
|
||||||
errorMessages={[
|
|
||||||
'Subnet mask is required',
|
|
||||||
'Must be an IP address'
|
|
||||||
]}
|
|
||||||
name="subnet_mask"
|
|
||||||
label="Subnet"
|
|
||||||
fullWidth
|
|
||||||
variant="outlined"
|
|
||||||
value={data.subnet_mask}
|
|
||||||
onChange={handleValueChange('subnet_mask')}
|
|
||||||
margin="normal"
|
|
||||||
/>
|
|
||||||
</Fragment>
|
|
||||||
)}
|
|
||||||
<FormActions>
|
|
||||||
<FormButton
|
|
||||||
startIcon={<SaveIcon />}
|
|
||||||
variant="contained"
|
|
||||||
color="primary"
|
|
||||||
type="submit"
|
|
||||||
>
|
|
||||||
Save
|
|
||||||
</FormButton>
|
|
||||||
</FormActions>
|
|
||||||
</ValidatorForm>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export default APSettingsForm;
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
import { Theme } from '@material-ui/core';
|
|
||||||
import { APStatus, APNetworkStatus } from './types';
|
|
||||||
|
|
||||||
export const apStatusHighlight = ({ status }: APStatus, theme: Theme) => {
|
|
||||||
switch (status) {
|
|
||||||
case APNetworkStatus.ACTIVE:
|
|
||||||
return theme.palette.success.main;
|
|
||||||
case APNetworkStatus.INACTIVE:
|
|
||||||
return theme.palette.info.main;
|
|
||||||
case APNetworkStatus.LINGERING:
|
|
||||||
return theme.palette.warning.main;
|
|
||||||
default:
|
|
||||||
return theme.palette.warning.main;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
export const apStatus = ({ status }: APStatus) => {
|
|
||||||
switch (status) {
|
|
||||||
case APNetworkStatus.ACTIVE:
|
|
||||||
return 'Active';
|
|
||||||
case APNetworkStatus.INACTIVE:
|
|
||||||
return 'Inactive';
|
|
||||||
case APNetworkStatus.LINGERING:
|
|
||||||
return 'Lingering until idle';
|
|
||||||
default:
|
|
||||||
return 'Unknown';
|
|
||||||
}
|
|
||||||
};
|
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
import { Component } from 'react';
|
|
||||||
|
|
||||||
import {
|
|
||||||
restController,
|
|
||||||
RestControllerProps,
|
|
||||||
RestFormLoader,
|
|
||||||
SectionContent
|
|
||||||
} from '../components';
|
|
||||||
import { AP_STATUS_ENDPOINT } from '../api';
|
|
||||||
|
|
||||||
import APStatusForm from './APStatusForm';
|
|
||||||
import { APStatus } from './types';
|
|
||||||
|
|
||||||
type APStatusControllerProps = RestControllerProps<APStatus>;
|
|
||||||
|
|
||||||
class APStatusController extends Component<APStatusControllerProps> {
|
|
||||||
componentDidMount() {
|
|
||||||
this.props.loadData();
|
|
||||||
}
|
|
||||||
|
|
||||||
render() {
|
|
||||||
return (
|
|
||||||
<SectionContent title="Access Point Status">
|
|
||||||
<RestFormLoader
|
|
||||||
{...this.props}
|
|
||||||
render={(formProps) => <APStatusForm {...formProps} />}
|
|
||||||
/>
|
|
||||||
</SectionContent>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export default restController(AP_STATUS_ENDPOINT, APStatusController);
|
|
||||||
@@ -1,91 +0,0 @@
|
|||||||
import React, { Component, Fragment } from 'react';
|
|
||||||
|
|
||||||
import { WithTheme, withTheme } from '@material-ui/core/styles';
|
|
||||||
import {
|
|
||||||
Avatar,
|
|
||||||
Divider,
|
|
||||||
List,
|
|
||||||
ListItem,
|
|
||||||
ListItemAvatar,
|
|
||||||
ListItemText
|
|
||||||
} from '@material-ui/core';
|
|
||||||
|
|
||||||
import SettingsInputAntennaIcon from '@material-ui/icons/SettingsInputAntenna';
|
|
||||||
import DeviceHubIcon from '@material-ui/icons/DeviceHub';
|
|
||||||
import ComputerIcon from '@material-ui/icons/Computer';
|
|
||||||
import RefreshIcon from '@material-ui/icons/Refresh';
|
|
||||||
|
|
||||||
import {
|
|
||||||
RestFormProps,
|
|
||||||
FormActions,
|
|
||||||
FormButton,
|
|
||||||
HighlightAvatar
|
|
||||||
} from '../components';
|
|
||||||
import { apStatusHighlight, apStatus } from './APStatus';
|
|
||||||
import { APStatus } from './types';
|
|
||||||
|
|
||||||
type APStatusFormProps = RestFormProps<APStatus> & WithTheme;
|
|
||||||
|
|
||||||
class APStatusForm extends Component<APStatusFormProps> {
|
|
||||||
createListItems() {
|
|
||||||
const { data, theme } = this.props;
|
|
||||||
return (
|
|
||||||
<Fragment>
|
|
||||||
<ListItem>
|
|
||||||
<ListItemAvatar>
|
|
||||||
<HighlightAvatar color={apStatusHighlight(data, theme)}>
|
|
||||||
<SettingsInputAntennaIcon />
|
|
||||||
</HighlightAvatar>
|
|
||||||
</ListItemAvatar>
|
|
||||||
<ListItemText primary="Status" secondary={apStatus(data)} />
|
|
||||||
</ListItem>
|
|
||||||
<Divider variant="inset" component="li" />
|
|
||||||
<ListItem>
|
|
||||||
<ListItemAvatar>
|
|
||||||
<Avatar>IP</Avatar>
|
|
||||||
</ListItemAvatar>
|
|
||||||
<ListItemText primary="IP Address" secondary={data.ip_address} />
|
|
||||||
</ListItem>
|
|
||||||
<Divider variant="inset" component="li" />
|
|
||||||
<ListItem>
|
|
||||||
<ListItemAvatar>
|
|
||||||
<Avatar>
|
|
||||||
<DeviceHubIcon />
|
|
||||||
</Avatar>
|
|
||||||
</ListItemAvatar>
|
|
||||||
<ListItemText primary="MAC Address" secondary={data.mac_address} />
|
|
||||||
</ListItem>
|
|
||||||
<Divider variant="inset" component="li" />
|
|
||||||
<ListItem>
|
|
||||||
<ListItemAvatar>
|
|
||||||
<Avatar>
|
|
||||||
<ComputerIcon />
|
|
||||||
</Avatar>
|
|
||||||
</ListItemAvatar>
|
|
||||||
<ListItemText primary="AP Clients" secondary={data.station_num} />
|
|
||||||
</ListItem>
|
|
||||||
<Divider variant="inset" component="li" />
|
|
||||||
</Fragment>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
render() {
|
|
||||||
return (
|
|
||||||
<Fragment>
|
|
||||||
<List>{this.createListItems()}</List>
|
|
||||||
<FormActions>
|
|
||||||
<FormButton
|
|
||||||
startIcon={<RefreshIcon />}
|
|
||||||
variant="contained"
|
|
||||||
color="secondary"
|
|
||||||
onClick={this.props.loadData}
|
|
||||||
>
|
|
||||||
Refresh
|
|
||||||
</FormButton>
|
|
||||||
</FormActions>
|
|
||||||
</Fragment>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export default withTheme(APStatusForm);
|
|
||||||
@@ -1,57 +0,0 @@
|
|||||||
import { Component } from 'react';
|
|
||||||
import { Redirect, Switch, RouteComponentProps } from 'react-router-dom';
|
|
||||||
|
|
||||||
import { Tabs, Tab } from '@material-ui/core';
|
|
||||||
|
|
||||||
import {
|
|
||||||
AuthenticatedContextProps,
|
|
||||||
withAuthenticatedContext,
|
|
||||||
AuthenticatedRoute
|
|
||||||
} from '../authentication';
|
|
||||||
import { MenuAppBar } from '../components';
|
|
||||||
|
|
||||||
import APSettingsController from './APSettingsController';
|
|
||||||
import APStatusController from './APStatusController';
|
|
||||||
|
|
||||||
type AccessPointProps = AuthenticatedContextProps & RouteComponentProps;
|
|
||||||
|
|
||||||
class AccessPoint extends Component<AccessPointProps> {
|
|
||||||
handleTabChange = (path: string) => {
|
|
||||||
this.props.history.push(path);
|
|
||||||
};
|
|
||||||
|
|
||||||
render() {
|
|
||||||
const { authenticatedContext } = this.props;
|
|
||||||
return (
|
|
||||||
<MenuAppBar sectionTitle="Access Point">
|
|
||||||
<Tabs
|
|
||||||
value={this.props.match.url}
|
|
||||||
onChange={(e, path) => this.handleTabChange(path)}
|
|
||||||
variant="fullWidth"
|
|
||||||
>
|
|
||||||
<Tab value="/ap/status" label="Access Point Status" />
|
|
||||||
<Tab
|
|
||||||
value="/ap/settings"
|
|
||||||
label="Access Point Settings"
|
|
||||||
disabled={!authenticatedContext.me.admin}
|
|
||||||
/>
|
|
||||||
</Tabs>
|
|
||||||
<Switch>
|
|
||||||
<AuthenticatedRoute
|
|
||||||
exact
|
|
||||||
path="/ap/status"
|
|
||||||
component={APStatusController}
|
|
||||||
/>
|
|
||||||
<AuthenticatedRoute
|
|
||||||
exact
|
|
||||||
path="/ap/settings"
|
|
||||||
component={APSettingsController}
|
|
||||||
/>
|
|
||||||
<Redirect to="/ap/status" />
|
|
||||||
</Switch>
|
|
||||||
</MenuAppBar>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export default withAuthenticatedContext(AccessPoint);
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
import { ENDPOINT_ROOT } from './Env';
|
|
||||||
|
|
||||||
export const FEATURES_ENDPOINT = ENDPOINT_ROOT + 'features';
|
|
||||||
export const NTP_STATUS_ENDPOINT = ENDPOINT_ROOT + 'ntpStatus';
|
|
||||||
export const NTP_SETTINGS_ENDPOINT = ENDPOINT_ROOT + 'ntpSettings';
|
|
||||||
export const TIME_ENDPOINT = ENDPOINT_ROOT + 'time';
|
|
||||||
export const AP_SETTINGS_ENDPOINT = ENDPOINT_ROOT + 'apSettings';
|
|
||||||
export const AP_STATUS_ENDPOINT = ENDPOINT_ROOT + 'apStatus';
|
|
||||||
export const SCAN_NETWORKS_ENDPOINT = ENDPOINT_ROOT + 'scanNetworks';
|
|
||||||
export const LIST_NETWORKS_ENDPOINT = ENDPOINT_ROOT + 'listNetworks';
|
|
||||||
export const NETWORK_SETTINGS_ENDPOINT = ENDPOINT_ROOT + 'networkSettings';
|
|
||||||
export const NETWORK_STATUS_ENDPOINT = ENDPOINT_ROOT + 'networkStatus';
|
|
||||||
export const OTA_SETTINGS_ENDPOINT = ENDPOINT_ROOT + 'otaSettings';
|
|
||||||
export const UPLOAD_FIRMWARE_ENDPOINT = ENDPOINT_ROOT + 'uploadFirmware';
|
|
||||||
export const MQTT_SETTINGS_ENDPOINT = ENDPOINT_ROOT + 'mqttSettings';
|
|
||||||
export const MQTT_STATUS_ENDPOINT = ENDPOINT_ROOT + 'mqttStatus';
|
|
||||||
export const SYSTEM_STATUS_ENDPOINT = ENDPOINT_ROOT + 'systemStatus';
|
|
||||||
export const SIGN_IN_ENDPOINT = ENDPOINT_ROOT + 'signIn';
|
|
||||||
export const VERIFY_AUTHORIZATION_ENDPOINT =
|
|
||||||
ENDPOINT_ROOT + 'verifyAuthorization';
|
|
||||||
export const SECURITY_SETTINGS_ENDPOINT = ENDPOINT_ROOT + 'securitySettings';
|
|
||||||
export const GENERATE_TOKEN_ENDPOINT = ENDPOINT_ROOT + 'generateToken';
|
|
||||||
export const RESTART_ENDPOINT = ENDPOINT_ROOT + 'restart';
|
|
||||||
export const FACTORY_RESET_ENDPOINT = ENDPOINT_ROOT + 'factoryReset';
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
export const PROJECT_NAME = process.env.REACT_APP_PROJECT_NAME!;
|
|
||||||
export const PROJECT_PATH = process.env.REACT_APP_PROJECT_PATH!;
|
|
||||||
|
|
||||||
export const ENDPOINT_ROOT = calculateEndpointRoot('/rest/');
|
|
||||||
export const WEB_SOCKET_ROOT = calculateWebSocketRoot('/ws/');
|
|
||||||
export const EVENT_SOURCE_ROOT = calculateEndpointRoot('/es/');
|
|
||||||
|
|
||||||
function calculateEndpointRoot(endpointPath: string) {
|
|
||||||
const httpRoot = process.env.REACT_APP_HTTP_ROOT;
|
|
||||||
if (httpRoot) {
|
|
||||||
return httpRoot + endpointPath;
|
|
||||||
}
|
|
||||||
const location = window.location;
|
|
||||||
return location.protocol + '//' + location.host + endpointPath;
|
|
||||||
}
|
|
||||||
|
|
||||||
function calculateWebSocketRoot(webSocketPath: string) {
|
|
||||||
const webSocketRoot = process.env.REACT_APP_WEB_SOCKET_ROOT;
|
|
||||||
if (webSocketRoot) {
|
|
||||||
return webSocketRoot + webSocketPath;
|
|
||||||
}
|
|
||||||
const location = window.location;
|
|
||||||
const webProtocol = location.protocol === 'https:' ? 'wss:' : 'ws:';
|
|
||||||
return webProtocol + '//' + location.host + webSocketPath;
|
|
||||||
}
|
|
||||||
16
interface/src/api/ap.ts
Normal file
16
interface/src/api/ap.ts
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
import { AxiosPromise } from 'axios';
|
||||||
|
|
||||||
|
import { APSettings, APStatus } from '../types';
|
||||||
|
import { AXIOS } from './endpoints';
|
||||||
|
|
||||||
|
export function readAPStatus(): AxiosPromise<APStatus> {
|
||||||
|
return AXIOS.get('/apStatus');
|
||||||
|
}
|
||||||
|
|
||||||
|
export function readAPSettings(): AxiosPromise<APSettings> {
|
||||||
|
return AXIOS.get('/apSettings');
|
||||||
|
}
|
||||||
|
|
||||||
|
export function updateAPSettings(apSettings: APSettings): AxiosPromise<APSettings> {
|
||||||
|
return AXIOS.post('/apSettings', apSettings);
|
||||||
|
}
|
||||||
64
interface/src/api/authentication.ts
Normal file
64
interface/src/api/authentication.ts
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
import { AxiosPromise } from 'axios';
|
||||||
|
import * as H from 'history';
|
||||||
|
import jwtDecode from 'jwt-decode';
|
||||||
|
import { Path } from 'react-router-dom';
|
||||||
|
|
||||||
|
import { Features, Me, SignInRequest, SignInResponse } from '../types';
|
||||||
|
|
||||||
|
import { ACCESS_TOKEN, AXIOS } from './endpoints';
|
||||||
|
import { PROJECT_PATH } from './env';
|
||||||
|
|
||||||
|
export const SIGN_IN_PATHNAME = 'loginPathname';
|
||||||
|
export const SIGN_IN_SEARCH = 'loginSearch';
|
||||||
|
|
||||||
|
export const getDefaultRoute = (features: Features) => (features.project ? `/${PROJECT_PATH}` : '/wifi');
|
||||||
|
|
||||||
|
export function verifyAuthorization(): AxiosPromise<void> {
|
||||||
|
return AXIOS.get('/verifyAuthorization');
|
||||||
|
}
|
||||||
|
|
||||||
|
export function signIn(request: SignInRequest): AxiosPromise<SignInResponse> {
|
||||||
|
return AXIOS.post('/signIn', request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fallback to sessionStorage if localStorage is absent. WebView may not have local storage enabled.
|
||||||
|
*/
|
||||||
|
export function getStorage() {
|
||||||
|
return localStorage || sessionStorage;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function storeLoginRedirect(location?: H.Location) {
|
||||||
|
if (location) {
|
||||||
|
getStorage().setItem(SIGN_IN_PATHNAME, location.pathname);
|
||||||
|
getStorage().setItem(SIGN_IN_SEARCH, location.search);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export function clearLoginRedirect() {
|
||||||
|
getStorage().removeItem(SIGN_IN_PATHNAME);
|
||||||
|
getStorage().removeItem(SIGN_IN_SEARCH);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function fetchLoginRedirect(features: Features): Partial<Path> {
|
||||||
|
const signInPathname = getStorage().getItem(SIGN_IN_PATHNAME);
|
||||||
|
const signInSearch = getStorage().getItem(SIGN_IN_SEARCH);
|
||||||
|
clearLoginRedirect();
|
||||||
|
return {
|
||||||
|
pathname: signInPathname || getDefaultRoute(features),
|
||||||
|
search: (signInPathname && signInSearch) || undefined
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export const clearAccessToken = () => localStorage.removeItem(ACCESS_TOKEN);
|
||||||
|
export const decodeMeJWT = (accessToken: string): Me => jwtDecode(accessToken) as Me;
|
||||||
|
|
||||||
|
export function addAccessTokenParameter(url: string) {
|
||||||
|
const accessToken = getStorage().getItem(ACCESS_TOKEN);
|
||||||
|
if (!accessToken) {
|
||||||
|
return url;
|
||||||
|
}
|
||||||
|
const parsedUrl = new URL(url);
|
||||||
|
parsedUrl.searchParams.set(ACCESS_TOKEN, accessToken);
|
||||||
|
return parsedUrl.toString();
|
||||||
|
}
|
||||||
105
interface/src/api/endpoints.ts
Normal file
105
interface/src/api/endpoints.ts
Normal file
@@ -0,0 +1,105 @@
|
|||||||
|
import axios, { AxiosPromise, CancelToken, AxiosProgressEvent } from 'axios';
|
||||||
|
|
||||||
|
import { decode } from '@msgpack/msgpack';
|
||||||
|
|
||||||
|
export const WS_BASE_URL = '/ws/';
|
||||||
|
export const API_BASE_URL = '/rest/';
|
||||||
|
export const ES_BASE_URL = '/es/';
|
||||||
|
export const EMSESP_API_BASE_URL = '/api/';
|
||||||
|
export const ACCESS_TOKEN = 'access_token';
|
||||||
|
export const WEB_SOCKET_ROOT = calculateWebSocketRoot(WS_BASE_URL);
|
||||||
|
export const EVENT_SOURCE_ROOT = calculateEventSourceRoot(ES_BASE_URL);
|
||||||
|
|
||||||
|
export const AXIOS = axios.create({
|
||||||
|
baseURL: API_BASE_URL,
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json'
|
||||||
|
},
|
||||||
|
transformRequest: [
|
||||||
|
(data, headers) => {
|
||||||
|
if (headers) {
|
||||||
|
if (localStorage.getItem(ACCESS_TOKEN)) {
|
||||||
|
headers.Authorization = 'Bearer ' + localStorage.getItem(ACCESS_TOKEN);
|
||||||
|
}
|
||||||
|
if (headers['Content-Type'] !== 'application/json') {
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return JSON.stringify(data);
|
||||||
|
}
|
||||||
|
]
|
||||||
|
});
|
||||||
|
|
||||||
|
export const AXIOS_API = axios.create({
|
||||||
|
baseURL: EMSESP_API_BASE_URL,
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json'
|
||||||
|
},
|
||||||
|
transformRequest: [
|
||||||
|
(data, headers) => {
|
||||||
|
if (headers) {
|
||||||
|
if (localStorage.getItem(ACCESS_TOKEN)) {
|
||||||
|
headers.Authorization = 'Bearer ' + localStorage.getItem(ACCESS_TOKEN);
|
||||||
|
}
|
||||||
|
if (headers['Content-Type'] !== 'application/json') {
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return JSON.stringify(data);
|
||||||
|
}
|
||||||
|
]
|
||||||
|
});
|
||||||
|
|
||||||
|
export const AXIOS_BIN = axios.create({
|
||||||
|
baseURL: API_BASE_URL,
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json'
|
||||||
|
},
|
||||||
|
responseType: 'arraybuffer',
|
||||||
|
transformRequest: [
|
||||||
|
(data, headers) => {
|
||||||
|
if (headers) {
|
||||||
|
if (localStorage.getItem(ACCESS_TOKEN)) {
|
||||||
|
headers.Authorization = 'Bearer ' + localStorage.getItem(ACCESS_TOKEN);
|
||||||
|
}
|
||||||
|
if (headers['Content-Type'] !== 'application/json') {
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return JSON.stringify(data);
|
||||||
|
}
|
||||||
|
],
|
||||||
|
transformResponse: [
|
||||||
|
(data) => {
|
||||||
|
return decode(data);
|
||||||
|
}
|
||||||
|
]
|
||||||
|
});
|
||||||
|
|
||||||
|
function calculateWebSocketRoot(webSocketPath: string) {
|
||||||
|
const location = window.location;
|
||||||
|
const webProtocol = location.protocol === 'https:' ? 'wss:' : 'ws:';
|
||||||
|
return webProtocol + '//' + location.host + webSocketPath;
|
||||||
|
}
|
||||||
|
|
||||||
|
function calculateEventSourceRoot(endpointPath: string) {
|
||||||
|
const location = window.location;
|
||||||
|
return location.protocol + '//' + location.host + endpointPath;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface FileUploadConfig {
|
||||||
|
cancelToken?: CancelToken;
|
||||||
|
onUploadProgress?: (progressEvent: AxiosProgressEvent) => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const startUploadFile = (url: string, file: File, config?: FileUploadConfig): AxiosPromise<void> => {
|
||||||
|
const formData = new FormData();
|
||||||
|
formData.append('file', file);
|
||||||
|
|
||||||
|
return AXIOS.post(url, formData, {
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'multipart/form-data'
|
||||||
|
},
|
||||||
|
...(config || {})
|
||||||
|
});
|
||||||
|
};
|
||||||
2
interface/src/api/env.ts
Normal file
2
interface/src/api/env.ts
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
export const PROJECT_NAME = process.env.REACT_APP_PROJECT_NAME || 'EMS-ESP';
|
||||||
|
export const PROJECT_PATH = process.env.REACT_APP_PROJECT_PATH || 'project';
|
||||||
9
interface/src/api/features.ts
Normal file
9
interface/src/api/features.ts
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
import { AxiosPromise } from 'axios';
|
||||||
|
|
||||||
|
import { Features } from '../types';
|
||||||
|
|
||||||
|
import { AXIOS } from './endpoints';
|
||||||
|
|
||||||
|
export function readFeatures(): AxiosPromise<Features> {
|
||||||
|
return AXIOS.get('/features');
|
||||||
|
}
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
export * from './Env';
|
|
||||||
export * from './Endpoints';
|
|
||||||
16
interface/src/api/mqtt.ts
Normal file
16
interface/src/api/mqtt.ts
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
import { AxiosPromise } from 'axios';
|
||||||
|
import { MqttSettings, MqttStatus } from '../types';
|
||||||
|
|
||||||
|
import { AXIOS } from './endpoints';
|
||||||
|
|
||||||
|
export function readMqttStatus(): AxiosPromise<MqttStatus> {
|
||||||
|
return AXIOS.get('/mqttStatus');
|
||||||
|
}
|
||||||
|
|
||||||
|
export function readMqttSettings(): AxiosPromise<MqttSettings> {
|
||||||
|
return AXIOS.get('/mqttSettings');
|
||||||
|
}
|
||||||
|
|
||||||
|
export function updateMqttSettings(mqttSettings: MqttSettings): AxiosPromise<MqttSettings> {
|
||||||
|
return AXIOS.post('/mqttSettings', mqttSettings);
|
||||||
|
}
|
||||||
25
interface/src/api/network.ts
Normal file
25
interface/src/api/network.ts
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
import { AxiosPromise } from 'axios';
|
||||||
|
|
||||||
|
import { WiFiNetworkList, NetworkSettings, NetworkStatus } from '../types';
|
||||||
|
|
||||||
|
import { AXIOS } from './endpoints';
|
||||||
|
|
||||||
|
export function readNetworkStatus(): AxiosPromise<NetworkStatus> {
|
||||||
|
return AXIOS.get('/networkStatus');
|
||||||
|
}
|
||||||
|
|
||||||
|
export function scanNetworks(): AxiosPromise<void> {
|
||||||
|
return AXIOS.get('/scanNetworks');
|
||||||
|
}
|
||||||
|
|
||||||
|
export function listNetworks(): AxiosPromise<WiFiNetworkList> {
|
||||||
|
return AXIOS.get('/listNetworks');
|
||||||
|
}
|
||||||
|
|
||||||
|
export function readNetworkSettings(): AxiosPromise<NetworkSettings> {
|
||||||
|
return AXIOS.get('/networkSettings');
|
||||||
|
}
|
||||||
|
|
||||||
|
export function updateNetworkSettings(wifiSettings: NetworkSettings): AxiosPromise<NetworkSettings> {
|
||||||
|
return AXIOS.post('/networkSettings', wifiSettings);
|
||||||
|
}
|
||||||
20
interface/src/api/ntp.ts
Normal file
20
interface/src/api/ntp.ts
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
import { AxiosPromise } from 'axios';
|
||||||
|
import { NTPSettings, NTPStatus, Time } from '../types';
|
||||||
|
|
||||||
|
import { AXIOS } from './endpoints';
|
||||||
|
|
||||||
|
export function readNTPStatus(): AxiosPromise<NTPStatus> {
|
||||||
|
return AXIOS.get('/ntpStatus');
|
||||||
|
}
|
||||||
|
|
||||||
|
export function readNTPSettings(): AxiosPromise<NTPSettings> {
|
||||||
|
return AXIOS.get('/ntpSettings');
|
||||||
|
}
|
||||||
|
|
||||||
|
export function updateNTPSettings(ntpSettings: NTPSettings): AxiosPromise<NTPSettings> {
|
||||||
|
return AXIOS.post('/ntpSettings', ntpSettings);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function updateTime(time: Time): AxiosPromise<Time> {
|
||||||
|
return AXIOS.post('/time', time);
|
||||||
|
}
|
||||||
17
interface/src/api/security.ts
Normal file
17
interface/src/api/security.ts
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
import { AxiosPromise } from 'axios';
|
||||||
|
|
||||||
|
import { SecuritySettings, Token } from '../types';
|
||||||
|
|
||||||
|
import { AXIOS } from './endpoints';
|
||||||
|
|
||||||
|
export function readSecuritySettings(): AxiosPromise<SecuritySettings> {
|
||||||
|
return AXIOS.get('/securitySettings');
|
||||||
|
}
|
||||||
|
|
||||||
|
export function updateSecuritySettings(securitySettings: SecuritySettings): AxiosPromise<SecuritySettings> {
|
||||||
|
return AXIOS.post('/securitySettings', securitySettings);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function generateToken(username?: string): AxiosPromise<Token> {
|
||||||
|
return AXIOS.get('/generateToken', { params: { username } });
|
||||||
|
}
|
||||||
44
interface/src/api/system.ts
Normal file
44
interface/src/api/system.ts
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
import { AxiosPromise } from 'axios';
|
||||||
|
|
||||||
|
import { OTASettings, SystemStatus, LogSettings, LogEntries } from '../types';
|
||||||
|
|
||||||
|
import { AXIOS, AXIOS_BIN, FileUploadConfig, startUploadFile } from './endpoints';
|
||||||
|
|
||||||
|
export function readSystemStatus(timeout?: number): AxiosPromise<SystemStatus> {
|
||||||
|
return AXIOS.get('/systemStatus', { timeout });
|
||||||
|
}
|
||||||
|
|
||||||
|
export function restart(): AxiosPromise<void> {
|
||||||
|
return AXIOS.post('/restart');
|
||||||
|
}
|
||||||
|
|
||||||
|
export function partition(): AxiosPromise<void> {
|
||||||
|
return AXIOS.post('/partition');
|
||||||
|
}
|
||||||
|
|
||||||
|
export function factoryReset(): AxiosPromise<void> {
|
||||||
|
return AXIOS.post('/factoryReset');
|
||||||
|
}
|
||||||
|
|
||||||
|
export function readOTASettings(): AxiosPromise<OTASettings> {
|
||||||
|
return AXIOS.get('/otaSettings');
|
||||||
|
}
|
||||||
|
|
||||||
|
export function updateOTASettings(otaSettings: OTASettings): AxiosPromise<OTASettings> {
|
||||||
|
return AXIOS.post('/otaSettings', otaSettings);
|
||||||
|
}
|
||||||
|
|
||||||
|
export const uploadFile = (file: File, config?: FileUploadConfig): AxiosPromise<void> =>
|
||||||
|
startUploadFile('/uploadFile', file, config);
|
||||||
|
|
||||||
|
export function readLogSettings(): AxiosPromise<LogSettings> {
|
||||||
|
return AXIOS.get('/logSettings');
|
||||||
|
}
|
||||||
|
|
||||||
|
export function updateLogSettings(logSettings: LogSettings): AxiosPromise<LogSettings> {
|
||||||
|
return AXIOS.post('/logSettings', logSettings);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function readLogEntries(): AxiosPromise<LogEntries> {
|
||||||
|
return AXIOS_BIN.get('/fetchLog');
|
||||||
|
}
|
||||||
@@ -1,56 +0,0 @@
|
|||||||
import * as React from 'react';
|
|
||||||
import {
|
|
||||||
Redirect,
|
|
||||||
Route,
|
|
||||||
RouteProps,
|
|
||||||
RouteComponentProps
|
|
||||||
} from 'react-router-dom';
|
|
||||||
import { withSnackbar, WithSnackbarProps } from 'notistack';
|
|
||||||
|
|
||||||
import * as Authentication from './Authentication';
|
|
||||||
import {
|
|
||||||
withAuthenticationContext,
|
|
||||||
AuthenticationContextProps,
|
|
||||||
AuthenticatedContext,
|
|
||||||
AuthenticatedContextValue
|
|
||||||
} from './AuthenticationContext';
|
|
||||||
|
|
||||||
interface AuthenticatedRouteProps
|
|
||||||
extends RouteProps,
|
|
||||||
WithSnackbarProps,
|
|
||||||
AuthenticationContextProps {
|
|
||||||
component:
|
|
||||||
| React.ComponentType<RouteComponentProps<any>>
|
|
||||||
| React.ComponentType<any>;
|
|
||||||
}
|
|
||||||
|
|
||||||
type RenderComponent = (props: RouteComponentProps<any>) => React.ReactNode;
|
|
||||||
|
|
||||||
export class AuthenticatedRoute extends React.Component<AuthenticatedRouteProps> {
|
|
||||||
render() {
|
|
||||||
const {
|
|
||||||
enqueueSnackbar,
|
|
||||||
authenticationContext,
|
|
||||||
component: Component,
|
|
||||||
...rest
|
|
||||||
} = this.props;
|
|
||||||
const { location } = this.props;
|
|
||||||
const renderComponent: RenderComponent = (props) => {
|
|
||||||
if (authenticationContext.me) {
|
|
||||||
return (
|
|
||||||
<AuthenticatedContext.Provider
|
|
||||||
value={authenticationContext as AuthenticatedContextValue}
|
|
||||||
>
|
|
||||||
<Component {...props} />
|
|
||||||
</AuthenticatedContext.Provider>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
Authentication.storeLoginRedirect(location);
|
|
||||||
enqueueSnackbar('Please sign in to continue', { variant: 'info' });
|
|
||||||
return <Redirect to="/" />;
|
|
||||||
};
|
|
||||||
return <Route {...rest} render={renderComponent} />;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export default withSnackbar(withAuthenticationContext(AuthenticatedRoute));
|
|
||||||
@@ -1,129 +0,0 @@
|
|||||||
import * as H from 'history';
|
|
||||||
|
|
||||||
import history from '../history';
|
|
||||||
import { Features } from '../features/types';
|
|
||||||
import { getDefaultRoute } from '../AppRouting';
|
|
||||||
|
|
||||||
export const ACCESS_TOKEN = 'access_token';
|
|
||||||
export const SIGN_IN_PATHNAME = 'signInPathname';
|
|
||||||
export const SIGN_IN_SEARCH = 'signInSearch';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Fallback to sessionStorage if localStorage is absent. WebView may not have local storage enabled.
|
|
||||||
*/
|
|
||||||
export function getStorage() {
|
|
||||||
return localStorage || sessionStorage;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function storeLoginRedirect(location?: H.Location) {
|
|
||||||
if (location) {
|
|
||||||
getStorage().setItem(SIGN_IN_PATHNAME, location.pathname);
|
|
||||||
getStorage().setItem(SIGN_IN_SEARCH, location.search);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export function clearLoginRedirect() {
|
|
||||||
getStorage().removeItem(SIGN_IN_PATHNAME);
|
|
||||||
getStorage().removeItem(SIGN_IN_SEARCH);
|
|
||||||
}
|
|
||||||
|
|
||||||
export function fetchLoginRedirect(
|
|
||||||
features: Features
|
|
||||||
): H.LocationDescriptorObject {
|
|
||||||
const signInPathname = getStorage().getItem(SIGN_IN_PATHNAME);
|
|
||||||
const signInSearch = getStorage().getItem(SIGN_IN_SEARCH);
|
|
||||||
clearLoginRedirect();
|
|
||||||
return {
|
|
||||||
pathname: signInPathname || getDefaultRoute(features),
|
|
||||||
search: (signInPathname && signInSearch) || undefined
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Wraps the normal fetch routine with one with provides the access token if present.
|
|
||||||
*/
|
|
||||||
export function authorizedFetch(
|
|
||||||
url: RequestInfo,
|
|
||||||
params?: RequestInit
|
|
||||||
): Promise<Response> {
|
|
||||||
const accessToken = getStorage().getItem(ACCESS_TOKEN);
|
|
||||||
if (accessToken) {
|
|
||||||
params = params || {};
|
|
||||||
params.credentials = 'include';
|
|
||||||
params.headers = {
|
|
||||||
...params.headers,
|
|
||||||
Authorization: 'Bearer ' + accessToken
|
|
||||||
};
|
|
||||||
}
|
|
||||||
return fetch(url, params);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* fetch() does not yet support upload progress, this wrapper allows us to configure the xhr request
|
|
||||||
* for a single file upload and takes care of adding the Authorization header and redirecting on
|
|
||||||
* authorization errors as we do for normal fetch operations.
|
|
||||||
*/
|
|
||||||
export function redirectingAuthorizedUpload(
|
|
||||||
xhr: XMLHttpRequest,
|
|
||||||
url: string,
|
|
||||||
file: File,
|
|
||||||
onProgress: (event: ProgressEvent<EventTarget>) => void
|
|
||||||
): Promise<void> {
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
xhr.open('POST', url, true);
|
|
||||||
const accessToken = getStorage().getItem(ACCESS_TOKEN);
|
|
||||||
if (accessToken) {
|
|
||||||
xhr.withCredentials = true;
|
|
||||||
xhr.setRequestHeader('Authorization', 'Bearer ' + accessToken);
|
|
||||||
}
|
|
||||||
xhr.upload.onprogress = onProgress;
|
|
||||||
xhr.onload = function () {
|
|
||||||
if (xhr.status === 401 || xhr.status === 403) {
|
|
||||||
history.push('/unauthorized');
|
|
||||||
} else {
|
|
||||||
resolve();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
xhr.onerror = function () {
|
|
||||||
reject(new DOMException('Error', 'UploadError'));
|
|
||||||
};
|
|
||||||
xhr.onabort = function () {
|
|
||||||
reject(new DOMException('Aborted', 'AbortError'));
|
|
||||||
};
|
|
||||||
const formData = new FormData();
|
|
||||||
formData.append('file', file);
|
|
||||||
xhr.send(formData);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Wraps the normal fetch routine which redirects on 401 response.
|
|
||||||
*/
|
|
||||||
export function redirectingAuthorizedFetch(
|
|
||||||
url: RequestInfo,
|
|
||||||
params?: RequestInit
|
|
||||||
): Promise<Response> {
|
|
||||||
return new Promise<Response>((resolve, reject) => {
|
|
||||||
authorizedFetch(url, params)
|
|
||||||
.then((response) => {
|
|
||||||
if (response.status === 401 || response.status === 403) {
|
|
||||||
history.push('/unauthorized');
|
|
||||||
} else {
|
|
||||||
resolve(response);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch((error) => {
|
|
||||||
reject(error);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
export function addAccessTokenParameter(url: string) {
|
|
||||||
const accessToken = getStorage().getItem(ACCESS_TOKEN);
|
|
||||||
if (!accessToken) {
|
|
||||||
return url;
|
|
||||||
}
|
|
||||||
const parsedUrl = new URL(url);
|
|
||||||
parsedUrl.searchParams.set(ACCESS_TOKEN, accessToken);
|
|
||||||
return parsedUrl.toString();
|
|
||||||
}
|
|
||||||
@@ -1,77 +0,0 @@
|
|||||||
import * as React from 'react';
|
|
||||||
|
|
||||||
export interface Me {
|
|
||||||
username: string;
|
|
||||||
admin: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AuthenticationContextValue {
|
|
||||||
refresh: () => void;
|
|
||||||
signIn: (accessToken: string) => void;
|
|
||||||
signOut: () => void;
|
|
||||||
me?: Me;
|
|
||||||
}
|
|
||||||
|
|
||||||
const AuthenticationContextDefaultValue = {} as AuthenticationContextValue;
|
|
||||||
export const AuthenticationContext = React.createContext(
|
|
||||||
AuthenticationContextDefaultValue
|
|
||||||
);
|
|
||||||
|
|
||||||
export interface AuthenticationContextProps {
|
|
||||||
authenticationContext: AuthenticationContextValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function withAuthenticationContext<T extends AuthenticationContextProps>(
|
|
||||||
Component: React.ComponentType<T>
|
|
||||||
) {
|
|
||||||
return class extends React.Component<
|
|
||||||
Omit<T, keyof AuthenticationContextProps>
|
|
||||||
> {
|
|
||||||
render() {
|
|
||||||
return (
|
|
||||||
<AuthenticationContext.Consumer>
|
|
||||||
{(authenticationContext) => (
|
|
||||||
<Component
|
|
||||||
{...(this.props as T)}
|
|
||||||
authenticationContext={authenticationContext}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
</AuthenticationContext.Consumer>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AuthenticatedContextValue extends AuthenticationContextValue {
|
|
||||||
me: Me;
|
|
||||||
}
|
|
||||||
|
|
||||||
const AuthenticatedContextDefaultValue = {} as AuthenticatedContextValue;
|
|
||||||
export const AuthenticatedContext = React.createContext(
|
|
||||||
AuthenticatedContextDefaultValue
|
|
||||||
);
|
|
||||||
|
|
||||||
export interface AuthenticatedContextProps {
|
|
||||||
authenticatedContext: AuthenticatedContextValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function withAuthenticatedContext<T extends AuthenticatedContextProps>(
|
|
||||||
Component: React.ComponentType<T>
|
|
||||||
) {
|
|
||||||
return class extends React.Component<
|
|
||||||
Omit<T, keyof AuthenticatedContextProps>
|
|
||||||
> {
|
|
||||||
render() {
|
|
||||||
return (
|
|
||||||
<AuthenticatedContext.Consumer>
|
|
||||||
{(authenticatedContext) => (
|
|
||||||
<Component
|
|
||||||
{...(this.props as T)}
|
|
||||||
authenticatedContext={authenticatedContext}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
</AuthenticatedContext.Consumer>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,135 +0,0 @@
|
|||||||
import * as React from 'react';
|
|
||||||
import { withSnackbar, WithSnackbarProps } from 'notistack';
|
|
||||||
import jwtDecode from 'jwt-decode';
|
|
||||||
|
|
||||||
import history from '../history';
|
|
||||||
import { VERIFY_AUTHORIZATION_ENDPOINT } from '../api';
|
|
||||||
import { ACCESS_TOKEN, authorizedFetch, getStorage } from './Authentication';
|
|
||||||
import {
|
|
||||||
AuthenticationContext,
|
|
||||||
AuthenticationContextValue,
|
|
||||||
Me
|
|
||||||
} from './AuthenticationContext';
|
|
||||||
import FullScreenLoading from '../components/FullScreenLoading';
|
|
||||||
import { withFeatures, WithFeaturesProps } from '../features/FeaturesContext';
|
|
||||||
|
|
||||||
export const decodeMeJWT = (accessToken: string): Me =>
|
|
||||||
jwtDecode(accessToken) as Me;
|
|
||||||
|
|
||||||
interface AuthenticationWrapperState {
|
|
||||||
context: AuthenticationContextValue;
|
|
||||||
initialized: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
type AuthenticationWrapperProps = WithSnackbarProps & WithFeaturesProps;
|
|
||||||
|
|
||||||
class AuthenticationWrapper extends React.Component<
|
|
||||||
AuthenticationWrapperProps,
|
|
||||||
AuthenticationWrapperState
|
|
||||||
> {
|
|
||||||
constructor(props: AuthenticationWrapperProps) {
|
|
||||||
super(props);
|
|
||||||
this.state = {
|
|
||||||
context: {
|
|
||||||
refresh: this.refresh,
|
|
||||||
signIn: this.signIn,
|
|
||||||
signOut: this.signOut
|
|
||||||
},
|
|
||||||
initialized: false
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
componentDidMount() {
|
|
||||||
this.refresh();
|
|
||||||
}
|
|
||||||
|
|
||||||
render() {
|
|
||||||
return (
|
|
||||||
<React.Fragment>
|
|
||||||
{this.state.initialized
|
|
||||||
? this.renderContent()
|
|
||||||
: this.renderContentLoading()}
|
|
||||||
</React.Fragment>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
renderContent() {
|
|
||||||
return (
|
|
||||||
<AuthenticationContext.Provider value={this.state.context}>
|
|
||||||
{this.props.children}
|
|
||||||
</AuthenticationContext.Provider>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
renderContentLoading() {
|
|
||||||
return <FullScreenLoading />;
|
|
||||||
}
|
|
||||||
|
|
||||||
refresh = () => {
|
|
||||||
// commented out, always need security - proddy
|
|
||||||
// if (!this.props.features.security) {
|
|
||||||
// this.setState({ initialized: true, context: { ...this.state.context, me: { admin: true, username: "admin" } } });
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
const accessToken = getStorage().getItem(ACCESS_TOKEN);
|
|
||||||
if (accessToken) {
|
|
||||||
authorizedFetch(VERIFY_AUTHORIZATION_ENDPOINT)
|
|
||||||
.then((response) => {
|
|
||||||
const me =
|
|
||||||
response.status === 200 ? decodeMeJWT(accessToken) : undefined;
|
|
||||||
this.setState({
|
|
||||||
initialized: true,
|
|
||||||
context: { ...this.state.context, me }
|
|
||||||
});
|
|
||||||
})
|
|
||||||
.catch((error) => {
|
|
||||||
this.setState({
|
|
||||||
initialized: true,
|
|
||||||
context: { ...this.state.context, me: undefined }
|
|
||||||
});
|
|
||||||
this.props.enqueueSnackbar(
|
|
||||||
'Error verifying authorization: ' + error.message,
|
|
||||||
{
|
|
||||||
variant: 'error'
|
|
||||||
}
|
|
||||||
);
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
this.setState({
|
|
||||||
initialized: true,
|
|
||||||
context: { ...this.state.context, me: undefined }
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
signIn = (accessToken: string) => {
|
|
||||||
try {
|
|
||||||
getStorage().setItem(ACCESS_TOKEN, accessToken);
|
|
||||||
const me: Me = decodeMeJWT(accessToken);
|
|
||||||
this.setState({ context: { ...this.state.context, me } });
|
|
||||||
this.props.enqueueSnackbar(`Logged in as ${me.username}`, {
|
|
||||||
variant: 'success'
|
|
||||||
});
|
|
||||||
} catch (err) {
|
|
||||||
this.setState({
|
|
||||||
initialized: true,
|
|
||||||
context: { ...this.state.context, me: undefined }
|
|
||||||
});
|
|
||||||
throw new Error('Failed to parse JWT ' + err.message);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
signOut = () => {
|
|
||||||
getStorage().removeItem(ACCESS_TOKEN);
|
|
||||||
this.setState({
|
|
||||||
context: {
|
|
||||||
...this.state.context,
|
|
||||||
me: undefined
|
|
||||||
}
|
|
||||||
});
|
|
||||||
this.props.enqueueSnackbar('You have signed out', { variant: 'success' });
|
|
||||||
history.push('/');
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
export default withFeatures(withSnackbar(AuthenticationWrapper));
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
import * as React from 'react';
|
|
||||||
import {
|
|
||||||
Redirect,
|
|
||||||
Route,
|
|
||||||
RouteProps,
|
|
||||||
RouteComponentProps
|
|
||||||
} from 'react-router-dom';
|
|
||||||
|
|
||||||
import {
|
|
||||||
withAuthenticationContext,
|
|
||||||
AuthenticationContextProps
|
|
||||||
} from './AuthenticationContext';
|
|
||||||
import * as Authentication from './Authentication';
|
|
||||||
import { WithFeaturesProps, withFeatures } from '../features/FeaturesContext';
|
|
||||||
|
|
||||||
interface UnauthenticatedRouteProps
|
|
||||||
extends RouteProps,
|
|
||||||
AuthenticationContextProps,
|
|
||||||
WithFeaturesProps {
|
|
||||||
component:
|
|
||||||
| React.ComponentType<RouteComponentProps<any>>
|
|
||||||
| React.ComponentType<any>;
|
|
||||||
}
|
|
||||||
|
|
||||||
type RenderComponent = (props: RouteComponentProps<any>) => React.ReactNode;
|
|
||||||
|
|
||||||
class UnauthenticatedRoute extends Route<UnauthenticatedRouteProps> {
|
|
||||||
public render() {
|
|
||||||
const {
|
|
||||||
authenticationContext,
|
|
||||||
component: Component,
|
|
||||||
features,
|
|
||||||
...rest
|
|
||||||
} = this.props;
|
|
||||||
const renderComponent: RenderComponent = (props) => {
|
|
||||||
if (authenticationContext.me) {
|
|
||||||
return <Redirect to={Authentication.fetchLoginRedirect(features)} />;
|
|
||||||
}
|
|
||||||
if (Component) {
|
|
||||||
return <Component {...props} />;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
return <Route {...rest} render={renderComponent} />;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export default withFeatures(withAuthenticationContext(UnauthenticatedRoute));
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
export { default as AuthenticatedRoute } from './AuthenticatedRoute';
|
|
||||||
export { default as AuthenticationWrapper } from './AuthenticationWrapper';
|
|
||||||
export { default as UnauthenticatedRoute } from './UnauthenticatedRoute';
|
|
||||||
|
|
||||||
export * from './Authentication';
|
|
||||||
export * from './AuthenticationContext';
|
|
||||||
@@ -1,59 +0,0 @@
|
|||||||
import React, { FC } from 'react';
|
|
||||||
import { makeStyles } from '@material-ui/styles';
|
|
||||||
import { Paper, Typography, Box, CssBaseline } from '@material-ui/core';
|
|
||||||
import WarningIcon from '@material-ui/icons/Warning';
|
|
||||||
|
|
||||||
const styles = makeStyles({
|
|
||||||
siteErrorPage: {
|
|
||||||
display: 'flex',
|
|
||||||
height: '100vh',
|
|
||||||
justifyContent: 'center',
|
|
||||||
flexDirection: 'column'
|
|
||||||
},
|
|
||||||
siteErrorPagePanel: {
|
|
||||||
textAlign: 'center',
|
|
||||||
padding: '280px 0 40px 0',
|
|
||||||
backgroundImage: 'url("/app/icon.png")',
|
|
||||||
backgroundRepeat: 'no-repeat',
|
|
||||||
backgroundPosition: '50% 40px',
|
|
||||||
backgroundSize: '200px auto',
|
|
||||||
width: '100%'
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
interface ApplicationErrorProps {
|
|
||||||
error?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
const ApplicationError: FC<ApplicationErrorProps> = ({ error }) => {
|
|
||||||
const classes = styles();
|
|
||||||
return (
|
|
||||||
<div className={classes.siteErrorPage}>
|
|
||||||
<CssBaseline />
|
|
||||||
<Paper className={classes.siteErrorPagePanel} elevation={10}>
|
|
||||||
<Box
|
|
||||||
display="flex"
|
|
||||||
flexDirection="row"
|
|
||||||
justifyContent="center"
|
|
||||||
alignItems="center"
|
|
||||||
mb={2}
|
|
||||||
>
|
|
||||||
<WarningIcon fontSize="large" color="error" />
|
|
||||||
<Box ml={2}>
|
|
||||||
<Typography variant="h4">Application error</Typography>
|
|
||||||
</Box>
|
|
||||||
</Box>
|
|
||||||
<Typography variant="subtitle1" gutterBottom>
|
|
||||||
Failed to configure the application, please refresh to try again.
|
|
||||||
</Typography>
|
|
||||||
{error && (
|
|
||||||
<Typography variant="subtitle2" gutterBottom>
|
|
||||||
Error: {error}
|
|
||||||
</Typography>
|
|
||||||
)}
|
|
||||||
</Paper>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default ApplicationError;
|
|
||||||
26
interface/src/components/ButtonRow.tsx
Normal file
26
interface/src/components/ButtonRow.tsx
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
import { FC } from 'react';
|
||||||
|
import { Box, BoxProps } from '@mui/material';
|
||||||
|
|
||||||
|
const ButtonRow: FC<BoxProps> = ({ children, ...rest }) => {
|
||||||
|
return (
|
||||||
|
<Box
|
||||||
|
sx={{
|
||||||
|
'& button, & a, & .MuiCard-root': {
|
||||||
|
mt: 2,
|
||||||
|
mx: 0.6,
|
||||||
|
'&:last-child': {
|
||||||
|
mr: 0
|
||||||
|
},
|
||||||
|
'&:first-of-type': {
|
||||||
|
ml: 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
{...rest}
|
||||||
|
>
|
||||||
|
{children}
|
||||||
|
</Box>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default ButtonRow;
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
import { Button, styled } from '@material-ui/core';
|
|
||||||
|
|
||||||
const ErrorButton = styled(Button)(({ theme }) => ({
|
|
||||||
color: theme.palette.getContrastText(theme.palette.error.main),
|
|
||||||
backgroundColor: theme.palette.error.main,
|
|
||||||
'&:hover': {
|
|
||||||
backgroundColor: theme.palette.error.dark
|
|
||||||
}
|
|
||||||
}));
|
|
||||||
|
|
||||||
export default ErrorButton;
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
import { styled, Box } from '@material-ui/core';
|
|
||||||
|
|
||||||
const FormActions = styled(Box)(({ theme }) => ({
|
|
||||||
marginTop: theme.spacing(1)
|
|
||||||
}));
|
|
||||||
|
|
||||||
export default FormActions;
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
import { Button, styled } from '@material-ui/core';
|
|
||||||
|
|
||||||
const FormButton = styled(Button)(({ theme }) => ({
|
|
||||||
margin: theme.spacing(0, 1),
|
|
||||||
'&:last-child': {
|
|
||||||
marginRight: 0
|
|
||||||
},
|
|
||||||
'&:first-child': {
|
|
||||||
marginLeft: 0
|
|
||||||
}
|
|
||||||
}));
|
|
||||||
|
|
||||||
export default FormButton;
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
import React from 'react';
|
|
||||||
import CircularProgress from '@material-ui/core/CircularProgress';
|
|
||||||
import { Typography, Theme } from '@material-ui/core';
|
|
||||||
import { makeStyles, createStyles } from '@material-ui/styles';
|
|
||||||
|
|
||||||
const useStyles = makeStyles((theme: Theme) =>
|
|
||||||
createStyles({
|
|
||||||
fullScreenLoading: {
|
|
||||||
padding: theme.spacing(2),
|
|
||||||
display: 'flex',
|
|
||||||
alignItems: 'center',
|
|
||||||
justifyContent: 'center',
|
|
||||||
height: '100vh',
|
|
||||||
flexDirection: 'column'
|
|
||||||
},
|
|
||||||
progress: {
|
|
||||||
margin: theme.spacing(4)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
);
|
|
||||||
|
|
||||||
const FullScreenLoading = () => {
|
|
||||||
const classes = useStyles();
|
|
||||||
return (
|
|
||||||
<div className={classes.fullScreenLoading}>
|
|
||||||
<CircularProgress className={classes.progress} size={100} />
|
|
||||||
<Typography variant="h4">Loading…</Typography>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default FullScreenLoading;
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
import { Avatar, makeStyles } from '@material-ui/core';
|
|
||||||
import { FC } from 'react';
|
|
||||||
|
|
||||||
interface HighlightAvatarProps {
|
|
||||||
color: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
const useStyles = makeStyles({
|
|
||||||
root: (props: HighlightAvatarProps) => ({
|
|
||||||
backgroundColor: props.color
|
|
||||||
})
|
|
||||||
});
|
|
||||||
|
|
||||||
const HighlightAvatar: FC<HighlightAvatarProps> = (props) => {
|
|
||||||
const classes = useStyles(props);
|
|
||||||
return <Avatar className={classes.root}>{props.children}</Avatar>;
|
|
||||||
};
|
|
||||||
|
|
||||||
export default HighlightAvatar;
|
|
||||||
@@ -1,390 +0,0 @@
|
|||||||
import React, { RefObject, Fragment } from 'react';
|
|
||||||
import { Link, withRouter, RouteComponentProps } from 'react-router-dom';
|
|
||||||
|
|
||||||
import {
|
|
||||||
Drawer,
|
|
||||||
AppBar,
|
|
||||||
Toolbar,
|
|
||||||
Avatar,
|
|
||||||
Divider,
|
|
||||||
Button,
|
|
||||||
Box,
|
|
||||||
IconButton
|
|
||||||
} from '@material-ui/core';
|
|
||||||
import {
|
|
||||||
ClickAwayListener,
|
|
||||||
Popper,
|
|
||||||
Hidden,
|
|
||||||
Typography
|
|
||||||
} from '@material-ui/core';
|
|
||||||
import {
|
|
||||||
List,
|
|
||||||
ListItem,
|
|
||||||
ListItemIcon,
|
|
||||||
ListItemText,
|
|
||||||
ListItemAvatar
|
|
||||||
} from '@material-ui/core';
|
|
||||||
import { Card, CardContent, CardActions } from '@material-ui/core';
|
|
||||||
|
|
||||||
import {
|
|
||||||
withStyles,
|
|
||||||
createStyles,
|
|
||||||
Theme,
|
|
||||||
WithTheme,
|
|
||||||
WithStyles,
|
|
||||||
withTheme
|
|
||||||
} from '@material-ui/core/styles';
|
|
||||||
|
|
||||||
import SettingsEthernetIcon from '@material-ui/icons/SettingsEthernet';
|
|
||||||
import SettingsIcon from '@material-ui/icons/Settings';
|
|
||||||
import AccessTimeIcon from '@material-ui/icons/AccessTime';
|
|
||||||
import AccountCircleIcon from '@material-ui/icons/AccountCircle';
|
|
||||||
import SettingsInputAntennaIcon from '@material-ui/icons/SettingsInputAntenna';
|
|
||||||
import DeviceHubIcon from '@material-ui/icons/DeviceHub';
|
|
||||||
import LockIcon from '@material-ui/icons/Lock';
|
|
||||||
import MenuIcon from '@material-ui/icons/Menu';
|
|
||||||
|
|
||||||
import ProjectMenu from '../project/ProjectMenu';
|
|
||||||
import { PROJECT_NAME } from '../api';
|
|
||||||
import {
|
|
||||||
withAuthenticatedContext,
|
|
||||||
AuthenticatedContextProps
|
|
||||||
} from '../authentication';
|
|
||||||
import { withFeatures, WithFeaturesProps } from '../features/FeaturesContext';
|
|
||||||
|
|
||||||
const drawerWidth = 290;
|
|
||||||
|
|
||||||
const styles = (theme: Theme) =>
|
|
||||||
createStyles({
|
|
||||||
root: {
|
|
||||||
display: 'flex'
|
|
||||||
},
|
|
||||||
drawer: {
|
|
||||||
[theme.breakpoints.up('md')]: {
|
|
||||||
width: drawerWidth,
|
|
||||||
flexShrink: 0
|
|
||||||
}
|
|
||||||
},
|
|
||||||
title: {
|
|
||||||
flexGrow: 1
|
|
||||||
},
|
|
||||||
appBar: {
|
|
||||||
marginLeft: drawerWidth,
|
|
||||||
[theme.breakpoints.up('md')]: {
|
|
||||||
width: `calc(100% - ${drawerWidth}px)`
|
|
||||||
}
|
|
||||||
},
|
|
||||||
toolbarImage: {
|
|
||||||
[theme.breakpoints.up('xs')]: {
|
|
||||||
height: 24,
|
|
||||||
marginRight: theme.spacing(2)
|
|
||||||
},
|
|
||||||
[theme.breakpoints.up('sm')]: {
|
|
||||||
height: 36,
|
|
||||||
marginRight: theme.spacing(3)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
menuButton: {
|
|
||||||
marginRight: theme.spacing(2),
|
|
||||||
[theme.breakpoints.up('md')]: {
|
|
||||||
display: 'none'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
toolbar: theme.mixins.toolbar,
|
|
||||||
drawerPaper: {
|
|
||||||
width: drawerWidth
|
|
||||||
},
|
|
||||||
content: {
|
|
||||||
flexGrow: 1
|
|
||||||
},
|
|
||||||
authMenu: {
|
|
||||||
zIndex: theme.zIndex.tooltip,
|
|
||||||
maxWidth: 400
|
|
||||||
},
|
|
||||||
authMenuActions: {
|
|
||||||
padding: theme.spacing(2),
|
|
||||||
'& > * + *': {
|
|
||||||
marginLeft: theme.spacing(2)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
interface MenuAppBarState {
|
|
||||||
mobileOpen: boolean;
|
|
||||||
authMenuOpen: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface MenuAppBarProps
|
|
||||||
extends WithFeaturesProps,
|
|
||||||
AuthenticatedContextProps,
|
|
||||||
WithTheme,
|
|
||||||
WithStyles<typeof styles>,
|
|
||||||
RouteComponentProps {
|
|
||||||
sectionTitle: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
class MenuAppBar extends React.Component<MenuAppBarProps, MenuAppBarState> {
|
|
||||||
constructor(props: MenuAppBarProps) {
|
|
||||||
super(props);
|
|
||||||
this.state = {
|
|
||||||
mobileOpen: false,
|
|
||||||
authMenuOpen: false
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
anchorRef: RefObject<HTMLButtonElement> = React.createRef();
|
|
||||||
|
|
||||||
handleToggle = () => {
|
|
||||||
this.setState({ authMenuOpen: !this.state.authMenuOpen });
|
|
||||||
};
|
|
||||||
|
|
||||||
handleClose = (event: React.MouseEvent<Document>) => {
|
|
||||||
if (
|
|
||||||
this.anchorRef.current &&
|
|
||||||
this.anchorRef.current.contains(event.currentTarget)
|
|
||||||
) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.setState({ authMenuOpen: false });
|
|
||||||
};
|
|
||||||
|
|
||||||
handleDrawerToggle = () => {
|
|
||||||
this.setState({ mobileOpen: !this.state.mobileOpen });
|
|
||||||
};
|
|
||||||
|
|
||||||
render() {
|
|
||||||
const {
|
|
||||||
classes,
|
|
||||||
theme,
|
|
||||||
children,
|
|
||||||
sectionTitle,
|
|
||||||
authenticatedContext,
|
|
||||||
features
|
|
||||||
} = this.props;
|
|
||||||
const { mobileOpen, authMenuOpen } = this.state;
|
|
||||||
const path = this.props.match.url;
|
|
||||||
const drawer = (
|
|
||||||
<div>
|
|
||||||
<Toolbar>
|
|
||||||
<Box display="flex">
|
|
||||||
<img
|
|
||||||
src="/app/icon.png"
|
|
||||||
className={classes.toolbarImage}
|
|
||||||
alt={PROJECT_NAME}
|
|
||||||
/>
|
|
||||||
</Box>
|
|
||||||
|
|
||||||
<Typography variant="h6" color="textPrimary">
|
|
||||||
{PROJECT_NAME}
|
|
||||||
</Typography>
|
|
||||||
|
|
||||||
<Divider absolute />
|
|
||||||
</Toolbar>
|
|
||||||
|
|
||||||
{features.project && (
|
|
||||||
<Fragment>
|
|
||||||
<ProjectMenu />
|
|
||||||
<Divider />
|
|
||||||
</Fragment>
|
|
||||||
)}
|
|
||||||
|
|
||||||
<List>
|
|
||||||
<ListItem
|
|
||||||
to="/network/"
|
|
||||||
selected={path.startsWith('/network/')}
|
|
||||||
button
|
|
||||||
component={Link}
|
|
||||||
>
|
|
||||||
<ListItemIcon>
|
|
||||||
<SettingsEthernetIcon />
|
|
||||||
</ListItemIcon>
|
|
||||||
<ListItemText primary="Network Connection" />
|
|
||||||
</ListItem>
|
|
||||||
<ListItem
|
|
||||||
to="/ap/"
|
|
||||||
selected={path.startsWith('/ap/')}
|
|
||||||
button
|
|
||||||
component={Link}
|
|
||||||
>
|
|
||||||
<ListItemIcon>
|
|
||||||
<SettingsInputAntennaIcon />
|
|
||||||
</ListItemIcon>
|
|
||||||
<ListItemText primary="Access Point" />
|
|
||||||
</ListItem>
|
|
||||||
{features.ntp && (
|
|
||||||
<ListItem
|
|
||||||
to="/ntp/"
|
|
||||||
selected={path.startsWith('/ntp/')}
|
|
||||||
button
|
|
||||||
component={Link}
|
|
||||||
>
|
|
||||||
<ListItemIcon>
|
|
||||||
<AccessTimeIcon />
|
|
||||||
</ListItemIcon>
|
|
||||||
<ListItemText primary="Network Time" />
|
|
||||||
</ListItem>
|
|
||||||
)}
|
|
||||||
{features.mqtt && (
|
|
||||||
<ListItem
|
|
||||||
to="/mqtt/"
|
|
||||||
selected={path.startsWith('/mqtt/')}
|
|
||||||
button
|
|
||||||
component={Link}
|
|
||||||
>
|
|
||||||
<ListItemIcon>
|
|
||||||
<DeviceHubIcon />
|
|
||||||
</ListItemIcon>
|
|
||||||
<ListItemText primary="MQTT" />
|
|
||||||
</ListItem>
|
|
||||||
)}
|
|
||||||
{features.security && (
|
|
||||||
<ListItem
|
|
||||||
to="/security/"
|
|
||||||
selected={path.startsWith('/security/')}
|
|
||||||
button
|
|
||||||
component={Link}
|
|
||||||
disabled={!authenticatedContext.me.admin}
|
|
||||||
>
|
|
||||||
<ListItemIcon>
|
|
||||||
<LockIcon />
|
|
||||||
</ListItemIcon>
|
|
||||||
<ListItemText primary="Security" />
|
|
||||||
</ListItem>
|
|
||||||
)}
|
|
||||||
<ListItem
|
|
||||||
to="/system/"
|
|
||||||
selected={path.startsWith('/system/')}
|
|
||||||
button
|
|
||||||
component={Link}
|
|
||||||
>
|
|
||||||
<ListItemIcon>
|
|
||||||
<SettingsIcon />
|
|
||||||
</ListItemIcon>
|
|
||||||
<ListItemText primary="System" />
|
|
||||||
</ListItem>
|
|
||||||
</List>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
|
|
||||||
const userMenu = (
|
|
||||||
<div>
|
|
||||||
<IconButton
|
|
||||||
ref={this.anchorRef}
|
|
||||||
aria-owns={authMenuOpen ? 'menu-list-grow' : undefined}
|
|
||||||
aria-haspopup="true"
|
|
||||||
onClick={this.handleToggle}
|
|
||||||
color="inherit"
|
|
||||||
>
|
|
||||||
<AccountCircleIcon />
|
|
||||||
</IconButton>
|
|
||||||
<Popper
|
|
||||||
open={authMenuOpen}
|
|
||||||
anchorEl={this.anchorRef.current}
|
|
||||||
transition
|
|
||||||
className={classes.authMenu}
|
|
||||||
>
|
|
||||||
<ClickAwayListener onClickAway={this.handleClose}>
|
|
||||||
<Card id="menu-list-grow">
|
|
||||||
<CardContent>
|
|
||||||
<List disablePadding>
|
|
||||||
<ListItem disableGutters>
|
|
||||||
<ListItemAvatar>
|
|
||||||
<Avatar>
|
|
||||||
<AccountCircleIcon />
|
|
||||||
</Avatar>
|
|
||||||
</ListItemAvatar>
|
|
||||||
<ListItemText
|
|
||||||
primary={
|
|
||||||
'Signed in as: ' + authenticatedContext.me.username
|
|
||||||
}
|
|
||||||
secondary={
|
|
||||||
authenticatedContext.me.admin ? 'Admin User' : undefined
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
</ListItem>
|
|
||||||
</List>
|
|
||||||
</CardContent>
|
|
||||||
<Divider />
|
|
||||||
<CardActions className={classes.authMenuActions}>
|
|
||||||
<Button
|
|
||||||
variant="contained"
|
|
||||||
fullWidth
|
|
||||||
color="primary"
|
|
||||||
onClick={authenticatedContext.signOut}
|
|
||||||
>
|
|
||||||
Sign Out
|
|
||||||
</Button>
|
|
||||||
</CardActions>
|
|
||||||
</Card>
|
|
||||||
</ClickAwayListener>
|
|
||||||
</Popper>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div className={classes.root}>
|
|
||||||
<AppBar position="fixed" className={classes.appBar} elevation={0}>
|
|
||||||
<Toolbar>
|
|
||||||
<IconButton
|
|
||||||
color="inherit"
|
|
||||||
aria-label="Open drawer"
|
|
||||||
edge="start"
|
|
||||||
onClick={this.handleDrawerToggle}
|
|
||||||
className={classes.menuButton}
|
|
||||||
>
|
|
||||||
<MenuIcon />
|
|
||||||
</IconButton>
|
|
||||||
<Typography
|
|
||||||
variant="h6"
|
|
||||||
color="inherit"
|
|
||||||
noWrap
|
|
||||||
className={classes.title}
|
|
||||||
>
|
|
||||||
{sectionTitle}
|
|
||||||
</Typography>
|
|
||||||
{features.security && userMenu}
|
|
||||||
</Toolbar>
|
|
||||||
</AppBar>
|
|
||||||
<nav className={classes.drawer}>
|
|
||||||
<Hidden mdUp implementation="css">
|
|
||||||
<Drawer
|
|
||||||
variant="temporary"
|
|
||||||
anchor={theme.direction === 'rtl' ? 'right' : 'left'}
|
|
||||||
open={mobileOpen}
|
|
||||||
onClose={this.handleDrawerToggle}
|
|
||||||
classes={{
|
|
||||||
paper: classes.drawerPaper
|
|
||||||
}}
|
|
||||||
ModalProps={{
|
|
||||||
keepMounted: true
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{drawer}
|
|
||||||
</Drawer>
|
|
||||||
</Hidden>
|
|
||||||
<Hidden smDown implementation="css">
|
|
||||||
<Drawer
|
|
||||||
classes={{
|
|
||||||
paper: classes.drawerPaper
|
|
||||||
}}
|
|
||||||
variant="permanent"
|
|
||||||
open
|
|
||||||
>
|
|
||||||
{drawer}
|
|
||||||
</Drawer>
|
|
||||||
</Hidden>
|
|
||||||
</nav>
|
|
||||||
<main className={classes.content}>
|
|
||||||
<div className={classes.toolbar} />
|
|
||||||
{children}
|
|
||||||
</main>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export default withRouter(
|
|
||||||
withTheme(
|
|
||||||
withFeatures(withAuthenticatedContext(withStyles(styles)(MenuAppBar)))
|
|
||||||
)
|
|
||||||
);
|
|
||||||
47
interface/src/components/MessageBox.tsx
Normal file
47
interface/src/components/MessageBox.tsx
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
import { FC } from 'react';
|
||||||
|
|
||||||
|
import { Box, BoxProps, SvgIconProps, Theme, Typography, useTheme } from '@mui/material';
|
||||||
|
|
||||||
|
import CheckCircleOutlineOutlinedIcon from '@mui/icons-material/CheckCircleOutlineOutlined';
|
||||||
|
import InfoOutlinedIcon from '@mui/icons-material/InfoOutlined';
|
||||||
|
import ReportProblemOutlinedIcon from '@mui/icons-material/ReportProblemOutlined';
|
||||||
|
import ErrorIcon from '@mui/icons-material/Error';
|
||||||
|
|
||||||
|
type MessageBoxLevel = 'warning' | 'success' | 'info' | 'error';
|
||||||
|
|
||||||
|
export interface MessageBoxProps extends BoxProps {
|
||||||
|
level: MessageBoxLevel;
|
||||||
|
message: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
const LEVEL_ICONS: { [type in MessageBoxLevel]: React.ComponentType<SvgIconProps> } = {
|
||||||
|
success: CheckCircleOutlineOutlinedIcon,
|
||||||
|
info: InfoOutlinedIcon,
|
||||||
|
warning: ReportProblemOutlinedIcon,
|
||||||
|
error: ErrorIcon
|
||||||
|
};
|
||||||
|
|
||||||
|
const LEVEL_BACKGROUNDS: { [type in MessageBoxLevel]: (theme: Theme) => string } = {
|
||||||
|
success: (theme: Theme) => theme.palette.success.dark,
|
||||||
|
info: (theme: Theme) => theme.palette.info.main,
|
||||||
|
warning: (theme: Theme) => theme.palette.warning.dark,
|
||||||
|
error: (theme: Theme) => theme.palette.error.dark
|
||||||
|
};
|
||||||
|
|
||||||
|
const MessageBox: FC<MessageBoxProps> = ({ level, message, sx, children, ...rest }) => {
|
||||||
|
const theme = useTheme();
|
||||||
|
const Icon = LEVEL_ICONS[level];
|
||||||
|
const backgroundColor = LEVEL_BACKGROUNDS[level](theme);
|
||||||
|
const color = 'white';
|
||||||
|
return (
|
||||||
|
<Box p={2} display="flex" alignItems="center" borderRadius={1} sx={{ backgroundColor, color, ...sx }} {...rest}>
|
||||||
|
<Icon />
|
||||||
|
<Typography sx={{ ml: 2, flexGrow: 1 }} variant="body1">
|
||||||
|
{message}
|
||||||
|
</Typography>
|
||||||
|
{children}
|
||||||
|
</Box>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default MessageBox;
|
||||||
@@ -1,64 +0,0 @@
|
|||||||
import React from 'react';
|
|
||||||
import {
|
|
||||||
TextValidator,
|
|
||||||
ValidatorComponentProps
|
|
||||||
} from 'react-material-ui-form-validator';
|
|
||||||
|
|
||||||
import { withStyles, WithStyles, createStyles } from '@material-ui/core/styles';
|
|
||||||
import { InputAdornment, IconButton } from '@material-ui/core';
|
|
||||||
import { Visibility, VisibilityOff } from '@material-ui/icons';
|
|
||||||
|
|
||||||
const styles = createStyles({
|
|
||||||
input: {
|
|
||||||
'&::-ms-reveal': {
|
|
||||||
display: 'none'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
type PasswordValidatorProps = WithStyles<typeof styles> &
|
|
||||||
Exclude<ValidatorComponentProps, 'type' | 'InputProps'>;
|
|
||||||
|
|
||||||
interface PasswordValidatorState {
|
|
||||||
showPassword: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
class PasswordValidator extends React.Component<
|
|
||||||
PasswordValidatorProps,
|
|
||||||
PasswordValidatorState
|
|
||||||
> {
|
|
||||||
state = {
|
|
||||||
showPassword: false
|
|
||||||
};
|
|
||||||
|
|
||||||
toggleShowPassword = () => {
|
|
||||||
this.setState({
|
|
||||||
showPassword: !this.state.showPassword
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
render() {
|
|
||||||
const { classes, ...rest } = this.props;
|
|
||||||
return (
|
|
||||||
<TextValidator
|
|
||||||
{...rest}
|
|
||||||
type={this.state.showPassword ? 'text' : 'password'}
|
|
||||||
InputProps={{
|
|
||||||
classes,
|
|
||||||
endAdornment: (
|
|
||||||
<InputAdornment position="end">
|
|
||||||
<IconButton
|
|
||||||
aria-label="Toggle password visibility"
|
|
||||||
onClick={this.toggleShowPassword}
|
|
||||||
>
|
|
||||||
{this.state.showPassword ? <Visibility /> : <VisibilityOff />}
|
|
||||||
</IconButton>
|
|
||||||
</InputAdornment>
|
|
||||||
)
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export default withStyles(styles)(PasswordValidator);
|
|
||||||
@@ -1,141 +0,0 @@
|
|||||||
import React from 'react';
|
|
||||||
import { withSnackbar, WithSnackbarProps } from 'notistack';
|
|
||||||
|
|
||||||
import { redirectingAuthorizedFetch } from '../authentication';
|
|
||||||
|
|
||||||
export interface RestControllerProps<D> extends WithSnackbarProps {
|
|
||||||
handleValueChange: (
|
|
||||||
name: keyof D
|
|
||||||
) => (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
||||||
|
|
||||||
setData: (data: D, callback?: () => void) => void;
|
|
||||||
saveData: () => void;
|
|
||||||
loadData: () => void;
|
|
||||||
|
|
||||||
data?: D;
|
|
||||||
loading: boolean;
|
|
||||||
errorMessage?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export const extractEventValue = (
|
|
||||||
event: React.ChangeEvent<HTMLInputElement>
|
|
||||||
) => {
|
|
||||||
switch (event.target.type) {
|
|
||||||
case 'number':
|
|
||||||
return event.target.valueAsNumber;
|
|
||||||
case 'checkbox':
|
|
||||||
return event.target.checked;
|
|
||||||
default:
|
|
||||||
return event.target.value;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
interface RestControllerState<D> {
|
|
||||||
data?: D;
|
|
||||||
loading: boolean;
|
|
||||||
errorMessage?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function restController<D, P extends RestControllerProps<D>>(
|
|
||||||
endpointUrl: string,
|
|
||||||
RestController: React.ComponentType<P & RestControllerProps<D>>
|
|
||||||
) {
|
|
||||||
return withSnackbar(
|
|
||||||
class extends React.Component<
|
|
||||||
Omit<P, keyof RestControllerProps<D>> & WithSnackbarProps,
|
|
||||||
RestControllerState<D>
|
|
||||||
> {
|
|
||||||
state: RestControllerState<D> = {
|
|
||||||
data: undefined,
|
|
||||||
loading: false,
|
|
||||||
errorMessage: undefined
|
|
||||||
};
|
|
||||||
|
|
||||||
setData = (data: D, callback?: () => void) => {
|
|
||||||
this.setState(
|
|
||||||
{
|
|
||||||
data,
|
|
||||||
loading: false,
|
|
||||||
errorMessage: undefined
|
|
||||||
},
|
|
||||||
callback
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
loadData = () => {
|
|
||||||
this.setState({
|
|
||||||
data: undefined,
|
|
||||||
loading: true,
|
|
||||||
errorMessage: undefined
|
|
||||||
});
|
|
||||||
redirectingAuthorizedFetch(endpointUrl)
|
|
||||||
.then((response) => {
|
|
||||||
if (response.status === 200) {
|
|
||||||
return response.json();
|
|
||||||
}
|
|
||||||
throw Error('Invalid status code: ' + response.status);
|
|
||||||
})
|
|
||||||
.then((json) => {
|
|
||||||
this.setState({ data: json, loading: false });
|
|
||||||
})
|
|
||||||
.catch((error) => {
|
|
||||||
const errorMessage = error.message || 'Unknown error';
|
|
||||||
this.props.enqueueSnackbar('Problem fetching: ' + errorMessage, {
|
|
||||||
variant: 'error'
|
|
||||||
});
|
|
||||||
this.setState({ data: undefined, loading: false, errorMessage });
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
saveData = () => {
|
|
||||||
this.setState({ loading: true });
|
|
||||||
redirectingAuthorizedFetch(endpointUrl, {
|
|
||||||
method: 'POST',
|
|
||||||
body: JSON.stringify(this.state.data),
|
|
||||||
headers: {
|
|
||||||
'Content-Type': 'application/json'
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.then((response) => {
|
|
||||||
if (response.status === 200) {
|
|
||||||
return response.json();
|
|
||||||
}
|
|
||||||
throw Error('Invalid status code: ' + response.status);
|
|
||||||
})
|
|
||||||
.then((json) => {
|
|
||||||
this.props.enqueueSnackbar('Update successful.', {
|
|
||||||
variant: 'success'
|
|
||||||
});
|
|
||||||
this.setState({ data: json, loading: false });
|
|
||||||
})
|
|
||||||
.catch((error) => {
|
|
||||||
const errorMessage = error.message || 'Unknown error';
|
|
||||||
this.props.enqueueSnackbar('Problem updating: ' + errorMessage, {
|
|
||||||
variant: 'error'
|
|
||||||
});
|
|
||||||
this.setState({ data: undefined, loading: false, errorMessage });
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
handleValueChange = (name: keyof D) => (
|
|
||||||
event: React.ChangeEvent<HTMLInputElement>
|
|
||||||
) => {
|
|
||||||
const data = { ...this.state.data!, [name]: extractEventValue(event) };
|
|
||||||
this.setState({ data });
|
|
||||||
};
|
|
||||||
|
|
||||||
render() {
|
|
||||||
return (
|
|
||||||
<RestController
|
|
||||||
{...this.state}
|
|
||||||
{...(this.props as P)}
|
|
||||||
handleValueChange={this.handleValueChange}
|
|
||||||
setData={this.setData}
|
|
||||||
saveData={this.saveData}
|
|
||||||
loadData={this.loadData}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,64 +0,0 @@
|
|||||||
import React from 'react';
|
|
||||||
|
|
||||||
import { makeStyles, Theme, createStyles } from '@material-ui/core/styles';
|
|
||||||
import { Button, LinearProgress, Typography } from '@material-ui/core';
|
|
||||||
|
|
||||||
import { RestControllerProps } from '.';
|
|
||||||
|
|
||||||
const useStyles = makeStyles((theme: Theme) =>
|
|
||||||
createStyles({
|
|
||||||
loadingSettings: {
|
|
||||||
margin: theme.spacing(0.5)
|
|
||||||
},
|
|
||||||
loadingSettingsDetails: {
|
|
||||||
margin: theme.spacing(4),
|
|
||||||
textAlign: 'center'
|
|
||||||
},
|
|
||||||
button: {
|
|
||||||
marginRight: theme.spacing(2),
|
|
||||||
marginTop: theme.spacing(2)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
);
|
|
||||||
|
|
||||||
export type RestFormProps<D> = Omit<
|
|
||||||
RestControllerProps<D>,
|
|
||||||
'loading' | 'errorMessage'
|
|
||||||
> & { data: D };
|
|
||||||
|
|
||||||
interface RestFormLoaderProps<D> extends RestControllerProps<D> {
|
|
||||||
render: (props: RestFormProps<D>) => JSX.Element;
|
|
||||||
}
|
|
||||||
|
|
||||||
export default function RestFormLoader<D>(props: RestFormLoaderProps<D>) {
|
|
||||||
const { loading, errorMessage, loadData, render, data, ...rest } = props;
|
|
||||||
const classes = useStyles();
|
|
||||||
if (loading || !data) {
|
|
||||||
return (
|
|
||||||
<div className={classes.loadingSettings}>
|
|
||||||
<LinearProgress className={classes.loadingSettingsDetails} />
|
|
||||||
<Typography variant="h6" className={classes.loadingSettingsDetails}>
|
|
||||||
Loading…
|
|
||||||
</Typography>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
if (errorMessage) {
|
|
||||||
return (
|
|
||||||
<div className={classes.loadingSettings}>
|
|
||||||
<Typography variant="h6" className={classes.loadingSettingsDetails}>
|
|
||||||
{errorMessage}
|
|
||||||
</Typography>
|
|
||||||
<Button
|
|
||||||
variant="contained"
|
|
||||||
color="secondary"
|
|
||||||
className={classes.button}
|
|
||||||
onClick={loadData}
|
|
||||||
>
|
|
||||||
Retry
|
|
||||||
</Button>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
return render({ ...rest, loadData, data });
|
|
||||||
}
|
|
||||||
@@ -1,31 +1,20 @@
|
|||||||
import React from 'react';
|
import { FC } from 'react';
|
||||||
|
|
||||||
import { Typography, Paper } from '@material-ui/core';
|
import { Paper, Divider } from '@mui/material';
|
||||||
import { createStyles, Theme, makeStyles } from '@material-ui/core/styles';
|
|
||||||
|
|
||||||
const useStyles = makeStyles((theme: Theme) =>
|
import { RequiredChildrenProps } from '../utils';
|
||||||
createStyles({
|
|
||||||
content: {
|
|
||||||
padding: theme.spacing(2),
|
|
||||||
margin: theme.spacing(3)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
);
|
|
||||||
|
|
||||||
interface SectionContentProps {
|
interface SectionContentProps extends RequiredChildrenProps {
|
||||||
title: string;
|
title: string;
|
||||||
titleGutter?: boolean;
|
titleGutter?: boolean;
|
||||||
id?: string;
|
id?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const SectionContent: React.FC<SectionContentProps> = (props) => {
|
const SectionContent: FC<SectionContentProps> = (props) => {
|
||||||
const { children, title, titleGutter, id } = props;
|
const { children, title, id } = props;
|
||||||
const classes = useStyles();
|
|
||||||
return (
|
return (
|
||||||
<Paper id={id} className={classes.content}>
|
<Paper id={id} sx={{ p: 2, m: 2 }}>
|
||||||
<Typography variant="h6" gutterBottom={titleGutter}>
|
<Divider sx={{ pb: 2, borderColor: 'primary.main', fontSize: 20, color: 'primary.main' }}>{title}</Divider>
|
||||||
{title}
|
|
||||||
</Typography>
|
|
||||||
{children}
|
{children}
|
||||||
</Paper>
|
</Paper>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,128 +0,0 @@
|
|||||||
import React, { FC, Fragment } from 'react';
|
|
||||||
import { useDropzone, DropzoneState } from 'react-dropzone';
|
|
||||||
|
|
||||||
import { makeStyles, createStyles } from '@material-ui/styles';
|
|
||||||
import CloudUploadIcon from '@material-ui/icons/CloudUpload';
|
|
||||||
import CancelIcon from '@material-ui/icons/Cancel';
|
|
||||||
import {
|
|
||||||
Theme,
|
|
||||||
Box,
|
|
||||||
Typography,
|
|
||||||
LinearProgress,
|
|
||||||
Button
|
|
||||||
} from '@material-ui/core';
|
|
||||||
|
|
||||||
interface SingleUploadStyleProps extends DropzoneState {
|
|
||||||
uploading: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
const progressPercentage = (progress: ProgressEvent) =>
|
|
||||||
Math.round((progress.loaded * 100) / progress.total);
|
|
||||||
|
|
||||||
const getBorderColor = (theme: Theme, props: SingleUploadStyleProps) => {
|
|
||||||
if (props.isDragAccept) {
|
|
||||||
return theme.palette.success.main;
|
|
||||||
}
|
|
||||||
if (props.isDragReject) {
|
|
||||||
return theme.palette.error.main;
|
|
||||||
}
|
|
||||||
if (props.isDragActive) {
|
|
||||||
return theme.palette.info.main;
|
|
||||||
}
|
|
||||||
return theme.palette.grey[700];
|
|
||||||
};
|
|
||||||
|
|
||||||
const useStyles = makeStyles((theme: Theme) =>
|
|
||||||
createStyles({
|
|
||||||
dropzone: {
|
|
||||||
padding: theme.spacing(8, 2),
|
|
||||||
borderWidth: 2,
|
|
||||||
borderRadius: 2,
|
|
||||||
borderStyle: 'dashed',
|
|
||||||
color: theme.palette.grey[700],
|
|
||||||
transition: 'border .24s ease-in-out',
|
|
||||||
cursor: (props: SingleUploadStyleProps) =>
|
|
||||||
props.uploading ? 'default' : 'pointer',
|
|
||||||
width: '100%',
|
|
||||||
borderColor: (props: SingleUploadStyleProps) =>
|
|
||||||
getBorderColor(theme, props)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
);
|
|
||||||
|
|
||||||
export interface SingleUploadProps {
|
|
||||||
onDrop: (acceptedFiles: File[]) => void;
|
|
||||||
onCancel: () => void;
|
|
||||||
accept?: string | string[];
|
|
||||||
uploading: boolean;
|
|
||||||
progress?: ProgressEvent;
|
|
||||||
}
|
|
||||||
|
|
||||||
const SingleUpload: FC<SingleUploadProps> = ({
|
|
||||||
onDrop,
|
|
||||||
onCancel,
|
|
||||||
accept,
|
|
||||||
uploading,
|
|
||||||
progress
|
|
||||||
}) => {
|
|
||||||
const dropzoneState = useDropzone({
|
|
||||||
onDrop,
|
|
||||||
accept,
|
|
||||||
disabled: uploading,
|
|
||||||
multiple: false
|
|
||||||
});
|
|
||||||
const { getRootProps, getInputProps } = dropzoneState;
|
|
||||||
const classes = useStyles({ ...dropzoneState, uploading });
|
|
||||||
|
|
||||||
const renderProgressText = () => {
|
|
||||||
if (uploading) {
|
|
||||||
if (progress?.lengthComputable) {
|
|
||||||
return `Uploading: ${progressPercentage(progress)}%`;
|
|
||||||
}
|
|
||||||
return 'Uploading\u2026';
|
|
||||||
}
|
|
||||||
return 'Drop file or click here';
|
|
||||||
};
|
|
||||||
|
|
||||||
const renderProgress = (progress?: ProgressEvent) => (
|
|
||||||
<LinearProgress
|
|
||||||
variant={
|
|
||||||
!progress || progress.lengthComputable ? 'determinate' : 'indeterminate'
|
|
||||||
}
|
|
||||||
value={
|
|
||||||
!progress
|
|
||||||
? 0
|
|
||||||
: progress.lengthComputable
|
|
||||||
? progressPercentage(progress)
|
|
||||||
: 0
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div {...getRootProps({ className: classes.dropzone })}>
|
|
||||||
<input {...getInputProps()} />
|
|
||||||
<Box flexDirection="column" display="flex" alignItems="center">
|
|
||||||
<CloudUploadIcon fontSize="large" />
|
|
||||||
<Typography variant="h6">{renderProgressText()}</Typography>
|
|
||||||
{uploading && (
|
|
||||||
<Fragment>
|
|
||||||
<Box width="100%" p={2}>
|
|
||||||
{renderProgress(progress)}
|
|
||||||
</Box>
|
|
||||||
<Button
|
|
||||||
startIcon={<CancelIcon />}
|
|
||||||
variant="contained"
|
|
||||||
color="secondary"
|
|
||||||
onClick={onCancel}
|
|
||||||
>
|
|
||||||
Cancel
|
|
||||||
</Button>
|
|
||||||
</Fragment>
|
|
||||||
)}
|
|
||||||
</Box>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default SingleUpload;
|
|
||||||
@@ -1,158 +0,0 @@
|
|||||||
import React from 'react';
|
|
||||||
import Sockette from 'sockette';
|
|
||||||
import throttle from 'lodash/throttle';
|
|
||||||
import { withSnackbar, WithSnackbarProps } from 'notistack';
|
|
||||||
|
|
||||||
import { addAccessTokenParameter } from '../authentication';
|
|
||||||
import { extractEventValue } from '.';
|
|
||||||
|
|
||||||
export interface WebSocketControllerProps<D> extends WithSnackbarProps {
|
|
||||||
handleValueChange: (
|
|
||||||
name: keyof D
|
|
||||||
) => (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
||||||
|
|
||||||
setData: (data: D, callback?: () => void) => void;
|
|
||||||
saveData: () => void;
|
|
||||||
saveDataAndClear(): () => void;
|
|
||||||
|
|
||||||
connected: boolean;
|
|
||||||
data?: D;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface WebSocketControllerState<D> {
|
|
||||||
ws: Sockette;
|
|
||||||
connected: boolean;
|
|
||||||
clientId?: string;
|
|
||||||
data?: D;
|
|
||||||
}
|
|
||||||
|
|
||||||
enum WebSocketMessageType {
|
|
||||||
ID = 'id',
|
|
||||||
PAYLOAD = 'payload'
|
|
||||||
}
|
|
||||||
|
|
||||||
interface WebSocketIdMessage {
|
|
||||||
type: typeof WebSocketMessageType.ID;
|
|
||||||
id: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface WebSocketPayloadMessage<D> {
|
|
||||||
type: typeof WebSocketMessageType.PAYLOAD;
|
|
||||||
origin_id: string;
|
|
||||||
payload: D;
|
|
||||||
}
|
|
||||||
|
|
||||||
export type WebSocketMessage<D> =
|
|
||||||
| WebSocketIdMessage
|
|
||||||
| WebSocketPayloadMessage<D>;
|
|
||||||
|
|
||||||
export function webSocketController<D, P extends WebSocketControllerProps<D>>(
|
|
||||||
wsUrl: string,
|
|
||||||
wsThrottle: number,
|
|
||||||
WebSocketController: React.ComponentType<P & WebSocketControllerProps<D>>
|
|
||||||
) {
|
|
||||||
return withSnackbar(
|
|
||||||
class extends React.Component<
|
|
||||||
Omit<P, keyof WebSocketControllerProps<D>> & WithSnackbarProps,
|
|
||||||
WebSocketControllerState<D>
|
|
||||||
> {
|
|
||||||
constructor(
|
|
||||||
props: Omit<P, keyof WebSocketControllerProps<D>> & WithSnackbarProps
|
|
||||||
) {
|
|
||||||
super(props);
|
|
||||||
this.state = {
|
|
||||||
ws: new Sockette(addAccessTokenParameter(wsUrl), {
|
|
||||||
onmessage: this.onMessage,
|
|
||||||
onopen: this.onOpen,
|
|
||||||
onclose: this.onClose
|
|
||||||
}),
|
|
||||||
connected: false
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
componentWillUnmount() {
|
|
||||||
this.state.ws.close();
|
|
||||||
}
|
|
||||||
|
|
||||||
onMessage = (event: MessageEvent) => {
|
|
||||||
const rawData = event.data;
|
|
||||||
if (typeof rawData === 'string' || rawData instanceof String) {
|
|
||||||
this.handleMessage(
|
|
||||||
JSON.parse(rawData as string) as WebSocketMessage<D>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
handleMessage = (message: WebSocketMessage<D>) => {
|
|
||||||
const { clientId, data } = this.state;
|
|
||||||
|
|
||||||
switch (message.type) {
|
|
||||||
case WebSocketMessageType.ID:
|
|
||||||
this.setState({ clientId: message.id });
|
|
||||||
break;
|
|
||||||
case WebSocketMessageType.PAYLOAD:
|
|
||||||
if (clientId && (!data || clientId !== message.origin_id)) {
|
|
||||||
this.setState({ data: message.payload });
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
onOpen = () => {
|
|
||||||
this.setState({ connected: true });
|
|
||||||
};
|
|
||||||
|
|
||||||
onClose = () => {
|
|
||||||
this.setState({
|
|
||||||
connected: false,
|
|
||||||
clientId: undefined,
|
|
||||||
data: undefined
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
setData = (data: D, callback?: () => void) => {
|
|
||||||
this.setState({ data }, callback);
|
|
||||||
};
|
|
||||||
|
|
||||||
saveData = throttle(() => {
|
|
||||||
const { ws, connected, data } = this.state;
|
|
||||||
if (connected) {
|
|
||||||
ws.json(data);
|
|
||||||
}
|
|
||||||
}, wsThrottle);
|
|
||||||
|
|
||||||
saveDataAndClear = throttle(() => {
|
|
||||||
const { ws, connected, data } = this.state;
|
|
||||||
if (connected) {
|
|
||||||
this.setState(
|
|
||||||
{
|
|
||||||
data: undefined
|
|
||||||
},
|
|
||||||
() => ws.json(data)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}, wsThrottle);
|
|
||||||
|
|
||||||
handleValueChange = (name: keyof D) => (
|
|
||||||
event: React.ChangeEvent<HTMLInputElement>
|
|
||||||
) => {
|
|
||||||
const data = { ...this.state.data!, [name]: extractEventValue(event) };
|
|
||||||
this.setState({ data });
|
|
||||||
};
|
|
||||||
|
|
||||||
render() {
|
|
||||||
return (
|
|
||||||
<WebSocketController
|
|
||||||
{...(this.props as P)}
|
|
||||||
handleValueChange={this.handleValueChange}
|
|
||||||
setData={this.setData}
|
|
||||||
saveData={this.saveData}
|
|
||||||
saveDataAndClear={this.saveDataAndClear}
|
|
||||||
connected={this.state.connected}
|
|
||||||
data={this.state.data}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,43 +0,0 @@
|
|||||||
import { makeStyles, Theme, createStyles } from '@material-ui/core/styles';
|
|
||||||
import { LinearProgress, Typography } from '@material-ui/core';
|
|
||||||
|
|
||||||
import { WebSocketControllerProps } from '.';
|
|
||||||
|
|
||||||
const useStyles = makeStyles((theme: Theme) =>
|
|
||||||
createStyles({
|
|
||||||
loadingSettings: {
|
|
||||||
margin: theme.spacing(0.5)
|
|
||||||
},
|
|
||||||
loadingSettingsDetails: {
|
|
||||||
margin: theme.spacing(4),
|
|
||||||
textAlign: 'center'
|
|
||||||
}
|
|
||||||
})
|
|
||||||
);
|
|
||||||
|
|
||||||
export type WebSocketFormProps<D> = Omit<
|
|
||||||
WebSocketControllerProps<D>,
|
|
||||||
'connected'
|
|
||||||
> & { data: D };
|
|
||||||
|
|
||||||
interface WebSocketFormLoaderProps<D> extends WebSocketControllerProps<D> {
|
|
||||||
render: (props: WebSocketFormProps<D>) => JSX.Element;
|
|
||||||
}
|
|
||||||
|
|
||||||
export default function WebSocketFormLoader<D>(
|
|
||||||
props: WebSocketFormLoaderProps<D>
|
|
||||||
) {
|
|
||||||
const { connected, render, data, ...rest } = props;
|
|
||||||
const classes = useStyles();
|
|
||||||
if (!connected || !data) {
|
|
||||||
return (
|
|
||||||
<div className={classes.loadingSettings}>
|
|
||||||
<LinearProgress className={classes.loadingSettingsDetails} />
|
|
||||||
<Typography variant="h6" className={classes.loadingSettingsDetails}>
|
|
||||||
Connecting to WebSocket...
|
|
||||||
</Typography>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
return render({ ...rest, data });
|
|
||||||
}
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
import { useLayoutEffect, useState } from 'react';
|
|
||||||
|
|
||||||
export function useWindowSize() {
|
|
||||||
const [size, setSize] = useState([0, 0]);
|
|
||||||
useLayoutEffect(() => {
|
|
||||||
function updateSize() {
|
|
||||||
setSize([window.innerWidth, window.innerHeight]);
|
|
||||||
}
|
|
||||||
window.addEventListener('resize', updateSize);
|
|
||||||
updateSize();
|
|
||||||
return () => window.removeEventListener('resize', updateSize);
|
|
||||||
}, []);
|
|
||||||
return size;
|
|
||||||
}
|
|
||||||
@@ -1,19 +1,8 @@
|
|||||||
export { default as BlockFormControlLabel } from './BlockFormControlLabel';
|
export * from './inputs';
|
||||||
export { default as FormActions } from './FormActions';
|
export * from './layout';
|
||||||
export { default as FormButton } from './FormButton';
|
export * from './loading';
|
||||||
export { default as HighlightAvatar } from './HighlightAvatar';
|
export * from './routing';
|
||||||
export { default as MenuAppBar } from './MenuAppBar';
|
export * from './upload';
|
||||||
export { default as PasswordValidator } from './PasswordValidator';
|
|
||||||
export { default as RestFormLoader } from './RestFormLoader';
|
|
||||||
export { default as SectionContent } from './SectionContent';
|
export { default as SectionContent } from './SectionContent';
|
||||||
export { default as WebSocketFormLoader } from './WebSocketFormLoader';
|
export { default as ButtonRow } from './ButtonRow';
|
||||||
export { default as ErrorButton } from './ErrorButton';
|
export { default as MessageBox } from './MessageBox';
|
||||||
export { default as SingleUpload } from './SingleUpload';
|
|
||||||
|
|
||||||
export * from './RestFormLoader';
|
|
||||||
export * from './RestController';
|
|
||||||
|
|
||||||
export * from './WebSocketFormLoader';
|
|
||||||
export * from './WebSocketController';
|
|
||||||
|
|
||||||
export * from './WindowSize';
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { FC } from 'react';
|
import { FC } from 'react';
|
||||||
import { FormControlLabel, FormControlLabelProps } from '@material-ui/core';
|
import { FormControlLabel, FormControlLabelProps } from '@mui/material';
|
||||||
|
|
||||||
const BlockFormControlLabel: FC<FormControlLabelProps> = (props) => (
|
const BlockFormControlLabel: FC<FormControlLabelProps> = (props) => (
|
||||||
<div>
|
<div>
|
||||||
36
interface/src/components/inputs/ValidatedPasswordField.tsx
Normal file
36
interface/src/components/inputs/ValidatedPasswordField.tsx
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
import { FC, useState } from 'react';
|
||||||
|
|
||||||
|
import { IconButton, InputAdornment } from '@mui/material';
|
||||||
|
import VisibilityIcon from '@mui/icons-material/Visibility';
|
||||||
|
import VisibilityOffIcon from '@mui/icons-material/VisibilityOff';
|
||||||
|
|
||||||
|
import ValidatedTextField, { ValidatedTextFieldProps } from './ValidatedTextField';
|
||||||
|
|
||||||
|
type ValidatedPasswordFieldProps = Omit<ValidatedTextFieldProps, 'type'>;
|
||||||
|
|
||||||
|
const ValidatedPasswordField: FC<ValidatedPasswordFieldProps> = ({ InputProps, ...props }) => {
|
||||||
|
const [showPassword, setShowPassword] = useState<boolean>(false);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<ValidatedTextField
|
||||||
|
{...props}
|
||||||
|
type={showPassword ? 'text' : 'password'}
|
||||||
|
InputProps={{
|
||||||
|
...InputProps,
|
||||||
|
endAdornment: (
|
||||||
|
<InputAdornment position="end">
|
||||||
|
<IconButton
|
||||||
|
aria-label="toggle password visibility"
|
||||||
|
onClick={() => setShowPassword(!showPassword)}
|
||||||
|
edge="end"
|
||||||
|
>
|
||||||
|
{showPassword ? <VisibilityIcon /> : <VisibilityOffIcon />}
|
||||||
|
</IconButton>
|
||||||
|
</InputAdornment>
|
||||||
|
)
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default ValidatedPasswordField;
|
||||||
24
interface/src/components/inputs/ValidatedTextField.tsx
Normal file
24
interface/src/components/inputs/ValidatedTextField.tsx
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
import { FC } from 'react';
|
||||||
|
import { ValidateFieldsError } from 'async-validator';
|
||||||
|
|
||||||
|
import { FormHelperText, TextField, TextFieldProps } from '@mui/material';
|
||||||
|
|
||||||
|
interface ValidatedFieldProps {
|
||||||
|
fieldErrors?: ValidateFieldsError;
|
||||||
|
name: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export type ValidatedTextFieldProps = ValidatedFieldProps & TextFieldProps;
|
||||||
|
|
||||||
|
const ValidatedTextField: FC<ValidatedTextFieldProps> = ({ fieldErrors, ...rest }) => {
|
||||||
|
const errors = fieldErrors && fieldErrors[rest.name];
|
||||||
|
const renderErrors = () => errors && errors.map((e, i) => <FormHelperText key={i}>{e.message}</FormHelperText>);
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<TextField error={!!errors} {...rest} />
|
||||||
|
{renderErrors()}
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default ValidatedTextField;
|
||||||
3
interface/src/components/inputs/index.ts
Normal file
3
interface/src/components/inputs/index.ts
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
export { default as BlockFormControlLabel } from './BlockFormControlLabel';
|
||||||
|
export { default as ValidatedPasswordField } from './ValidatedPasswordField';
|
||||||
|
export { default as ValidatedTextField } from './ValidatedTextField';
|
||||||
38
interface/src/components/layout/Layout.tsx
Normal file
38
interface/src/components/layout/Layout.tsx
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
import { FC, useState, useEffect } from 'react';
|
||||||
|
import { useLocation } from 'react-router-dom';
|
||||||
|
|
||||||
|
import { Box, Toolbar } from '@mui/material';
|
||||||
|
|
||||||
|
import { PROJECT_NAME } from '../../api/env';
|
||||||
|
import { RequiredChildrenProps } from '../../utils';
|
||||||
|
|
||||||
|
import LayoutDrawer from './LayoutDrawer';
|
||||||
|
import LayoutAppBar from './LayoutAppBar';
|
||||||
|
import { LayoutContext } from './context';
|
||||||
|
|
||||||
|
export const DRAWER_WIDTH = 240;
|
||||||
|
|
||||||
|
const Layout: FC<RequiredChildrenProps> = ({ children }) => {
|
||||||
|
const [mobileOpen, setMobileOpen] = useState(false);
|
||||||
|
const [title, setTitle] = useState(PROJECT_NAME);
|
||||||
|
const { pathname } = useLocation();
|
||||||
|
|
||||||
|
const handleDrawerToggle = () => {
|
||||||
|
setMobileOpen(!mobileOpen);
|
||||||
|
};
|
||||||
|
|
||||||
|
useEffect(() => setMobileOpen(false), [pathname]);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<LayoutContext.Provider value={{ title, setTitle }}>
|
||||||
|
<LayoutAppBar title={title} onToggleDrawer={handleDrawerToggle} />
|
||||||
|
<LayoutDrawer mobileOpen={mobileOpen} onClose={handleDrawerToggle} />
|
||||||
|
<Box component="main" sx={{ marginLeft: { md: `${DRAWER_WIDTH}px` } }}>
|
||||||
|
<Toolbar />
|
||||||
|
{children}
|
||||||
|
</Box>
|
||||||
|
</LayoutContext.Provider>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default Layout;
|
||||||
50
interface/src/components/layout/LayoutAppBar.tsx
Normal file
50
interface/src/components/layout/LayoutAppBar.tsx
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
import { FC, useContext } from 'react';
|
||||||
|
|
||||||
|
import { AppBar, Box, IconButton, Toolbar, Typography } from '@mui/material';
|
||||||
|
import MenuIcon from '@mui/icons-material/Menu';
|
||||||
|
|
||||||
|
import LayoutAuthMenu from './LayoutAuthMenu';
|
||||||
|
|
||||||
|
import { FeaturesContext } from '../../contexts/features';
|
||||||
|
|
||||||
|
export const DRAWER_WIDTH = 240;
|
||||||
|
|
||||||
|
interface LayoutAppBarProps {
|
||||||
|
title: string;
|
||||||
|
onToggleDrawer: () => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
const LayoutAppBar: FC<LayoutAppBarProps> = ({ title, onToggleDrawer }) => {
|
||||||
|
const { features } = useContext(FeaturesContext);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<AppBar
|
||||||
|
position="fixed"
|
||||||
|
sx={{
|
||||||
|
width: { md: `calc(100% - ${DRAWER_WIDTH}px)` },
|
||||||
|
ml: { md: `${DRAWER_WIDTH}px` },
|
||||||
|
boxShadow: 'none',
|
||||||
|
backgroundColor: '#2e586a'
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Toolbar>
|
||||||
|
<IconButton
|
||||||
|
color="inherit"
|
||||||
|
aria-label="open drawer"
|
||||||
|
edge="start"
|
||||||
|
onClick={onToggleDrawer}
|
||||||
|
sx={{ mr: 2, display: { md: 'none' } }}
|
||||||
|
>
|
||||||
|
<MenuIcon />
|
||||||
|
</IconButton>
|
||||||
|
<Typography variant="h6" noWrap component="div">
|
||||||
|
{title}
|
||||||
|
</Typography>
|
||||||
|
<Box flexGrow={1} />
|
||||||
|
{features.security && <LayoutAuthMenu />}
|
||||||
|
</Toolbar>
|
||||||
|
</AppBar>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default LayoutAppBar;
|
||||||
154
interface/src/components/layout/LayoutAuthMenu.tsx
Normal file
154
interface/src/components/layout/LayoutAuthMenu.tsx
Normal file
@@ -0,0 +1,154 @@
|
|||||||
|
import { FC, useState, useContext, ChangeEventHandler } from 'react';
|
||||||
|
|
||||||
|
import {
|
||||||
|
Box,
|
||||||
|
Button,
|
||||||
|
Divider,
|
||||||
|
IconButton,
|
||||||
|
Popover,
|
||||||
|
Typography,
|
||||||
|
Avatar,
|
||||||
|
styled,
|
||||||
|
TypographyProps,
|
||||||
|
MenuItem,
|
||||||
|
TextField
|
||||||
|
} from '@mui/material';
|
||||||
|
|
||||||
|
import PersonIcon from '@mui/icons-material/Person';
|
||||||
|
import AccountCircleIcon from '@mui/icons-material/AccountCircle';
|
||||||
|
|
||||||
|
import { AuthenticatedContext } from '../../contexts/authentication';
|
||||||
|
|
||||||
|
import { I18nContext } from '../../i18n/i18n-react';
|
||||||
|
import type { Locales } from '../../i18n/i18n-types';
|
||||||
|
import { loadLocaleAsync } from '../../i18n/i18n-util.async';
|
||||||
|
|
||||||
|
import { ReactComponent as NLflag } from '../../i18n/NL.svg';
|
||||||
|
import { ReactComponent as DEflag } from '../../i18n/DE.svg';
|
||||||
|
import { ReactComponent as GBflag } from '../../i18n/GB.svg';
|
||||||
|
import { ReactComponent as SVflag } from '../../i18n/SV.svg';
|
||||||
|
import { ReactComponent as PLflag } from '../../i18n/PL.svg';
|
||||||
|
import { ReactComponent as NOflag } from '../../i18n/NO.svg';
|
||||||
|
import { ReactComponent as FRflag } from '../../i18n/FR.svg';
|
||||||
|
|
||||||
|
const ItemTypography = styled(Typography)<TypographyProps>({
|
||||||
|
maxWidth: '250px',
|
||||||
|
whiteSpace: 'nowrap',
|
||||||
|
overflow: 'hidden',
|
||||||
|
textOverflow: 'ellipsis'
|
||||||
|
});
|
||||||
|
|
||||||
|
const LayoutAuthMenu: FC = () => {
|
||||||
|
const { me, signOut } = useContext(AuthenticatedContext);
|
||||||
|
|
||||||
|
const [anchorEl, setAnchorEl] = useState<HTMLButtonElement | null>(null);
|
||||||
|
|
||||||
|
const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {
|
||||||
|
setAnchorEl(event.currentTarget);
|
||||||
|
};
|
||||||
|
|
||||||
|
const { locale, LL, setLocale } = useContext(I18nContext);
|
||||||
|
|
||||||
|
const onLocaleSelected: ChangeEventHandler<HTMLInputElement> = async ({ target }) => {
|
||||||
|
const loc = target.value as Locales;
|
||||||
|
localStorage.setItem('lang', loc);
|
||||||
|
await loadLocaleAsync(loc);
|
||||||
|
setLocale(loc);
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleClose = () => {
|
||||||
|
setAnchorEl(null);
|
||||||
|
};
|
||||||
|
|
||||||
|
const open = Boolean(anchorEl);
|
||||||
|
const id = anchorEl ? 'app-menu-popover' : undefined;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<TextField
|
||||||
|
name="locale"
|
||||||
|
InputProps={{ style: { fontSize: 10 } }}
|
||||||
|
variant="outlined"
|
||||||
|
value={locale}
|
||||||
|
onChange={onLocaleSelected}
|
||||||
|
size="small"
|
||||||
|
select
|
||||||
|
>
|
||||||
|
<MenuItem key="en" value="en">
|
||||||
|
<GBflag style={{ width: 16, verticalAlign: 'middle' }} />
|
||||||
|
EN
|
||||||
|
</MenuItem>
|
||||||
|
<Divider />
|
||||||
|
<MenuItem key="de" value="de">
|
||||||
|
<DEflag style={{ width: 16, verticalAlign: 'middle' }} />
|
||||||
|
DE
|
||||||
|
</MenuItem>
|
||||||
|
<MenuItem key="fr" value="fr">
|
||||||
|
<FRflag style={{ width: 16, verticalAlign: 'middle' }} />
|
||||||
|
FR
|
||||||
|
</MenuItem>
|
||||||
|
<MenuItem key="nl" value="nl">
|
||||||
|
<NLflag style={{ width: 16, verticalAlign: 'middle' }} />
|
||||||
|
NL
|
||||||
|
</MenuItem>
|
||||||
|
<MenuItem key="no" value="no">
|
||||||
|
<NOflag style={{ width: 16, verticalAlign: 'middle' }} />
|
||||||
|
NO
|
||||||
|
</MenuItem>
|
||||||
|
<MenuItem key="pl" value="pl">
|
||||||
|
<PLflag style={{ width: 16, verticalAlign: 'middle' }} />
|
||||||
|
PL
|
||||||
|
</MenuItem>
|
||||||
|
<MenuItem key="sv" value="sv">
|
||||||
|
<SVflag style={{ width: 16, verticalAlign: 'middle' }} />
|
||||||
|
SV
|
||||||
|
</MenuItem>
|
||||||
|
</TextField>
|
||||||
|
|
||||||
|
<IconButton
|
||||||
|
id="open-auth-menu"
|
||||||
|
sx={{ ml: 1, padding: 0 }}
|
||||||
|
aria-describedby={id}
|
||||||
|
color="inherit"
|
||||||
|
onClick={handleClick}
|
||||||
|
>
|
||||||
|
<AccountCircleIcon />
|
||||||
|
</IconButton>
|
||||||
|
<Popover
|
||||||
|
id="app-menu-popover"
|
||||||
|
sx={{ mt: 1 }}
|
||||||
|
open={open}
|
||||||
|
anchorEl={anchorEl}
|
||||||
|
onClose={handleClose}
|
||||||
|
anchorOrigin={{
|
||||||
|
vertical: 'bottom',
|
||||||
|
horizontal: 'center'
|
||||||
|
}}
|
||||||
|
transformOrigin={{
|
||||||
|
vertical: 'top',
|
||||||
|
horizontal: 'center'
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Box display="flex" flexDirection="row" alignItems="center" p={2}>
|
||||||
|
<Avatar sx={{ width: 80, height: 80 }}>
|
||||||
|
<PersonIcon fontSize="large" />
|
||||||
|
</Avatar>
|
||||||
|
<Box pl={2}>
|
||||||
|
<ItemTypography variant="h6">{me.username}</ItemTypography>
|
||||||
|
<ItemTypography variant="body1">
|
||||||
|
{me.admin ? LL.ADMIN() : LL.GUEST()} {LL.USER(2)}
|
||||||
|
</ItemTypography>
|
||||||
|
</Box>
|
||||||
|
</Box>
|
||||||
|
<Divider />
|
||||||
|
<Box p={1.5}>
|
||||||
|
<Button variant="outlined" fullWidth color="primary" onClick={() => signOut(true)}>
|
||||||
|
{LL.SIGN_OUT()}
|
||||||
|
</Button>
|
||||||
|
</Box>
|
||||||
|
</Popover>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default LayoutAuthMenu;
|
||||||
73
interface/src/components/layout/LayoutDrawer.tsx
Normal file
73
interface/src/components/layout/LayoutDrawer.tsx
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
import { FC } from 'react';
|
||||||
|
|
||||||
|
import { Box, Divider, Drawer, Toolbar, Typography, styled } from '@mui/material';
|
||||||
|
|
||||||
|
import { PROJECT_NAME } from '../../api/env';
|
||||||
|
|
||||||
|
import LayoutMenu from './LayoutMenu';
|
||||||
|
import { DRAWER_WIDTH } from './Layout';
|
||||||
|
|
||||||
|
const LayoutDrawerLogo = styled('img')(({ theme }) => ({
|
||||||
|
[theme.breakpoints.down('sm')]: {
|
||||||
|
height: 24,
|
||||||
|
marginRight: theme.spacing(2)
|
||||||
|
},
|
||||||
|
[theme.breakpoints.up('sm')]: {
|
||||||
|
height: 36,
|
||||||
|
marginRight: theme.spacing(2)
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
|
||||||
|
interface LayoutDrawerProps {
|
||||||
|
mobileOpen: boolean;
|
||||||
|
onClose: () => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
const LayoutDrawer: FC<LayoutDrawerProps> = ({ mobileOpen, onClose }) => {
|
||||||
|
const drawer = (
|
||||||
|
<>
|
||||||
|
<Toolbar disableGutters>
|
||||||
|
<Box display="flex" alignItems="center" px={2}>
|
||||||
|
<LayoutDrawerLogo src="/app/icon.png" alt={PROJECT_NAME} />
|
||||||
|
<Typography variant="h6" color="textPrimary">
|
||||||
|
{PROJECT_NAME}
|
||||||
|
</Typography>
|
||||||
|
</Box>
|
||||||
|
<Divider absolute />
|
||||||
|
</Toolbar>
|
||||||
|
<Divider />
|
||||||
|
<LayoutMenu />
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Box component="nav" sx={{ width: { md: DRAWER_WIDTH }, flexShrink: { md: 0 } }}>
|
||||||
|
<Drawer
|
||||||
|
variant="temporary"
|
||||||
|
open={mobileOpen}
|
||||||
|
onClose={onClose}
|
||||||
|
ModalProps={{
|
||||||
|
keepMounted: true
|
||||||
|
}}
|
||||||
|
sx={{
|
||||||
|
display: { xs: 'block', md: 'none' },
|
||||||
|
'& .MuiDrawer-paper': { boxSizing: 'border-box', width: DRAWER_WIDTH }
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{drawer}
|
||||||
|
</Drawer>
|
||||||
|
<Drawer
|
||||||
|
variant="permanent"
|
||||||
|
sx={{
|
||||||
|
display: { xs: 'none', md: 'block' },
|
||||||
|
'& .MuiDrawer-paper': { boxSizing: 'border-box', width: DRAWER_WIDTH }
|
||||||
|
}}
|
||||||
|
open
|
||||||
|
>
|
||||||
|
{drawer}
|
||||||
|
</Drawer>
|
||||||
|
</Box>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default LayoutDrawer;
|
||||||
50
interface/src/components/layout/LayoutMenu.tsx
Normal file
50
interface/src/components/layout/LayoutMenu.tsx
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
import { FC, useContext } from 'react';
|
||||||
|
|
||||||
|
import { Divider, List } from '@mui/material';
|
||||||
|
|
||||||
|
import SettingsInputAntennaIcon from '@mui/icons-material/SettingsInputAntenna';
|
||||||
|
import AccessTimeIcon from '@mui/icons-material/AccessTime';
|
||||||
|
import DeviceHubIcon from '@mui/icons-material/DeviceHub';
|
||||||
|
import SettingsIcon from '@mui/icons-material/Settings';
|
||||||
|
import LockIcon from '@mui/icons-material/Lock';
|
||||||
|
import SettingsEthernetIcon from '@mui/icons-material/SettingsEthernet';
|
||||||
|
|
||||||
|
import { FeaturesContext } from '../../contexts/features';
|
||||||
|
import ProjectMenu from '../../project/ProjectMenu';
|
||||||
|
|
||||||
|
import LayoutMenuItem from './LayoutMenuItem';
|
||||||
|
import { AuthenticatedContext } from '../../contexts/authentication';
|
||||||
|
|
||||||
|
import { useI18nContext } from '../../i18n/i18n-react';
|
||||||
|
|
||||||
|
const LayoutMenu: FC = () => {
|
||||||
|
const { features } = useContext(FeaturesContext);
|
||||||
|
const authenticatedContext = useContext(AuthenticatedContext);
|
||||||
|
const { LL } = useI18nContext();
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
{features.project && (
|
||||||
|
<List disablePadding component="nav">
|
||||||
|
<ProjectMenu />
|
||||||
|
<Divider />
|
||||||
|
</List>
|
||||||
|
)}
|
||||||
|
<List disablePadding component="nav">
|
||||||
|
<LayoutMenuItem icon={SettingsEthernetIcon} label={LL.NETWORK(0)} to="/network" />
|
||||||
|
<LayoutMenuItem icon={SettingsInputAntennaIcon} label={LL.ACCESS_POINT(0)} to="/ap" />
|
||||||
|
{features.ntp && <LayoutMenuItem icon={AccessTimeIcon} label="NTP" to="/ntp" />}
|
||||||
|
{features.mqtt && <LayoutMenuItem icon={DeviceHubIcon} label="MQTT" to="/mqtt" />}
|
||||||
|
<LayoutMenuItem
|
||||||
|
icon={LockIcon}
|
||||||
|
label={LL.SECURITY(0)}
|
||||||
|
to="/security"
|
||||||
|
disabled={!authenticatedContext.me.admin}
|
||||||
|
/>
|
||||||
|
<LayoutMenuItem icon={SettingsIcon} label={LL.SYSTEM(0)} to="/system" />
|
||||||
|
</List>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default LayoutMenu;
|
||||||
32
interface/src/components/layout/LayoutMenuItem.tsx
Normal file
32
interface/src/components/layout/LayoutMenuItem.tsx
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
import { FC } from 'react';
|
||||||
|
import { Link, useLocation } from 'react-router-dom';
|
||||||
|
|
||||||
|
import { ListItem, ListItemButton, ListItemIcon, ListItemText, SvgIconProps } from '@mui/material';
|
||||||
|
|
||||||
|
import { grey } from '@mui/material/colors';
|
||||||
|
|
||||||
|
import { routeMatches } from '../../utils';
|
||||||
|
|
||||||
|
interface LayoutMenuItemProps {
|
||||||
|
icon: React.ComponentType<SvgIconProps>;
|
||||||
|
label: string;
|
||||||
|
to: string;
|
||||||
|
disabled?: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
const LayoutMenuItem: FC<LayoutMenuItemProps> = ({ icon: Icon, label, to, disabled }) => {
|
||||||
|
const { pathname } = useLocation();
|
||||||
|
|
||||||
|
return (
|
||||||
|
<ListItem disablePadding selected={routeMatches(to, pathname)}>
|
||||||
|
<ListItemButton component={Link} to={to} disabled={disabled}>
|
||||||
|
<ListItemIcon sx={{ color: grey[500] }}>
|
||||||
|
<Icon />
|
||||||
|
</ListItemIcon>
|
||||||
|
<ListItemText>{label}</ListItemText>
|
||||||
|
</ListItemButton>
|
||||||
|
</ListItem>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default LayoutMenuItem;
|
||||||
25
interface/src/components/layout/context.ts
Normal file
25
interface/src/components/layout/context.ts
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
import { useRef, useEffect, createContext, useContext } from 'react';
|
||||||
|
|
||||||
|
export interface LayoutContextValue {
|
||||||
|
title: string;
|
||||||
|
setTitle: (title: string) => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
const LayoutContextDefaultValue = {} as LayoutContextValue;
|
||||||
|
export const LayoutContext = createContext(LayoutContextDefaultValue);
|
||||||
|
|
||||||
|
export const useLayoutTitle = (myTitle: string) => {
|
||||||
|
const { title, setTitle } = useContext(LayoutContext);
|
||||||
|
const previousTitle = useRef(title);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
setTitle(myTitle);
|
||||||
|
}, [setTitle, myTitle]);
|
||||||
|
|
||||||
|
useEffect(
|
||||||
|
() => () => {
|
||||||
|
setTitle(previousTitle.current);
|
||||||
|
},
|
||||||
|
[setTitle]
|
||||||
|
);
|
||||||
|
};
|
||||||
2
interface/src/components/layout/index.ts
Normal file
2
interface/src/components/layout/index.ts
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
export * from './context';
|
||||||
|
export { default as Layout } from './Layout';
|
||||||
43
interface/src/components/loading/ApplicationError.tsx
Normal file
43
interface/src/components/loading/ApplicationError.tsx
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
import { FC } from 'react';
|
||||||
|
|
||||||
|
import { Box, Paper, Typography } from '@mui/material';
|
||||||
|
import WarningIcon from '@mui/icons-material/Warning';
|
||||||
|
|
||||||
|
interface ApplicationErrorProps {
|
||||||
|
message?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
const ApplicationError: FC<ApplicationErrorProps> = ({ message }) => (
|
||||||
|
<Box display="flex" height="100vh" justifyContent="center" flexDirection="column">
|
||||||
|
<Paper
|
||||||
|
elevation={10}
|
||||||
|
sx={{
|
||||||
|
textAlign: 'center',
|
||||||
|
padding: '280px 0 40px 0',
|
||||||
|
backgroundImage: 'url("/app/icon.png")',
|
||||||
|
backgroundRepeat: 'no-repeat',
|
||||||
|
backgroundPosition: '50% 40px',
|
||||||
|
backgroundSize: '200px auto',
|
||||||
|
width: '100%',
|
||||||
|
borderRadius: 0
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Box display="flex" flexDirection="row" justifyContent="center" alignItems="center" mb={2}>
|
||||||
|
<WarningIcon fontSize="large" color="error" />
|
||||||
|
<Box ml={2}>
|
||||||
|
<Typography variant="h4">Application Error</Typography>
|
||||||
|
</Box>
|
||||||
|
</Box>
|
||||||
|
<Typography variant="subtitle1" gutterBottom>
|
||||||
|
Failed to configure the application, please refresh to try again.
|
||||||
|
</Typography>
|
||||||
|
{message && (
|
||||||
|
<Typography variant="subtitle2" gutterBottom>
|
||||||
|
{message}
|
||||||
|
</Typography>
|
||||||
|
)}
|
||||||
|
</Paper>
|
||||||
|
</Box>
|
||||||
|
);
|
||||||
|
|
||||||
|
export default ApplicationError;
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user