mirror of
https://github.com/home-assistant/frontend.git
synced 2025-08-15 12:19:25 +00:00
Compare commits
888 Commits
websocket_
...
20250502.0
Author | SHA1 | Date | |
---|---|---|---|
![]() |
1154d1769d | ||
![]() |
a820cd4576 | ||
![]() |
678a8a85cb | ||
![]() |
358e450e60 | ||
![]() |
32acef8fad | ||
![]() |
fae619085c | ||
![]() |
5d89563aa5 | ||
![]() |
d7dd11ba7f | ||
![]() |
4624cc609f | ||
![]() |
f24b6a4cb1 | ||
![]() |
2b06742bb9 | ||
![]() |
9e5b7462af | ||
![]() |
a544ff4c8a | ||
![]() |
b81d2013dc | ||
![]() |
9b7e2886b6 | ||
![]() |
69eaf178ca | ||
![]() |
1a14511fa6 | ||
![]() |
ee9cbf7370 | ||
![]() |
efd7b380a9 | ||
![]() |
46cc254f77 | ||
![]() |
e5f41ceb3e | ||
![]() |
2e4ce71d06 | ||
![]() |
50e39de974 | ||
![]() |
1ba941282c | ||
![]() |
b656ddc1f0 | ||
![]() |
0aeb8fa75c | ||
![]() |
456a44fdfd | ||
![]() |
53a0b311de | ||
![]() |
ded5ade0f2 | ||
![]() |
5d2d6dcd6c | ||
![]() |
92353ebed5 | ||
![]() |
bc582db7fc | ||
![]() |
ab415188ba | ||
![]() |
29c11978b3 | ||
![]() |
574f9e8936 | ||
![]() |
fddc00bfab | ||
![]() |
ff5cbb0613 | ||
![]() |
498d933c06 | ||
![]() |
f9fbb254bf | ||
![]() |
536602580d | ||
![]() |
c111bf1062 | ||
![]() |
0242fbc6f8 | ||
![]() |
f65a0ef4f7 | ||
![]() |
92521d4565 | ||
![]() |
66dbafb5f5 | ||
![]() |
7c46d2d2f4 | ||
![]() |
ca642d46cc | ||
![]() |
9a52185e13 | ||
![]() |
39a73774b0 | ||
![]() |
b25b170539 | ||
![]() |
6442606fc5 | ||
![]() |
1b79869c87 | ||
![]() |
672fbc6007 | ||
![]() |
e1899836bf | ||
![]() |
e90967d200 | ||
![]() |
631bfe46ba | ||
![]() |
a5762f07ac | ||
![]() |
bf7422e4c5 | ||
![]() |
45994e7989 | ||
![]() |
995e3f10ad | ||
![]() |
6464c2b602 | ||
![]() |
8901c1fb31 | ||
![]() |
1f5f18f7e7 | ||
![]() |
51ca3e277c | ||
![]() |
ee495a432f | ||
![]() |
d75ea3bb8d | ||
![]() |
40fbeaae1c | ||
![]() |
dc2c6cee21 | ||
![]() |
3b0cd9e3ae | ||
![]() |
834ece8547 | ||
![]() |
b7aa296be7 | ||
![]() |
0cab6c9e2e | ||
![]() |
94c8665528 | ||
![]() |
c7ca654926 | ||
![]() |
488599905b | ||
![]() |
221e1d9ed8 | ||
![]() |
0229f67751 | ||
![]() |
3a0c367f76 | ||
![]() |
af0854e480 | ||
![]() |
14f4120926 | ||
![]() |
e2bd464001 | ||
![]() |
eb9f81d9a1 | ||
![]() |
078209d154 | ||
![]() |
7a617600ad | ||
![]() |
ae74e3496c | ||
![]() |
c0f304ad40 | ||
![]() |
c794a2734b | ||
![]() |
e156dd36f4 | ||
![]() |
c40bf8f3cd | ||
![]() |
93485d8b57 | ||
![]() |
ce5cdaa496 | ||
![]() |
dcbaa31c96 | ||
![]() |
71b2e5f827 | ||
![]() |
d58590b534 | ||
![]() |
b2044e88b6 | ||
![]() |
94b5ed97c6 | ||
![]() |
11b8f6210f | ||
![]() |
8e778cfc32 | ||
![]() |
4c6a5ed2e3 | ||
![]() |
48c90267df | ||
![]() |
fcab356639 | ||
![]() |
a70a0d4b4a | ||
![]() |
5a34560381 | ||
![]() |
f71245893a | ||
![]() |
1e7bfd59f2 | ||
![]() |
1c15116052 | ||
![]() |
3647722824 | ||
![]() |
713dd68089 | ||
![]() |
53dd0cbaa8 | ||
![]() |
6bf8faa96a | ||
![]() |
09a17131ab | ||
![]() |
7f20b2d6d2 | ||
![]() |
fa05cd0c90 | ||
![]() |
0b7fc330b3 | ||
![]() |
6aa78794a7 | ||
![]() |
3f17548582 | ||
![]() |
0cee3c2882 | ||
![]() |
5753b3e166 | ||
![]() |
7b78d821f9 | ||
![]() |
9a4469588c | ||
![]() |
f9eadf08fd | ||
![]() |
c630176fcf | ||
![]() |
0389fbba52 | ||
![]() |
d56c7c41e2 | ||
![]() |
e74cac697e | ||
![]() |
77216e8e76 | ||
![]() |
02a8924f63 | ||
![]() |
9fc28e5abb | ||
![]() |
933fb1327a | ||
![]() |
c73a9fccb8 | ||
![]() |
38c11e738e | ||
![]() |
93c5632ee0 | ||
![]() |
5459eaff30 | ||
![]() |
b02f1037fb | ||
![]() |
3d130b790c | ||
![]() |
e23d2392d8 | ||
![]() |
d5a6e16bf8 | ||
![]() |
91a5497c60 | ||
![]() |
65dae09a49 | ||
![]() |
7e0f293d1f | ||
![]() |
2682011ae6 | ||
![]() |
1bba103a3d | ||
![]() |
e425375d55 | ||
![]() |
a2689eee63 | ||
![]() |
74741c5d69 | ||
![]() |
53426d647a | ||
![]() |
f6e4f4c0d6 | ||
![]() |
2f086f4d00 | ||
![]() |
cd91e8c07c | ||
![]() |
b3a5ea2893 | ||
![]() |
98ae0295b4 | ||
![]() |
43bb9d3401 | ||
![]() |
8ad4385d67 | ||
![]() |
8fb7c1594a | ||
![]() |
4fca09f9ae | ||
![]() |
6793753755 | ||
![]() |
f4e3fdb98e | ||
![]() |
63f4cc456c | ||
![]() |
33735abfb0 | ||
![]() |
22b59b247e | ||
![]() |
6d7a40368c | ||
![]() |
fbeb457c25 | ||
![]() |
4a6834f0d9 | ||
![]() |
add417a166 | ||
![]() |
ae4f43496e | ||
![]() |
4ce792e5bf | ||
![]() |
b9433b96dc | ||
![]() |
1dfd937c94 | ||
![]() |
6a333a4774 | ||
![]() |
7742ccf631 | ||
![]() |
20f2a8d53e | ||
![]() |
ec9fbe7d77 | ||
![]() |
6fa226d30a | ||
![]() |
b76a723fd9 | ||
![]() |
5237cc72b7 | ||
![]() |
63d2718f67 | ||
![]() |
14e0666c3a | ||
![]() |
929a0b9cd4 | ||
![]() |
0541270695 | ||
![]() |
20d357fb13 | ||
![]() |
6658c10b94 | ||
![]() |
c2ce02652b | ||
![]() |
634db1944f | ||
![]() |
21b3177f95 | ||
![]() |
7383e3247b | ||
![]() |
b33e4bf305 | ||
![]() |
9d9522cade | ||
![]() |
430e47c0fc | ||
![]() |
a6c9702ab2 | ||
![]() |
e3122e8e4d | ||
![]() |
c8e46bd239 | ||
![]() |
4fd87a1d7c | ||
![]() |
80151ff759 | ||
![]() |
5f187c1bb3 | ||
![]() |
ddc04dd48a | ||
![]() |
228acf1fae | ||
![]() |
74acd7ec38 | ||
![]() |
9bc867d0dc | ||
![]() |
590df8dd1a | ||
![]() |
ccee57f4a5 | ||
![]() |
828bf977b2 | ||
![]() |
a2b3ea2ac6 | ||
![]() |
9c3f77532c | ||
![]() |
4a1cf250c4 | ||
![]() |
9df5141aac | ||
![]() |
13aeb02b53 | ||
![]() |
f0f60bae78 | ||
![]() |
d1465a79ae | ||
![]() |
6fe8af7c75 | ||
![]() |
21180d066e | ||
![]() |
dec968af54 | ||
![]() |
2ccc5355c4 | ||
![]() |
316c3f4e1f | ||
![]() |
f88d0ca613 | ||
![]() |
edd4a3c31f | ||
![]() |
a7ee98e7de | ||
![]() |
1b6ed8cdc3 | ||
![]() |
671049beb2 | ||
![]() |
daf4158fa0 | ||
![]() |
848713858f | ||
![]() |
f0ef7e0c53 | ||
![]() |
e10b0fad95 | ||
![]() |
8d50bb1d2b | ||
![]() |
1e26f155a7 | ||
![]() |
27e13017c3 | ||
![]() |
88f1dc9c16 | ||
![]() |
825e707a80 | ||
![]() |
a15f0c7814 | ||
![]() |
e37f7219c2 | ||
![]() |
570076c539 | ||
![]() |
cfeb0336d1 | ||
![]() |
b18cc4dcfb | ||
![]() |
e271989cee | ||
![]() |
ca223f9d73 | ||
![]() |
8fb1cf35ad | ||
![]() |
9f59be492e | ||
![]() |
8429d114a8 | ||
![]() |
4fbc155f8b | ||
![]() |
0bcaa104e7 | ||
![]() |
6b3f807129 | ||
![]() |
c464d344db | ||
![]() |
69f0a4a728 | ||
![]() |
cd39e2d0f2 | ||
![]() |
a23f57256c | ||
![]() |
c279efaa99 | ||
![]() |
c4389ec119 | ||
![]() |
50d632f8d4 | ||
![]() |
dba2fba828 | ||
![]() |
3890afddb9 | ||
![]() |
2ba8f9f99d | ||
![]() |
7e06bbc467 | ||
![]() |
6017d82c21 | ||
![]() |
40c200a172 | ||
![]() |
a2f70f682f | ||
![]() |
c42a899b52 | ||
![]() |
706f43e99e | ||
![]() |
f5496c21e8 | ||
![]() |
34dce5b279 | ||
![]() |
a4f07423ec | ||
![]() |
9e32c24f3c | ||
![]() |
b281d095cd | ||
![]() |
76f187ee2c | ||
![]() |
488b54cf19 | ||
![]() |
29d2c29af3 | ||
![]() |
a2f9101a9f | ||
![]() |
7893eba7a7 | ||
![]() |
94ced8af32 | ||
![]() |
c4b5882b2d | ||
![]() |
6e8bac2e58 | ||
![]() |
8a2ab2eab4 | ||
![]() |
c7e5be185d | ||
![]() |
e98721aa76 | ||
![]() |
4c8d661c63 | ||
![]() |
b7c60ffc74 | ||
![]() |
db6c728cd6 | ||
![]() |
34f8335a9d | ||
![]() |
ecf5068bd0 | ||
![]() |
0a2a2b8a70 | ||
![]() |
52f4fe6bc0 | ||
![]() |
a781bca94b | ||
![]() |
63b44c25f8 | ||
![]() |
fe7e8e17ae | ||
![]() |
2161357226 | ||
![]() |
e8e65a4293 | ||
![]() |
b96319703a | ||
![]() |
9e686190f6 | ||
![]() |
5ca7b1d508 | ||
![]() |
724adab2d6 | ||
![]() |
345ad6c9c5 | ||
![]() |
a88d066d7e | ||
![]() |
a8e5c8482b | ||
![]() |
d5ff8ab1e1 | ||
![]() |
e765cc10fb | ||
![]() |
916dec101f | ||
![]() |
909fc119b7 | ||
![]() |
8751dc46f4 | ||
![]() |
7c1d74c6c3 | ||
![]() |
d257f667c1 | ||
![]() |
842a064682 | ||
![]() |
3d8e146582 | ||
![]() |
78e8bd4305 | ||
![]() |
0152a79bd5 | ||
![]() |
f5bb72f067 | ||
![]() |
9ca6a886f5 | ||
![]() |
f39011f8f4 | ||
![]() |
8b190867e3 | ||
![]() |
321b15a270 | ||
![]() |
6ba235d540 | ||
![]() |
e34fd8161c | ||
![]() |
118c25d25f | ||
![]() |
ae5427a75e | ||
![]() |
3b6e267fb5 | ||
![]() |
084cda8218 | ||
![]() |
f06a0fa34c | ||
![]() |
1770a51303 | ||
![]() |
534df3d378 | ||
![]() |
23229b3e3b | ||
![]() |
94ee99160b | ||
![]() |
b009d71e8f | ||
![]() |
2ab8209622 | ||
![]() |
ed2940edc3 | ||
![]() |
e2b9a06242 | ||
![]() |
a7acee0438 | ||
![]() |
1208af510c | ||
![]() |
750c59399b | ||
![]() |
a6a17cd70c | ||
![]() |
de1c6a5178 | ||
![]() |
04c3cd7d68 | ||
![]() |
17ef74d680 | ||
![]() |
098c6a2567 | ||
![]() |
899288ae43 | ||
![]() |
a9823f30e3 | ||
![]() |
97966805fa | ||
![]() |
615b228827 | ||
![]() |
1819c04c27 | ||
![]() |
05e303d771 | ||
![]() |
53bb8251fa | ||
![]() |
f6467a35db | ||
![]() |
7cc6397324 | ||
![]() |
f6e3e312bb | ||
![]() |
be1e1ff9fc | ||
![]() |
2717e1e6cb | ||
![]() |
2e9f72867f | ||
![]() |
ff6b318fc9 | ||
![]() |
386b8ba747 | ||
![]() |
e27b97abc0 | ||
![]() |
772a2658cb | ||
![]() |
1a076061da | ||
![]() |
1cb71ed379 | ||
![]() |
fb11c21518 | ||
![]() |
9cfcd21a93 | ||
![]() |
e3f5e921d6 | ||
![]() |
df4e81be75 | ||
![]() |
1519e1b90c | ||
![]() |
4c8b7a30f4 | ||
![]() |
1e513281f4 | ||
![]() |
3c28764264 | ||
![]() |
82be98dad6 | ||
![]() |
3320cf1880 | ||
![]() |
f7cb83482a | ||
![]() |
a9ddaf1bd7 | ||
![]() |
eb7923fa49 | ||
![]() |
2ae70e9b54 | ||
![]() |
3857c53b7f | ||
![]() |
620fb6375e | ||
![]() |
e18f853f7e | ||
![]() |
bbe549fa86 | ||
![]() |
586a137037 | ||
![]() |
60010c82bd | ||
![]() |
d77f962087 | ||
![]() |
4c952c191a | ||
![]() |
e0fbd3cd1f | ||
![]() |
9f05f4df50 | ||
![]() |
6fbc7b2efe | ||
![]() |
8dab7c598e | ||
![]() |
b24f185d62 | ||
![]() |
dc5bb899d2 | ||
![]() |
420477e416 | ||
![]() |
cd9faf7d67 | ||
![]() |
852207a5f5 | ||
![]() |
1f705c07b2 | ||
![]() |
39ee84b54e | ||
![]() |
de402e7c1a | ||
![]() |
9b74cdebc2 | ||
![]() |
ebe8e54046 | ||
![]() |
2bac7455cc | ||
![]() |
3cbeef070a | ||
![]() |
bae0c232be | ||
![]() |
e65b5ae91e | ||
![]() |
4a166b6c23 | ||
![]() |
fe17bb89eb | ||
![]() |
888b2472df | ||
![]() |
ef7f499364 | ||
![]() |
5d9a53dcd5 | ||
![]() |
7ce166e40f | ||
![]() |
2c0c48106d | ||
![]() |
0e8be25a60 | ||
![]() |
27379c98df | ||
![]() |
4076e5655a | ||
![]() |
858b8b90d8 | ||
![]() |
d61c771e35 | ||
![]() |
ddbf57d541 | ||
![]() |
a5b7bb8391 | ||
![]() |
5803ab68c2 | ||
![]() |
64b9104199 | ||
![]() |
7aaea37db7 | ||
![]() |
3c11323ea4 | ||
![]() |
4f7d5053ec | ||
![]() |
7009482057 | ||
![]() |
d1090e8ad3 | ||
![]() |
06b969f6b6 | ||
![]() |
d8b6de2afd | ||
![]() |
dfd5e80436 | ||
![]() |
9d4df46d5f | ||
![]() |
5f4cb9e3c1 | ||
![]() |
96e6169b8d | ||
![]() |
0906d7aa5a | ||
![]() |
02fce1f40a | ||
![]() |
05aa55bfb9 | ||
![]() |
d4717f1293 | ||
![]() |
f6a7e40d4a | ||
![]() |
d73e677bea | ||
![]() |
356b74607a | ||
![]() |
8cb248223d | ||
![]() |
24eed2e5fa | ||
![]() |
c8a21a7a2f | ||
![]() |
54cc096b1a | ||
![]() |
49b1198cb7 | ||
![]() |
91e9836423 | ||
![]() |
6aa2a576b3 | ||
![]() |
9712f04662 | ||
![]() |
731a9a2e07 | ||
![]() |
d42bd36a3e | ||
![]() |
28c355812c | ||
![]() |
e09dbb474b | ||
![]() |
ee10f9080d | ||
![]() |
4f9ec622bf | ||
![]() |
dba269f2a3 | ||
![]() |
46c9af75fd | ||
![]() |
df934cfed9 | ||
![]() |
e871dc8151 | ||
![]() |
69026cbecf | ||
![]() |
dda7de3301 | ||
![]() |
1e000d2740 | ||
![]() |
1d747c0901 | ||
![]() |
8ef769559f | ||
![]() |
e141b4dbee | ||
![]() |
d0545fe827 | ||
![]() |
4ef3a25479 | ||
![]() |
616c1fda81 | ||
![]() |
e8805be561 | ||
![]() |
1b6d2ac08e | ||
![]() |
de4a8a0a72 | ||
![]() |
58dd778b3d | ||
![]() |
a4cdb294b1 | ||
![]() |
07c4296771 | ||
![]() |
95a99c7857 | ||
![]() |
fee215fe96 | ||
![]() |
5e9341bf4e | ||
![]() |
58b7c76b90 | ||
![]() |
6ed26407be | ||
![]() |
1ac0092d4e | ||
![]() |
a4e8ea366a | ||
![]() |
fe70355dde | ||
![]() |
01f07f6476 | ||
![]() |
9ef72e4afc | ||
![]() |
022ef982ca | ||
![]() |
f132a32fd4 | ||
![]() |
782df0473c | ||
![]() |
690cd47945 | ||
![]() |
8fe55b9bc0 | ||
![]() |
913fdfd0eb | ||
![]() |
c97916bea4 | ||
![]() |
cdfe4b53bf | ||
![]() |
75edc5132b | ||
![]() |
c79164992b | ||
![]() |
68960ba03d | ||
![]() |
c3a60a9c3f | ||
![]() |
4783720aaa | ||
![]() |
d55b806ce5 | ||
![]() |
e2ff8ce302 | ||
![]() |
b26bc1dcf0 | ||
![]() |
76b03d3a40 | ||
![]() |
c581d6d028 | ||
![]() |
d899711a48 | ||
![]() |
b7be74e722 | ||
![]() |
e53961d395 | ||
![]() |
03b08fefb7 | ||
![]() |
79374f6052 | ||
![]() |
ba19849182 | ||
![]() |
48338e0886 | ||
![]() |
3b87fc84a9 | ||
![]() |
61effc3f70 | ||
![]() |
e5b460c259 | ||
![]() |
7a56731f56 | ||
![]() |
bfe20d3760 | ||
![]() |
5a37087231 | ||
![]() |
dbe5bffe22 | ||
![]() |
62da09d045 | ||
![]() |
75d7676b36 | ||
![]() |
0bea89db91 | ||
![]() |
7ad759dd95 | ||
![]() |
5377c9e75d | ||
![]() |
bf206aa12b | ||
![]() |
73669e27f4 | ||
![]() |
1b5f4d3432 | ||
![]() |
49379b49d0 | ||
![]() |
2827421c9f | ||
![]() |
1a5a183410 | ||
![]() |
88a1de9aaf | ||
![]() |
4ad64ce2c8 | ||
![]() |
3f1ca32d13 | ||
![]() |
a6f7ee6b28 | ||
![]() |
0294198fba | ||
![]() |
7120200fd4 | ||
![]() |
209d0ae5f4 | ||
![]() |
81bafba4e4 | ||
![]() |
819225d32b | ||
![]() |
7f7575dcbc | ||
![]() |
56eef4bf31 | ||
![]() |
a384bc2273 | ||
![]() |
9d5d0e448f | ||
![]() |
f020269447 | ||
![]() |
99f86bb9cf | ||
![]() |
587751f5b4 | ||
![]() |
52b199c92b | ||
![]() |
ed6659ad8f | ||
![]() |
f1d04e5178 | ||
![]() |
807e87fce0 | ||
![]() |
cafab61727 | ||
![]() |
88e6906b6b | ||
![]() |
ebc1259e39 | ||
![]() |
c1f2e6d82b | ||
![]() |
ef964fd23e | ||
![]() |
13105c2d6f | ||
![]() |
5b9262487d | ||
![]() |
4ec6e324f8 | ||
![]() |
20f385e053 | ||
![]() |
dd441f882b | ||
![]() |
3a1d371b0b | ||
![]() |
5caa47acc1 | ||
![]() |
7833a680a9 | ||
![]() |
92681e7036 | ||
![]() |
ac18c6c018 | ||
![]() |
7e0cd35ea8 | ||
![]() |
45dee566b7 | ||
![]() |
71a4dceedc | ||
![]() |
27d883c1f6 | ||
![]() |
014db0e60f | ||
![]() |
c80247d992 | ||
![]() |
df33e97996 | ||
![]() |
8848911b34 | ||
![]() |
51193cf441 | ||
![]() |
a5b7f2466e | ||
![]() |
3d9bde548d | ||
![]() |
dfa98a4ba8 | ||
![]() |
20fe5b1b71 | ||
![]() |
9250ecb16f | ||
![]() |
e21d1399ea | ||
![]() |
5dded38ccc | ||
![]() |
54cc8f025c | ||
![]() |
0d215e65cd | ||
![]() |
f9824a3b3b | ||
![]() |
197c9219bd | ||
![]() |
4974a12221 | ||
![]() |
a13bcac0aa | ||
![]() |
cf288f7cd1 | ||
![]() |
1c8284609f | ||
![]() |
1fdadbf1b8 | ||
![]() |
3b272ae411 | ||
![]() |
a048c36861 | ||
![]() |
2a6c1773f3 | ||
![]() |
bf17012753 | ||
![]() |
bbaf23e049 | ||
![]() |
34b7929165 | ||
![]() |
8f06e70a11 | ||
![]() |
50ac60b35e | ||
![]() |
4caca19e32 | ||
![]() |
a7b1c45c00 | ||
![]() |
10c3e4c6f8 | ||
![]() |
1f50c359dc | ||
![]() |
a3e24a3dc0 | ||
![]() |
a906285a03 | ||
![]() |
5c933a43b2 | ||
![]() |
151a7fbc40 | ||
![]() |
4fa915c869 | ||
![]() |
d47e5c847b | ||
![]() |
db5036aed3 | ||
![]() |
bb672d0272 | ||
![]() |
e26d3d39f0 | ||
![]() |
e54c3a69af | ||
![]() |
cc04457d72 | ||
![]() |
9e1d64e728 | ||
![]() |
0cfe7f8d12 | ||
![]() |
2b1f301db6 | ||
![]() |
fc4996412e | ||
![]() |
ece4a6345f | ||
![]() |
a4c08a78b9 | ||
![]() |
a438fc5e41 | ||
![]() |
783132ae46 | ||
![]() |
680d81001c | ||
![]() |
a917383d7a | ||
![]() |
455a6761cd | ||
![]() |
acf42d7637 | ||
![]() |
3857c7321a | ||
![]() |
5eec814988 | ||
![]() |
4a1b7d46ca | ||
![]() |
75fadcca42 | ||
![]() |
41c93f5f7e | ||
![]() |
99559ff716 | ||
![]() |
753fe719e3 | ||
![]() |
5c14afd944 | ||
![]() |
23f1925c84 | ||
![]() |
edd37565a6 | ||
![]() |
fb3f779121 | ||
![]() |
4d7634ac67 | ||
![]() |
ba5c1133c6 | ||
![]() |
0a05dd8f71 | ||
![]() |
400106ec09 | ||
![]() |
a7a4194e09 | ||
![]() |
0bd7d27c57 | ||
![]() |
8175e45921 | ||
![]() |
cae36b393b | ||
![]() |
f84ad92356 | ||
![]() |
fb1ee2ed1d | ||
![]() |
9073282174 | ||
![]() |
91bd5cba08 | ||
![]() |
a68bdbfe08 | ||
![]() |
f3d614b0d3 | ||
![]() |
f3c9e4a4a0 | ||
![]() |
d22a82c4a6 | ||
![]() |
5cddc6e5c6 | ||
![]() |
c5c067ef19 | ||
![]() |
694bb3088c | ||
![]() |
ad487470fd | ||
![]() |
2801d071ba | ||
![]() |
71b65f208f | ||
![]() |
ab4efb7412 | ||
![]() |
c7a46ec25b | ||
![]() |
83d4a408f6 | ||
![]() |
06932d1479 | ||
![]() |
24211d5f25 | ||
![]() |
d387f19a31 | ||
![]() |
347ee2a4c3 | ||
![]() |
1363884773 | ||
![]() |
0256da511d | ||
![]() |
c52217c1ce | ||
![]() |
cdd17eed2e | ||
![]() |
4546c6f624 | ||
![]() |
2c34760204 | ||
![]() |
0b64861297 | ||
![]() |
94a5e737cc | ||
![]() |
05163588fc | ||
![]() |
ee64536862 | ||
![]() |
695a6a506e | ||
![]() |
3ee3cfa6cb | ||
![]() |
00d0cb7afa | ||
![]() |
3ae34403bd | ||
![]() |
1434966170 | ||
![]() |
8dd70f7017 | ||
![]() |
84a0289e1b | ||
![]() |
a25e1d3f7f | ||
![]() |
f53ac41eee | ||
![]() |
b9acd40b0f | ||
![]() |
7524dc8709 | ||
![]() |
cbedf62c39 | ||
![]() |
63a98155cd | ||
![]() |
7369b7e0d5 | ||
![]() |
922abafabf | ||
![]() |
f1bb4a5694 | ||
![]() |
e0b9cb8ccb | ||
![]() |
06f27650da | ||
![]() |
a772eaffd7 | ||
![]() |
c39be4a9b8 | ||
![]() |
c68002214f | ||
![]() |
8dbc203130 | ||
![]() |
64274d7355 | ||
![]() |
c07f4de39d | ||
![]() |
37ee2bf308 | ||
![]() |
d9559b7f07 | ||
![]() |
fce07daa20 | ||
![]() |
5d6fcaf6bb | ||
![]() |
0abccb88d6 | ||
![]() |
5dc5879773 | ||
![]() |
41df7a3f4a | ||
![]() |
920ec035c5 | ||
![]() |
043e8d6e2e | ||
![]() |
d8e36894a0 | ||
![]() |
65b6a3c6a3 | ||
![]() |
b16f82cedb | ||
![]() |
02deeb4ce7 | ||
![]() |
0c6651c2c2 | ||
![]() |
abbf56db1d | ||
![]() |
bc0cc8b387 | ||
![]() |
b66f41db7d | ||
![]() |
05fbe204c5 | ||
![]() |
ee199fbbc0 | ||
![]() |
56ab29da81 | ||
![]() |
10abaa538d | ||
![]() |
f25dac7f68 | ||
![]() |
99065a689f | ||
![]() |
ac88d5993a | ||
![]() |
b09ce45d31 | ||
![]() |
78e2809fe7 | ||
![]() |
a631bf9854 | ||
![]() |
1349c8520c | ||
![]() |
6d1a55cc3a | ||
![]() |
23a9ae6835 | ||
![]() |
dbd1e928de | ||
![]() |
e86ad21ce2 | ||
![]() |
0d97afb3f2 | ||
![]() |
0ab9098f23 | ||
![]() |
4498747fb1 | ||
![]() |
76977b64fa | ||
![]() |
2ca7395733 | ||
![]() |
0900869957 | ||
![]() |
91e8750f44 | ||
![]() |
936f66c41c | ||
![]() |
9ab5be4730 | ||
![]() |
a30e501031 | ||
![]() |
dcb04067b8 | ||
![]() |
bf962b29af | ||
![]() |
0ae6fa0763 | ||
![]() |
03a415beff | ||
![]() |
44cc75afbc | ||
![]() |
748642a8d6 | ||
![]() |
3d5c65d652 | ||
![]() |
a26bf80b13 | ||
![]() |
497c6c35f1 | ||
![]() |
b0b06a2787 | ||
![]() |
f3d55447ca | ||
![]() |
1b3d4b77d3 | ||
![]() |
6ec4041c4c | ||
![]() |
d919e8d333 | ||
![]() |
af7bb85667 | ||
![]() |
9061e2039b | ||
![]() |
906e6f4a88 | ||
![]() |
73fbe9a69d | ||
![]() |
2a0f69a629 | ||
![]() |
9411a77f14 | ||
![]() |
de3bf2e088 | ||
![]() |
16181b48ae | ||
![]() |
8682debe61 | ||
![]() |
bdbc9bc1b4 | ||
![]() |
79b9f8d083 | ||
![]() |
3918194d2d | ||
![]() |
e9fef1f873 | ||
![]() |
35face602b | ||
![]() |
9d7d332790 | ||
![]() |
803ac496f6 | ||
![]() |
f1173dd84b | ||
![]() |
44dcca9923 | ||
![]() |
bd74d39dd8 | ||
![]() |
172d6c3079 | ||
![]() |
56539e8065 | ||
![]() |
8f6867f142 | ||
![]() |
d51f8995dd | ||
![]() |
f2e35dc70a | ||
![]() |
6487b9b7ea | ||
![]() |
e50b658db7 | ||
![]() |
6efe237639 | ||
![]() |
4a94cfc05b | ||
![]() |
7cbdb1dcfd | ||
![]() |
553bb61db7 | ||
![]() |
786ff787d1 | ||
![]() |
28b3f2970a | ||
![]() |
7d170a710e | ||
![]() |
cc40b50675 | ||
![]() |
b6eaff46e9 | ||
![]() |
674bb0d16a | ||
![]() |
6ff018afc9 | ||
![]() |
ad48732bb7 | ||
![]() |
fef162346a | ||
![]() |
72d208d1ac | ||
![]() |
5a8b1b0fd4 | ||
![]() |
4cfc651799 | ||
![]() |
b4a3f4cb2c | ||
![]() |
f0507a88a6 | ||
![]() |
fe041e442d | ||
![]() |
e5fea98460 | ||
![]() |
31180e3a9e | ||
![]() |
ce0f02a45b | ||
![]() |
53f090356e | ||
![]() |
776c4da688 | ||
![]() |
849922f7be | ||
![]() |
a26701808f | ||
![]() |
904ee2e418 | ||
![]() |
11ae3a77e8 | ||
![]() |
3a12019b64 | ||
![]() |
6c2cf1ff60 | ||
![]() |
02ae0b5864 | ||
![]() |
85fe2213c1 | ||
![]() |
7dbc78f1d6 | ||
![]() |
f965a3504f | ||
![]() |
077f5efe7e | ||
![]() |
ef3bea71a0 | ||
![]() |
fcf655b0ec | ||
![]() |
b263b74916 | ||
![]() |
0f4b6b423a | ||
![]() |
72df585c5e | ||
![]() |
4698a63642 | ||
![]() |
6eb43a7d61 | ||
![]() |
af35b15400 | ||
![]() |
0d50d2664f | ||
![]() |
ff1159402e | ||
![]() |
f8742ae690 | ||
![]() |
c786d26542 | ||
![]() |
3f8ff94002 | ||
![]() |
64a968543b | ||
![]() |
aea98f702b | ||
![]() |
863ff622be | ||
![]() |
730cea6646 | ||
![]() |
7d1f8d618a | ||
![]() |
67b970fcaa | ||
![]() |
38bcdaa6f6 | ||
![]() |
8f1389de66 | ||
![]() |
37ac796c8f | ||
![]() |
716cd19d41 | ||
![]() |
173725f011 | ||
![]() |
ad561b885b | ||
![]() |
d77bdf4ac6 | ||
![]() |
ac3796ec31 | ||
![]() |
8c3fdfb6fb | ||
![]() |
b7c7d0b4b5 | ||
![]() |
8b0e6eed3a | ||
![]() |
603f884e8c | ||
![]() |
97dfccf4c7 | ||
![]() |
fd1e31c0cc | ||
![]() |
1de740e7b5 | ||
![]() |
5abfb90b16 | ||
![]() |
6b691063a8 | ||
![]() |
d1d746e7e6 | ||
![]() |
2fcb64d4a1 | ||
![]() |
3769f8c7c0 | ||
![]() |
f0a56e75f5 | ||
![]() |
15f33e1f19 | ||
![]() |
181122177b | ||
![]() |
684cd0f627 | ||
![]() |
277202e363 | ||
![]() |
b388d1fd42 | ||
![]() |
251e6399f5 | ||
![]() |
f44c5d7a63 | ||
![]() |
cae1ca52f0 | ||
![]() |
f8de2c64a5 | ||
![]() |
34ef5be720 | ||
![]() |
1402802031 | ||
![]() |
816989ab4d | ||
![]() |
d4497ca39c | ||
![]() |
6e39242ca3 | ||
![]() |
0197e32783 | ||
![]() |
87dfed4beb | ||
![]() |
dae991dc89 | ||
![]() |
6197e3483b | ||
![]() |
b2a6c8bd36 | ||
![]() |
938855e13c | ||
![]() |
a8712e3b8e | ||
![]() |
b15b577057 | ||
![]() |
653aeae3d8 | ||
![]() |
0aea6141ad | ||
![]() |
5243c1d871 | ||
![]() |
9449f5ad0a | ||
![]() |
c337bc5f97 | ||
![]() |
6aab60cf45 | ||
![]() |
52e9bc3213 | ||
![]() |
e48b2383cf | ||
![]() |
002a249777 | ||
![]() |
10498ce18d | ||
![]() |
6a5936b2b2 | ||
![]() |
dc68aaa803 | ||
![]() |
e7931ce049 | ||
![]() |
59b2582fe3 | ||
![]() |
8577b0721c | ||
![]() |
91319be855 | ||
![]() |
0dff538298 | ||
![]() |
6ac6d9c6eb | ||
![]() |
6ba0071296 | ||
![]() |
fef5dc4232 | ||
![]() |
ce58962dbb | ||
![]() |
9fb1e1d2ed | ||
![]() |
a29544c1e6 | ||
![]() |
b2b71edd04 | ||
![]() |
028472fc7b | ||
![]() |
b056ce228b | ||
![]() |
0cd4256c0e | ||
![]() |
e274c5b23f | ||
![]() |
ea57846465 | ||
![]() |
3f2e2bc659 | ||
![]() |
e3f2f66206 |
@@ -5,12 +5,15 @@
|
|||||||
"context": ".."
|
"context": ".."
|
||||||
},
|
},
|
||||||
"appPort": "8124:8123",
|
"appPort": "8124:8123",
|
||||||
"postCreateCommand": "sudo apt update && sudo apt upgrade -y && sudo apt install -y libpcap-dev",
|
"postCreateCommand": "./.devcontainer/post_create.sh",
|
||||||
"postStartCommand": "script/bootstrap",
|
"postStartCommand": "script/bootstrap",
|
||||||
"containerEnv": {
|
"containerEnv": {
|
||||||
"DEV_CONTAINER": "1",
|
"DEV_CONTAINER": "1",
|
||||||
"WORKSPACE_DIRECTORY": "${containerWorkspaceFolder}"
|
"WORKSPACE_DIRECTORY": "${containerWorkspaceFolder}"
|
||||||
},
|
},
|
||||||
|
"remoteEnv": {
|
||||||
|
"NODE_OPTIONS": "--max_old_space_size=8192"
|
||||||
|
},
|
||||||
"customizations": {
|
"customizations": {
|
||||||
"vscode": {
|
"vscode": {
|
||||||
"extensions": [
|
"extensions": [
|
||||||
@@ -18,7 +21,8 @@
|
|||||||
"esbenp.prettier-vscode",
|
"esbenp.prettier-vscode",
|
||||||
"runem.lit-plugin",
|
"runem.lit-plugin",
|
||||||
"github.vscode-pull-request-github",
|
"github.vscode-pull-request-github",
|
||||||
"eamodio.gitlens"
|
"eamodio.gitlens",
|
||||||
|
"yeion7.styled-global-variables-autocomplete"
|
||||||
],
|
],
|
||||||
"settings": {
|
"settings": {
|
||||||
"files.eol": "\n",
|
"files.eol": "\n",
|
||||||
|
22
.devcontainer/post_create.sh
Executable file
22
.devcontainer/post_create.sh
Executable file
@@ -0,0 +1,22 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# This script will run after the container is created
|
||||||
|
|
||||||
|
# add github cli
|
||||||
|
(type -p wget >/dev/null || (sudo apt update && sudo apt-get install wget -y)) \
|
||||||
|
&& sudo mkdir -p -m 755 /etc/apt/keyrings \
|
||||||
|
&& out=$(mktemp) && wget -nv -O$out https://cli.github.com/packages/githubcli-archive-keyring.gpg \
|
||||||
|
&& cat $out | sudo tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null \
|
||||||
|
&& sudo chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg \
|
||||||
|
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
|
||||||
|
|
||||||
|
# Update package lists
|
||||||
|
sudo apt-get update
|
||||||
|
|
||||||
|
sudo apt upgrade -y
|
||||||
|
|
||||||
|
# Install necessary packages
|
||||||
|
sudo apt-get install -y libpcap-dev gh
|
||||||
|
|
||||||
|
# Display a message
|
||||||
|
echo "Post-create script has been executed successfully."
|
14
.github/workflows/cast_deployment.yaml
vendored
14
.github/workflows/cast_deployment.yaml
vendored
@@ -26,7 +26,7 @@ jobs:
|
|||||||
ref: dev
|
ref: dev
|
||||||
|
|
||||||
- name: Setup Node
|
- name: Setup Node
|
||||||
uses: actions/setup-node@v4.2.0
|
uses: actions/setup-node@v4.4.0
|
||||||
with:
|
with:
|
||||||
node-version-file: ".nvmrc"
|
node-version-file: ".nvmrc"
|
||||||
cache: yarn
|
cache: yarn
|
||||||
@@ -41,9 +41,8 @@ jobs:
|
|||||||
|
|
||||||
- name: Deploy to Netlify
|
- name: Deploy to Netlify
|
||||||
id: deploy
|
id: deploy
|
||||||
uses: netlify/actions/cli@master
|
run: |
|
||||||
with:
|
npx -y netlify-cli deploy --dir=cast/dist --alias dev
|
||||||
args: deploy --dir=cast/dist --alias dev
|
|
||||||
env:
|
env:
|
||||||
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
|
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
|
||||||
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_CAST_SITE_ID }}
|
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_CAST_SITE_ID }}
|
||||||
@@ -62,7 +61,7 @@ jobs:
|
|||||||
ref: master
|
ref: master
|
||||||
|
|
||||||
- name: Setup Node
|
- name: Setup Node
|
||||||
uses: actions/setup-node@v4.2.0
|
uses: actions/setup-node@v4.4.0
|
||||||
with:
|
with:
|
||||||
node-version-file: ".nvmrc"
|
node-version-file: ".nvmrc"
|
||||||
cache: yarn
|
cache: yarn
|
||||||
@@ -77,9 +76,8 @@ jobs:
|
|||||||
|
|
||||||
- name: Deploy to Netlify
|
- name: Deploy to Netlify
|
||||||
id: deploy
|
id: deploy
|
||||||
uses: netlify/actions/cli@master
|
run: |
|
||||||
with:
|
npx -y netlify-cli deploy --dir=cast/dist --prod
|
||||||
args: deploy --dir=cast/dist --prod
|
|
||||||
env:
|
env:
|
||||||
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
|
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
|
||||||
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_CAST_SITE_ID }}
|
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_CAST_SITE_ID }}
|
||||||
|
14
.github/workflows/ci.yaml
vendored
14
.github/workflows/ci.yaml
vendored
@@ -26,7 +26,7 @@ jobs:
|
|||||||
- name: Check out files from GitHub
|
- name: Check out files from GitHub
|
||||||
uses: actions/checkout@v4.2.2
|
uses: actions/checkout@v4.2.2
|
||||||
- name: Setup Node
|
- name: Setup Node
|
||||||
uses: actions/setup-node@v4.2.0
|
uses: actions/setup-node@v4.4.0
|
||||||
with:
|
with:
|
||||||
node-version-file: ".nvmrc"
|
node-version-file: ".nvmrc"
|
||||||
cache: yarn
|
cache: yarn
|
||||||
@@ -37,7 +37,7 @@ jobs:
|
|||||||
- name: Build resources
|
- name: Build resources
|
||||||
run: ./node_modules/.bin/gulp gen-icons-json build-translations build-locale-data gather-gallery-pages
|
run: ./node_modules/.bin/gulp gen-icons-json build-translations build-locale-data gather-gallery-pages
|
||||||
- name: Setup lint cache
|
- name: Setup lint cache
|
||||||
uses: actions/cache@v4.2.0
|
uses: actions/cache@v4.2.3
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
node_modules/.cache/prettier
|
node_modules/.cache/prettier
|
||||||
@@ -60,7 +60,7 @@ jobs:
|
|||||||
- name: Check out files from GitHub
|
- name: Check out files from GitHub
|
||||||
uses: actions/checkout@v4.2.2
|
uses: actions/checkout@v4.2.2
|
||||||
- name: Setup Node
|
- name: Setup Node
|
||||||
uses: actions/setup-node@v4.2.0
|
uses: actions/setup-node@v4.4.0
|
||||||
with:
|
with:
|
||||||
node-version-file: ".nvmrc"
|
node-version-file: ".nvmrc"
|
||||||
cache: yarn
|
cache: yarn
|
||||||
@@ -78,7 +78,7 @@ jobs:
|
|||||||
- name: Check out files from GitHub
|
- name: Check out files from GitHub
|
||||||
uses: actions/checkout@v4.2.2
|
uses: actions/checkout@v4.2.2
|
||||||
- name: Setup Node
|
- name: Setup Node
|
||||||
uses: actions/setup-node@v4.2.0
|
uses: actions/setup-node@v4.4.0
|
||||||
with:
|
with:
|
||||||
node-version-file: ".nvmrc"
|
node-version-file: ".nvmrc"
|
||||||
cache: yarn
|
cache: yarn
|
||||||
@@ -89,7 +89,7 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
IS_TEST: "true"
|
IS_TEST: "true"
|
||||||
- name: Upload bundle stats
|
- name: Upload bundle stats
|
||||||
uses: actions/upload-artifact@v4.6.0
|
uses: actions/upload-artifact@v4.6.2
|
||||||
with:
|
with:
|
||||||
name: frontend-bundle-stats
|
name: frontend-bundle-stats
|
||||||
path: build/stats/*.json
|
path: build/stats/*.json
|
||||||
@@ -102,7 +102,7 @@ jobs:
|
|||||||
- name: Check out files from GitHub
|
- name: Check out files from GitHub
|
||||||
uses: actions/checkout@v4.2.2
|
uses: actions/checkout@v4.2.2
|
||||||
- name: Setup Node
|
- name: Setup Node
|
||||||
uses: actions/setup-node@v4.2.0
|
uses: actions/setup-node@v4.4.0
|
||||||
with:
|
with:
|
||||||
node-version-file: ".nvmrc"
|
node-version-file: ".nvmrc"
|
||||||
cache: yarn
|
cache: yarn
|
||||||
@@ -113,7 +113,7 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
IS_TEST: "true"
|
IS_TEST: "true"
|
||||||
- name: Upload bundle stats
|
- name: Upload bundle stats
|
||||||
uses: actions/upload-artifact@v4.6.0
|
uses: actions/upload-artifact@v4.6.2
|
||||||
with:
|
with:
|
||||||
name: supervisor-bundle-stats
|
name: supervisor-bundle-stats
|
||||||
path: build/stats/*.json
|
path: build/stats/*.json
|
||||||
|
14
.github/workflows/demo_deployment.yaml
vendored
14
.github/workflows/demo_deployment.yaml
vendored
@@ -27,7 +27,7 @@ jobs:
|
|||||||
ref: dev
|
ref: dev
|
||||||
|
|
||||||
- name: Setup Node
|
- name: Setup Node
|
||||||
uses: actions/setup-node@v4.2.0
|
uses: actions/setup-node@v4.4.0
|
||||||
with:
|
with:
|
||||||
node-version-file: ".nvmrc"
|
node-version-file: ".nvmrc"
|
||||||
cache: yarn
|
cache: yarn
|
||||||
@@ -42,9 +42,8 @@ jobs:
|
|||||||
|
|
||||||
- name: Deploy to Netlify
|
- name: Deploy to Netlify
|
||||||
id: deploy
|
id: deploy
|
||||||
uses: netlify/actions/cli@master
|
run: |
|
||||||
with:
|
npx -y netlify-cli deploy --dir=demo/dist --prod
|
||||||
args: deploy --dir=demo/dist --prod
|
|
||||||
env:
|
env:
|
||||||
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
|
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
|
||||||
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_DEMO_DEV_SITE_ID }}
|
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_DEMO_DEV_SITE_ID }}
|
||||||
@@ -63,7 +62,7 @@ jobs:
|
|||||||
ref: master
|
ref: master
|
||||||
|
|
||||||
- name: Setup Node
|
- name: Setup Node
|
||||||
uses: actions/setup-node@v4.2.0
|
uses: actions/setup-node@v4.4.0
|
||||||
with:
|
with:
|
||||||
node-version-file: ".nvmrc"
|
node-version-file: ".nvmrc"
|
||||||
cache: yarn
|
cache: yarn
|
||||||
@@ -78,9 +77,8 @@ jobs:
|
|||||||
|
|
||||||
- name: Deploy to Netlify
|
- name: Deploy to Netlify
|
||||||
id: deploy
|
id: deploy
|
||||||
uses: netlify/actions/cli@master
|
run: |
|
||||||
with:
|
npx -y netlify-cli deploy --dir=demo/dist --prod
|
||||||
args: deploy --dir=demo/dist --prod
|
|
||||||
env:
|
env:
|
||||||
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
|
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
|
||||||
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_DEMO_SITE_ID }}
|
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_DEMO_SITE_ID }}
|
||||||
|
7
.github/workflows/design_deployment.yaml
vendored
7
.github/workflows/design_deployment.yaml
vendored
@@ -19,7 +19,7 @@ jobs:
|
|||||||
uses: actions/checkout@v4.2.2
|
uses: actions/checkout@v4.2.2
|
||||||
|
|
||||||
- name: Setup Node
|
- name: Setup Node
|
||||||
uses: actions/setup-node@v4.2.0
|
uses: actions/setup-node@v4.4.0
|
||||||
with:
|
with:
|
||||||
node-version-file: ".nvmrc"
|
node-version-file: ".nvmrc"
|
||||||
cache: yarn
|
cache: yarn
|
||||||
@@ -34,9 +34,8 @@ jobs:
|
|||||||
|
|
||||||
- name: Deploy to Netlify
|
- name: Deploy to Netlify
|
||||||
id: deploy
|
id: deploy
|
||||||
uses: netlify/actions/cli@master
|
run: |
|
||||||
with:
|
npx -y netlify-cli deploy --dir=gallery/dist --prod
|
||||||
args: deploy --dir=gallery/dist --prod
|
|
||||||
env:
|
env:
|
||||||
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
|
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
|
||||||
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_GALLERY_SITE_ID }}
|
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_GALLERY_SITE_ID }}
|
||||||
|
11
.github/workflows/design_preview.yaml
vendored
11
.github/workflows/design_preview.yaml
vendored
@@ -24,7 +24,7 @@ jobs:
|
|||||||
uses: actions/checkout@v4.2.2
|
uses: actions/checkout@v4.2.2
|
||||||
|
|
||||||
- name: Setup Node
|
- name: Setup Node
|
||||||
uses: actions/setup-node@v4.2.0
|
uses: actions/setup-node@v4.4.0
|
||||||
with:
|
with:
|
||||||
node-version-file: ".nvmrc"
|
node-version-file: ".nvmrc"
|
||||||
cache: yarn
|
cache: yarn
|
||||||
@@ -39,13 +39,14 @@ jobs:
|
|||||||
|
|
||||||
- name: Deploy preview to Netlify
|
- name: Deploy preview to Netlify
|
||||||
id: deploy
|
id: deploy
|
||||||
uses: netlify/actions/cli@master
|
run: |
|
||||||
with:
|
npx -y netlify-cli deploy --dir=gallery/dist --alias "deploy-preview-${{ github.event.number }}" \
|
||||||
args: deploy --dir=gallery/dist --alias "deploy-preview-${{ github.event.number }}"
|
--json > deploy_output.json
|
||||||
env:
|
env:
|
||||||
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
|
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
|
||||||
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_GALLERY_SITE_ID }}
|
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_GALLERY_SITE_ID }}
|
||||||
|
|
||||||
- name: Generate summary
|
- name: Generate summary
|
||||||
run: |
|
run: |
|
||||||
echo "${{ steps.deploy.outputs.NETLIFY_LIVE_URL || steps.deploy.outputs.NETLIFY_URL }}" >> "$GITHUB_STEP_SUMMARY"
|
NETLIFY_LIVE_URL=$(jq -r '.deploy_url' deploy_output.json)
|
||||||
|
echo "$NETLIFY_LIVE_URL" >> "$GITHUB_STEP_SUMMARY"
|
||||||
|
6
.github/workflows/nightly.yaml
vendored
6
.github/workflows/nightly.yaml
vendored
@@ -28,7 +28,7 @@ jobs:
|
|||||||
python-version: ${{ env.PYTHON_VERSION }}
|
python-version: ${{ env.PYTHON_VERSION }}
|
||||||
|
|
||||||
- name: Setup Node
|
- name: Setup Node
|
||||||
uses: actions/setup-node@v4.2.0
|
uses: actions/setup-node@v4.4.0
|
||||||
with:
|
with:
|
||||||
node-version-file: ".nvmrc"
|
node-version-file: ".nvmrc"
|
||||||
cache: yarn
|
cache: yarn
|
||||||
@@ -57,14 +57,14 @@ jobs:
|
|||||||
run: tar -czvf translations.tar.gz translations
|
run: tar -czvf translations.tar.gz translations
|
||||||
|
|
||||||
- name: Upload build artifacts
|
- name: Upload build artifacts
|
||||||
uses: actions/upload-artifact@v4.6.0
|
uses: actions/upload-artifact@v4.6.2
|
||||||
with:
|
with:
|
||||||
name: wheels
|
name: wheels
|
||||||
path: dist/home_assistant_frontend*.whl
|
path: dist/home_assistant_frontend*.whl
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
|
|
||||||
- name: Upload translations
|
- name: Upload translations
|
||||||
uses: actions/upload-artifact@v4.6.0
|
uses: actions/upload-artifact@v4.6.2
|
||||||
with:
|
with:
|
||||||
name: translations
|
name: translations
|
||||||
path: translations.tar.gz
|
path: translations.tar.gz
|
||||||
|
2
.github/workflows/relative-ci.yaml
vendored
2
.github/workflows/relative-ci.yaml
vendored
@@ -17,7 +17,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Send bundle stats and build information to RelativeCI
|
- name: Send bundle stats and build information to RelativeCI
|
||||||
uses: relative-ci/agent-action@v2.1.14
|
uses: relative-ci/agent-action@v2.2.0
|
||||||
with:
|
with:
|
||||||
key: ${{ secrets[format('RELATIVE_CI_KEY_{0}_{1}', matrix.bundle, matrix.build)] }}
|
key: ${{ secrets[format('RELATIVE_CI_KEY_{0}_{1}', matrix.bundle, matrix.build)] }}
|
||||||
token: ${{ github.token }}
|
token: ${{ github.token }}
|
||||||
|
14
.github/workflows/release.yaml
vendored
14
.github/workflows/release.yaml
vendored
@@ -34,7 +34,7 @@ jobs:
|
|||||||
uses: home-assistant/actions/helpers/verify-version@master
|
uses: home-assistant/actions/helpers/verify-version@master
|
||||||
|
|
||||||
- name: Setup Node
|
- name: Setup Node
|
||||||
uses: actions/setup-node@v4.2.0
|
uses: actions/setup-node@v4.4.0
|
||||||
with:
|
with:
|
||||||
node-version-file: ".nvmrc"
|
node-version-file: ".nvmrc"
|
||||||
cache: yarn
|
cache: yarn
|
||||||
@@ -55,7 +55,7 @@ jobs:
|
|||||||
script/release
|
script/release
|
||||||
|
|
||||||
- name: Upload release assets
|
- name: Upload release assets
|
||||||
uses: softprops/action-gh-release@v2.2.1
|
uses: softprops/action-gh-release@v2.2.2
|
||||||
with:
|
with:
|
||||||
files: |
|
files: |
|
||||||
dist/*.whl
|
dist/*.whl
|
||||||
@@ -74,7 +74,7 @@ jobs:
|
|||||||
echo "home-assistant-frontend==$version" > ./requirements.txt
|
echo "home-assistant-frontend==$version" > ./requirements.txt
|
||||||
|
|
||||||
- name: Build wheels
|
- name: Build wheels
|
||||||
uses: home-assistant/wheels@2024.11.0
|
uses: home-assistant/wheels@2025.03.0
|
||||||
with:
|
with:
|
||||||
abi: cp313
|
abi: cp313
|
||||||
tag: musllinux_1_2
|
tag: musllinux_1_2
|
||||||
@@ -92,7 +92,7 @@ jobs:
|
|||||||
- name: Checkout the repository
|
- name: Checkout the repository
|
||||||
uses: actions/checkout@v4.2.2
|
uses: actions/checkout@v4.2.2
|
||||||
- name: Setup Node
|
- name: Setup Node
|
||||||
uses: actions/setup-node@v4.2.0
|
uses: actions/setup-node@v4.4.0
|
||||||
with:
|
with:
|
||||||
node-version-file: ".nvmrc"
|
node-version-file: ".nvmrc"
|
||||||
cache: yarn
|
cache: yarn
|
||||||
@@ -107,7 +107,7 @@ jobs:
|
|||||||
- name: Tar folder
|
- name: Tar folder
|
||||||
run: tar -czf landing-page/home_assistant_frontend_landingpage-${{ github.event.release.tag_name }}.tar.gz -C landing-page/dist .
|
run: tar -czf landing-page/home_assistant_frontend_landingpage-${{ github.event.release.tag_name }}.tar.gz -C landing-page/dist .
|
||||||
- name: Upload release asset
|
- name: Upload release asset
|
||||||
uses: softprops/action-gh-release@v2.2.1
|
uses: softprops/action-gh-release@v2.2.2
|
||||||
with:
|
with:
|
||||||
files: landing-page/home_assistant_frontend_landingpage-${{ github.event.release.tag_name }}.tar.gz
|
files: landing-page/home_assistant_frontend_landingpage-${{ github.event.release.tag_name }}.tar.gz
|
||||||
|
|
||||||
@@ -121,7 +121,7 @@ jobs:
|
|||||||
- name: Checkout the repository
|
- name: Checkout the repository
|
||||||
uses: actions/checkout@v4.2.2
|
uses: actions/checkout@v4.2.2
|
||||||
- name: Setup Node
|
- name: Setup Node
|
||||||
uses: actions/setup-node@v4.2.0
|
uses: actions/setup-node@v4.4.0
|
||||||
with:
|
with:
|
||||||
node-version-file: ".nvmrc"
|
node-version-file: ".nvmrc"
|
||||||
cache: yarn
|
cache: yarn
|
||||||
@@ -136,6 +136,6 @@ jobs:
|
|||||||
- name: Tar folder
|
- name: Tar folder
|
||||||
run: tar -czf hassio/home_assistant_frontend_supervisor-${{ github.event.release.tag_name }}.tar.gz -C hassio/build .
|
run: tar -czf hassio/home_assistant_frontend_supervisor-${{ github.event.release.tag_name }}.tar.gz -C hassio/build .
|
||||||
- name: Upload release asset
|
- name: Upload release asset
|
||||||
uses: softprops/action-gh-release@v2.2.1
|
uses: softprops/action-gh-release@v2.2.2
|
||||||
with:
|
with:
|
||||||
files: hassio/home_assistant_frontend_supervisor-${{ github.event.release.tag_name }}.tar.gz
|
files: hassio/home_assistant_frontend_supervisor-${{ github.event.release.tag_name }}.tar.gz
|
||||||
|
3
.vscode/extensions.json
vendored
3
.vscode/extensions.json
vendored
@@ -5,6 +5,7 @@
|
|||||||
"runem.lit-plugin",
|
"runem.lit-plugin",
|
||||||
"github.vscode-pull-request-github",
|
"github.vscode-pull-request-github",
|
||||||
"eamodio.gitlens",
|
"eamodio.gitlens",
|
||||||
"vitest.explorer"
|
"vitest.explorer",
|
||||||
|
"yeion7.styled-global-variables-autocomplete"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
42
.vscode/tasks.json
vendored
42
.vscode/tasks.json
vendored
@@ -1,6 +1,42 @@
|
|||||||
{
|
{
|
||||||
"version": "2.0.0",
|
"version": "2.0.0",
|
||||||
"tasks": [
|
"tasks": [
|
||||||
|
{
|
||||||
|
"label": "Develop and serve Frontend",
|
||||||
|
"type": "shell",
|
||||||
|
"command": "script/develop_and_serve -c ${input:coreUrl}",
|
||||||
|
// Sync changes here to other tasks until issue resolved
|
||||||
|
// https://github.com/Microsoft/vscode/issues/61497
|
||||||
|
"problemMatcher": {
|
||||||
|
"owner": "ha-build",
|
||||||
|
"source": "ha-build",
|
||||||
|
"fileLocation": "absolute",
|
||||||
|
"severity": "error",
|
||||||
|
"pattern": [
|
||||||
|
{
|
||||||
|
"regexp": "(SyntaxError): (.+): (.+) \\((\\d+):(\\d+)\\)",
|
||||||
|
"severity": 1,
|
||||||
|
"file": 2,
|
||||||
|
"message": 3,
|
||||||
|
"line": 4,
|
||||||
|
"column": 5
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"background": {
|
||||||
|
"activeOnStart": true,
|
||||||
|
"beginsPattern": "Changes detected. Starting compilation",
|
||||||
|
"endsPattern": "Build done @"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"isBackground": true,
|
||||||
|
"group": {
|
||||||
|
"kind": "build",
|
||||||
|
"isDefault": true
|
||||||
|
},
|
||||||
|
"runOptions": {
|
||||||
|
"instanceLimit": 1
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"label": "Develop Frontend",
|
"label": "Develop Frontend",
|
||||||
"type": "gulp",
|
"type": "gulp",
|
||||||
@@ -241,6 +277,12 @@
|
|||||||
"id": "supervisorToken",
|
"id": "supervisorToken",
|
||||||
"type": "promptString",
|
"type": "promptString",
|
||||||
"description": "The token for the Remote API proxy add-on"
|
"description": "The token for the Remote API proxy add-on"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "coreUrl",
|
||||||
|
"type": "promptString",
|
||||||
|
"description": "The URL of the Home Assistant Core instance",
|
||||||
|
"default": "http://127.0.0.1:8123"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@@ -0,0 +1,22 @@
|
|||||||
|
diff --git a/mwc-formfield-base.js b/mwc-formfield-base.js
|
||||||
|
index 7b763326d7d51835ad52646bfbc80fe21989abd3..f2baa8224e6d03df1fdb0b9fd03f5c6d77fc8747 100644
|
||||||
|
--- a/mwc-formfield-base.js
|
||||||
|
+++ b/mwc-formfield-base.js
|
||||||
|
@@ -9,7 +9,7 @@ import { BaseElement } from '@material/mwc-base/base-element.js';
|
||||||
|
import { FormElement } from '@material/mwc-base/form-element.js';
|
||||||
|
import { observer } from '@material/mwc-base/observer.js';
|
||||||
|
import { html } from 'lit';
|
||||||
|
-import { property, query, queryAssignedNodes } from 'lit/decorators.js';
|
||||||
|
+import { property, query, queryAssignedElements } from 'lit/decorators.js';
|
||||||
|
import { classMap } from 'lit/directives/class-map.js';
|
||||||
|
export class FormfieldBase extends BaseElement {
|
||||||
|
constructor() {
|
||||||
|
@@ -96,7 +96,7 @@ __decorate([
|
||||||
|
query('.mdc-form-field')
|
||||||
|
], FormfieldBase.prototype, "mdcRoot", void 0);
|
||||||
|
__decorate([
|
||||||
|
- queryAssignedNodes('', true, '*')
|
||||||
|
+ queryAssignedElements({ slot: "", flatten: true, selector: "*" })
|
||||||
|
], FormfieldBase.prototype, "slottedInputs", void 0);
|
||||||
|
__decorate([
|
||||||
|
query('label')
|
26
.yarn/patches/@material-mwc-list-npm-0.27.0-5344fc9de4.patch
Normal file
26
.yarn/patches/@material-mwc-list-npm-0.27.0-5344fc9de4.patch
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
diff --git a/mwc-list-base.js b/mwc-list-base.js
|
||||||
|
index 1ba95b6a01dcecea4d85b5cbbbcc3dfb04c40d5f..dced13fdb7929c490d6661b1bbe7e9f96dcd2285 100644
|
||||||
|
--- a/mwc-list-base.js
|
||||||
|
+++ b/mwc-list-base.js
|
||||||
|
@@ -11,7 +11,7 @@ import { BaseElement } from '@material/mwc-base/base-element.js';
|
||||||
|
import { observer } from '@material/mwc-base/observer.js';
|
||||||
|
import { deepActiveElementPath, doesElementContainFocus, isNodeElement } from '@material/mwc-base/utils.js';
|
||||||
|
import { html } from 'lit';
|
||||||
|
-import { property, query, queryAssignedNodes } from 'lit/decorators.js';
|
||||||
|
+import { property, query, queryAssignedElements } from 'lit/decorators.js';
|
||||||
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
||||||
|
import MDCListFoundation, { isIndexSet } from './mwc-list-foundation.js';
|
||||||
|
export { createSetFromIndex, isEventMulti, isIndexSet } from './mwc-list-foundation.js';
|
||||||
|
@@ -425,10 +425,10 @@ __decorate([
|
||||||
|
query('.mdc-deprecated-list')
|
||||||
|
], ListBase.prototype, "mdcRoot", void 0);
|
||||||
|
__decorate([
|
||||||
|
- queryAssignedNodes('', true, '*')
|
||||||
|
+ queryAssignedElements({ flatten: true, selector: "*" })
|
||||||
|
], ListBase.prototype, "assignedElements", void 0);
|
||||||
|
__decorate([
|
||||||
|
- queryAssignedNodes('', true, '[tabindex="0"]')
|
||||||
|
+ queryAssignedElements({ flatten: true, selector: '[tabindex="0"]' })
|
||||||
|
], ListBase.prototype, "tabbableElements", void 0);
|
||||||
|
__decorate([
|
||||||
|
property({ type: Boolean }),
|
@@ -1,34 +0,0 @@
|
|||||||
diff --git a/lib/legacy/class.js b/lib/legacy/class.js
|
|
||||||
index aee2511be1cd9bf900ee552bc98190c1631c57c0..f2f499d68bf52034cac9c28307c99e8ce6b8417d 100644
|
|
||||||
--- a/lib/legacy/class.js
|
|
||||||
+++ b/lib/legacy/class.js
|
|
||||||
@@ -304,17 +304,23 @@ function GenerateClassFromInfo(info, Base, behaviors) {
|
|
||||||
// only proceed if the generated class' prototype has not been registered.
|
|
||||||
const generatedProto = PolymerGenerated.prototype;
|
|
||||||
if (!generatedProto.hasOwnProperty(JSCompiler_renameProperty('__hasRegisterFinished', generatedProto))) {
|
|
||||||
- generatedProto.__hasRegisterFinished = true;
|
|
||||||
+ // make sure legacy lifecycle is called on the *element*'s prototype
|
|
||||||
+ // and not the generated class prototype; if the element has been
|
|
||||||
+ // extended, these are *not* the same.
|
|
||||||
+ const proto = Object.getPrototypeOf(this);
|
|
||||||
+ // Only set flag when generated prototype itself is registered,
|
|
||||||
+ // as this element may be extended from, and needs to run `registered`
|
|
||||||
+ // on all behaviors on the subclass as well.
|
|
||||||
+ if (proto === generatedProto) {
|
|
||||||
+ generatedProto.__hasRegisterFinished = true;
|
|
||||||
+ }
|
|
||||||
// ensure superclass is registered first.
|
|
||||||
super._registered();
|
|
||||||
// copy properties onto the generated class lazily if we're optimizing,
|
|
||||||
- if (legacyOptimizations) {
|
|
||||||
+ if (legacyOptimizations && !Object.hasOwnProperty(generatedProto, '__hasCopiedProperties')) {
|
|
||||||
+ generatedProto.__hasCopiedProperties = true;
|
|
||||||
copyPropertiesToProto(generatedProto);
|
|
||||||
}
|
|
||||||
- // make sure legacy lifecycle is called on the *element*'s prototype
|
|
||||||
- // and not the generated class prototype; if the element has been
|
|
||||||
- // extended, these are *not* the same.
|
|
||||||
- const proto = Object.getPrototypeOf(this);
|
|
||||||
let list = lifecycle.beforeRegister;
|
|
||||||
if (list) {
|
|
||||||
for (let i=0; i < list.length; i++) {
|
|
934
.yarn/releases/yarn-4.6.0.cjs
vendored
934
.yarn/releases/yarn-4.6.0.cjs
vendored
File diff suppressed because one or more lines are too long
948
.yarn/releases/yarn-4.9.1.cjs
vendored
Executable file
948
.yarn/releases/yarn-4.9.1.cjs
vendored
Executable file
File diff suppressed because one or more lines are too long
@@ -6,4 +6,4 @@ enableGlobalCache: false
|
|||||||
|
|
||||||
nodeLinker: node-modules
|
nodeLinker: node-modules
|
||||||
|
|
||||||
yarnPath: .yarn/releases/yarn-4.6.0.cjs
|
yarnPath: .yarn/releases/yarn-4.9.1.cjs
|
||||||
|
@@ -2,7 +2,7 @@ import defineProvider from "@babel/helper-define-polyfill-provider";
|
|||||||
import { join } from "node:path";
|
import { join } from "node:path";
|
||||||
import paths from "../paths.cjs";
|
import paths from "../paths.cjs";
|
||||||
|
|
||||||
const POLYFILL_DIR = join(paths.polymer_dir, "src/resources/polyfills");
|
const POLYFILL_DIR = join(paths.root_dir, "src/resources/polyfills");
|
||||||
|
|
||||||
// List of polyfill keys with supported browser targets for the functionality
|
// List of polyfill keys with supported browser targets for the functionality
|
||||||
const polyfillSupport = {
|
const polyfillSupport = {
|
||||||
|
@@ -18,30 +18,18 @@ module.exports.sourceMapURL = () => {
|
|||||||
module.exports.ignorePackages = () => [];
|
module.exports.ignorePackages = () => [];
|
||||||
|
|
||||||
// Files from NPM packages that we should replace with empty file
|
// Files from NPM packages that we should replace with empty file
|
||||||
module.exports.emptyPackages = ({ latestBuild, isHassioBuild }) =>
|
module.exports.emptyPackages = ({ isHassioBuild }) =>
|
||||||
[
|
[
|
||||||
// Contains all color definitions for all material color sets.
|
|
||||||
// We don't use it
|
|
||||||
require.resolve("@polymer/paper-styles/color.js"),
|
|
||||||
require.resolve("@polymer/paper-styles/default-theme.js"),
|
|
||||||
// Loads stuff from a CDN
|
|
||||||
require.resolve("@polymer/font-roboto/roboto.js"),
|
|
||||||
require.resolve("@vaadin/vaadin-material-styles/typography.js"),
|
require.resolve("@vaadin/vaadin-material-styles/typography.js"),
|
||||||
require.resolve("@vaadin/vaadin-material-styles/font-icons.js"),
|
require.resolve("@vaadin/vaadin-material-styles/font-icons.js"),
|
||||||
// Compatibility not needed for latest builds
|
|
||||||
latestBuild &&
|
|
||||||
// wrapped in require.resolve so it blows up if file no longer exists
|
|
||||||
require.resolve(
|
|
||||||
path.resolve(paths.polymer_dir, "src/resources/compatibility.ts")
|
|
||||||
),
|
|
||||||
// Icons in supervisor conflict with icons in HA so we don't load.
|
// Icons in supervisor conflict with icons in HA so we don't load.
|
||||||
isHassioBuild &&
|
isHassioBuild &&
|
||||||
require.resolve(
|
require.resolve(
|
||||||
path.resolve(paths.polymer_dir, "src/components/ha-icon.ts")
|
path.resolve(paths.root_dir, "src/components/ha-icon.ts")
|
||||||
),
|
),
|
||||||
isHassioBuild &&
|
isHassioBuild &&
|
||||||
require.resolve(
|
require.resolve(
|
||||||
path.resolve(paths.polymer_dir, "src/components/ha-icon-picker.ts")
|
path.resolve(paths.root_dir, "src/components/ha-icon-picker.ts")
|
||||||
),
|
),
|
||||||
].filter(Boolean);
|
].filter(Boolean);
|
||||||
|
|
||||||
@@ -55,8 +43,9 @@ module.exports.definedVars = ({ isProdBuild, latestBuild, defineOverlay }) => ({
|
|||||||
__STATIC_PATH__: "/static/",
|
__STATIC_PATH__: "/static/",
|
||||||
__HASS_URL__: `\`${
|
__HASS_URL__: `\`${
|
||||||
"HASS_URL" in process.env
|
"HASS_URL" in process.env
|
||||||
? process.env["HASS_URL"]
|
? process.env.HASS_URL
|
||||||
: "${location.protocol}//${location.host}"
|
: // eslint-disable-next-line no-template-curly-in-string
|
||||||
|
"${location.protocol}//${location.host}"
|
||||||
}\``,
|
}\``,
|
||||||
"process.env.NODE_ENV": JSON.stringify(
|
"process.env.NODE_ENV": JSON.stringify(
|
||||||
isProdBuild ? "production" : "development"
|
isProdBuild ? "production" : "development"
|
||||||
@@ -84,6 +73,19 @@ module.exports.terserOptions = ({ latestBuild, isTestBuild }) => ({
|
|||||||
sourceMap: !isTestBuild,
|
sourceMap: !isTestBuild,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/** @type {import('@rspack/core').SwcLoaderOptions} */
|
||||||
|
module.exports.swcOptions = () => ({
|
||||||
|
jsc: {
|
||||||
|
loose: true,
|
||||||
|
externalHelpers: true,
|
||||||
|
target: "ES2021",
|
||||||
|
parser: {
|
||||||
|
syntax: "typescript",
|
||||||
|
decorators: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
module.exports.babelOptions = ({
|
module.exports.babelOptions = ({
|
||||||
latestBuild,
|
latestBuild,
|
||||||
isProdBuild,
|
isProdBuild,
|
||||||
@@ -108,7 +110,6 @@ module.exports.babelOptions = ({
|
|||||||
shippedProposals: true,
|
shippedProposals: true,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
"@babel/preset-typescript",
|
|
||||||
],
|
],
|
||||||
plugins: [
|
plugins: [
|
||||||
[
|
[
|
||||||
@@ -145,12 +146,6 @@ module.exports.babelOptions = ({
|
|||||||
"@babel/plugin-transform-runtime",
|
"@babel/plugin-transform-runtime",
|
||||||
{ version: dependencies["@babel/runtime"] },
|
{ version: dependencies["@babel/runtime"] },
|
||||||
],
|
],
|
||||||
// Transpile decorators (still in TC39 process)
|
|
||||||
// Modern browsers support class fields and private methods, but transform is required with the older decorator version dictated by Lit
|
|
||||||
[
|
|
||||||
"@babel/plugin-proposal-decorators",
|
|
||||||
{ version: "2018-09", decoratorsBeforeExport: true },
|
|
||||||
],
|
|
||||||
"@babel/plugin-transform-class-properties",
|
"@babel/plugin-transform-class-properties",
|
||||||
"@babel/plugin-transform-private-methods",
|
"@babel/plugin-transform-private-methods",
|
||||||
].filter(Boolean),
|
].filter(Boolean),
|
||||||
@@ -170,7 +165,7 @@ module.exports.babelOptions = ({
|
|||||||
],
|
],
|
||||||
],
|
],
|
||||||
exclude: [
|
exclude: [
|
||||||
path.join(paths.polymer_dir, "src/resources/polyfills"),
|
path.join(paths.root_dir, "src/resources/polyfills"),
|
||||||
...[
|
...[
|
||||||
"@formatjs/(?:ecma402-abstract|intl-\\w+)",
|
"@formatjs/(?:ecma402-abstract|intl-\\w+)",
|
||||||
"@lit-labs/virtualizer/polyfills",
|
"@lit-labs/virtualizer/polyfills",
|
||||||
@@ -188,6 +183,7 @@ module.exports.babelOptions = ({
|
|||||||
include: /\/node_modules\//,
|
include: /\/node_modules\//,
|
||||||
exclude: [
|
exclude: [
|
||||||
"element-internals-polyfill",
|
"element-internals-polyfill",
|
||||||
|
"@shoelace-style",
|
||||||
"@?lit(?:-labs|-element|-html)?",
|
"@?lit(?:-labs|-element|-html)?",
|
||||||
].map((p) => new RegExp(`/node_modules/${p}/`)),
|
].map((p) => new RegExp(`/node_modules/${p}/`)),
|
||||||
},
|
},
|
||||||
|
@@ -21,7 +21,7 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
version() {
|
version() {
|
||||||
const version = fs
|
const version = fs
|
||||||
.readFileSync(path.resolve(paths.polymer_dir, "pyproject.toml"), "utf8")
|
.readFileSync(path.resolve(paths.root_dir, "pyproject.toml"), "utf8")
|
||||||
.match(/version\W+=\W"(\d{8}\.\d(?:\.dev)?)"/);
|
.match(/version\W+=\W"(\d{8}\.\d(?:\.dev)?)"/);
|
||||||
if (!version) {
|
if (!version) {
|
||||||
throw Error("Version not found");
|
throw Error("Version not found");
|
||||||
|
@@ -1,16 +1,16 @@
|
|||||||
|
// @ts-check
|
||||||
|
|
||||||
|
import tseslint from "typescript-eslint";
|
||||||
import rootConfig from "../eslint.config.mjs";
|
import rootConfig from "../eslint.config.mjs";
|
||||||
|
|
||||||
export default [
|
export default tseslint.config(...rootConfig, {
|
||||||
...rootConfig,
|
rules: {
|
||||||
{
|
"no-console": "off",
|
||||||
rules: {
|
"import/no-extraneous-dependencies": "off",
|
||||||
"no-console": "off",
|
"import/extensions": "off",
|
||||||
"import/no-extraneous-dependencies": "off",
|
"import/no-dynamic-require": "off",
|
||||||
"import/extensions": "off",
|
"global-require": "off",
|
||||||
"import/no-dynamic-require": "off",
|
"@typescript-eslint/no-require-imports": "off",
|
||||||
"global-require": "off",
|
"prefer-arrow-callback": "off",
|
||||||
"@typescript-eslint/no-require-imports": "off",
|
|
||||||
"prefer-arrow-callback": "off",
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
];
|
});
|
||||||
|
@@ -56,6 +56,7 @@ const getCommonTemplateVars = () => {
|
|||||||
);
|
);
|
||||||
return {
|
return {
|
||||||
modernRegex: compileRegex(browserRegexes.concat(haMacOSRegex)).toString(),
|
modernRegex: compileRegex(browserRegexes.concat(haMacOSRegex)).toString(),
|
||||||
|
hassUrl: process.env.HASS_URL || "",
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -168,14 +169,14 @@ const APP_PAGE_ENTRIES = {
|
|||||||
|
|
||||||
gulp.task(
|
gulp.task(
|
||||||
"gen-pages-app-dev",
|
"gen-pages-app-dev",
|
||||||
genPagesDevTask(APP_PAGE_ENTRIES, paths.polymer_dir, paths.app_output_root)
|
genPagesDevTask(APP_PAGE_ENTRIES, paths.root_dir, paths.app_output_root)
|
||||||
);
|
);
|
||||||
|
|
||||||
gulp.task(
|
gulp.task(
|
||||||
"gen-pages-app-prod",
|
"gen-pages-app-prod",
|
||||||
genPagesProdTask(
|
genPagesProdTask(
|
||||||
APP_PAGE_ENTRIES,
|
APP_PAGE_ENTRIES,
|
||||||
paths.polymer_dir,
|
paths.root_dir,
|
||||||
paths.app_output_root,
|
paths.app_output_root,
|
||||||
paths.app_output_latest,
|
paths.app_output_latest,
|
||||||
paths.app_output_es5
|
paths.app_output_es5
|
||||||
|
@@ -6,8 +6,8 @@ import path from "path";
|
|||||||
import paths from "../paths.cjs";
|
import paths from "../paths.cjs";
|
||||||
|
|
||||||
const npmPath = (...parts) =>
|
const npmPath = (...parts) =>
|
||||||
path.resolve(paths.polymer_dir, "node_modules", ...parts);
|
path.resolve(paths.root_dir, "node_modules", ...parts);
|
||||||
const polyPath = (...parts) => path.resolve(paths.polymer_dir, ...parts);
|
const polyPath = (...parts) => path.resolve(paths.root_dir, ...parts);
|
||||||
|
|
||||||
const copyFileDir = (fromFile, toDir) =>
|
const copyFileDir = (fromFile, toDir) =>
|
||||||
fs.copySync(fromFile, path.join(toDir, path.basename(fromFile)));
|
fs.copySync(fromFile, path.join(toDir, path.basename(fromFile)));
|
||||||
@@ -59,6 +59,11 @@ function copyPolyfills(staticDir) {
|
|||||||
npmPath("@webcomponents/webcomponentsjs/webcomponents-bundle.js.map"),
|
npmPath("@webcomponents/webcomponentsjs/webcomponents-bundle.js.map"),
|
||||||
staticPath("polyfills/")
|
staticPath("polyfills/")
|
||||||
);
|
);
|
||||||
|
// Lit polyfill support
|
||||||
|
fs.copySync(
|
||||||
|
npmPath("lit/polyfill-support.js"),
|
||||||
|
path.join(staticPath("polyfills/"), "lit-polyfill-support.js")
|
||||||
|
);
|
||||||
|
|
||||||
// dialog-polyfill css
|
// dialog-polyfill css
|
||||||
copyFileDir(
|
copyFileDir(
|
||||||
@@ -90,6 +95,10 @@ function copyMapPanel(staticDir) {
|
|||||||
npmPath("leaflet/dist/leaflet.css"),
|
npmPath("leaflet/dist/leaflet.css"),
|
||||||
staticPath("images/leaflet/")
|
staticPath("images/leaflet/")
|
||||||
);
|
);
|
||||||
|
copyFileDir(
|
||||||
|
npmPath("leaflet.markercluster/dist/MarkerCluster.css"),
|
||||||
|
staticPath("images/leaflet/")
|
||||||
|
);
|
||||||
fs.copySync(
|
fs.copySync(
|
||||||
npmPath("leaflet/dist/images"),
|
npmPath("leaflet/dist/images"),
|
||||||
staticPath("images/leaflet/images/")
|
staticPath("images/leaflet/images/")
|
||||||
|
@@ -4,7 +4,7 @@ import gulp from "gulp";
|
|||||||
import { join, resolve } from "node:path";
|
import { join, resolve } from "node:path";
|
||||||
import paths from "../paths.cjs";
|
import paths from "../paths.cjs";
|
||||||
|
|
||||||
const formatjsDir = join(paths.polymer_dir, "node_modules", "@formatjs");
|
const formatjsDir = join(paths.root_dir, "node_modules", "@formatjs");
|
||||||
const outDir = join(paths.build_dir, "locale-data");
|
const outDir = join(paths.build_dir, "locale-data");
|
||||||
|
|
||||||
const INTL_POLYFILLS = {
|
const INTL_POLYFILLS = {
|
||||||
|
@@ -40,20 +40,17 @@ class CustomJSON extends Transform {
|
|||||||
this._reviver = reviver;
|
this._reviver = reviver;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||||
async _transform(file, _, callback) {
|
async _transform(file, _, callback) {
|
||||||
try {
|
let obj = JSON.parse(file.contents.toString(), this._reviver);
|
||||||
let obj = JSON.parse(file.contents.toString(), this._reviver);
|
if (this._func) obj = this._func(obj, file.path);
|
||||||
if (this._func) obj = this._func(obj, file.path);
|
for (const [outObj, dir] of Array.isArray(obj) ? obj : [[obj, ""]]) {
|
||||||
for (const [outObj, dir] of Array.isArray(obj) ? obj : [[obj, ""]]) {
|
const outFile = file.clone({ contents: false });
|
||||||
const outFile = file.clone({ contents: false });
|
outFile.contents = Buffer.from(JSON.stringify(outObj));
|
||||||
outFile.contents = Buffer.from(JSON.stringify(outObj));
|
outFile.dirname += `/${dir}`;
|
||||||
outFile.dirname += `/${dir}`;
|
this.push(outFile);
|
||||||
this.push(outFile);
|
|
||||||
}
|
|
||||||
callback(null);
|
|
||||||
} catch (err) {
|
|
||||||
callback(err);
|
|
||||||
}
|
}
|
||||||
|
callback(null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -68,25 +65,19 @@ class MergeJSON extends Transform {
|
|||||||
this._reviver = reviver;
|
this._reviver = reviver;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||||
async _transform(file, _, callback) {
|
async _transform(file, _, callback) {
|
||||||
try {
|
this._objects.push(JSON.parse(file.contents.toString(), this._reviver));
|
||||||
this._objects.push(JSON.parse(file.contents.toString(), this._reviver));
|
if (!this._outFile) this._outFile = file.clone({ contents: false });
|
||||||
if (!this._outFile) this._outFile = file.clone({ contents: false });
|
callback(null);
|
||||||
callback(null);
|
|
||||||
} catch (err) {
|
|
||||||
callback(err);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||||
async _flush(callback) {
|
async _flush(callback) {
|
||||||
try {
|
const mergedObj = merge(this._startObj, ...this._objects);
|
||||||
const mergedObj = merge(this._startObj, ...this._objects);
|
this._outFile.contents = Buffer.from(JSON.stringify(mergedObj));
|
||||||
this._outFile.contents = Buffer.from(JSON.stringify(mergedObj));
|
this._outFile.stem = this._stem;
|
||||||
this._outFile.stem = this._stem;
|
callback(null, this._outFile);
|
||||||
callback(null, this._outFile);
|
|
||||||
} catch (err) {
|
|
||||||
callback(err);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -16,6 +16,7 @@ const detailsClose = "</details>\n";
|
|||||||
|
|
||||||
const dummyAPI = {
|
const dummyAPI = {
|
||||||
version: babelVersion,
|
version: babelVersion,
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
||||||
assertVersion: () => {},
|
assertVersion: () => {},
|
||||||
caller: (callback) =>
|
caller: (callback) =>
|
||||||
callback({
|
callback({
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
const path = require("path");
|
const path = require("path");
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
polymer_dir: path.resolve(__dirname, ".."),
|
root_dir: path.resolve(__dirname, ".."),
|
||||||
|
|
||||||
build_dir: path.resolve(__dirname, "../build"),
|
build_dir: path.resolve(__dirname, "../build"),
|
||||||
app_output_root: path.resolve(__dirname, "../hass_frontend"),
|
app_output_root: path.resolve(__dirname, "../hass_frontend"),
|
||||||
|
@@ -1,12 +1,17 @@
|
|||||||
const { existsSync } = require("fs");
|
const { existsSync } = require("fs");
|
||||||
const path = require("path");
|
const path = require("path");
|
||||||
const rspack = require("@rspack/core");
|
const rspack = require("@rspack/core");
|
||||||
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||||
const { RsdoctorRspackPlugin } = require("@rsdoctor/rspack-plugin");
|
const { RsdoctorRspackPlugin } = require("@rsdoctor/rspack-plugin");
|
||||||
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||||
const { StatsWriterPlugin } = require("webpack-stats-plugin");
|
const { StatsWriterPlugin } = require("webpack-stats-plugin");
|
||||||
const filterStats = require("@bundle-stats/plugin-webpack-filter").default;
|
const filterStats = require("@bundle-stats/plugin-webpack-filter");
|
||||||
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||||
const TerserPlugin = require("terser-webpack-plugin");
|
const TerserPlugin = require("terser-webpack-plugin");
|
||||||
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||||
const { WebpackManifestPlugin } = require("rspack-manifest-plugin");
|
const { WebpackManifestPlugin } = require("rspack-manifest-plugin");
|
||||||
const log = require("fancy-log");
|
const log = require("fancy-log");
|
||||||
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||||
const WebpackBar = require("webpackbar/rspack");
|
const WebpackBar = require("webpackbar/rspack");
|
||||||
const paths = require("./paths.cjs");
|
const paths = require("./paths.cjs");
|
||||||
const bundle = require("./bundle.cjs");
|
const bundle = require("./bundle.cjs");
|
||||||
@@ -60,19 +65,26 @@ const createRspackConfig = ({
|
|||||||
rules: [
|
rules: [
|
||||||
{
|
{
|
||||||
test: /\.m?js$|\.ts$/,
|
test: /\.m?js$|\.ts$/,
|
||||||
use: (info) => ({
|
exclude: /node_modules[\\/]core-js/,
|
||||||
loader: "babel-loader",
|
use: (info) => [
|
||||||
options: {
|
{
|
||||||
...bundle.babelOptions({
|
loader: "babel-loader",
|
||||||
latestBuild,
|
options: {
|
||||||
isProdBuild,
|
...bundle.babelOptions({
|
||||||
isTestBuild,
|
latestBuild,
|
||||||
sw: info.issuerLayer === "sw",
|
isProdBuild,
|
||||||
}),
|
isTestBuild,
|
||||||
cacheDirectory: !isProdBuild,
|
sw: info.issuerLayer === "sw",
|
||||||
cacheCompression: false,
|
}),
|
||||||
|
cacheDirectory: !isProdBuild,
|
||||||
|
cacheCompression: false,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}),
|
{
|
||||||
|
loader: "builtin:swc-loader",
|
||||||
|
options: bundle.swcOptions(),
|
||||||
|
},
|
||||||
|
],
|
||||||
resolve: {
|
resolve: {
|
||||||
fullySpecified: false,
|
fullySpecified: false,
|
||||||
},
|
},
|
||||||
@@ -131,7 +143,8 @@ const createRspackConfig = ({
|
|||||||
// calling define.amd will call require("!!webpack amd options")
|
// calling define.amd will call require("!!webpack amd options")
|
||||||
resource.startsWith("!!webpack") ||
|
resource.startsWith("!!webpack") ||
|
||||||
// loaded by webpack dev server but doesn't exist.
|
// loaded by webpack dev server but doesn't exist.
|
||||||
resource === "webpack/hot"
|
resource === "webpack/hot" ||
|
||||||
|
resource.startsWith("@swc/helpers")
|
||||||
) {
|
) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -155,10 +168,8 @@ const createRspackConfig = ({
|
|||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
new rspack.NormalModuleReplacementPlugin(
|
new rspack.NormalModuleReplacementPlugin(
|
||||||
new RegExp(
|
new RegExp(bundle.emptyPackages({ isHassioBuild }).join("|")),
|
||||||
bundle.emptyPackages({ latestBuild, isHassioBuild }).join("|")
|
path.resolve(paths.root_dir, "src/util/empty.js")
|
||||||
),
|
|
||||||
path.resolve(paths.polymer_dir, "src/util/empty.js")
|
|
||||||
),
|
),
|
||||||
!isProdBuild && new LogStartCompilePlugin(),
|
!isProdBuild && new LogStartCompilePlugin(),
|
||||||
isProdBuild &&
|
isProdBuild &&
|
||||||
@@ -192,6 +203,7 @@ const createRspackConfig = ({
|
|||||||
"lit/directives/if-defined$": "lit/directives/if-defined.js",
|
"lit/directives/if-defined$": "lit/directives/if-defined.js",
|
||||||
"lit/directives/guard$": "lit/directives/guard.js",
|
"lit/directives/guard$": "lit/directives/guard.js",
|
||||||
"lit/directives/cache$": "lit/directives/cache.js",
|
"lit/directives/cache$": "lit/directives/cache.js",
|
||||||
|
"lit/directives/join$": "lit/directives/join.js",
|
||||||
"lit/directives/repeat$": "lit/directives/repeat.js",
|
"lit/directives/repeat$": "lit/directives/repeat.js",
|
||||||
"lit/directives/live$": "lit/directives/live.js",
|
"lit/directives/live$": "lit/directives/live.js",
|
||||||
"lit/directives/keyed$": "lit/directives/keyed.js",
|
"lit/directives/keyed$": "lit/directives/keyed.js",
|
||||||
|
@@ -1,3 +1,3 @@
|
|||||||
import "./layout/hc-connect";
|
import "./layout/hc-connect";
|
||||||
|
|
||||||
import("../../../src/resources/ha-style");
|
import("../../../src/resources/append-ha-style");
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
import "@material/mwc-button/mwc-button";
|
import "@material/mwc-button/mwc-button";
|
||||||
import "@material/mwc-list/mwc-list";
|
|
||||||
import type { ActionDetail } from "@material/mwc-list/mwc-list";
|
import type { ActionDetail } from "@material/mwc-list/mwc-list";
|
||||||
import { mdiCast, mdiCastConnected, mdiViewDashboard } from "@mdi/js";
|
import { mdiCast, mdiCastConnected, mdiViewDashboard } from "@mdi/js";
|
||||||
import type { Auth, Connection } from "home-assistant-js-websocket";
|
import type { Auth, Connection } from "home-assistant-js-websocket";
|
||||||
@@ -19,6 +19,8 @@ import {
|
|||||||
import { atLeastVersion } from "../../../../src/common/config/version";
|
import { atLeastVersion } from "../../../../src/common/config/version";
|
||||||
import { toggleAttribute } from "../../../../src/common/dom/toggle_attribute";
|
import { toggleAttribute } from "../../../../src/common/dom/toggle_attribute";
|
||||||
import "../../../../src/components/ha-icon";
|
import "../../../../src/components/ha-icon";
|
||||||
|
import "../../../../src/components/ha-list";
|
||||||
|
import "../../../../src/components/ha-list-item";
|
||||||
import "../../../../src/components/ha-svg-icon";
|
import "../../../../src/components/ha-svg-icon";
|
||||||
import {
|
import {
|
||||||
getLegacyLovelaceCollection,
|
getLegacyLovelaceCollection,
|
||||||
@@ -29,7 +31,6 @@ import type { LovelaceViewConfig } from "../../../../src/data/lovelace/config/vi
|
|||||||
import "../../../../src/layouts/hass-loading-screen";
|
import "../../../../src/layouts/hass-loading-screen";
|
||||||
import { generateDefaultViewConfig } from "../../../../src/panels/lovelace/common/generate-lovelace-config";
|
import { generateDefaultViewConfig } from "../../../../src/panels/lovelace/common/generate-lovelace-config";
|
||||||
import "./hc-layout";
|
import "./hc-layout";
|
||||||
import "../../../../src/components/ha-list-item";
|
|
||||||
|
|
||||||
@customElement("hc-cast")
|
@customElement("hc-cast")
|
||||||
class HcCast extends LitElement {
|
class HcCast extends LitElement {
|
||||||
@@ -85,7 +86,7 @@ class HcCast extends LitElement {
|
|||||||
`
|
`
|
||||||
: html`
|
: html`
|
||||||
<div class="section-header">PICK A VIEW</div>
|
<div class="section-header">PICK A VIEW</div>
|
||||||
<mwc-list @action=${this._handlePickView} activatable>
|
<ha-list @action=${this._handlePickView} activatable>
|
||||||
${(
|
${(
|
||||||
this.lovelaceViews ?? [
|
this.lovelaceViews ?? [
|
||||||
generateDefaultViewConfig({}, {}, {}, {}, () => ""),
|
generateDefaultViewConfig({}, {}, {}, {}, () => ""),
|
||||||
@@ -113,7 +114,7 @@ class HcCast extends LitElement {
|
|||||||
></ha-svg-icon>`}
|
></ha-svg-icon>`}
|
||||||
</ha-list-item>
|
</ha-list-item>
|
||||||
`
|
`
|
||||||
)}</mwc-list
|
)}</ha-list
|
||||||
>
|
>
|
||||||
`}
|
`}
|
||||||
|
|
||||||
|
@@ -109,7 +109,7 @@ export class HcMain extends HassElement {
|
|||||||
protected firstUpdated(changedProps) {
|
protected firstUpdated(changedProps) {
|
||||||
super.firstUpdated(changedProps);
|
super.firstUpdated(changedProps);
|
||||||
import("./hc-lovelace");
|
import("./hc-lovelace");
|
||||||
import("../../../../src/resources/ha-style");
|
import("../../../../src/resources/append-ha-style");
|
||||||
|
|
||||||
window.addEventListener("location-changed", () => {
|
window.addEventListener("location-changed", () => {
|
||||||
const panelPath = `/${this._urlPath || "lovelace"}/`;
|
const panelPath = `/${this._urlPath || "lovelace"}/`;
|
||||||
@@ -309,7 +309,7 @@ export class HcMain extends HassElement {
|
|||||||
"../../../../src/panels/lovelace/strategies/get-strategy"
|
"../../../../src/panels/lovelace/strategies/get-strategy"
|
||||||
);
|
);
|
||||||
const config = await generateLovelaceDashboardStrategy(
|
const config = await generateLovelaceDashboardStrategy(
|
||||||
rawConfig.strategy,
|
rawConfig,
|
||||||
this.hass!
|
this.hass!
|
||||||
);
|
);
|
||||||
this._handleNewLovelaceConfig(config);
|
this._handleNewLovelaceConfig(config);
|
||||||
@@ -351,10 +351,7 @@ export class HcMain extends HassElement {
|
|||||||
"../../../../src/panels/lovelace/strategies/get-strategy"
|
"../../../../src/panels/lovelace/strategies/get-strategy"
|
||||||
);
|
);
|
||||||
this._handleNewLovelaceConfig(
|
this._handleNewLovelaceConfig(
|
||||||
await generateLovelaceDashboardStrategy(
|
await generateLovelaceDashboardStrategy(DEFAULT_CONFIG, this.hass!)
|
||||||
DEFAULT_CONFIG.strategy,
|
|
||||||
this.hass!
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,37 +1,28 @@
|
|||||||
export const demoThemeJimpower = () => ({
|
export const demoThemeJimpower = () => ({
|
||||||
"text-primary-color": "var(--primary-text-color)",
|
"text-primary-color": "var(--primary-text-color)",
|
||||||
"paper-item-icon-color": "var(--primary-text-color)",
|
|
||||||
"primary-color": "#5294E2",
|
"primary-color": "#5294E2",
|
||||||
"label-badge-red": "var(--accent-color)",
|
"label-badge-red": "var(--accent-color)",
|
||||||
"paper-tabs-selection-bar-color": "green",
|
|
||||||
"light-primary-color": "var(--accent-color)",
|
"light-primary-color": "var(--accent-color)",
|
||||||
"primary-background-color": "#383C45",
|
"primary-background-color": "#383C45",
|
||||||
"primary-text-color": "#FFFFFF",
|
"primary-text-color": "#FFFFFF",
|
||||||
"paper-item-selected_-_background-color": "#434954",
|
|
||||||
"secondary-background-color": "#383C45",
|
"secondary-background-color": "#383C45",
|
||||||
"disabled-text-color": "#7F848E",
|
"disabled-text-color": "#7F848E",
|
||||||
"paper-item-icon_-_color": "green",
|
|
||||||
"paper-grey-200": "#414A59",
|
"paper-grey-200": "#414A59",
|
||||||
"label-badge-background-color": "#2E333A",
|
"label-badge-background-color": "#2E333A",
|
||||||
"paper-card-header-color": "var(--accent-color)",
|
"sidebar-icon-color": "var(--state-icon-color)",
|
||||||
"sidebar-icon-color": "var(--paper-item-icon-color)",
|
|
||||||
"paper-listbox-background-color": "#2E333A",
|
|
||||||
"table-row-background-color": "#353840",
|
"table-row-background-color": "#353840",
|
||||||
"paper-grey-50": "var(--primary-text-color)",
|
"paper-grey-50": "var(--primary-text-color)",
|
||||||
"switch-checked-color": "var(--accent-color)",
|
"switch-checked-color": "var(--accent-color)",
|
||||||
"paper-dialog-background-color": "#434954",
|
|
||||||
"secondary-text-color": "#5294E2",
|
"secondary-text-color": "#5294E2",
|
||||||
"error-color": "#E45E65",
|
"error-color": "#E45E65",
|
||||||
"divider-color": "rgba(0, 0, 0, .12)",
|
"divider-color": "rgba(0, 0, 0, .12)",
|
||||||
"success-color": "#39E949",
|
"success-color": "#39E949",
|
||||||
"switch-unchecked-button-color": "var(--disabled-text-color)",
|
"switch-unchecked-button-color": "var(--disabled-text-color)",
|
||||||
"label-badge-border-color": "green",
|
"label-badge-border-color": "green",
|
||||||
"paper-listbox-color": "var(--primary-color)",
|
|
||||||
"card-background-color": "#434954",
|
"card-background-color": "#434954",
|
||||||
"label-badge-text-color": "var(--primary-text-color)",
|
"label-badge-text-color": "var(--primary-text-color)",
|
||||||
"switch-unchecked-track-color": "var(--disabled-text-color)",
|
"switch-unchecked-track-color": "var(--disabled-text-color)",
|
||||||
"dark-primary-color": "var(--accent-color)",
|
"dark-primary-color": "var(--accent-color)",
|
||||||
"paper-item-icon-active-color": "#F9C536",
|
|
||||||
"accent-color": "#E45E65",
|
"accent-color": "#E45E65",
|
||||||
"table-row-alternative-background-color": "#3E424B",
|
"table-row-alternative-background-color": "#3E424B",
|
||||||
});
|
});
|
||||||
|
@@ -1,38 +1,29 @@
|
|||||||
// https://community.home-assistant.io/t/slate-a-new-dark-theme/86410
|
// https://community.home-assistant.io/t/slate-a-new-dark-theme/86410
|
||||||
export const demoThemeKernehed = () => ({
|
export const demoThemeKernehed = () => ({
|
||||||
"text-primary-color": "var(--primary-text-color)",
|
"text-primary-color": "var(--primary-text-color)",
|
||||||
"paper-item-icon-color": "var(--primary-text-color)",
|
|
||||||
"primary-color": "#2980b9",
|
"primary-color": "#2980b9",
|
||||||
"label-badge-red": "var(--accent-color)",
|
"label-badge-red": "var(--accent-color)",
|
||||||
"paper-tabs-selection-bar-color": "green",
|
|
||||||
"primary-text-color": "#FFFFFF",
|
"primary-text-color": "#FFFFFF",
|
||||||
"light-primary-color": "var(--accent-color)",
|
"light-primary-color": "var(--accent-color)",
|
||||||
"primary-background-color": "#222222",
|
"primary-background-color": "#222222",
|
||||||
"sidebar-icon-color": "#777777",
|
"sidebar-icon-color": "#777777",
|
||||||
"paper-item-selected_-_background-color": "#292929",
|
|
||||||
"secondary-background-color": "#222222",
|
"secondary-background-color": "#222222",
|
||||||
"disabled-text-color": "#777777",
|
"disabled-text-color": "#777777",
|
||||||
"paper-item-icon_-_color": "green",
|
|
||||||
"paper-grey-200": "#222222",
|
"paper-grey-200": "#222222",
|
||||||
"label-badge-background-color": "#222222",
|
"label-badge-background-color": "#222222",
|
||||||
"paper-card-header-color": "var(--accent-color)",
|
|
||||||
"paper-listbox-background-color": "#141414",
|
|
||||||
"table-row-background-color": "#292929",
|
"table-row-background-color": "#292929",
|
||||||
"paper-grey-50": "var(--primary-text-color)",
|
"paper-grey-50": "var(--primary-text-color)",
|
||||||
"switch-checked-color": "var(--accent-color)",
|
"switch-checked-color": "var(--accent-color)",
|
||||||
"paper-dialog-background-color": "#292929",
|
|
||||||
"secondary-text-color": "#b58e31",
|
"secondary-text-color": "#b58e31",
|
||||||
"error-color": "#b58e31",
|
"error-color": "#b58e31",
|
||||||
"divider-color": "rgba(0, 0, 0, .12)",
|
"divider-color": "rgba(0, 0, 0, .12)",
|
||||||
"success-color": "#2980b9",
|
"success-color": "#2980b9",
|
||||||
"switch-unchecked-button-color": "var(--disabled-text-color)",
|
"switch-unchecked-button-color": "var(--disabled-text-color)",
|
||||||
"label-badge-border-color": "green",
|
"label-badge-border-color": "green",
|
||||||
"paper-listbox-color": "#777777",
|
|
||||||
"card-background-color": "#292929",
|
"card-background-color": "#292929",
|
||||||
"label-badge-text-color": "var(--primary-text-color)",
|
"label-badge-text-color": "var(--primary-text-color)",
|
||||||
"switch-unchecked-track-color": "var(--disabled-text-color)",
|
"switch-unchecked-track-color": "var(--disabled-text-color)",
|
||||||
"dark-primary-color": "var(--accent-color)",
|
"dark-primary-color": "var(--accent-color)",
|
||||||
"paper-item-icon-active-color": "#b58e31",
|
|
||||||
"accent-color": "#2980b9",
|
"accent-color": "#2980b9",
|
||||||
"table-row-alternative-background-color": "#292929",
|
"table-row-alternative-background-color": "#292929",
|
||||||
});
|
});
|
||||||
|
@@ -1,26 +1,18 @@
|
|||||||
export const demoThemeTeachingbirds = () => ({
|
export const demoThemeTeachingbirds = () => ({
|
||||||
"paper-card-header-color": "var(--paper-item-icon-color)",
|
|
||||||
"paper-listbox-background-color": "#202020",
|
|
||||||
"paper-grey-50": "var(--primary-text-color)",
|
"paper-grey-50": "var(--primary-text-color)",
|
||||||
"paper-item-icon-color": "#d3d3d3",
|
|
||||||
"divider-color": "rgba(255, 255, 255, 0.12)",
|
"divider-color": "rgba(255, 255, 255, 0.12)",
|
||||||
"primary-color": "#389638",
|
"primary-color": "#389638",
|
||||||
"light-primary-color": "#6f956f",
|
"light-primary-color": "#6f956f",
|
||||||
"label-badge-red": "var(--primary-color)",
|
"label-badge-red": "var(--primary-color)",
|
||||||
"paper-listbox-color": "#FFFFFF",
|
|
||||||
"paper-toggle-button-checked-bar-color": "var(--light-primary-color)",
|
|
||||||
"switch-unchecked-track-color": "var(--primary-text-color)",
|
"switch-unchecked-track-color": "var(--primary-text-color)",
|
||||||
"card-background-color": "#4e4e4e",
|
"card-background-color": "#4e4e4e",
|
||||||
"label-badge-text-color": "var(--text-primary-color)",
|
"label-badge-text-color": "var(--text-primary-color)",
|
||||||
"primary-background-color": "#303030",
|
"primary-background-color": "#303030",
|
||||||
"sidebar-icon-color": "var(--paper-item-icon-color)",
|
"sidebar-icon-color": "#d3d3d3",
|
||||||
"secondary-background-color": "#2b2b2b",
|
"secondary-background-color": "#2b2b2b",
|
||||||
"paper-item-icon-active-color": "#d8bf50",
|
|
||||||
"switch-checked-color": "var(--primary-color)",
|
"switch-checked-color": "var(--primary-color)",
|
||||||
"secondary-text-color": "#389638",
|
"secondary-text-color": "#389638",
|
||||||
"disabled-text-color": "#545454",
|
"disabled-text-color": "#545454",
|
||||||
"paper-item-icon_-_color": "var(--primary-text-color)",
|
|
||||||
"paper-grey-200": "#191919",
|
"paper-grey-200": "#191919",
|
||||||
"primary-text-color": "#cfcfcf",
|
|
||||||
"label-badge-background-color": "var(--secondary-background-color)",
|
"label-badge-background-color": "var(--secondary-background-color)",
|
||||||
});
|
});
|
||||||
|
@@ -73,7 +73,7 @@ class CastDemoRow extends LitElement implements LovelaceRow {
|
|||||||
}
|
}
|
||||||
ha-svg-icon {
|
ha-svg-icon {
|
||||||
padding: 8px;
|
padding: 8px;
|
||||||
color: var(--paper-item-icon-color);
|
color: var(--state-icon-color);
|
||||||
}
|
}
|
||||||
.flex {
|
.flex {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
|
@@ -5,7 +5,7 @@ import { until } from "lit/directives/until";
|
|||||||
import { fireEvent } from "../../../src/common/dom/fire_event";
|
import { fireEvent } from "../../../src/common/dom/fire_event";
|
||||||
import "../../../src/components/ha-card";
|
import "../../../src/components/ha-card";
|
||||||
import "../../../src/components/ha-button";
|
import "../../../src/components/ha-button";
|
||||||
import "../../../src/components/ha-circular-progress";
|
import "../../../src/components/ha-spinner";
|
||||||
import type { LovelaceCardConfig } from "../../../src/data/lovelace/config/card";
|
import type { LovelaceCardConfig } from "../../../src/data/lovelace/config/card";
|
||||||
import type { MockHomeAssistant } from "../../../src/fake_data/provide_hass";
|
import type { MockHomeAssistant } from "../../../src/fake_data/provide_hass";
|
||||||
import type {
|
import type {
|
||||||
@@ -44,9 +44,7 @@ export class HADemoCard extends LitElement implements LovelaceCard {
|
|||||||
<div class="picker">
|
<div class="picker">
|
||||||
<div class="label">
|
<div class="label">
|
||||||
${this._switching
|
${this._switching
|
||||||
? html`
|
? html`<ha-spinner></ha-spinner>`
|
||||||
<ha-circular-progress indeterminate></ha-circular-progress>
|
|
||||||
`
|
|
||||||
: until(
|
: until(
|
||||||
selectedDemoConfig.then(
|
selectedDemoConfig.then(
|
||||||
(conf) => html`
|
(conf) => html`
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
import "./util/is_frontpage";
|
import "./util/is_frontpage";
|
||||||
import "./ha-demo";
|
import "./ha-demo";
|
||||||
|
|
||||||
import("../../src/resources/ha-style");
|
import("../../src/resources/append-ha-style");
|
||||||
|
@@ -1,5 +1,3 @@
|
|||||||
// Compat needs to be first import
|
|
||||||
import "../../src/resources/compatibility";
|
|
||||||
import { customElement } from "lit/decorators";
|
import { customElement } from "lit/decorators";
|
||||||
import { isNavigationClick } from "../../src/common/dom/is-navigation-click";
|
import { isNavigationClick } from "../../src/common/dom/is-navigation-click";
|
||||||
import { navigate } from "../../src/common/navigate";
|
import { navigate } from "../../src/common/navigate";
|
||||||
@@ -65,6 +63,7 @@ export class HaDemo extends HomeAssistantAppEl {
|
|||||||
mockEntityRegistry(hass, [
|
mockEntityRegistry(hass, [
|
||||||
{
|
{
|
||||||
config_entry_id: "co2signal",
|
config_entry_id: "co2signal",
|
||||||
|
config_subentry_id: null,
|
||||||
device_id: "co2signal",
|
device_id: "co2signal",
|
||||||
area_id: null,
|
area_id: null,
|
||||||
disabled_by: null,
|
disabled_by: null,
|
||||||
@@ -85,6 +84,7 @@ export class HaDemo extends HomeAssistantAppEl {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
config_entry_id: "co2signal",
|
config_entry_id: "co2signal",
|
||||||
|
config_subentry_id: null,
|
||||||
device_id: "co2signal",
|
device_id: "co2signal",
|
||||||
area_id: null,
|
area_id: null,
|
||||||
disabled_by: null,
|
disabled_by: null,
|
||||||
|
@@ -1,9 +1,10 @@
|
|||||||
|
import type { validateConfig } from "../../../src/data/config";
|
||||||
import type { MockHomeAssistant } from "../../../src/fake_data/provide_hass";
|
import type { MockHomeAssistant } from "../../../src/fake_data/provide_hass";
|
||||||
|
|
||||||
export const mockConfig = (hass: MockHomeAssistant) => {
|
export const mockConfig = (hass: MockHomeAssistant) => {
|
||||||
hass.mockWS("validate_config", () => ({
|
hass.mockWS<typeof validateConfig>("validate_config", () => ({
|
||||||
actions: { valid: true },
|
actions: { valid: true, error: null },
|
||||||
conditions: { valid: true },
|
conditions: { valid: true, error: null },
|
||||||
triggers: { valid: true },
|
triggers: { valid: true, error: null },
|
||||||
}));
|
}));
|
||||||
};
|
};
|
||||||
|
@@ -1,19 +1,26 @@
|
|||||||
|
import type { getConfigEntries } from "../../../src/data/config_entries";
|
||||||
import type { MockHomeAssistant } from "../../../src/fake_data/provide_hass";
|
import type { MockHomeAssistant } from "../../../src/fake_data/provide_hass";
|
||||||
|
|
||||||
export const mockConfigEntries = (hass: MockHomeAssistant) => {
|
export const mockConfigEntries = (hass: MockHomeAssistant) => {
|
||||||
hass.mockWS("config_entries/get", () => ({
|
hass.mockWS<typeof getConfigEntries>("config_entries/get", () => [
|
||||||
entry_id: "co2signal",
|
{
|
||||||
domain: "co2signal",
|
entry_id: "mock-entry-co2signal",
|
||||||
title: "Electricity Maps",
|
domain: "co2signal",
|
||||||
source: "user",
|
title: "Electricity Maps",
|
||||||
state: "loaded",
|
source: "user",
|
||||||
supports_options: false,
|
state: "loaded",
|
||||||
supports_remove_device: false,
|
supports_options: false,
|
||||||
supports_unload: true,
|
supports_remove_device: false,
|
||||||
supports_reconfigure: true,
|
supports_unload: true,
|
||||||
pref_disable_new_entities: false,
|
supports_reconfigure: true,
|
||||||
pref_disable_polling: false,
|
supported_subentry_types: {},
|
||||||
disabled_by: null,
|
pref_disable_new_entities: false,
|
||||||
reason: null,
|
pref_disable_polling: false,
|
||||||
}));
|
disabled_by: null,
|
||||||
|
reason: null,
|
||||||
|
num_subentries: 0,
|
||||||
|
error_reason_translation_key: null,
|
||||||
|
error_reason_translation_placeholders: null,
|
||||||
|
},
|
||||||
|
]);
|
||||||
};
|
};
|
||||||
|
@@ -2,26 +2,36 @@ import type { TodoItem } from "../../../src/data/todo";
|
|||||||
import { TodoItemStatus } from "../../../src/data/todo";
|
import { TodoItemStatus } from "../../../src/data/todo";
|
||||||
import type { MockHomeAssistant } from "../../../src/fake_data/provide_hass";
|
import type { MockHomeAssistant } from "../../../src/fake_data/provide_hass";
|
||||||
|
|
||||||
export const mockTodo = (hass: MockHomeAssistant) => {
|
const items = {
|
||||||
hass.mockWS("todo/item/list", () => ({
|
items: [
|
||||||
items: [
|
{
|
||||||
{
|
uid: "12",
|
||||||
uid: "12",
|
summary: "Milk",
|
||||||
summary: "Milk",
|
status: TodoItemStatus.NeedsAction,
|
||||||
status: TodoItemStatus.NeedsAction,
|
},
|
||||||
},
|
{
|
||||||
{
|
uid: "13",
|
||||||
uid: "13",
|
summary: "Eggs",
|
||||||
summary: "Eggs",
|
status: TodoItemStatus.NeedsAction,
|
||||||
status: TodoItemStatus.NeedsAction,
|
},
|
||||||
},
|
{
|
||||||
{
|
uid: "14",
|
||||||
uid: "14",
|
summary: "Oranges",
|
||||||
summary: "Oranges",
|
status: TodoItemStatus.Completed,
|
||||||
status: TodoItemStatus.Completed,
|
},
|
||||||
},
|
{
|
||||||
] as TodoItem[],
|
uid: "15",
|
||||||
}));
|
summary: "Beer",
|
||||||
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
},
|
||||||
hass.mockWS("todo/item/subscribe", (_msg, _hass) => () => {});
|
] as TodoItem[],
|
||||||
|
};
|
||||||
|
|
||||||
|
export const mockTodo = (hass: MockHomeAssistant) => {
|
||||||
|
hass.mockWS("todo/item/list", () => items);
|
||||||
|
hass.mockWS("todo/item/move", () => undefined);
|
||||||
|
hass.mockWS("todo/item/subscribe", (_msg, _hass, onChange) => {
|
||||||
|
onChange!(items);
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
||||||
|
return () => {};
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
@@ -1,11 +1,16 @@
|
|||||||
|
// @ts-check
|
||||||
|
|
||||||
/* eslint-disable import/no-extraneous-dependencies */
|
/* eslint-disable import/no-extraneous-dependencies */
|
||||||
import unusedImports from "eslint-plugin-unused-imports";
|
import unusedImports from "eslint-plugin-unused-imports";
|
||||||
import globals from "globals";
|
import globals from "globals";
|
||||||
import tsParser from "@typescript-eslint/parser";
|
|
||||||
import path from "node:path";
|
import path from "node:path";
|
||||||
import { fileURLToPath } from "node:url";
|
import { fileURLToPath } from "node:url";
|
||||||
import js from "@eslint/js";
|
import js from "@eslint/js";
|
||||||
import { FlatCompat } from "@eslint/eslintrc";
|
import { FlatCompat } from "@eslint/eslintrc";
|
||||||
|
import tseslint from "typescript-eslint";
|
||||||
|
import eslintConfigPrettier from "eslint-config-prettier";
|
||||||
|
import { configs as litConfigs } from "eslint-plugin-lit";
|
||||||
|
import { configs as wcConfigs } from "eslint-plugin-wc";
|
||||||
|
|
||||||
const _filename = fileURLToPath(import.meta.url);
|
const _filename = fileURLToPath(import.meta.url);
|
||||||
const _dirname = path.dirname(_filename);
|
const _dirname = path.dirname(_filename);
|
||||||
@@ -15,17 +20,14 @@ const compat = new FlatCompat({
|
|||||||
allConfig: js.configs.all,
|
allConfig: js.configs.all,
|
||||||
});
|
});
|
||||||
|
|
||||||
export default [
|
export default tseslint.config(
|
||||||
...compat.extends(
|
...compat.extends("airbnb-base", "plugin:lit-a11y/recommended"),
|
||||||
"airbnb-base",
|
eslintConfigPrettier,
|
||||||
"plugin:@typescript-eslint/recommended",
|
litConfigs["flat/all"],
|
||||||
"plugin:@typescript-eslint/strict",
|
tseslint.configs.recommended,
|
||||||
"plugin:@typescript-eslint/stylistic",
|
tseslint.configs.strict,
|
||||||
"plugin:wc/recommended",
|
tseslint.configs.stylistic,
|
||||||
"plugin:lit/all",
|
wcConfigs["flat/recommended"],
|
||||||
"plugin:lit-a11y/recommended",
|
|
||||||
"prettier"
|
|
||||||
),
|
|
||||||
{
|
{
|
||||||
plugins: {
|
plugins: {
|
||||||
"unused-imports": unusedImports,
|
"unused-imports": unusedImports,
|
||||||
@@ -40,10 +42,9 @@ export default [
|
|||||||
__VERSION__: false,
|
__VERSION__: false,
|
||||||
__STATIC_PATH__: false,
|
__STATIC_PATH__: false,
|
||||||
__SUPERVISOR__: false,
|
__SUPERVISOR__: false,
|
||||||
Polymer: true,
|
|
||||||
},
|
},
|
||||||
|
|
||||||
parser: tsParser,
|
parser: tseslint.parser,
|
||||||
ecmaVersion: 2020,
|
ecmaVersion: 2020,
|
||||||
sourceType: "module",
|
sourceType: "module",
|
||||||
|
|
||||||
@@ -184,5 +185,5 @@ export default [
|
|||||||
],
|
],
|
||||||
"no-use-before-define": "off",
|
"no-use-before-define": "off",
|
||||||
},
|
},
|
||||||
},
|
}
|
||||||
];
|
);
|
||||||
|
@@ -1,10 +1,10 @@
|
|||||||
|
// @ts-check
|
||||||
|
|
||||||
|
import tseslint from "typescript-eslint";
|
||||||
import rootConfig from "../eslint.config.mjs";
|
import rootConfig from "../eslint.config.mjs";
|
||||||
|
|
||||||
export default [
|
export default tseslint.config(...rootConfig, {
|
||||||
...rootConfig,
|
rules: {
|
||||||
{
|
"no-console": "off",
|
||||||
rules: {
|
|
||||||
"no-console": "off",
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
];
|
});
|
||||||
|
10
gallery/public/images/select_box/card.svg
Normal file
10
gallery/public/images/select_box/card.svg
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
<svg width="94" height="64" viewBox="0 0 94 64" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<rect width="94" height="64" rx="8" fill="white"/>
|
||||||
|
<rect x="0.5" y="0.5" width="93" height="63" rx="7.5" stroke="black" stroke-opacity="0.12"/>
|
||||||
|
<path d="M8 14C8 10.6863 10.6863 8 14 8H33C36.3137 8 39 10.6863 39 14C39 17.3137 36.3137 20 33 20H14C10.6863 20 8 17.3137 8 14Z" fill="black" fill-opacity="0.32"/>
|
||||||
|
<path d="M8 27C8 25.3431 9.34315 24 11 24H31C32.6569 24 34 25.3431 34 27V29C34 30.6569 32.6569 32 31 32H11C9.34315 32 8 30.6569 8 29V27Z" fill="black" fill-opacity="0.12"/>
|
||||||
|
<path d="M38 27C38 25.3431 39.3431 24 41 24H83C84.6569 24 86 25.3431 86 27V29C86 30.6569 84.6569 32 83 32H41C39.3431 32 38 30.6569 38 29V27Z" fill="black" fill-opacity="0.12"/>
|
||||||
|
<path d="M8 39C8 37.3431 9.34315 36 11 36H53C54.6569 36 56 37.3431 56 39V41C56 42.6569 54.6569 44 53 44H11C9.34315 44 8 42.6569 8 41V39Z" fill="black" fill-opacity="0.12"/>
|
||||||
|
<path d="M60 39C60 37.3431 61.3431 36 63 36H83C84.6569 36 86 37.3431 86 39V41C86 42.6569 84.6569 44 83 44H63C61.3431 44 60 42.6569 60 41V39Z" fill="black" fill-opacity="0.12"/>
|
||||||
|
<path d="M8 51C8 49.3431 9.34315 48 11 48H31C32.6569 48 34 49.3431 34 51V53C34 54.6569 32.6569 56 31 56H11C9.34315 56 8 54.6569 8 53V51Z" fill="black" fill-opacity="0.12"/>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 1.3 KiB |
7
gallery/public/images/select_box/text_only.svg
Normal file
7
gallery/public/images/select_box/text_only.svg
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<svg width="94" height="48" viewBox="0 0 94 48" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path d="M0 11C0 9.34315 1.34315 8 3 8H23C24.6569 8 26 9.34315 26 11V13C26 14.6569 24.6569 16 23 16H3C1.34315 16 0 14.6569 0 13V11Z" fill="black" fill-opacity="0.12"/>
|
||||||
|
<path d="M30 11C30 9.34315 31.3431 8 33 8H91C92.6569 8 94 9.34315 94 11V13C94 14.6569 92.6569 16 91 16H33C31.3431 16 30 14.6569 30 13V11Z" fill="black" fill-opacity="0.12"/>
|
||||||
|
<path d="M0 23C0 21.3431 1.34315 20 3 20H61C62.6569 20 64 21.3431 64 23V25C64 26.6569 62.6569 28 61 28H3C1.34315 28 0 26.6569 0 25V23Z" fill="black" fill-opacity="0.12"/>
|
||||||
|
<path d="M68 23C68 21.3431 69.3431 20 71 20H91C92.6569 20 94 21.3431 94 23V25C94 26.6569 92.6569 28 91 28H71C69.3431 28 68 26.6569 68 25V23Z" fill="black" fill-opacity="0.12"/>
|
||||||
|
<path d="M0 35C0 33.3431 1.34315 32 3 32H23C24.6569 32 26 33.3431 26 35V37C26 38.6569 24.6569 40 23 40H3C1.34315 40 0 38.6569 0 37V35Z" fill="black" fill-opacity="0.12"/>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 964 B |
@@ -1,5 +1,5 @@
|
|||||||
import "./ha-gallery";
|
import "./ha-gallery";
|
||||||
|
|
||||||
import("../../src/resources/ha-style");
|
import("../../src/resources/append-ha-style");
|
||||||
|
|
||||||
document.body.appendChild(document.createElement("ha-gallery"));
|
document.body.appendChild(document.createElement("ha-gallery"));
|
||||||
|
@@ -1,29 +1,30 @@
|
|||||||
import type { TemplateResult } from "lit";
|
import type { TemplateResult } from "lit";
|
||||||
import { LitElement, html, css } from "lit";
|
import { LitElement, css, html } from "lit";
|
||||||
import { customElement, state } from "lit/decorators";
|
import { customElement, state } from "lit/decorators";
|
||||||
|
import "../../../../src/components/ha-formfield";
|
||||||
import { provideHass } from "../../../../src/fake_data/provide_hass";
|
import { provideHass } from "../../../../src/fake_data/provide_hass";
|
||||||
import type { HomeAssistant } from "../../../../src/types";
|
import type { HomeAssistant } from "../../../../src/types";
|
||||||
import "../../components/demo-black-white-row";
|
import "../../components/demo-black-white-row";
|
||||||
import { mockEntityRegistry } from "../../../../demo/src/stubs/entity_registry";
|
|
||||||
import { mockDeviceRegistry } from "../../../../demo/src/stubs/device_registry";
|
|
||||||
import { mockAreaRegistry } from "../../../../demo/src/stubs/area_registry";
|
import { mockAreaRegistry } from "../../../../demo/src/stubs/area_registry";
|
||||||
|
import { mockDeviceRegistry } from "../../../../demo/src/stubs/device_registry";
|
||||||
|
import { mockEntityRegistry } from "../../../../demo/src/stubs/entity_registry";
|
||||||
import { mockHassioSupervisor } from "../../../../demo/src/stubs/hassio_supervisor";
|
import { mockHassioSupervisor } from "../../../../demo/src/stubs/hassio_supervisor";
|
||||||
|
import type { Action } from "../../../../src/data/script";
|
||||||
import "../../../../src/panels/config/automation/action/ha-automation-action";
|
import "../../../../src/panels/config/automation/action/ha-automation-action";
|
||||||
import { HaChooseAction } from "../../../../src/panels/config/automation/action/types/ha-automation-action-choose";
|
import { HaChooseAction } from "../../../../src/panels/config/automation/action/types/ha-automation-action-choose";
|
||||||
|
import { HaConditionAction } from "../../../../src/panels/config/automation/action/types/ha-automation-action-condition";
|
||||||
import { HaDelayAction } from "../../../../src/panels/config/automation/action/types/ha-automation-action-delay";
|
import { HaDelayAction } from "../../../../src/panels/config/automation/action/types/ha-automation-action-delay";
|
||||||
import { HaDeviceAction } from "../../../../src/panels/config/automation/action/types/ha-automation-action-device_id";
|
import { HaDeviceAction } from "../../../../src/panels/config/automation/action/types/ha-automation-action-device_id";
|
||||||
import { HaEventAction } from "../../../../src/panels/config/automation/action/types/ha-automation-action-event";
|
import { HaEventAction } from "../../../../src/panels/config/automation/action/types/ha-automation-action-event";
|
||||||
|
import { HaIfAction } from "../../../../src/panels/config/automation/action/types/ha-automation-action-if";
|
||||||
|
import { HaParallelAction } from "../../../../src/panels/config/automation/action/types/ha-automation-action-parallel";
|
||||||
|
import { HaPlayMediaAction } from "../../../../src/panels/config/automation/action/types/ha-automation-action-play_media";
|
||||||
import { HaRepeatAction } from "../../../../src/panels/config/automation/action/types/ha-automation-action-repeat";
|
import { HaRepeatAction } from "../../../../src/panels/config/automation/action/types/ha-automation-action-repeat";
|
||||||
|
import { HaSequenceAction } from "../../../../src/panels/config/automation/action/types/ha-automation-action-sequence";
|
||||||
import { HaServiceAction } from "../../../../src/panels/config/automation/action/types/ha-automation-action-service";
|
import { HaServiceAction } from "../../../../src/panels/config/automation/action/types/ha-automation-action-service";
|
||||||
|
import { HaStopAction } from "../../../../src/panels/config/automation/action/types/ha-automation-action-stop";
|
||||||
import { HaWaitForTriggerAction } from "../../../../src/panels/config/automation/action/types/ha-automation-action-wait_for_trigger";
|
import { HaWaitForTriggerAction } from "../../../../src/panels/config/automation/action/types/ha-automation-action-wait_for_trigger";
|
||||||
import { HaWaitAction } from "../../../../src/panels/config/automation/action/types/ha-automation-action-wait_template";
|
import { HaWaitAction } from "../../../../src/panels/config/automation/action/types/ha-automation-action-wait_template";
|
||||||
import type { Action } from "../../../../src/data/script";
|
|
||||||
import { HaConditionAction } from "../../../../src/panels/config/automation/action/types/ha-automation-action-condition";
|
|
||||||
import { HaSequenceAction } from "../../../../src/panels/config/automation/action/types/ha-automation-action-sequence";
|
|
||||||
import { HaParallelAction } from "../../../../src/panels/config/automation/action/types/ha-automation-action-parallel";
|
|
||||||
import { HaIfAction } from "../../../../src/panels/config/automation/action/types/ha-automation-action-if";
|
|
||||||
import { HaStopAction } from "../../../../src/panels/config/automation/action/types/ha-automation-action-stop";
|
|
||||||
import { HaPlayMediaAction } from "../../../../src/panels/config/automation/action/types/ha-automation-action-play_media";
|
|
||||||
|
|
||||||
const SCHEMAS: { name: string; actions: Action[] }[] = [
|
const SCHEMAS: { name: string; actions: Action[] }[] = [
|
||||||
{ name: "Event", actions: [HaEventAction.defaultConfig] },
|
{ name: "Event", actions: [HaEventAction.defaultConfig] },
|
||||||
|
@@ -1,26 +1,27 @@
|
|||||||
import type { TemplateResult } from "lit";
|
import type { TemplateResult } from "lit";
|
||||||
import { LitElement, html, css } from "lit";
|
import { LitElement, css, html } from "lit";
|
||||||
import { customElement, state } from "lit/decorators";
|
import { customElement, state } from "lit/decorators";
|
||||||
import { provideHass } from "../../../../src/fake_data/provide_hass";
|
|
||||||
import type { HomeAssistant } from "../../../../src/types";
|
|
||||||
import "../../components/demo-black-white-row";
|
|
||||||
import { mockEntityRegistry } from "../../../../demo/src/stubs/entity_registry";
|
|
||||||
import { mockDeviceRegistry } from "../../../../demo/src/stubs/device_registry";
|
|
||||||
import { mockAreaRegistry } from "../../../../demo/src/stubs/area_registry";
|
import { mockAreaRegistry } from "../../../../demo/src/stubs/area_registry";
|
||||||
|
import { mockDeviceRegistry } from "../../../../demo/src/stubs/device_registry";
|
||||||
|
import { mockEntityRegistry } from "../../../../demo/src/stubs/entity_registry";
|
||||||
import { mockHassioSupervisor } from "../../../../demo/src/stubs/hassio_supervisor";
|
import { mockHassioSupervisor } from "../../../../demo/src/stubs/hassio_supervisor";
|
||||||
|
import "../../../../src/components/ha-formfield";
|
||||||
import type { ConditionWithShorthand } from "../../../../src/data/automation";
|
import type { ConditionWithShorthand } from "../../../../src/data/automation";
|
||||||
|
import { provideHass } from "../../../../src/fake_data/provide_hass";
|
||||||
import "../../../../src/panels/config/automation/condition/ha-automation-condition";
|
import "../../../../src/panels/config/automation/condition/ha-automation-condition";
|
||||||
|
import { HaAndCondition } from "../../../../src/panels/config/automation/condition/types/ha-automation-condition-and";
|
||||||
import { HaDeviceCondition } from "../../../../src/panels/config/automation/condition/types/ha-automation-condition-device";
|
import { HaDeviceCondition } from "../../../../src/panels/config/automation/condition/types/ha-automation-condition-device";
|
||||||
|
import { HaNotCondition } from "../../../../src/panels/config/automation/condition/types/ha-automation-condition-not";
|
||||||
import HaNumericStateCondition from "../../../../src/panels/config/automation/condition/types/ha-automation-condition-numeric_state";
|
import HaNumericStateCondition from "../../../../src/panels/config/automation/condition/types/ha-automation-condition-numeric_state";
|
||||||
|
import { HaOrCondition } from "../../../../src/panels/config/automation/condition/types/ha-automation-condition-or";
|
||||||
import { HaStateCondition } from "../../../../src/panels/config/automation/condition/types/ha-automation-condition-state";
|
import { HaStateCondition } from "../../../../src/panels/config/automation/condition/types/ha-automation-condition-state";
|
||||||
import { HaSunCondition } from "../../../../src/panels/config/automation/condition/types/ha-automation-condition-sun";
|
import { HaSunCondition } from "../../../../src/panels/config/automation/condition/types/ha-automation-condition-sun";
|
||||||
import { HaTemplateCondition } from "../../../../src/panels/config/automation/condition/types/ha-automation-condition-template";
|
import { HaTemplateCondition } from "../../../../src/panels/config/automation/condition/types/ha-automation-condition-template";
|
||||||
import { HaTimeCondition } from "../../../../src/panels/config/automation/condition/types/ha-automation-condition-time";
|
import { HaTimeCondition } from "../../../../src/panels/config/automation/condition/types/ha-automation-condition-time";
|
||||||
import { HaTriggerCondition } from "../../../../src/panels/config/automation/condition/types/ha-automation-condition-trigger";
|
import { HaTriggerCondition } from "../../../../src/panels/config/automation/condition/types/ha-automation-condition-trigger";
|
||||||
import { HaZoneCondition } from "../../../../src/panels/config/automation/condition/types/ha-automation-condition-zone";
|
import { HaZoneCondition } from "../../../../src/panels/config/automation/condition/types/ha-automation-condition-zone";
|
||||||
import { HaAndCondition } from "../../../../src/panels/config/automation/condition/types/ha-automation-condition-and";
|
import type { HomeAssistant } from "../../../../src/types";
|
||||||
import { HaOrCondition } from "../../../../src/panels/config/automation/condition/types/ha-automation-condition-or";
|
import "../../components/demo-black-white-row";
|
||||||
import { HaNotCondition } from "../../../../src/panels/config/automation/condition/types/ha-automation-condition-not";
|
|
||||||
|
|
||||||
const SCHEMAS: { name: string; conditions: ConditionWithShorthand[] }[] = [
|
const SCHEMAS: { name: string; conditions: ConditionWithShorthand[] }[] = [
|
||||||
{
|
{
|
||||||
|
@@ -1,35 +1,36 @@
|
|||||||
import type { TemplateResult } from "lit";
|
import type { TemplateResult } from "lit";
|
||||||
import { LitElement, html, css } from "lit";
|
import { LitElement, css, html } from "lit";
|
||||||
import { customElement, state } from "lit/decorators";
|
import { customElement, state } from "lit/decorators";
|
||||||
import { provideHass } from "../../../../src/fake_data/provide_hass";
|
|
||||||
import type { HomeAssistant } from "../../../../src/types";
|
|
||||||
import "../../components/demo-black-white-row";
|
|
||||||
import { mockEntityRegistry } from "../../../../demo/src/stubs/entity_registry";
|
|
||||||
import { mockDeviceRegistry } from "../../../../demo/src/stubs/device_registry";
|
|
||||||
import { mockAreaRegistry } from "../../../../demo/src/stubs/area_registry";
|
import { mockAreaRegistry } from "../../../../demo/src/stubs/area_registry";
|
||||||
import { mockHassioSupervisor } from "../../../../demo/src/stubs/hassio_supervisor";
|
|
||||||
import { mockConfig } from "../../../../demo/src/stubs/config";
|
|
||||||
import { mockTags } from "../../../../demo/src/stubs/tags";
|
|
||||||
import { mockAuth } from "../../../../demo/src/stubs/auth";
|
import { mockAuth } from "../../../../demo/src/stubs/auth";
|
||||||
|
import { mockConfig } from "../../../../demo/src/stubs/config";
|
||||||
|
import { mockDeviceRegistry } from "../../../../demo/src/stubs/device_registry";
|
||||||
|
import { mockEntityRegistry } from "../../../../demo/src/stubs/entity_registry";
|
||||||
|
import { mockHassioSupervisor } from "../../../../demo/src/stubs/hassio_supervisor";
|
||||||
|
import { mockTags } from "../../../../demo/src/stubs/tags";
|
||||||
|
import "../../../../src/components/ha-formfield";
|
||||||
import type { Trigger } from "../../../../src/data/automation";
|
import type { Trigger } from "../../../../src/data/automation";
|
||||||
import { HaGeolocationTrigger } from "../../../../src/panels/config/automation/trigger/types/ha-automation-trigger-geo_location";
|
import { provideHass } from "../../../../src/fake_data/provide_hass";
|
||||||
|
import "../../../../src/panels/config/automation/trigger/ha-automation-trigger";
|
||||||
|
import { HaConversationTrigger } from "../../../../src/panels/config/automation/trigger/types/ha-automation-trigger-conversation";
|
||||||
|
import { HaDeviceTrigger } from "../../../../src/panels/config/automation/trigger/types/ha-automation-trigger-device";
|
||||||
import { HaEventTrigger } from "../../../../src/panels/config/automation/trigger/types/ha-automation-trigger-event";
|
import { HaEventTrigger } from "../../../../src/panels/config/automation/trigger/types/ha-automation-trigger-event";
|
||||||
|
import { HaGeolocationTrigger } from "../../../../src/panels/config/automation/trigger/types/ha-automation-trigger-geo_location";
|
||||||
import { HaHassTrigger } from "../../../../src/panels/config/automation/trigger/types/ha-automation-trigger-homeassistant";
|
import { HaHassTrigger } from "../../../../src/panels/config/automation/trigger/types/ha-automation-trigger-homeassistant";
|
||||||
|
import { HaTriggerList } from "../../../../src/panels/config/automation/trigger/types/ha-automation-trigger-list";
|
||||||
|
import { HaMQTTTrigger } from "../../../../src/panels/config/automation/trigger/types/ha-automation-trigger-mqtt";
|
||||||
import { HaNumericStateTrigger } from "../../../../src/panels/config/automation/trigger/types/ha-automation-trigger-numeric_state";
|
import { HaNumericStateTrigger } from "../../../../src/panels/config/automation/trigger/types/ha-automation-trigger-numeric_state";
|
||||||
|
import { HaPersistentNotificationTrigger } from "../../../../src/panels/config/automation/trigger/types/ha-automation-trigger-persistent_notification";
|
||||||
|
import { HaStateTrigger } from "../../../../src/panels/config/automation/trigger/types/ha-automation-trigger-state";
|
||||||
import { HaSunTrigger } from "../../../../src/panels/config/automation/trigger/types/ha-automation-trigger-sun";
|
import { HaSunTrigger } from "../../../../src/panels/config/automation/trigger/types/ha-automation-trigger-sun";
|
||||||
import { HaTagTrigger } from "../../../../src/panels/config/automation/trigger/types/ha-automation-trigger-tag";
|
import { HaTagTrigger } from "../../../../src/panels/config/automation/trigger/types/ha-automation-trigger-tag";
|
||||||
import { HaTemplateTrigger } from "../../../../src/panels/config/automation/trigger/types/ha-automation-trigger-template";
|
import { HaTemplateTrigger } from "../../../../src/panels/config/automation/trigger/types/ha-automation-trigger-template";
|
||||||
import { HaTimeTrigger } from "../../../../src/panels/config/automation/trigger/types/ha-automation-trigger-time";
|
import { HaTimeTrigger } from "../../../../src/panels/config/automation/trigger/types/ha-automation-trigger-time";
|
||||||
import { HaTimePatternTrigger } from "../../../../src/panels/config/automation/trigger/types/ha-automation-trigger-time_pattern";
|
import { HaTimePatternTrigger } from "../../../../src/panels/config/automation/trigger/types/ha-automation-trigger-time_pattern";
|
||||||
import { HaWebhookTrigger } from "../../../../src/panels/config/automation/trigger/types/ha-automation-trigger-webhook";
|
import { HaWebhookTrigger } from "../../../../src/panels/config/automation/trigger/types/ha-automation-trigger-webhook";
|
||||||
import { HaPersistentNotificationTrigger } from "../../../../src/panels/config/automation/trigger/types/ha-automation-trigger-persistent_notification";
|
|
||||||
import { HaZoneTrigger } from "../../../../src/panels/config/automation/trigger/types/ha-automation-trigger-zone";
|
import { HaZoneTrigger } from "../../../../src/panels/config/automation/trigger/types/ha-automation-trigger-zone";
|
||||||
import { HaDeviceTrigger } from "../../../../src/panels/config/automation/trigger/types/ha-automation-trigger-device";
|
import type { HomeAssistant } from "../../../../src/types";
|
||||||
import { HaStateTrigger } from "../../../../src/panels/config/automation/trigger/types/ha-automation-trigger-state";
|
import "../../components/demo-black-white-row";
|
||||||
import { HaMQTTTrigger } from "../../../../src/panels/config/automation/trigger/types/ha-automation-trigger-mqtt";
|
|
||||||
import "../../../../src/panels/config/automation/trigger/ha-automation-trigger";
|
|
||||||
import { HaConversationTrigger } from "../../../../src/panels/config/automation/trigger/types/ha-automation-trigger-conversation";
|
|
||||||
import { HaTriggerList } from "../../../../src/panels/config/automation/trigger/types/ha-automation-trigger-list";
|
|
||||||
|
|
||||||
const SCHEMAS: { name: string; triggers: Trigger[] }[] = [
|
const SCHEMAS: { name: string; triggers: Trigger[] }[] = [
|
||||||
{
|
{
|
||||||
|
65
gallery/src/pages/components/ha-badge.markdown
Normal file
65
gallery/src/pages/components/ha-badge.markdown
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
---
|
||||||
|
title: Badge
|
||||||
|
subtitle: Lovelace dashboard badge
|
||||||
|
---
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.wrapper {
|
||||||
|
display: flex;
|
||||||
|
gap: 24px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
# Badge `<ha-badge>`
|
||||||
|
|
||||||
|
The badge component is a small component that displays a number or status information. It is used in the lovelace dashboard on the top.
|
||||||
|
|
||||||
|
## Implementation
|
||||||
|
|
||||||
|
### Example Usage
|
||||||
|
|
||||||
|
<div class="wrapper">
|
||||||
|
<ha-badge>
|
||||||
|
simple badge
|
||||||
|
</ha-badge>
|
||||||
|
|
||||||
|
<ha-badge label="Info">
|
||||||
|
With a label
|
||||||
|
</ha-badge>
|
||||||
|
|
||||||
|
<ha-badge type="button">
|
||||||
|
Type button
|
||||||
|
</ha-badge>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
```html
|
||||||
|
<ha-badge> simple badge </ha-badge>
|
||||||
|
|
||||||
|
<ha-badge label="Info"> With a label </ha-badge>
|
||||||
|
|
||||||
|
<ha-badge type="button"> Type button </ha-badge>
|
||||||
|
```
|
||||||
|
|
||||||
|
### API
|
||||||
|
|
||||||
|
**Slots**
|
||||||
|
|
||||||
|
- default slot is the content of the badge
|
||||||
|
- no default
|
||||||
|
- `icon` set the icon of the badge
|
||||||
|
- no default
|
||||||
|
|
||||||
|
**Properties/Attributes**
|
||||||
|
|
||||||
|
| Name | Type | Default | Description |
|
||||||
|
| -------- | ----------------------- | ----------- | ------------------------------------------------------------ |
|
||||||
|
| type | `"badge"` or `"button"` | `"badge"` | If it's button it shows a ripple effect |
|
||||||
|
| label | string | `undefined` | Text label for the badge, only visible if `iconOnly = false` |
|
||||||
|
| iconOnly | boolean | `false` | Only show label |
|
||||||
|
|
||||||
|
**CSS Custom Properties**
|
||||||
|
|
||||||
|
- `--ha-badge-size` (default `36px`)
|
||||||
|
- `--ha-badge-border-radius` (default `calc(var(--ha-badge-size, 36px) / 2)`)
|
||||||
|
- `--ha-badge-font-size` (default `var(--ha-font-size-s)`)
|
||||||
|
- `--ha-badge-icon-size` (default `18px`)
|
129
gallery/src/pages/components/ha-badge.ts
Normal file
129
gallery/src/pages/components/ha-badge.ts
Normal file
@@ -0,0 +1,129 @@
|
|||||||
|
import { mdiButtonCursor, mdiHome } from "@mdi/js";
|
||||||
|
import type { TemplateResult } from "lit";
|
||||||
|
import { css, html, LitElement } from "lit";
|
||||||
|
import { customElement } from "lit/decorators";
|
||||||
|
import { applyThemesOnElement } from "../../../../src/common/dom/apply_themes_on_element";
|
||||||
|
import "../../../../src/components/ha-badge";
|
||||||
|
import "../../../../src/components/ha-card";
|
||||||
|
import "../../../../src/components/ha-svg-icon";
|
||||||
|
import { mdiHomeAssistant } from "../../../../src/resources/home-assistant-logo-svg";
|
||||||
|
|
||||||
|
const badges: {
|
||||||
|
type?: "badge" | "button";
|
||||||
|
label?: string;
|
||||||
|
iconOnly?: boolean;
|
||||||
|
slot?: TemplateResult;
|
||||||
|
iconSlot?: TemplateResult;
|
||||||
|
}[] = [
|
||||||
|
{
|
||||||
|
slot: html`<span>Badge</span>`,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "badge",
|
||||||
|
label: "Badge",
|
||||||
|
iconSlot: html`<ha-svg-icon slot="icon" .path=${mdiHome}></ha-svg-icon>`,
|
||||||
|
slot: html`<span>Badge</span>`,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "button",
|
||||||
|
label: "Button",
|
||||||
|
iconSlot: html`<ha-svg-icon
|
||||||
|
slot="icon"
|
||||||
|
.path=${mdiButtonCursor}
|
||||||
|
></ha-svg-icon>`,
|
||||||
|
slot: html`<span>Button</span>`,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "button",
|
||||||
|
label: "Label only",
|
||||||
|
iconSlot: html`<ha-svg-icon
|
||||||
|
slot="icon"
|
||||||
|
.path=${mdiButtonCursor}
|
||||||
|
></ha-svg-icon>`,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "button",
|
||||||
|
label: "Label",
|
||||||
|
slot: html`<span>Button no label</span>`,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "Icon only",
|
||||||
|
iconOnly: true,
|
||||||
|
iconSlot: html`<ha-svg-icon
|
||||||
|
slot="icon"
|
||||||
|
.path=${mdiHomeAssistant}
|
||||||
|
></ha-svg-icon>`,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
@customElement("demo-components-ha-badge")
|
||||||
|
export class DemoHaBadge extends LitElement {
|
||||||
|
protected render(): TemplateResult {
|
||||||
|
return html`
|
||||||
|
${["light", "dark"].map(
|
||||||
|
(mode) => html`
|
||||||
|
<div class=${mode}>
|
||||||
|
<ha-card header="ha-badge ${mode} demo">
|
||||||
|
<div class="card-content">
|
||||||
|
${badges.map(
|
||||||
|
(badge) => html`
|
||||||
|
<ha-badge
|
||||||
|
.type=${badge.type || undefined}
|
||||||
|
.label=${badge.label}
|
||||||
|
.iconOnly=${badge.iconOnly || false}
|
||||||
|
>
|
||||||
|
${badge.iconSlot} ${badge.slot}
|
||||||
|
</ha-badge>
|
||||||
|
`
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</ha-card>
|
||||||
|
</div>
|
||||||
|
`
|
||||||
|
)}
|
||||||
|
`;
|
||||||
|
}
|
||||||
|
|
||||||
|
firstUpdated(changedProps) {
|
||||||
|
super.firstUpdated(changedProps);
|
||||||
|
applyThemesOnElement(
|
||||||
|
this.shadowRoot!.querySelector(".dark"),
|
||||||
|
{
|
||||||
|
default_theme: "default",
|
||||||
|
default_dark_theme: "default",
|
||||||
|
themes: {},
|
||||||
|
darkMode: true,
|
||||||
|
theme: "default",
|
||||||
|
},
|
||||||
|
undefined,
|
||||||
|
undefined,
|
||||||
|
true
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
static styles = css`
|
||||||
|
:host {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
.dark,
|
||||||
|
.light {
|
||||||
|
display: block;
|
||||||
|
background-color: var(--primary-background-color);
|
||||||
|
padding: 0 50px;
|
||||||
|
}
|
||||||
|
ha-card {
|
||||||
|
margin: 24px auto;
|
||||||
|
}
|
||||||
|
.card-content {
|
||||||
|
display: flex;
|
||||||
|
gap: 24px;
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
}
|
||||||
|
|
||||||
|
declare global {
|
||||||
|
interface HTMLElementTagNameMap {
|
||||||
|
"demo-components-ha-badge": DemoHaBadge;
|
||||||
|
}
|
||||||
|
}
|
@@ -1,63 +0,0 @@
|
|||||||
import type { TemplateResult } from "lit";
|
|
||||||
import { html, css, LitElement } from "lit";
|
|
||||||
import { customElement, property } from "lit/decorators";
|
|
||||||
import "../../../../src/components/ha-bar";
|
|
||||||
import "../../../../src/components/ha-card";
|
|
||||||
import "../../../../src/components/ha-circular-progress";
|
|
||||||
import "@material/web/progress/circular-progress";
|
|
||||||
import type { HomeAssistant } from "../../../../src/types";
|
|
||||||
|
|
||||||
@customElement("demo-components-ha-circular-progress")
|
|
||||||
export class DemoHaCircularProgress extends LitElement {
|
|
||||||
@property({ attribute: false }) hass!: HomeAssistant;
|
|
||||||
|
|
||||||
protected render(): TemplateResult {
|
|
||||||
return html`<ha-card header="Basic circular progress">
|
|
||||||
<div class="card-content">
|
|
||||||
<ha-circular-progress indeterminate></ha-circular-progress></div
|
|
||||||
></ha-card>
|
|
||||||
<ha-card header="Different circular progress sizes">
|
|
||||||
<div class="card-content">
|
|
||||||
<ha-circular-progress
|
|
||||||
indeterminate
|
|
||||||
size="tiny"
|
|
||||||
></ha-circular-progress>
|
|
||||||
<ha-circular-progress
|
|
||||||
indeterminate
|
|
||||||
size="small"
|
|
||||||
></ha-circular-progress>
|
|
||||||
<ha-circular-progress
|
|
||||||
indeterminate
|
|
||||||
size="medium"
|
|
||||||
></ha-circular-progress>
|
|
||||||
<ha-circular-progress
|
|
||||||
indeterminate
|
|
||||||
size="large"
|
|
||||||
></ha-circular-progress></div
|
|
||||||
></ha-card>
|
|
||||||
<ha-card header="Circular progress with an aria-label">
|
|
||||||
<div class="card-content">
|
|
||||||
<ha-circular-progress
|
|
||||||
indeterminate
|
|
||||||
aria-label="Doing something..."
|
|
||||||
></ha-circular-progress>
|
|
||||||
<ha-circular-progress
|
|
||||||
indeterminate
|
|
||||||
.ariaLabel=${"Doing something..."}
|
|
||||||
></ha-circular-progress></div
|
|
||||||
></ha-card>`;
|
|
||||||
}
|
|
||||||
|
|
||||||
static styles = css`
|
|
||||||
ha-card {
|
|
||||||
max-width: 600px;
|
|
||||||
margin: 24px auto;
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare global {
|
|
||||||
interface HTMLElementTagNameMap {
|
|
||||||
"demo-components-ha-circular-progress": DemoHaCircularProgress;
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,4 +1,4 @@
|
|||||||
import { mdiPacMan } from "@mdi/js";
|
import { mdiLightbulbOn, mdiPacMan } from "@mdi/js";
|
||||||
import type { TemplateResult } from "lit";
|
import type { TemplateResult } from "lit";
|
||||||
import { css, html, LitElement } from "lit";
|
import { css, html, LitElement } from "lit";
|
||||||
import { customElement } from "lit/decorators";
|
import { customElement } from "lit/decorators";
|
||||||
@@ -125,6 +125,23 @@ const SAMPLES: {
|
|||||||
`;
|
`;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
template(slot, leftChevron) {
|
||||||
|
return html`
|
||||||
|
<ha-expansion-panel
|
||||||
|
slot=${slot}
|
||||||
|
.leftChevron=${leftChevron}
|
||||||
|
header="Attr Header with actions"
|
||||||
|
>
|
||||||
|
<ha-svg-icon
|
||||||
|
slot="leading-icon"
|
||||||
|
.path=${mdiLightbulbOn}
|
||||||
|
></ha-svg-icon>
|
||||||
|
${SHORT_TEXT}
|
||||||
|
</ha-expansion-panel>
|
||||||
|
`;
|
||||||
|
},
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
@customElement("demo-components-ha-expansion-panel")
|
@customElement("demo-components-ha-expansion-panel")
|
||||||
|
@@ -48,6 +48,7 @@ const DEVICES: DeviceRegistryEntry[] = [
|
|||||||
area_id: "bedroom",
|
area_id: "bedroom",
|
||||||
configuration_url: null,
|
configuration_url: null,
|
||||||
config_entries: ["config_entry_1"],
|
config_entries: ["config_entry_1"],
|
||||||
|
config_entries_subentries: {},
|
||||||
connections: [],
|
connections: [],
|
||||||
disabled_by: null,
|
disabled_by: null,
|
||||||
entry_type: null,
|
entry_type: null,
|
||||||
@@ -71,6 +72,7 @@ const DEVICES: DeviceRegistryEntry[] = [
|
|||||||
area_id: "backyard",
|
area_id: "backyard",
|
||||||
configuration_url: null,
|
configuration_url: null,
|
||||||
config_entries: ["config_entry_2"],
|
config_entries: ["config_entry_2"],
|
||||||
|
config_entries_subentries: {},
|
||||||
connections: [],
|
connections: [],
|
||||||
disabled_by: null,
|
disabled_by: null,
|
||||||
entry_type: null,
|
entry_type: null,
|
||||||
@@ -94,6 +96,7 @@ const DEVICES: DeviceRegistryEntry[] = [
|
|||||||
area_id: null,
|
area_id: null,
|
||||||
configuration_url: null,
|
configuration_url: null,
|
||||||
config_entries: ["config_entry_3"],
|
config_entries: ["config_entry_3"],
|
||||||
|
config_entries_subentries: {},
|
||||||
connections: [],
|
connections: [],
|
||||||
disabled_by: null,
|
disabled_by: null,
|
||||||
entry_type: null,
|
entry_type: null,
|
||||||
|
3
gallery/src/pages/components/ha-select-box.markdown
Normal file
3
gallery/src/pages/components/ha-select-box.markdown
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
---
|
||||||
|
title: Select box
|
||||||
|
---
|
152
gallery/src/pages/components/ha-select-box.ts
Normal file
152
gallery/src/pages/components/ha-select-box.ts
Normal file
@@ -0,0 +1,152 @@
|
|||||||
|
import type { TemplateResult } from "lit";
|
||||||
|
import { css, html, LitElement } from "lit";
|
||||||
|
import { customElement, state } from "lit/decorators";
|
||||||
|
import { repeat } from "lit/directives/repeat";
|
||||||
|
import "../../../../src/components/ha-card";
|
||||||
|
import "../../../../src/components/ha-select-box";
|
||||||
|
import type { SelectBoxOption } from "../../../../src/components/ha-select-box";
|
||||||
|
|
||||||
|
const basicOptions: SelectBoxOption[] = [
|
||||||
|
{
|
||||||
|
value: "text-only",
|
||||||
|
label: "Text only",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "card",
|
||||||
|
label: "Card",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "disabled",
|
||||||
|
label: "Disabled option",
|
||||||
|
disabled: true,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
const fullOptions: SelectBoxOption[] = [
|
||||||
|
{
|
||||||
|
value: "text-only",
|
||||||
|
label: "Text only",
|
||||||
|
description: "Only text, no border and background",
|
||||||
|
image: "/images/select_box/text_only.svg",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "card",
|
||||||
|
label: "Card",
|
||||||
|
description: "With border and background",
|
||||||
|
image: "/images/select_box/card.svg",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "disabled",
|
||||||
|
label: "Disabled",
|
||||||
|
description: "Option that can not be selected",
|
||||||
|
disabled: true,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
const selects: {
|
||||||
|
id: string;
|
||||||
|
label: string;
|
||||||
|
class?: string;
|
||||||
|
options: SelectBoxOption[];
|
||||||
|
disabled?: boolean;
|
||||||
|
}[] = [
|
||||||
|
{
|
||||||
|
id: "basic",
|
||||||
|
label: "Basic",
|
||||||
|
options: basicOptions,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "full",
|
||||||
|
label: "With description and image",
|
||||||
|
options: fullOptions,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
@customElement("demo-components-ha-select-box")
|
||||||
|
export class DemoHaSelectBox extends LitElement {
|
||||||
|
@state() private value?: string = "off";
|
||||||
|
|
||||||
|
handleValueChanged(e: CustomEvent) {
|
||||||
|
this.value = e.detail.value as string;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected render(): TemplateResult {
|
||||||
|
return html`
|
||||||
|
${repeat(selects, (select) => {
|
||||||
|
const { id, label, options } = select;
|
||||||
|
return html`
|
||||||
|
<ha-card>
|
||||||
|
<div class="card-content">
|
||||||
|
<label id=${id}>${label}</label>
|
||||||
|
<ha-select-box
|
||||||
|
.value=${this.value}
|
||||||
|
.options=${options}
|
||||||
|
@value-changed=${this.handleValueChanged}
|
||||||
|
>
|
||||||
|
</ha-select-box>
|
||||||
|
</div>
|
||||||
|
</ha-card>
|
||||||
|
`;
|
||||||
|
})}
|
||||||
|
<ha-card>
|
||||||
|
<div class="card-content">
|
||||||
|
<p class="title"><b>Column layout</b></p>
|
||||||
|
<div class="vertical-selects">
|
||||||
|
${repeat(selects, (select) => {
|
||||||
|
const { options } = select;
|
||||||
|
return html`
|
||||||
|
<ha-select-box
|
||||||
|
.value=${this.value}
|
||||||
|
.options=${options}
|
||||||
|
.maxColumns=${1}
|
||||||
|
@value-changed=${this.handleValueChanged}
|
||||||
|
>
|
||||||
|
</ha-select-box>
|
||||||
|
`;
|
||||||
|
})}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</ha-card>
|
||||||
|
`;
|
||||||
|
}
|
||||||
|
|
||||||
|
static styles = css`
|
||||||
|
ha-card {
|
||||||
|
max-width: 600px;
|
||||||
|
margin: 24px auto;
|
||||||
|
}
|
||||||
|
pre {
|
||||||
|
margin-top: 0;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
}
|
||||||
|
p {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
label {
|
||||||
|
font-weight: 600;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
.custom {
|
||||||
|
--mdc-icon-size: 24px;
|
||||||
|
--control-select-color: var(--state-fan-active-color);
|
||||||
|
--control-select-thickness: 130px;
|
||||||
|
--control-select-border-radius: 36px;
|
||||||
|
}
|
||||||
|
|
||||||
|
p.title {
|
||||||
|
margin-bottom: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.vertical-selects ha-select-box {
|
||||||
|
display: block;
|
||||||
|
margin-bottom: 24px;
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
}
|
||||||
|
|
||||||
|
declare global {
|
||||||
|
interface HTMLElementTagNameMap {
|
||||||
|
"demo-components-ha-select-box": DemoHaSelectBox;
|
||||||
|
}
|
||||||
|
}
|
@@ -6,22 +6,23 @@ import { mockAreaRegistry } from "../../../../demo/src/stubs/area_registry";
|
|||||||
import { mockConfigEntries } from "../../../../demo/src/stubs/config_entries";
|
import { mockConfigEntries } from "../../../../demo/src/stubs/config_entries";
|
||||||
import { mockDeviceRegistry } from "../../../../demo/src/stubs/device_registry";
|
import { mockDeviceRegistry } from "../../../../demo/src/stubs/device_registry";
|
||||||
import { mockEntityRegistry } from "../../../../demo/src/stubs/entity_registry";
|
import { mockEntityRegistry } from "../../../../demo/src/stubs/entity_registry";
|
||||||
|
import { mockFloorRegistry } from "../../../../demo/src/stubs/floor_registry";
|
||||||
import { mockHassioSupervisor } from "../../../../demo/src/stubs/hassio_supervisor";
|
import { mockHassioSupervisor } from "../../../../demo/src/stubs/hassio_supervisor";
|
||||||
|
import { mockLabelRegistry } from "../../../../demo/src/stubs/label_registry";
|
||||||
|
import "../../../../src/components/ha-formfield";
|
||||||
import "../../../../src/components/ha-selector/ha-selector";
|
import "../../../../src/components/ha-selector/ha-selector";
|
||||||
import "../../../../src/components/ha-settings-row";
|
import "../../../../src/components/ha-settings-row";
|
||||||
import type { AreaRegistryEntry } from "../../../../src/data/area_registry";
|
import type { AreaRegistryEntry } from "../../../../src/data/area_registry";
|
||||||
import type { BlueprintInput } from "../../../../src/data/blueprint";
|
import type { BlueprintInput } from "../../../../src/data/blueprint";
|
||||||
|
import type { DeviceRegistryEntry } from "../../../../src/data/device_registry";
|
||||||
|
import type { FloorRegistryEntry } from "../../../../src/data/floor_registry";
|
||||||
|
import type { LabelRegistryEntry } from "../../../../src/data/label_registry";
|
||||||
import { showDialog } from "../../../../src/dialogs/make-dialog-manager";
|
import { showDialog } from "../../../../src/dialogs/make-dialog-manager";
|
||||||
import { getEntity } from "../../../../src/fake_data/entity";
|
import { getEntity } from "../../../../src/fake_data/entity";
|
||||||
import { provideHass } from "../../../../src/fake_data/provide_hass";
|
import { provideHass } from "../../../../src/fake_data/provide_hass";
|
||||||
import type { ProvideHassElement } from "../../../../src/mixins/provide-hass-lit-mixin";
|
import type { ProvideHassElement } from "../../../../src/mixins/provide-hass-lit-mixin";
|
||||||
import type { HomeAssistant } from "../../../../src/types";
|
import type { HomeAssistant } from "../../../../src/types";
|
||||||
import "../../components/demo-black-white-row";
|
import "../../components/demo-black-white-row";
|
||||||
import type { FloorRegistryEntry } from "../../../../src/data/floor_registry";
|
|
||||||
import type { LabelRegistryEntry } from "../../../../src/data/label_registry";
|
|
||||||
import { mockFloorRegistry } from "../../../../demo/src/stubs/floor_registry";
|
|
||||||
import { mockLabelRegistry } from "../../../../demo/src/stubs/label_registry";
|
|
||||||
import type { DeviceRegistryEntry } from "../../../../src/data/device_registry";
|
|
||||||
|
|
||||||
const ENTITIES = [
|
const ENTITIES = [
|
||||||
getEntity("alarm_control_panel", "alarm", "disarmed", {
|
getEntity("alarm_control_panel", "alarm", "disarmed", {
|
||||||
@@ -47,6 +48,7 @@ const DEVICES: DeviceRegistryEntry[] = [
|
|||||||
area_id: "bedroom",
|
area_id: "bedroom",
|
||||||
configuration_url: null,
|
configuration_url: null,
|
||||||
config_entries: ["config_entry_1"],
|
config_entries: ["config_entry_1"],
|
||||||
|
config_entries_subentries: {},
|
||||||
connections: [],
|
connections: [],
|
||||||
disabled_by: null,
|
disabled_by: null,
|
||||||
entry_type: null,
|
entry_type: null,
|
||||||
@@ -70,6 +72,7 @@ const DEVICES: DeviceRegistryEntry[] = [
|
|||||||
area_id: "backyard",
|
area_id: "backyard",
|
||||||
configuration_url: null,
|
configuration_url: null,
|
||||||
config_entries: ["config_entry_2"],
|
config_entries: ["config_entry_2"],
|
||||||
|
config_entries_subentries: {},
|
||||||
connections: [],
|
connections: [],
|
||||||
disabled_by: null,
|
disabled_by: null,
|
||||||
entry_type: null,
|
entry_type: null,
|
||||||
@@ -93,6 +96,7 @@ const DEVICES: DeviceRegistryEntry[] = [
|
|||||||
area_id: null,
|
area_id: null,
|
||||||
configuration_url: null,
|
configuration_url: null,
|
||||||
config_entries: ["config_entry_3"],
|
config_entries: ["config_entry_3"],
|
||||||
|
config_entries_subentries: {},
|
||||||
connections: [],
|
connections: [],
|
||||||
disabled_by: null,
|
disabled_by: null,
|
||||||
entry_type: null,
|
entry_type: null,
|
||||||
@@ -640,9 +644,6 @@ class DemoHaSelector extends LitElement implements ProvideHassElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static styles = css`
|
static styles = css`
|
||||||
ha-settings-row {
|
|
||||||
--paper-item-body-two-line-min-height: 0;
|
|
||||||
}
|
|
||||||
.options {
|
.options {
|
||||||
max-width: 800px;
|
max-width: 800px;
|
||||||
margin: 16px auto;
|
margin: 16px auto;
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
---
|
---
|
||||||
title: Circular Progress
|
title: Spinner
|
||||||
subtitle: Can be used to indicate an ongoing task.
|
subtitle: Can be used to indicate an ongoing task.
|
||||||
---
|
---
|
44
gallery/src/pages/components/ha-spinner.ts
Normal file
44
gallery/src/pages/components/ha-spinner.ts
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
import type { TemplateResult } from "lit";
|
||||||
|
import { html, css, LitElement } from "lit";
|
||||||
|
import { customElement, property } from "lit/decorators";
|
||||||
|
import "../../../../src/components/ha-bar";
|
||||||
|
import "../../../../src/components/ha-card";
|
||||||
|
import "../../../../src/components/ha-spinner";
|
||||||
|
import type { HomeAssistant } from "../../../../src/types";
|
||||||
|
|
||||||
|
@customElement("demo-components-ha-spinner")
|
||||||
|
export class DemoHaSpinner extends LitElement {
|
||||||
|
@property({ attribute: false }) hass!: HomeAssistant;
|
||||||
|
|
||||||
|
protected render(): TemplateResult {
|
||||||
|
return html`<ha-card header="Basic spinner">
|
||||||
|
<div class="card-content">
|
||||||
|
<ha-spinner></ha-spinner></div
|
||||||
|
></ha-card>
|
||||||
|
<ha-card header="Different spinner sizes">
|
||||||
|
<div class="card-content">
|
||||||
|
<ha-spinner size="tiny"></ha-spinner>
|
||||||
|
<ha-spinner size="small"></ha-spinner>
|
||||||
|
<ha-spinner size="medium"></ha-spinner>
|
||||||
|
<ha-spinner size="large"></ha-spinner></div
|
||||||
|
></ha-card>
|
||||||
|
<ha-card header="Spinner with an aria-label">
|
||||||
|
<div class="card-content">
|
||||||
|
<ha-spinner aria-label="Doing something..."></ha-spinner>
|
||||||
|
<ha-spinner .ariaLabel=${"Doing something..."}></ha-spinner></div
|
||||||
|
></ha-card>`;
|
||||||
|
}
|
||||||
|
|
||||||
|
static styles = css`
|
||||||
|
ha-card {
|
||||||
|
max-width: 600px;
|
||||||
|
margin: 24px auto;
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
}
|
||||||
|
|
||||||
|
declare global {
|
||||||
|
interface HTMLElementTagNameMap {
|
||||||
|
"demo-components-ha-spinner": DemoHaSpinner;
|
||||||
|
}
|
||||||
|
}
|
34
gallery/src/pages/components/ha-tooltip.markdown
Normal file
34
gallery/src/pages/components/ha-tooltip.markdown
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
---
|
||||||
|
title: Tooltip
|
||||||
|
---
|
||||||
|
|
||||||
|
A tooltip's target is its _first child element_, so you should only wrap one element inside of the tooltip. If you need the tooltip to show up for multiple elements, nest them inside a container first.
|
||||||
|
|
||||||
|
Tooltips use `display: contents` so they won't interfere with how elements are positioned in a flex or grid layout.
|
||||||
|
|
||||||
|
<ha-tooltip content="This is a tooltip">
|
||||||
|
<ha-button>Hover Me</ha-button>
|
||||||
|
</ha-tooltip>
|
||||||
|
|
||||||
|
```
|
||||||
|
<ha-tooltip content="This is a tooltip">
|
||||||
|
<ha-button>Hover Me</ha-button>
|
||||||
|
</ha-tooltip>
|
||||||
|
```
|
||||||
|
|
||||||
|
## Documentation
|
||||||
|
|
||||||
|
This element is based on shoelace `sl-tooltip` it only sets some css tokens and has a custom show/hide animation.
|
||||||
|
|
||||||
|
<a href="https://shoelace.style/components/tooltip" target="_blank" rel="noopener noreferrer">Shoelace documentation</a>
|
||||||
|
|
||||||
|
### HA style tokens
|
||||||
|
|
||||||
|
In your theme settings use this without the prefixed `--`.
|
||||||
|
|
||||||
|
- `--ha-tooltip-border-radius` (Default: 4px)
|
||||||
|
- `--ha-tooltip-arrow-size` (Default: 8px)
|
||||||
|
- `--sl-tooltip-font-family` (Default: `var(--ha-font-family-body)`)
|
||||||
|
- `--ha-tooltip-font-size` (Default: `var(--ha-font-size-s)`)
|
||||||
|
- `--sl-tooltip-font-weight` (Default: `var(--ha-font-weight-normal)`)
|
||||||
|
- `--sl-tooltip-line-height` (Default: `var(--ha-line-height-condensed)`)
|
2
gallery/src/pages/components/ha-tooltip.ts
Normal file
2
gallery/src/pages/components/ha-tooltip.ts
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
import "../../../../src/components/ha-tooltip";
|
||||||
|
import "../../../../src/components/ha-button";
|
@@ -1,9 +1,9 @@
|
|||||||
import "@material/mwc-list/mwc-list";
|
|
||||||
import { LitElement, css, html } from "lit";
|
import { LitElement, css, html } from "lit";
|
||||||
import { customElement, state } from "lit/decorators";
|
import { customElement, state } from "lit/decorators";
|
||||||
import { formatDateTimeNumeric } from "../../../../src/common/datetime/format_date_time";
|
import { formatDateTimeNumeric } from "../../../../src/common/datetime/format_date_time";
|
||||||
import "../../../../src/components/ha-card";
|
import "../../../../src/components/ha-card";
|
||||||
import "../../../../src/components/ha-control-select";
|
import "../../../../src/components/ha-control-select";
|
||||||
|
import "../../../../src/components/ha-list";
|
||||||
import type { FrontendLocaleData } from "../../../../src/data/translation";
|
import type { FrontendLocaleData } from "../../../../src/data/translation";
|
||||||
import {
|
import {
|
||||||
DateFormat,
|
DateFormat,
|
||||||
@@ -49,7 +49,7 @@ export class DemoDateTimeDateTimeNumeric extends LitElement {
|
|||||||
@value-changed=${this.handleValueChanged}
|
@value-changed=${this.handleValueChanged}
|
||||||
>
|
>
|
||||||
</ha-control-select>
|
</ha-control-select>
|
||||||
<mwc-list>
|
<ha-list>
|
||||||
<div class="container header">
|
<div class="container header">
|
||||||
<div>Language</div>
|
<div>Language</div>
|
||||||
<div class="center">Default (lang)</div>
|
<div class="center">Default (lang)</div>
|
||||||
@@ -96,7 +96,7 @@ export class DemoDateTimeDateTimeNumeric extends LitElement {
|
|||||||
</div>
|
</div>
|
||||||
`
|
`
|
||||||
)}
|
)}
|
||||||
</mwc-list>
|
</ha-list>
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,9 +1,9 @@
|
|||||||
import "@material/mwc-list/mwc-list";
|
|
||||||
import { LitElement, css, html } from "lit";
|
import { LitElement, css, html } from "lit";
|
||||||
import { customElement, state } from "lit/decorators";
|
import { customElement, state } from "lit/decorators";
|
||||||
import { formatDateTimeWithSeconds } from "../../../../src/common/datetime/format_date_time";
|
import { formatDateTimeWithSeconds } from "../../../../src/common/datetime/format_date_time";
|
||||||
import "../../../../src/components/ha-card";
|
import "../../../../src/components/ha-card";
|
||||||
import "../../../../src/components/ha-control-select";
|
import "../../../../src/components/ha-control-select";
|
||||||
|
import "../../../../src/components/ha-list";
|
||||||
import type { FrontendLocaleData } from "../../../../src/data/translation";
|
import type { FrontendLocaleData } from "../../../../src/data/translation";
|
||||||
import {
|
import {
|
||||||
DateFormat,
|
DateFormat,
|
||||||
@@ -49,7 +49,7 @@ export class DemoDateTimeDateTimeSeconds extends LitElement {
|
|||||||
@value-changed=${this.handleValueChanged}
|
@value-changed=${this.handleValueChanged}
|
||||||
>
|
>
|
||||||
</ha-control-select>
|
</ha-control-select>
|
||||||
<mwc-list>
|
<ha-list>
|
||||||
<div class="container header">
|
<div class="container header">
|
||||||
<div>Language</div>
|
<div>Language</div>
|
||||||
<div class="center">Default (lang)</div>
|
<div class="center">Default (lang)</div>
|
||||||
@@ -96,7 +96,7 @@ export class DemoDateTimeDateTimeSeconds extends LitElement {
|
|||||||
</div>
|
</div>
|
||||||
`
|
`
|
||||||
)}
|
)}
|
||||||
</mwc-list>
|
</ha-list>
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,9 +1,9 @@
|
|||||||
import "@material/mwc-list/mwc-list";
|
|
||||||
import { LitElement, css, html } from "lit";
|
import { LitElement, css, html } from "lit";
|
||||||
import { customElement, state } from "lit/decorators";
|
import { customElement, state } from "lit/decorators";
|
||||||
import { formatShortDateTimeWithYear } from "../../../../src/common/datetime/format_date_time";
|
import { formatShortDateTimeWithYear } from "../../../../src/common/datetime/format_date_time";
|
||||||
import "../../../../src/components/ha-card";
|
import "../../../../src/components/ha-card";
|
||||||
import "../../../../src/components/ha-control-select";
|
import "../../../../src/components/ha-control-select";
|
||||||
|
import "../../../../src/components/ha-list";
|
||||||
import type { FrontendLocaleData } from "../../../../src/data/translation";
|
import type { FrontendLocaleData } from "../../../../src/data/translation";
|
||||||
import {
|
import {
|
||||||
DateFormat,
|
DateFormat,
|
||||||
@@ -49,7 +49,7 @@ export class DemoDateTimeDateTimeShortYear extends LitElement {
|
|||||||
@value-changed=${this.handleValueChanged}
|
@value-changed=${this.handleValueChanged}
|
||||||
>
|
>
|
||||||
</ha-control-select>
|
</ha-control-select>
|
||||||
<mwc-list>
|
<ha-list>
|
||||||
<div class="container header">
|
<div class="container header">
|
||||||
<div>Language</div>
|
<div>Language</div>
|
||||||
<div class="center">Default (lang)</div>
|
<div class="center">Default (lang)</div>
|
||||||
@@ -96,7 +96,7 @@ export class DemoDateTimeDateTimeShortYear extends LitElement {
|
|||||||
</div>
|
</div>
|
||||||
`
|
`
|
||||||
)}
|
)}
|
||||||
</mwc-list>
|
</ha-list>
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,9 +1,9 @@
|
|||||||
import "@material/mwc-list/mwc-list";
|
|
||||||
import { LitElement, css, html } from "lit";
|
import { LitElement, css, html } from "lit";
|
||||||
import { customElement, state } from "lit/decorators";
|
import { customElement, state } from "lit/decorators";
|
||||||
import { formatShortDateTime } from "../../../../src/common/datetime/format_date_time";
|
import { formatShortDateTime } from "../../../../src/common/datetime/format_date_time";
|
||||||
import "../../../../src/components/ha-card";
|
import "../../../../src/components/ha-card";
|
||||||
import "../../../../src/components/ha-control-select";
|
import "../../../../src/components/ha-control-select";
|
||||||
|
import "../../../../src/components/ha-list";
|
||||||
import type { FrontendLocaleData } from "../../../../src/data/translation";
|
import type { FrontendLocaleData } from "../../../../src/data/translation";
|
||||||
import {
|
import {
|
||||||
DateFormat,
|
DateFormat,
|
||||||
@@ -49,7 +49,7 @@ export class DemoDateTimeDateTimeShort extends LitElement {
|
|||||||
@value-changed=${this.handleValueChanged}
|
@value-changed=${this.handleValueChanged}
|
||||||
>
|
>
|
||||||
</ha-control-select>
|
</ha-control-select>
|
||||||
<mwc-list>
|
<ha-list>
|
||||||
<div class="container header">
|
<div class="container header">
|
||||||
<div>Language</div>
|
<div>Language</div>
|
||||||
<div class="center">Default (lang)</div>
|
<div class="center">Default (lang)</div>
|
||||||
@@ -96,7 +96,7 @@ export class DemoDateTimeDateTimeShort extends LitElement {
|
|||||||
</div>
|
</div>
|
||||||
`
|
`
|
||||||
)}
|
)}
|
||||||
</mwc-list>
|
</ha-list>
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,9 +1,9 @@
|
|||||||
import "@material/mwc-list/mwc-list";
|
|
||||||
import { LitElement, css, html } from "lit";
|
import { LitElement, css, html } from "lit";
|
||||||
import { customElement, state } from "lit/decorators";
|
import { customElement, state } from "lit/decorators";
|
||||||
import { formatDateTime } from "../../../../src/common/datetime/format_date_time";
|
import { formatDateTime } from "../../../../src/common/datetime/format_date_time";
|
||||||
import "../../../../src/components/ha-card";
|
import "../../../../src/components/ha-card";
|
||||||
import "../../../../src/components/ha-control-select";
|
import "../../../../src/components/ha-control-select";
|
||||||
|
import "../../../../src/components/ha-list";
|
||||||
import type { FrontendLocaleData } from "../../../../src/data/translation";
|
import type { FrontendLocaleData } from "../../../../src/data/translation";
|
||||||
import {
|
import {
|
||||||
DateFormat,
|
DateFormat,
|
||||||
@@ -49,7 +49,7 @@ export class DemoDateTimeDateTime extends LitElement {
|
|||||||
@value-changed=${this.handleValueChanged}
|
@value-changed=${this.handleValueChanged}
|
||||||
>
|
>
|
||||||
</ha-control-select>
|
</ha-control-select>
|
||||||
<mwc-list>
|
<ha-list>
|
||||||
<div class="container header">
|
<div class="container header">
|
||||||
<div>Language</div>
|
<div>Language</div>
|
||||||
<div class="center">Default (lang)</div>
|
<div class="center">Default (lang)</div>
|
||||||
@@ -96,7 +96,7 @@ export class DemoDateTimeDateTime extends LitElement {
|
|||||||
</div>
|
</div>
|
||||||
`
|
`
|
||||||
)}
|
)}
|
||||||
</mwc-list>
|
</ha-list>
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,8 +1,8 @@
|
|||||||
import "@material/mwc-list/mwc-list";
|
|
||||||
import { css, html, LitElement } from "lit";
|
import { css, html, LitElement } from "lit";
|
||||||
import { customElement } from "lit/decorators";
|
import { customElement } from "lit/decorators";
|
||||||
import { formatDateNumeric } from "../../../../src/common/datetime/format_date";
|
import { formatDateNumeric } from "../../../../src/common/datetime/format_date";
|
||||||
import "../../../../src/components/ha-card";
|
import "../../../../src/components/ha-card";
|
||||||
|
import "../../../../src/components/ha-list";
|
||||||
import type { FrontendLocaleData } from "../../../../src/data/translation";
|
import type { FrontendLocaleData } from "../../../../src/data/translation";
|
||||||
import {
|
import {
|
||||||
DateFormat,
|
DateFormat,
|
||||||
@@ -27,7 +27,7 @@ export class DemoDateTimeDate extends LitElement {
|
|||||||
};
|
};
|
||||||
const date = new Date();
|
const date = new Date();
|
||||||
return html`
|
return html`
|
||||||
<mwc-list>
|
<ha-list>
|
||||||
<div class="container header">
|
<div class="container header">
|
||||||
<div>Language</div>
|
<div>Language</div>
|
||||||
<div class="center">Default (lang)</div>
|
<div class="center">Default (lang)</div>
|
||||||
@@ -86,7 +86,7 @@ export class DemoDateTimeDate extends LitElement {
|
|||||||
</div>
|
</div>
|
||||||
`
|
`
|
||||||
)}
|
)}
|
||||||
</mwc-list>
|
</ha-list>
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,9 +1,9 @@
|
|||||||
import "@material/mwc-list/mwc-list";
|
|
||||||
import { LitElement, css, html } from "lit";
|
import { LitElement, css, html } from "lit";
|
||||||
import { customElement, state } from "lit/decorators";
|
import { customElement, state } from "lit/decorators";
|
||||||
import { formatTimeWithSeconds } from "../../../../src/common/datetime/format_time";
|
import { formatTimeWithSeconds } from "../../../../src/common/datetime/format_time";
|
||||||
import "../../../../src/components/ha-card";
|
import "../../../../src/components/ha-card";
|
||||||
import "../../../../src/components/ha-control-select";
|
import "../../../../src/components/ha-control-select";
|
||||||
|
import "../../../../src/components/ha-list";
|
||||||
import type { FrontendLocaleData } from "../../../../src/data/translation";
|
import type { FrontendLocaleData } from "../../../../src/data/translation";
|
||||||
import {
|
import {
|
||||||
DateFormat,
|
DateFormat,
|
||||||
@@ -49,7 +49,7 @@ export class DemoDateTimeTimeSeconds extends LitElement {
|
|||||||
@value-changed=${this.handleValueChanged}
|
@value-changed=${this.handleValueChanged}
|
||||||
>
|
>
|
||||||
</ha-control-select>
|
</ha-control-select>
|
||||||
<mwc-list>
|
<ha-list>
|
||||||
<div class="container header">
|
<div class="container header">
|
||||||
<div>Language</div>
|
<div>Language</div>
|
||||||
<div class="center">Default (lang)</div>
|
<div class="center">Default (lang)</div>
|
||||||
@@ -96,7 +96,7 @@ export class DemoDateTimeTimeSeconds extends LitElement {
|
|||||||
</div>
|
</div>
|
||||||
`
|
`
|
||||||
)}
|
)}
|
||||||
</mwc-list>
|
</ha-list>
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,9 +1,9 @@
|
|||||||
import "@material/mwc-list/mwc-list";
|
|
||||||
import { LitElement, css, html } from "lit";
|
import { LitElement, css, html } from "lit";
|
||||||
import { customElement, state } from "lit/decorators";
|
import { customElement, state } from "lit/decorators";
|
||||||
import { formatTimeWeekday } from "../../../../src/common/datetime/format_time";
|
import { formatTimeWeekday } from "../../../../src/common/datetime/format_time";
|
||||||
import "../../../../src/components/ha-card";
|
import "../../../../src/components/ha-card";
|
||||||
import "../../../../src/components/ha-control-select";
|
import "../../../../src/components/ha-control-select";
|
||||||
|
import "../../../../src/components/ha-list";
|
||||||
import type { FrontendLocaleData } from "../../../../src/data/translation";
|
import type { FrontendLocaleData } from "../../../../src/data/translation";
|
||||||
import {
|
import {
|
||||||
DateFormat,
|
DateFormat,
|
||||||
@@ -49,7 +49,7 @@ export class DemoDateTimeTimeWeekday extends LitElement {
|
|||||||
@value-changed=${this.handleValueChanged}
|
@value-changed=${this.handleValueChanged}
|
||||||
>
|
>
|
||||||
</ha-control-select>
|
</ha-control-select>
|
||||||
<mwc-list>
|
<ha-list>
|
||||||
<div class="container header">
|
<div class="container header">
|
||||||
<div>Language</div>
|
<div>Language</div>
|
||||||
<div class="center">Default (lang)</div>
|
<div class="center">Default (lang)</div>
|
||||||
@@ -96,7 +96,7 @@ export class DemoDateTimeTimeWeekday extends LitElement {
|
|||||||
</div>
|
</div>
|
||||||
`
|
`
|
||||||
)}
|
)}
|
||||||
</mwc-list>
|
</ha-list>
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,9 +1,9 @@
|
|||||||
import "@material/mwc-list/mwc-list";
|
|
||||||
import { LitElement, css, html } from "lit";
|
import { LitElement, css, html } from "lit";
|
||||||
import { customElement, state } from "lit/decorators";
|
import { customElement, state } from "lit/decorators";
|
||||||
import { formatTime } from "../../../../src/common/datetime/format_time";
|
import { formatTime } from "../../../../src/common/datetime/format_time";
|
||||||
import "../../../../src/components/ha-card";
|
import "../../../../src/components/ha-card";
|
||||||
import "../../../../src/components/ha-control-select";
|
import "../../../../src/components/ha-control-select";
|
||||||
|
import "../../../../src/components/ha-list";
|
||||||
import type { FrontendLocaleData } from "../../../../src/data/translation";
|
import type { FrontendLocaleData } from "../../../../src/data/translation";
|
||||||
import {
|
import {
|
||||||
DateFormat,
|
DateFormat,
|
||||||
@@ -49,7 +49,7 @@ export class DemoDateTimeTime extends LitElement {
|
|||||||
@value-changed=${this.handleValueChanged}
|
@value-changed=${this.handleValueChanged}
|
||||||
>
|
>
|
||||||
</ha-control-select>
|
</ha-control-select>
|
||||||
<mwc-list>
|
<ha-list>
|
||||||
<div class="container header">
|
<div class="container header">
|
||||||
<div>Language</div>
|
<div>Language</div>
|
||||||
<div class="center">Default (lang)</div>
|
<div class="center">Default (lang)</div>
|
||||||
@@ -96,7 +96,7 @@ export class DemoDateTimeTime extends LitElement {
|
|||||||
</div>
|
</div>
|
||||||
`
|
`
|
||||||
)}
|
)}
|
||||||
</mwc-list>
|
</ha-list>
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,11 +1,11 @@
|
|||||||
import type { PropertyValues, TemplateResult } from "lit";
|
import type { PropertyValues, TemplateResult } from "lit";
|
||||||
import { html, LitElement } from "lit";
|
import { html, LitElement } from "lit";
|
||||||
import { customElement, query } from "lit/decorators";
|
import { customElement, query } from "lit/decorators";
|
||||||
|
import { mockIcons } from "../../../../demo/src/stubs/icons";
|
||||||
|
import { mockTodo } from "../../../../demo/src/stubs/todo";
|
||||||
|
import { getEntity } from "../../../../src/fake_data/entity";
|
||||||
import { provideHass } from "../../../../src/fake_data/provide_hass";
|
import { provideHass } from "../../../../src/fake_data/provide_hass";
|
||||||
import "../../components/demo-cards";
|
import "../../components/demo-cards";
|
||||||
import { getEntity } from "../../../../src/fake_data/entity";
|
|
||||||
import { mockTodo } from "../../../../demo/src/stubs/todo";
|
|
||||||
import { mockIcons } from "../../../../demo/src/stubs/icons";
|
|
||||||
|
|
||||||
const ENTITIES = [
|
const ENTITIES = [
|
||||||
getEntity("todo", "shopping_list", "2", {
|
getEntity("todo", "shopping_list", "2", {
|
||||||
|
@@ -32,6 +32,8 @@ const createConfigEntry = (
|
|||||||
supports_remove_device: false,
|
supports_remove_device: false,
|
||||||
supports_unload: true,
|
supports_unload: true,
|
||||||
supports_reconfigure: true,
|
supports_reconfigure: true,
|
||||||
|
supported_subentry_types: {},
|
||||||
|
num_subentries: 0,
|
||||||
disabled_by: null,
|
disabled_by: null,
|
||||||
pref_disable_new_entities: false,
|
pref_disable_new_entities: false,
|
||||||
pref_disable_polling: false,
|
pref_disable_polling: false,
|
||||||
@@ -188,6 +190,7 @@ const createEntityRegistryEntries = (
|
|||||||
): EntityRegistryEntry[] => [
|
): EntityRegistryEntry[] => [
|
||||||
{
|
{
|
||||||
config_entry_id: item.entry_id,
|
config_entry_id: item.entry_id,
|
||||||
|
config_subentry_id: null,
|
||||||
device_id: "mock-device-id",
|
device_id: "mock-device-id",
|
||||||
area_id: null,
|
area_id: null,
|
||||||
disabled_by: null,
|
disabled_by: null,
|
||||||
@@ -214,6 +217,7 @@ const createDeviceRegistryEntries = (
|
|||||||
{
|
{
|
||||||
entry_type: null,
|
entry_type: null,
|
||||||
config_entries: [item.entry_id],
|
config_entries: [item.entry_id],
|
||||||
|
config_entries_subentries: {},
|
||||||
connections: [],
|
connections: [],
|
||||||
manufacturer: "ESPHome",
|
manufacturer: "ESPHome",
|
||||||
model: "Mock Device",
|
model: "Mock Device",
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
import type { ActionDetail } from "@material/mwc-list/mwc-list-foundation";
|
import type { ActionDetail } from "@material/mwc-list/mwc-list-foundation";
|
||||||
import "@material/mwc-list/mwc-list-item";
|
|
||||||
import { mdiDotsVertical } from "@mdi/js";
|
import { mdiDotsVertical } from "@mdi/js";
|
||||||
import type { PropertyValues, TemplateResult } from "lit";
|
import type { PropertyValues, TemplateResult } from "lit";
|
||||||
import { css, html, LitElement, nothing } from "lit";
|
import { css, html, LitElement, nothing } from "lit";
|
||||||
@@ -11,6 +11,7 @@ import { navigate } from "../../../src/common/navigate";
|
|||||||
import { extractSearchParam } from "../../../src/common/url/search-params";
|
import { extractSearchParam } from "../../../src/common/url/search-params";
|
||||||
import "../../../src/components/ha-button-menu";
|
import "../../../src/components/ha-button-menu";
|
||||||
import "../../../src/components/ha-icon-button";
|
import "../../../src/components/ha-icon-button";
|
||||||
|
import "../../../src/components/ha-list-item";
|
||||||
import "../../../src/components/search-input";
|
import "../../../src/components/search-input";
|
||||||
import type { HassioAddonRepository } from "../../../src/data/hassio/addon";
|
import type { HassioAddonRepository } from "../../../src/data/hassio/addon";
|
||||||
import { reloadHassioAddons } from "../../../src/data/hassio/addon";
|
import { reloadHassioAddons } from "../../../src/data/hassio/addon";
|
||||||
@@ -89,17 +90,17 @@ export class HassioAddonStore extends LitElement {
|
|||||||
.path=${mdiDotsVertical}
|
.path=${mdiDotsVertical}
|
||||||
slot="trigger"
|
slot="trigger"
|
||||||
></ha-icon-button>
|
></ha-icon-button>
|
||||||
<mwc-list-item>
|
<ha-list-item>
|
||||||
${this.supervisor.localize("store.check_updates")}
|
${this.supervisor.localize("store.check_updates")}
|
||||||
</mwc-list-item>
|
</ha-list-item>
|
||||||
<mwc-list-item>
|
<ha-list-item>
|
||||||
${this.supervisor.localize("store.repositories")}
|
${this.supervisor.localize("store.repositories")}
|
||||||
</mwc-list-item>
|
</ha-list-item>
|
||||||
${this.hass.userData?.showAdvanced &&
|
${this.hass.userData?.showAdvanced &&
|
||||||
atLeastVersion(this.hass.config.version, 0, 117)
|
atLeastVersion(this.hass.config.version, 0, 117)
|
||||||
? html`<mwc-list-item>
|
? html`<ha-list-item>
|
||||||
${this.supervisor.localize("store.registries")}
|
${this.supervisor.localize("store.registries")}
|
||||||
</mwc-list-item>`
|
</ha-list-item>`
|
||||||
: ""}
|
: ""}
|
||||||
</ha-button-menu>
|
</ha-button-menu>
|
||||||
${repos.length === 0
|
${repos.length === 0
|
||||||
|
@@ -1,12 +1,11 @@
|
|||||||
import "@material/mwc-button";
|
|
||||||
import "@material/mwc-list/mwc-list-item";
|
|
||||||
import type { CSSResultGroup, PropertyValues, TemplateResult } from "lit";
|
import type { CSSResultGroup, PropertyValues, TemplateResult } from "lit";
|
||||||
import { css, html, LitElement } from "lit";
|
import { css, html, LitElement, nothing } from "lit";
|
||||||
import { customElement, property, state } from "lit/decorators";
|
import { customElement, property, state } from "lit/decorators";
|
||||||
import { stopPropagation } from "../../../../src/common/dom/stop_propagation";
|
import { stopPropagation } from "../../../../src/common/dom/stop_propagation";
|
||||||
import "../../../../src/components/buttons/ha-progress-button";
|
import "../../../../src/components/buttons/ha-progress-button";
|
||||||
import "../../../../src/components/ha-alert";
|
import "../../../../src/components/ha-alert";
|
||||||
import "../../../../src/components/ha-card";
|
import "../../../../src/components/ha-card";
|
||||||
|
import "../../../../src/components/ha-list-item";
|
||||||
import "../../../../src/components/ha-select";
|
import "../../../../src/components/ha-select";
|
||||||
import type {
|
import type {
|
||||||
HassioAddonDetails,
|
HassioAddonDetails,
|
||||||
@@ -29,6 +28,8 @@ class HassioAddonAudio extends LitElement {
|
|||||||
|
|
||||||
@property({ attribute: false }) public addon!: HassioAddonDetails;
|
@property({ attribute: false }) public addon!: HassioAddonDetails;
|
||||||
|
|
||||||
|
@property({ type: Boolean }) public disabled = false;
|
||||||
|
|
||||||
@state() private _error?: string;
|
@state() private _error?: string;
|
||||||
|
|
||||||
@state() private _inputDevices?: HassioHardwareAudioDevice[];
|
@state() private _inputDevices?: HassioHardwareAudioDevice[];
|
||||||
@@ -48,7 +49,7 @@ class HassioAddonAudio extends LitElement {
|
|||||||
<div class="card-content">
|
<div class="card-content">
|
||||||
${this._error
|
${this._error
|
||||||
? html`<ha-alert alert-type="error">${this._error}</ha-alert>`
|
? html`<ha-alert alert-type="error">${this._error}</ha-alert>`
|
||||||
: ""}
|
: nothing}
|
||||||
${this._inputDevices &&
|
${this._inputDevices &&
|
||||||
html`<ha-select
|
html`<ha-select
|
||||||
.label=${this.supervisor.localize(
|
.label=${this.supervisor.localize(
|
||||||
@@ -59,12 +60,13 @@ class HassioAddonAudio extends LitElement {
|
|||||||
fixedMenuPosition
|
fixedMenuPosition
|
||||||
naturalMenuWidth
|
naturalMenuWidth
|
||||||
.value=${this._selectedInput!}
|
.value=${this._selectedInput!}
|
||||||
|
.disabled=${this.disabled}
|
||||||
>
|
>
|
||||||
${this._inputDevices.map(
|
${this._inputDevices.map(
|
||||||
(item) => html`
|
(item) => html`
|
||||||
<mwc-list-item .value=${item.device || ""}>
|
<ha-list-item .value=${item.device || ""}>
|
||||||
${item.name}
|
${item.name}
|
||||||
</mwc-list-item>
|
</ha-list-item>
|
||||||
`
|
`
|
||||||
)}
|
)}
|
||||||
</ha-select>`}
|
</ha-select>`}
|
||||||
@@ -78,18 +80,22 @@ class HassioAddonAudio extends LitElement {
|
|||||||
fixedMenuPosition
|
fixedMenuPosition
|
||||||
naturalMenuWidth
|
naturalMenuWidth
|
||||||
.value=${this._selectedOutput!}
|
.value=${this._selectedOutput!}
|
||||||
|
.disabled=${this.disabled}
|
||||||
>
|
>
|
||||||
${this._outputDevices.map(
|
${this._outputDevices.map(
|
||||||
(item) => html`
|
(item) => html`
|
||||||
<mwc-list-item .value=${item.device || ""}
|
<ha-list-item .value=${item.device || ""}
|
||||||
>${item.name}</mwc-list-item
|
>${item.name}</ha-list-item
|
||||||
>
|
>
|
||||||
`
|
`
|
||||||
)}
|
)}
|
||||||
</ha-select>`}
|
</ha-select>`}
|
||||||
</div>
|
</div>
|
||||||
<div class="card-actions">
|
<div class="card-actions">
|
||||||
<ha-progress-button @click=${this._saveSettings}>
|
<ha-progress-button
|
||||||
|
.disabled=${this.disabled}
|
||||||
|
@click=${this._saveSettings}
|
||||||
|
>
|
||||||
${this.supervisor.localize("common.save")}
|
${this.supervisor.localize("common.save")}
|
||||||
</ha-progress-button>
|
</ha-progress-button>
|
||||||
</div>
|
</div>
|
||||||
@@ -171,6 +177,10 @@ class HassioAddonAudio extends LitElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private async _saveSettings(ev: CustomEvent): Promise<void> {
|
private async _saveSettings(ev: CustomEvent): Promise<void> {
|
||||||
|
if (this.disabled) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const button = ev.currentTarget as any;
|
const button = ev.currentTarget as any;
|
||||||
button.progress = true;
|
button.progress = true;
|
||||||
|
|
||||||
|
@@ -1,12 +1,13 @@
|
|||||||
import type { CSSResultGroup, TemplateResult } from "lit";
|
import type { CSSResultGroup, TemplateResult } from "lit";
|
||||||
import { css, html, LitElement } from "lit";
|
import { css, html, LitElement, nothing } from "lit";
|
||||||
import { customElement, property } from "lit/decorators";
|
import { customElement, property } from "lit/decorators";
|
||||||
import "../../../../src/components/ha-circular-progress";
|
import "../../../../src/components/ha-spinner";
|
||||||
import type { HassioAddonDetails } from "../../../../src/data/hassio/addon";
|
import type { HassioAddonDetails } from "../../../../src/data/hassio/addon";
|
||||||
import type { Supervisor } from "../../../../src/data/supervisor/supervisor";
|
import type { Supervisor } from "../../../../src/data/supervisor/supervisor";
|
||||||
import { haStyle } from "../../../../src/resources/styles";
|
import { haStyle } from "../../../../src/resources/styles";
|
||||||
import type { HomeAssistant } from "../../../../src/types";
|
import type { HomeAssistant } from "../../../../src/types";
|
||||||
import { hassioStyle } from "../../resources/hassio-style";
|
import { hassioStyle } from "../../resources/hassio-style";
|
||||||
|
import "../info/hassio-addon-system-managed";
|
||||||
import "./hassio-addon-audio";
|
import "./hassio-addon-audio";
|
||||||
import "./hassio-addon-config";
|
import "./hassio-addon-config";
|
||||||
import "./hassio-addon-network";
|
import "./hassio-addon-network";
|
||||||
@@ -19,9 +20,14 @@ class HassioAddonConfigDashboard extends LitElement {
|
|||||||
|
|
||||||
@property({ attribute: false }) public addon?: HassioAddonDetails;
|
@property({ attribute: false }) public addon?: HassioAddonDetails;
|
||||||
|
|
||||||
|
@property({ type: Boolean }) public narrow = false;
|
||||||
|
|
||||||
|
@property({ type: Boolean, attribute: "control-enabled" })
|
||||||
|
public controlEnabled = false;
|
||||||
|
|
||||||
protected render(): TemplateResult {
|
protected render(): TemplateResult {
|
||||||
if (!this.addon) {
|
if (!this.addon) {
|
||||||
return html`<ha-circular-progress indeterminate></ha-circular-progress>`;
|
return html`<ha-spinner></ha-spinner>`;
|
||||||
}
|
}
|
||||||
const hasConfiguration =
|
const hasConfiguration =
|
||||||
(this.addon.options && Object.keys(this.addon.options).length) ||
|
(this.addon.options && Object.keys(this.addon.options).length) ||
|
||||||
@@ -29,6 +35,16 @@ class HassioAddonConfigDashboard extends LitElement {
|
|||||||
|
|
||||||
return html`
|
return html`
|
||||||
<div class="content">
|
<div class="content">
|
||||||
|
${this.addon.system_managed &&
|
||||||
|
(hasConfiguration || this.addon.network || this.addon.audio)
|
||||||
|
? html`
|
||||||
|
<hassio-addon-system-managed
|
||||||
|
.supervisor=${this.supervisor}
|
||||||
|
.narrow=${this.narrow}
|
||||||
|
.hideButton=${this.controlEnabled}
|
||||||
|
></hassio-addon-system-managed>
|
||||||
|
`
|
||||||
|
: nothing}
|
||||||
${hasConfiguration || this.addon.network || this.addon.audio
|
${hasConfiguration || this.addon.network || this.addon.audio
|
||||||
? html`
|
? html`
|
||||||
${hasConfiguration
|
${hasConfiguration
|
||||||
@@ -37,27 +53,33 @@ class HassioAddonConfigDashboard extends LitElement {
|
|||||||
.hass=${this.hass}
|
.hass=${this.hass}
|
||||||
.addon=${this.addon}
|
.addon=${this.addon}
|
||||||
.supervisor=${this.supervisor}
|
.supervisor=${this.supervisor}
|
||||||
|
.disabled=${this.addon.system_managed &&
|
||||||
|
!this.controlEnabled}
|
||||||
></hassio-addon-config>
|
></hassio-addon-config>
|
||||||
`
|
`
|
||||||
: ""}
|
: nothing}
|
||||||
${this.addon.network
|
${this.addon.network
|
||||||
? html`
|
? html`
|
||||||
<hassio-addon-network
|
<hassio-addon-network
|
||||||
.hass=${this.hass}
|
.hass=${this.hass}
|
||||||
.addon=${this.addon}
|
.addon=${this.addon}
|
||||||
.supervisor=${this.supervisor}
|
.supervisor=${this.supervisor}
|
||||||
|
.disabled=${this.addon.system_managed &&
|
||||||
|
!this.controlEnabled}
|
||||||
></hassio-addon-network>
|
></hassio-addon-network>
|
||||||
`
|
`
|
||||||
: ""}
|
: nothing}
|
||||||
${this.addon.audio
|
${this.addon.audio
|
||||||
? html`
|
? html`
|
||||||
<hassio-addon-audio
|
<hassio-addon-audio
|
||||||
.hass=${this.hass}
|
.hass=${this.hass}
|
||||||
.addon=${this.addon}
|
.addon=${this.addon}
|
||||||
.supervisor=${this.supervisor}
|
.supervisor=${this.supervisor}
|
||||||
|
.disabled=${this.addon.system_managed &&
|
||||||
|
!this.controlEnabled}
|
||||||
></hassio-addon-audio>
|
></hassio-addon-audio>
|
||||||
`
|
`
|
||||||
: ""}
|
: nothing}
|
||||||
`
|
`
|
||||||
: this.supervisor.localize("addon.configuration.no_configuration")}
|
: this.supervisor.localize("addon.configuration.no_configuration")}
|
||||||
</div>
|
</div>
|
||||||
|
@@ -1,6 +1,4 @@
|
|||||||
import "@material/mwc-button";
|
|
||||||
import type { ActionDetail } from "@material/mwc-list";
|
import type { ActionDetail } from "@material/mwc-list";
|
||||||
import "@material/mwc-list/mwc-list-item";
|
|
||||||
import { mdiDotsVertical } from "@mdi/js";
|
import { mdiDotsVertical } from "@mdi/js";
|
||||||
import { DEFAULT_SCHEMA, Type } from "js-yaml";
|
import { DEFAULT_SCHEMA, Type } from "js-yaml";
|
||||||
import type { CSSResultGroup, PropertyValues, TemplateResult } from "lit";
|
import type { CSSResultGroup, PropertyValues, TemplateResult } from "lit";
|
||||||
@@ -16,6 +14,7 @@ import "../../../../src/components/ha-form/ha-form";
|
|||||||
import type { HaFormSchema } from "../../../../src/components/ha-form/types";
|
import type { HaFormSchema } from "../../../../src/components/ha-form/types";
|
||||||
import "../../../../src/components/ha-formfield";
|
import "../../../../src/components/ha-formfield";
|
||||||
import "../../../../src/components/ha-icon-button";
|
import "../../../../src/components/ha-icon-button";
|
||||||
|
import "../../../../src/components/ha-list-item";
|
||||||
import "../../../../src/components/ha-switch";
|
import "../../../../src/components/ha-switch";
|
||||||
import "../../../../src/components/ha-yaml-editor";
|
import "../../../../src/components/ha-yaml-editor";
|
||||||
import type { HaYamlEditor } from "../../../../src/components/ha-yaml-editor";
|
import type { HaYamlEditor } from "../../../../src/components/ha-yaml-editor";
|
||||||
@@ -61,6 +60,8 @@ class HassioAddonConfig extends LitElement {
|
|||||||
|
|
||||||
@property({ attribute: false }) public supervisor!: Supervisor;
|
@property({ attribute: false }) public supervisor!: Supervisor;
|
||||||
|
|
||||||
|
@property({ type: Boolean }) public disabled = false;
|
||||||
|
|
||||||
@state() private _configHasChanged = false;
|
@state() private _configHasChanged = false;
|
||||||
|
|
||||||
@state() private _valid = true;
|
@state() private _valid = true;
|
||||||
@@ -113,8 +114,9 @@ class HassioAddonConfig extends LitElement {
|
|||||||
required: entry.required,
|
required: entry.required,
|
||||||
selector: {
|
selector: {
|
||||||
text: {
|
text: {
|
||||||
type:
|
type: entry.format
|
||||||
entry.format || MASKED_FIELDS.includes(entry.name)
|
? entry.format
|
||||||
|
: MASKED_FIELDS.includes(entry.name)
|
||||||
? "password"
|
? "password"
|
||||||
: "text",
|
: "text",
|
||||||
},
|
},
|
||||||
@@ -175,7 +177,7 @@ class HassioAddonConfig extends LitElement {
|
|||||||
.path=${mdiDotsVertical}
|
.path=${mdiDotsVertical}
|
||||||
slot="trigger"
|
slot="trigger"
|
||||||
></ha-icon-button>
|
></ha-icon-button>
|
||||||
<mwc-list-item .disabled=${!this._canShowSchema}>
|
<ha-list-item .disabled=${!this._canShowSchema || this.disabled}>
|
||||||
${this._yamlMode
|
${this._yamlMode
|
||||||
? this.supervisor.localize(
|
? this.supervisor.localize(
|
||||||
"addon.configuration.options.edit_in_ui"
|
"addon.configuration.options.edit_in_ui"
|
||||||
@@ -183,10 +185,13 @@ class HassioAddonConfig extends LitElement {
|
|||||||
: this.supervisor.localize(
|
: this.supervisor.localize(
|
||||||
"addon.configuration.options.edit_in_yaml"
|
"addon.configuration.options.edit_in_yaml"
|
||||||
)}
|
)}
|
||||||
</mwc-list-item>
|
</ha-list-item>
|
||||||
<mwc-list-item class="warning">
|
<ha-list-item
|
||||||
|
class=${!this.disabled ? "warning" : ""}
|
||||||
|
.disabled=${this.disabled}
|
||||||
|
>
|
||||||
${this.supervisor.localize("common.reset_defaults")}
|
${this.supervisor.localize("common.reset_defaults")}
|
||||||
</mwc-list-item>
|
</ha-list-item>
|
||||||
</ha-button-menu>
|
</ha-button-menu>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -194,6 +199,7 @@ class HassioAddonConfig extends LitElement {
|
|||||||
<div class="card-content">
|
<div class="card-content">
|
||||||
${showForm
|
${showForm
|
||||||
? html`<ha-form
|
? html`<ha-form
|
||||||
|
.disabled=${this.disabled}
|
||||||
.data=${this._options!}
|
.data=${this._options!}
|
||||||
@value-changed=${this._configChanged}
|
@value-changed=${this._configChanged}
|
||||||
.computeLabel=${this.computeLabel}
|
.computeLabel=${this.computeLabel}
|
||||||
@@ -207,7 +213,7 @@ class HassioAddonConfig extends LitElement {
|
|||||||
)
|
)
|
||||||
)}
|
)}
|
||||||
></ha-form>`
|
></ha-form>`
|
||||||
: html` <ha-yaml-editor
|
: html`<ha-yaml-editor
|
||||||
@value-changed=${this._configChanged}
|
@value-changed=${this._configChanged}
|
||||||
.yamlSchema=${ADDON_YAML_SCHEMA}
|
.yamlSchema=${ADDON_YAML_SCHEMA}
|
||||||
></ha-yaml-editor>`}
|
></ha-yaml-editor>`}
|
||||||
@@ -243,7 +249,9 @@ class HassioAddonConfig extends LitElement {
|
|||||||
<div class="card-actions right">
|
<div class="card-actions right">
|
||||||
<ha-progress-button
|
<ha-progress-button
|
||||||
@click=${this._saveTapped}
|
@click=${this._saveTapped}
|
||||||
.disabled=${!this._configHasChanged || !this._valid}
|
.disabled=${this.disabled ||
|
||||||
|
!this._configHasChanged ||
|
||||||
|
!this._valid}
|
||||||
>
|
>
|
||||||
${this.supervisor.localize("common.save")}
|
${this.supervisor.localize("common.save")}
|
||||||
</ha-progress-button>
|
</ha-progress-button>
|
||||||
@@ -345,6 +353,10 @@ class HassioAddonConfig extends LitElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private async _saveTapped(ev: CustomEvent): Promise<void> {
|
private async _saveTapped(ev: CustomEvent): Promise<void> {
|
||||||
|
if (this.disabled || !this._configHasChanged || !this._valid) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const button = ev.currentTarget as any;
|
const button = ev.currentTarget as any;
|
||||||
const options: Record<string, unknown> = this._yamlMode
|
const options: Record<string, unknown> = this._yamlMode
|
||||||
? this._editor?.value
|
? this._editor?.value
|
||||||
@@ -406,7 +418,7 @@ class HassioAddonConfig extends LitElement {
|
|||||||
z-index: 3;
|
z-index: 3;
|
||||||
--mdc-theme-text-primary-on-background: var(--primary-text-color);
|
--mdc-theme-text-primary-on-background: var(--primary-text-color);
|
||||||
}
|
}
|
||||||
mwc-list-item[disabled] {
|
ha-list-item[disabled] {
|
||||||
--mdc-theme-text-primary-on-background: var(--disabled-text-color);
|
--mdc-theme-text-primary-on-background: var(--disabled-text-color);
|
||||||
}
|
}
|
||||||
.header {
|
.header {
|
||||||
|
@@ -6,6 +6,7 @@ import { fireEvent } from "../../../../src/common/dom/fire_event";
|
|||||||
import "../../../../src/components/buttons/ha-progress-button";
|
import "../../../../src/components/buttons/ha-progress-button";
|
||||||
import "../../../../src/components/ha-alert";
|
import "../../../../src/components/ha-alert";
|
||||||
import "../../../../src/components/ha-card";
|
import "../../../../src/components/ha-card";
|
||||||
|
import "../../../../src/components/ha-formfield";
|
||||||
import "../../../../src/components/ha-form/ha-form";
|
import "../../../../src/components/ha-form/ha-form";
|
||||||
import type { HaFormSchema } from "../../../../src/components/ha-form/types";
|
import type { HaFormSchema } from "../../../../src/components/ha-form/types";
|
||||||
import type {
|
import type {
|
||||||
@@ -28,6 +29,8 @@ class HassioAddonNetwork extends LitElement {
|
|||||||
|
|
||||||
@property({ attribute: false }) public addon!: HassioAddonDetails;
|
@property({ attribute: false }) public addon!: HassioAddonDetails;
|
||||||
|
|
||||||
|
@property({ type: Boolean }) public disabled = false;
|
||||||
|
|
||||||
@state() private _showOptional = false;
|
@state() private _showOptional = false;
|
||||||
|
|
||||||
@state() private _configHasChanged = false;
|
@state() private _configHasChanged = false;
|
||||||
@@ -65,9 +68,10 @@ class HassioAddonNetwork extends LitElement {
|
|||||||
</p>
|
</p>
|
||||||
${this._error
|
${this._error
|
||||||
? html`<ha-alert alert-type="error">${this._error}</ha-alert>`
|
? html`<ha-alert alert-type="error">${this._error}</ha-alert>`
|
||||||
: ""}
|
: nothing}
|
||||||
|
|
||||||
<ha-form
|
<ha-form
|
||||||
|
.disabled=${this.disabled}
|
||||||
.data=${this._config}
|
.data=${this._config}
|
||||||
@value-changed=${this._configChanged}
|
@value-changed=${this._configChanged}
|
||||||
.computeLabel=${this._computeLabel}
|
.computeLabel=${this._computeLabel}
|
||||||
@@ -92,14 +96,18 @@ class HassioAddonNetwork extends LitElement {
|
|||||||
>
|
>
|
||||||
</ha-switch>
|
</ha-switch>
|
||||||
</ha-formfield>`
|
</ha-formfield>`
|
||||||
: ""}
|
: nothing}
|
||||||
<div class="card-actions">
|
<div class="card-actions">
|
||||||
<ha-progress-button class="warning" @click=${this._resetTapped}>
|
<ha-progress-button
|
||||||
|
class="warning"
|
||||||
|
.disabled=${this.disabled}
|
||||||
|
@click=${this._resetTapped}
|
||||||
|
>
|
||||||
${this.supervisor.localize("common.reset_defaults")}
|
${this.supervisor.localize("common.reset_defaults")}
|
||||||
</ha-progress-button>
|
</ha-progress-button>
|
||||||
<ha-progress-button
|
<ha-progress-button
|
||||||
@click=${this._saveTapped}
|
@click=${this._saveTapped}
|
||||||
.disabled=${!this._configHasChanged}
|
.disabled=${!this._configHasChanged || this.disabled}
|
||||||
>
|
>
|
||||||
${this.supervisor.localize("common.save")}
|
${this.supervisor.localize("common.save")}
|
||||||
</ha-progress-button>
|
</ha-progress-button>
|
||||||
@@ -155,6 +163,10 @@ class HassioAddonNetwork extends LitElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private async _resetTapped(ev: CustomEvent): Promise<void> {
|
private async _resetTapped(ev: CustomEvent): Promise<void> {
|
||||||
|
if (this.disabled) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const button = ev.currentTarget as any;
|
const button = ev.currentTarget as any;
|
||||||
const data: HassioAddonSetOptionParams = {
|
const data: HassioAddonSetOptionParams = {
|
||||||
network: null,
|
network: null,
|
||||||
@@ -186,6 +198,10 @@ class HassioAddonNetwork extends LitElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private async _saveTapped(ev: CustomEvent): Promise<void> {
|
private async _saveTapped(ev: CustomEvent): Promise<void> {
|
||||||
|
if (!this._configHasChanged || this.disabled) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const button = ev.currentTarget as any;
|
const button = ev.currentTarget as any;
|
||||||
|
|
||||||
this._error = undefined;
|
this._error = undefined;
|
||||||
|
@@ -2,7 +2,7 @@ import "../../../../src/components/ha-card";
|
|||||||
import type { CSSResultGroup, TemplateResult } from "lit";
|
import type { CSSResultGroup, TemplateResult } from "lit";
|
||||||
import { css, html, LitElement } from "lit";
|
import { css, html, LitElement } from "lit";
|
||||||
import "../../../../src/components/ha-alert";
|
import "../../../../src/components/ha-alert";
|
||||||
import "../../../../src/components/ha-circular-progress";
|
import "../../../../src/components/ha-spinner";
|
||||||
import "../../../../src/components/ha-markdown";
|
import "../../../../src/components/ha-markdown";
|
||||||
import { customElement, property, state } from "lit/decorators";
|
import { customElement, property, state } from "lit/decorators";
|
||||||
import type { HassioAddonDetails } from "../../../../src/data/hassio/addon";
|
import type { HassioAddonDetails } from "../../../../src/data/hassio/addon";
|
||||||
@@ -33,7 +33,7 @@ class HassioAddonDocumentationDashboard extends LitElement {
|
|||||||
|
|
||||||
protected render(): TemplateResult {
|
protected render(): TemplateResult {
|
||||||
if (!this.addon) {
|
if (!this.addon) {
|
||||||
return html`<ha-circular-progress indeterminate></ha-circular-progress>`;
|
return html`<ha-spinner></ha-spinner>`;
|
||||||
}
|
}
|
||||||
return html`
|
return html`
|
||||||
<div class="content">
|
<div class="content">
|
||||||
|
@@ -11,7 +11,6 @@ import memoizeOne from "memoize-one";
|
|||||||
import { fireEvent } from "../../../src/common/dom/fire_event";
|
import { fireEvent } from "../../../src/common/dom/fire_event";
|
||||||
import { navigate } from "../../../src/common/navigate";
|
import { navigate } from "../../../src/common/navigate";
|
||||||
import { extractSearchParam } from "../../../src/common/url/search-params";
|
import { extractSearchParam } from "../../../src/common/url/search-params";
|
||||||
import "../../../src/components/ha-circular-progress";
|
|
||||||
import type { HassioAddonDetails } from "../../../src/data/hassio/addon";
|
import type { HassioAddonDetails } from "../../../src/data/hassio/addon";
|
||||||
import {
|
import {
|
||||||
fetchAddonInfo,
|
fetchAddonInfo,
|
||||||
@@ -53,6 +52,9 @@ class HassioAddonDashboard extends LitElement {
|
|||||||
|
|
||||||
@property({ type: Boolean }) public narrow = false;
|
@property({ type: Boolean }) public narrow = false;
|
||||||
|
|
||||||
|
@state()
|
||||||
|
private _controlEnabled = false;
|
||||||
|
|
||||||
@state() private _error?: string;
|
@state() private _error?: string;
|
||||||
|
|
||||||
private _backPath = new URLSearchParams(window.parent.location.search).get(
|
private _backPath = new URLSearchParams(window.parent.location.search).get(
|
||||||
@@ -135,11 +137,17 @@ class HassioAddonDashboard extends LitElement {
|
|||||||
.hass=${this.hass}
|
.hass=${this.hass}
|
||||||
.supervisor=${this.supervisor}
|
.supervisor=${this.supervisor}
|
||||||
.addon=${this.addon}
|
.addon=${this.addon}
|
||||||
|
.controlEnabled=${this._controlEnabled}
|
||||||
|
@system-managed-take-control=${this._enableControl}
|
||||||
></hassio-addon-router>
|
></hassio-addon-router>
|
||||||
</hass-tabs-subpage>
|
</hass-tabs-subpage>
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private _enableControl() {
|
||||||
|
this._controlEnabled = true;
|
||||||
|
}
|
||||||
|
|
||||||
static get styles(): CSSResultGroup {
|
static get styles(): CSSResultGroup {
|
||||||
return [
|
return [
|
||||||
haStyle,
|
haStyle,
|
||||||
|
@@ -23,6 +23,9 @@ class HassioAddonRouter extends HassRouterPage {
|
|||||||
| HassioAddonDetails
|
| HassioAddonDetails
|
||||||
| StoreAddonDetails;
|
| StoreAddonDetails;
|
||||||
|
|
||||||
|
@property({ type: Boolean, attribute: "control-enabled" })
|
||||||
|
public controlEnabled = false;
|
||||||
|
|
||||||
protected routerOptions: RouterOptions = {
|
protected routerOptions: RouterOptions = {
|
||||||
defaultPage: "info",
|
defaultPage: "info",
|
||||||
showLoading: true,
|
showLoading: true,
|
||||||
@@ -48,6 +51,7 @@ class HassioAddonRouter extends HassRouterPage {
|
|||||||
el.supervisor = this.supervisor;
|
el.supervisor = this.supervisor;
|
||||||
el.addon = this.addon;
|
el.addon = this.addon;
|
||||||
el.narrow = this.narrow;
|
el.narrow = this.narrow;
|
||||||
|
el.controlEnabled = this.controlEnabled;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
import type { CSSResultGroup, TemplateResult } from "lit";
|
import type { CSSResultGroup, TemplateResult } from "lit";
|
||||||
import { css, html, LitElement } from "lit";
|
import { css, html, LitElement } from "lit";
|
||||||
import { customElement, property } from "lit/decorators";
|
import { customElement, property } from "lit/decorators";
|
||||||
import "../../../../src/components/ha-circular-progress";
|
import "../../../../src/components/ha-spinner";
|
||||||
import type { HassioAddonDetails } from "../../../../src/data/hassio/addon";
|
import type { HassioAddonDetails } from "../../../../src/data/hassio/addon";
|
||||||
import type { Supervisor } from "../../../../src/data/supervisor/supervisor";
|
import type { Supervisor } from "../../../../src/data/supervisor/supervisor";
|
||||||
import { haStyle } from "../../../../src/resources/styles";
|
import { haStyle } from "../../../../src/resources/styles";
|
||||||
@@ -21,9 +21,12 @@ class HassioAddonInfoDashboard extends LitElement {
|
|||||||
|
|
||||||
@property({ attribute: false }) public addon?: HassioAddonDetails;
|
@property({ attribute: false }) public addon?: HassioAddonDetails;
|
||||||
|
|
||||||
|
@property({ type: Boolean, attribute: "control-enabled" })
|
||||||
|
public controlEnabled = false;
|
||||||
|
|
||||||
protected render(): TemplateResult {
|
protected render(): TemplateResult {
|
||||||
if (!this.addon) {
|
if (!this.addon) {
|
||||||
return html`<ha-circular-progress indeterminate></ha-circular-progress>`;
|
return html`<ha-spinner></ha-spinner>`;
|
||||||
}
|
}
|
||||||
|
|
||||||
return html`
|
return html`
|
||||||
@@ -34,6 +37,7 @@ class HassioAddonInfoDashboard extends LitElement {
|
|||||||
.hass=${this.hass}
|
.hass=${this.hass}
|
||||||
.supervisor=${this.supervisor}
|
.supervisor=${this.supervisor}
|
||||||
.addon=${this.addon}
|
.addon=${this.addon}
|
||||||
|
.controlEnabled=${this.controlEnabled}
|
||||||
></hassio-addon-info>
|
></hassio-addon-info>
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
|
@@ -1,8 +1,6 @@
|
|||||||
import "@material/mwc-button";
|
|
||||||
import {
|
import {
|
||||||
mdiCheckCircle,
|
mdiCheckCircle,
|
||||||
mdiChip,
|
mdiChip,
|
||||||
mdiPlayCircle,
|
|
||||||
mdiCircleOffOutline,
|
mdiCircleOffOutline,
|
||||||
mdiCursorDefaultClickOutline,
|
mdiCursorDefaultClickOutline,
|
||||||
mdiDocker,
|
mdiDocker,
|
||||||
@@ -19,27 +17,30 @@ import {
|
|||||||
mdiNumeric6,
|
mdiNumeric6,
|
||||||
mdiNumeric7,
|
mdiNumeric7,
|
||||||
mdiNumeric8,
|
mdiNumeric8,
|
||||||
|
mdiPlayCircle,
|
||||||
mdiPound,
|
mdiPound,
|
||||||
mdiShield,
|
mdiShield,
|
||||||
} from "@mdi/js";
|
} from "@mdi/js";
|
||||||
import type { CSSResultGroup, TemplateResult } from "lit";
|
import type { CSSResultGroup, TemplateResult } from "lit";
|
||||||
import { LitElement, css, html } from "lit";
|
import { LitElement, css, html, nothing } from "lit";
|
||||||
import { customElement, property, state } from "lit/decorators";
|
import { customElement, property, state } from "lit/decorators";
|
||||||
import { classMap } from "lit/directives/class-map";
|
import { classMap } from "lit/directives/class-map";
|
||||||
import memoizeOne from "memoize-one";
|
import memoizeOne from "memoize-one";
|
||||||
import { atLeastVersion } from "../../../../src/common/config/version";
|
import { atLeastVersion } from "../../../../src/common/config/version";
|
||||||
import { fireEvent } from "../../../../src/common/dom/fire_event";
|
import { fireEvent } from "../../../../src/common/dom/fire_event";
|
||||||
import { navigate } from "../../../../src/common/navigate";
|
import { navigate } from "../../../../src/common/navigate";
|
||||||
|
import { capitalizeFirstLetter } from "../../../../src/common/string/capitalize-first-letter";
|
||||||
import "../../../../src/components/buttons/ha-progress-button";
|
import "../../../../src/components/buttons/ha-progress-button";
|
||||||
import "../../../../src/components/ha-alert";
|
|
||||||
import "../../../../src/components/ha-card";
|
|
||||||
import "../../../../src/components/chips/ha-chip-set";
|
|
||||||
import "../../../../src/components/chips/ha-assist-chip";
|
import "../../../../src/components/chips/ha-assist-chip";
|
||||||
|
import "../../../../src/components/chips/ha-chip-set";
|
||||||
|
import "../../../../src/components/ha-alert";
|
||||||
|
import "../../../../src/components/ha-button";
|
||||||
|
import "../../../../src/components/ha-card";
|
||||||
|
import "../../../../src/components/ha-formfield";
|
||||||
import "../../../../src/components/ha-markdown";
|
import "../../../../src/components/ha-markdown";
|
||||||
import "../../../../src/components/ha-settings-row";
|
import "../../../../src/components/ha-settings-row";
|
||||||
import "../../../../src/components/ha-svg-icon";
|
import "../../../../src/components/ha-svg-icon";
|
||||||
import "../../../../src/components/ha-switch";
|
import "../../../../src/components/ha-switch";
|
||||||
import "../../../../src/components/ha-formfield";
|
|
||||||
import type { HaSwitch } from "../../../../src/components/ha-switch";
|
import type { HaSwitch } from "../../../../src/components/ha-switch";
|
||||||
import type {
|
import type {
|
||||||
AddonCapability,
|
AddonCapability,
|
||||||
@@ -81,10 +82,11 @@ import { bytesToString } from "../../../../src/util/bytes-to-string";
|
|||||||
import "../../components/hassio-card-content";
|
import "../../components/hassio-card-content";
|
||||||
import "../../components/supervisor-metric";
|
import "../../components/supervisor-metric";
|
||||||
import { showHassioMarkdownDialog } from "../../dialogs/markdown/show-dialog-hassio-markdown";
|
import { showHassioMarkdownDialog } from "../../dialogs/markdown/show-dialog-hassio-markdown";
|
||||||
|
import { showSystemManagedDialog } from "../../dialogs/system-managed/show-dialog-system-managed";
|
||||||
import { hassioStyle } from "../../resources/hassio-style";
|
import { hassioStyle } from "../../resources/hassio-style";
|
||||||
import "../../update-available/update-available-card";
|
import "../../update-available/update-available-card";
|
||||||
import { addonArchIsSupported, extractChangelog } from "../../util/addon";
|
import { addonArchIsSupported, extractChangelog } from "../../util/addon";
|
||||||
import { capitalizeFirstLetter } from "../../../../src/common/string/capitalize-first-letter";
|
import "./hassio-addon-system-managed";
|
||||||
|
|
||||||
const STAGE_ICON = {
|
const STAGE_ICON = {
|
||||||
stable: mdiCheckCircle,
|
stable: mdiCheckCircle,
|
||||||
@@ -117,6 +119,9 @@ class HassioAddonInfo extends LitElement {
|
|||||||
|
|
||||||
@property({ attribute: false }) public supervisor!: Supervisor;
|
@property({ attribute: false }) public supervisor!: Supervisor;
|
||||||
|
|
||||||
|
@property({ type: Boolean, attribute: "control-enabled" })
|
||||||
|
public controlEnabled = false;
|
||||||
|
|
||||||
@state() private _metrics?: HassioStats;
|
@state() private _metrics?: HassioStats;
|
||||||
|
|
||||||
@state() private _error?: string;
|
@state() private _error?: string;
|
||||||
@@ -155,6 +160,9 @@ class HassioAddonInfo extends LitElement {
|
|||||||
)}`,
|
)}`,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
const systemManaged = this._isSystemManaged(this.addon);
|
||||||
|
|
||||||
return html`
|
return html`
|
||||||
${this.addon.update_available
|
${this.addon.update_available
|
||||||
? html`
|
? html`
|
||||||
@@ -166,7 +174,7 @@ class HassioAddonInfo extends LitElement {
|
|||||||
@update-complete=${this._updateComplete}
|
@update-complete=${this._updateComplete}
|
||||||
></update-available-card>
|
></update-available-card>
|
||||||
`
|
`
|
||||||
: ""}
|
: nothing}
|
||||||
${"protected" in this.addon && !this.addon.protected
|
${"protected" in this.addon && !this.addon.protected
|
||||||
? html`
|
? html`
|
||||||
<ha-alert
|
<ha-alert
|
||||||
@@ -178,22 +186,31 @@ class HassioAddonInfo extends LitElement {
|
|||||||
${this.supervisor.localize(
|
${this.supervisor.localize(
|
||||||
"addon.dashboard.protection_mode.content"
|
"addon.dashboard.protection_mode.content"
|
||||||
)}
|
)}
|
||||||
<mwc-button
|
<ha-button
|
||||||
slot="action"
|
slot="action"
|
||||||
.label=${this.supervisor.localize(
|
.label=${this.supervisor.localize(
|
||||||
"addon.dashboard.protection_mode.enable"
|
"addon.dashboard.protection_mode.enable"
|
||||||
)}
|
)}
|
||||||
@click=${this._protectionToggled}
|
@click=${this._protectionToggled}
|
||||||
>
|
>
|
||||||
</mwc-button>
|
</ha-button>
|
||||||
</ha-alert>
|
</ha-alert>
|
||||||
`
|
`
|
||||||
: ""}
|
: nothing}
|
||||||
|
${systemManaged
|
||||||
|
? html`
|
||||||
|
<hassio-addon-system-managed
|
||||||
|
.supervisor=${this.supervisor}
|
||||||
|
.narrow=${this.narrow}
|
||||||
|
.hideButton=${this.controlEnabled}
|
||||||
|
></hassio-addon-system-managed>
|
||||||
|
`
|
||||||
|
: nothing}
|
||||||
|
|
||||||
<ha-card outlined>
|
<ha-card outlined>
|
||||||
<div class="card-content">
|
<div class="card-content">
|
||||||
<div class="addon-header">
|
<div class="addon-header">
|
||||||
${!this.narrow ? this.addon.name : ""}
|
${!this.narrow ? this.addon.name : nothing}
|
||||||
<div class="addon-version light-color">
|
<div class="addon-version light-color">
|
||||||
${this.addon.version
|
${this.addon.version
|
||||||
? html`
|
? html`
|
||||||
@@ -266,7 +283,7 @@ class HassioAddonInfo extends LitElement {
|
|||||||
</ha-svg-icon>
|
</ha-svg-icon>
|
||||||
</ha-assist-chip>
|
</ha-assist-chip>
|
||||||
`
|
`
|
||||||
: ""}
|
: nothing}
|
||||||
|
|
||||||
<ha-assist-chip
|
<ha-assist-chip
|
||||||
filled
|
filled
|
||||||
@@ -301,7 +318,7 @@ class HassioAddonInfo extends LitElement {
|
|||||||
<ha-svg-icon slot="icon" .path=${mdiNetwork}> </ha-svg-icon>
|
<ha-svg-icon slot="icon" .path=${mdiNetwork}> </ha-svg-icon>
|
||||||
</ha-assist-chip>
|
</ha-assist-chip>
|
||||||
`
|
`
|
||||||
: ""}
|
: nothing}
|
||||||
${this.addon.full_access
|
${this.addon.full_access
|
||||||
? html`
|
? html`
|
||||||
<ha-assist-chip
|
<ha-assist-chip
|
||||||
@@ -317,7 +334,7 @@ class HassioAddonInfo extends LitElement {
|
|||||||
<ha-svg-icon slot="icon" .path=${mdiChip}></ha-svg-icon>
|
<ha-svg-icon slot="icon" .path=${mdiChip}></ha-svg-icon>
|
||||||
</ha-assist-chip>
|
</ha-assist-chip>
|
||||||
`
|
`
|
||||||
: ""}
|
: nothing}
|
||||||
${this.addon.homeassistant_api
|
${this.addon.homeassistant_api
|
||||||
? html`
|
? html`
|
||||||
<ha-assist-chip
|
<ha-assist-chip
|
||||||
@@ -336,7 +353,7 @@ class HassioAddonInfo extends LitElement {
|
|||||||
></ha-svg-icon>
|
></ha-svg-icon>
|
||||||
</ha-assist-chip>
|
</ha-assist-chip>
|
||||||
`
|
`
|
||||||
: ""}
|
: nothing}
|
||||||
${this._computeHassioApi
|
${this._computeHassioApi
|
||||||
? html`
|
? html`
|
||||||
<ha-assist-chip
|
<ha-assist-chip
|
||||||
@@ -355,7 +372,7 @@ class HassioAddonInfo extends LitElement {
|
|||||||
></ha-svg-icon>
|
></ha-svg-icon>
|
||||||
</ha-assist-chip>
|
</ha-assist-chip>
|
||||||
`
|
`
|
||||||
: ""}
|
: nothing}
|
||||||
${this.addon.docker_api
|
${this.addon.docker_api
|
||||||
? html`
|
? html`
|
||||||
<ha-assist-chip
|
<ha-assist-chip
|
||||||
@@ -371,7 +388,7 @@ class HassioAddonInfo extends LitElement {
|
|||||||
<ha-svg-icon slot="icon" .path=${mdiDocker}></ha-svg-icon>
|
<ha-svg-icon slot="icon" .path=${mdiDocker}></ha-svg-icon>
|
||||||
</ha-assist-chip>
|
</ha-assist-chip>
|
||||||
`
|
`
|
||||||
: ""}
|
: nothing}
|
||||||
${this.addon.host_pid
|
${this.addon.host_pid
|
||||||
? html`
|
? html`
|
||||||
<ha-assist-chip
|
<ha-assist-chip
|
||||||
@@ -387,7 +404,7 @@ class HassioAddonInfo extends LitElement {
|
|||||||
<ha-svg-icon slot="icon" .path=${mdiPound}></ha-svg-icon>
|
<ha-svg-icon slot="icon" .path=${mdiPound}></ha-svg-icon>
|
||||||
</ha-assist-chip>
|
</ha-assist-chip>
|
||||||
`
|
`
|
||||||
: ""}
|
: nothing}
|
||||||
${this.addon.apparmor !== "default"
|
${this.addon.apparmor !== "default"
|
||||||
? html`
|
? html`
|
||||||
<ha-assist-chip
|
<ha-assist-chip
|
||||||
@@ -404,7 +421,7 @@ class HassioAddonInfo extends LitElement {
|
|||||||
<ha-svg-icon slot="icon" .path=${mdiShield}></ha-svg-icon>
|
<ha-svg-icon slot="icon" .path=${mdiShield}></ha-svg-icon>
|
||||||
</ha-assist-chip>
|
</ha-assist-chip>
|
||||||
`
|
`
|
||||||
: ""}
|
: nothing}
|
||||||
${this.addon.auth_api
|
${this.addon.auth_api
|
||||||
? html`
|
? html`
|
||||||
<ha-assist-chip
|
<ha-assist-chip
|
||||||
@@ -420,7 +437,7 @@ class HassioAddonInfo extends LitElement {
|
|||||||
<ha-svg-icon slot="icon" .path=${mdiKey}></ha-svg-icon>
|
<ha-svg-icon slot="icon" .path=${mdiKey}></ha-svg-icon>
|
||||||
</ha-assist-chip>
|
</ha-assist-chip>
|
||||||
`
|
`
|
||||||
: ""}
|
: nothing}
|
||||||
${this.addon.ingress
|
${this.addon.ingress
|
||||||
? html`
|
? html`
|
||||||
<ha-assist-chip
|
<ha-assist-chip
|
||||||
@@ -439,7 +456,7 @@ class HassioAddonInfo extends LitElement {
|
|||||||
></ha-svg-icon>
|
></ha-svg-icon>
|
||||||
</ha-assist-chip>
|
</ha-assist-chip>
|
||||||
`
|
`
|
||||||
: ""}
|
: nothing}
|
||||||
${this.addon.signed
|
${this.addon.signed
|
||||||
? html`
|
? html`
|
||||||
<ha-assist-chip
|
<ha-assist-chip
|
||||||
@@ -455,7 +472,24 @@ class HassioAddonInfo extends LitElement {
|
|||||||
<ha-svg-icon slot="icon" .path=${mdiLinkLock}></ha-svg-icon>
|
<ha-svg-icon slot="icon" .path=${mdiLinkLock}></ha-svg-icon>
|
||||||
</ha-assist-chip>
|
</ha-assist-chip>
|
||||||
`
|
`
|
||||||
: ""}
|
: nothing}
|
||||||
|
${systemManaged
|
||||||
|
? html`
|
||||||
|
<ha-assist-chip
|
||||||
|
filled
|
||||||
|
@click=${this._showSystemManagedDialog}
|
||||||
|
id="system_managed"
|
||||||
|
.label=${capitalizeFirstLetter(
|
||||||
|
this.supervisor.localize("addon.system_managed.badge")
|
||||||
|
)}
|
||||||
|
>
|
||||||
|
<ha-svg-icon
|
||||||
|
slot="icon"
|
||||||
|
.path=${mdiHomeAssistant}
|
||||||
|
></ha-svg-icon>
|
||||||
|
</ha-assist-chip>
|
||||||
|
`
|
||||||
|
: nothing}
|
||||||
</ha-chip-set>
|
</ha-chip-set>
|
||||||
|
|
||||||
<div class="description light-color">
|
<div class="description light-color">
|
||||||
@@ -479,7 +513,7 @@ class HassioAddonInfo extends LitElement {
|
|||||||
src="/api/hassio/addons/${this.addon.slug}/logo"
|
src="/api/hassio/addons/${this.addon.slug}/logo"
|
||||||
/>
|
/>
|
||||||
`
|
`
|
||||||
: ""}
|
: nothing}
|
||||||
${this.addon.version
|
${this.addon.version
|
||||||
? html`
|
? html`
|
||||||
<div
|
<div
|
||||||
@@ -500,6 +534,7 @@ class HassioAddonInfo extends LitElement {
|
|||||||
)}
|
)}
|
||||||
</span>
|
</span>
|
||||||
<ha-switch
|
<ha-switch
|
||||||
|
.disabled=${systemManaged && !this.controlEnabled}
|
||||||
@change=${this._startOnBootToggled}
|
@change=${this._startOnBootToggled}
|
||||||
.checked=${this.addon.boot === "auto"}
|
.checked=${this.addon.boot === "auto"}
|
||||||
haptic
|
haptic
|
||||||
@@ -520,13 +555,15 @@ class HassioAddonInfo extends LitElement {
|
|||||||
)}
|
)}
|
||||||
</span>
|
</span>
|
||||||
<ha-switch
|
<ha-switch
|
||||||
|
.disabled=${systemManaged &&
|
||||||
|
!this.controlEnabled}
|
||||||
@change=${this._watchdogToggled}
|
@change=${this._watchdogToggled}
|
||||||
.checked=${this.addon.watchdog}
|
.checked=${this.addon.watchdog || false}
|
||||||
haptic
|
haptic
|
||||||
></ha-switch>
|
></ha-switch>
|
||||||
</ha-settings-row>
|
</ha-settings-row>
|
||||||
`
|
`
|
||||||
: ""}
|
: nothing}
|
||||||
${this.addon.auto_update ||
|
${this.addon.auto_update ||
|
||||||
this.hass.userData?.showAdvanced
|
this.hass.userData?.showAdvanced
|
||||||
? html`
|
? html`
|
||||||
@@ -542,13 +579,15 @@ class HassioAddonInfo extends LitElement {
|
|||||||
)}
|
)}
|
||||||
</span>
|
</span>
|
||||||
<ha-switch
|
<ha-switch
|
||||||
|
.disabled=${systemManaged &&
|
||||||
|
!this.controlEnabled}
|
||||||
@change=${this._autoUpdateToggled}
|
@change=${this._autoUpdateToggled}
|
||||||
.checked=${this.addon.auto_update}
|
.checked=${this.addon.auto_update}
|
||||||
haptic
|
haptic
|
||||||
></ha-switch>
|
></ha-switch>
|
||||||
</ha-settings-row>
|
</ha-settings-row>
|
||||||
`
|
`
|
||||||
: ""}
|
: nothing}
|
||||||
${!this._computeCannotIngressSidebar && this.addon.ingress
|
${!this._computeCannotIngressSidebar && this.addon.ingress
|
||||||
? html`
|
? html`
|
||||||
<ha-settings-row ?three-line=${this.narrow}>
|
<ha-settings-row ?three-line=${this.narrow}>
|
||||||
@@ -563,13 +602,15 @@ class HassioAddonInfo extends LitElement {
|
|||||||
)}
|
)}
|
||||||
</span>
|
</span>
|
||||||
<ha-switch
|
<ha-switch
|
||||||
|
.disabled=${systemManaged &&
|
||||||
|
!this.controlEnabled}
|
||||||
@change=${this._panelToggled}
|
@change=${this._panelToggled}
|
||||||
.checked=${this.addon.ingress_panel}
|
.checked=${this.addon.ingress_panel}
|
||||||
haptic
|
haptic
|
||||||
></ha-switch>
|
></ha-switch>
|
||||||
</ha-settings-row>
|
</ha-settings-row>
|
||||||
`
|
`
|
||||||
: ""}
|
: nothing}
|
||||||
${this._computeUsesProtectedOptions
|
${this._computeUsesProtectedOptions
|
||||||
? html`
|
? html`
|
||||||
<ha-settings-row ?three-line=${this.narrow}>
|
<ha-settings-row ?three-line=${this.narrow}>
|
||||||
@@ -584,16 +625,18 @@ class HassioAddonInfo extends LitElement {
|
|||||||
)}
|
)}
|
||||||
</span>
|
</span>
|
||||||
<ha-switch
|
<ha-switch
|
||||||
|
.disabled=${systemManaged &&
|
||||||
|
!this.controlEnabled}
|
||||||
@change=${this._protectionToggled}
|
@change=${this._protectionToggled}
|
||||||
.checked=${this.addon.protected}
|
.checked=${this.addon.protected}
|
||||||
haptic
|
haptic
|
||||||
></ha-switch>
|
></ha-switch>
|
||||||
</ha-settings-row>
|
</ha-settings-row>
|
||||||
`
|
`
|
||||||
: ""}
|
: nothing}
|
||||||
</div>
|
</div>
|
||||||
`
|
`
|
||||||
: ""}
|
: nothing}
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
${this.addon.version && this.addon.state === "started"
|
${this.addon.version && this.addon.state === "started"
|
||||||
@@ -612,12 +655,12 @@ class HassioAddonInfo extends LitElement {
|
|||||||
></supervisor-metric>
|
></supervisor-metric>
|
||||||
`
|
`
|
||||||
)}`
|
)}`
|
||||||
: ""}
|
: nothing}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
${this._error
|
${this._error
|
||||||
? html`<ha-alert alert-type="error">${this._error}</ha-alert>`
|
? html`<ha-alert alert-type="error">${this._error}</ha-alert>`
|
||||||
: ""}
|
: nothing}
|
||||||
${!this.addon.version && addonStoreInfo && !this.addon.available
|
${!this.addon.version && addonStoreInfo && !this.addon.available
|
||||||
? !addonArchIsSupported(
|
? !addonArchIsSupported(
|
||||||
this.supervisor.info.supported_arch,
|
this.supervisor.info.supported_arch,
|
||||||
@@ -641,7 +684,7 @@ class HassioAddonInfo extends LitElement {
|
|||||||
)}
|
)}
|
||||||
</ha-alert>
|
</ha-alert>
|
||||||
`
|
`
|
||||||
: ""}
|
: nothing}
|
||||||
</div>
|
</div>
|
||||||
<div class="card-actions">
|
<div class="card-actions">
|
||||||
<div>
|
<div>
|
||||||
@@ -651,6 +694,7 @@ class HassioAddonInfo extends LitElement {
|
|||||||
<ha-progress-button
|
<ha-progress-button
|
||||||
class="warning"
|
class="warning"
|
||||||
@click=${this._stopClicked}
|
@click=${this._stopClicked}
|
||||||
|
.disabled=${systemManaged && !this.controlEnabled}
|
||||||
>
|
>
|
||||||
${this.supervisor.localize("addon.dashboard.stop")}
|
${this.supervisor.localize("addon.dashboard.stop")}
|
||||||
</ha-progress-button>
|
</ha-progress-button>
|
||||||
@@ -688,26 +732,27 @@ class HassioAddonInfo extends LitElement {
|
|||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noopener"
|
rel="noopener"
|
||||||
>
|
>
|
||||||
<mwc-button>
|
<ha-button>
|
||||||
${this.supervisor.localize(
|
${this.supervisor.localize(
|
||||||
"addon.dashboard.open_web_ui"
|
"addon.dashboard.open_web_ui"
|
||||||
)}
|
)}
|
||||||
</mwc-button>
|
</ha-button>
|
||||||
</a>
|
</a>
|
||||||
`
|
`
|
||||||
: ""}
|
: nothing}
|
||||||
${this._computeShowIngressUI
|
${this._computeShowIngressUI
|
||||||
? html`
|
? html`
|
||||||
<mwc-button @click=${this._openIngress}>
|
<ha-button @click=${this._openIngress}>
|
||||||
${this.supervisor.localize(
|
${this.supervisor.localize(
|
||||||
"addon.dashboard.open_web_ui"
|
"addon.dashboard.open_web_ui"
|
||||||
)}
|
)}
|
||||||
</mwc-button>
|
</ha-button>
|
||||||
`
|
`
|
||||||
: ""}
|
: nothing}
|
||||||
<ha-progress-button
|
<ha-progress-button
|
||||||
class="warning"
|
class="warning"
|
||||||
@click=${this._uninstallClicked}
|
@click=${this._uninstallClicked}
|
||||||
|
.disabled=${systemManaged && !this.controlEnabled}
|
||||||
>
|
>
|
||||||
${this.supervisor.localize("addon.dashboard.uninstall")}
|
${this.supervisor.localize("addon.dashboard.uninstall")}
|
||||||
</ha-progress-button>
|
</ha-progress-button>
|
||||||
@@ -720,8 +765,8 @@ class HassioAddonInfo extends LitElement {
|
|||||||
${this.supervisor.localize("addon.dashboard.rebuild")}
|
${this.supervisor.localize("addon.dashboard.rebuild")}
|
||||||
</ha-progress-button>
|
</ha-progress-button>
|
||||||
`
|
`
|
||||||
: ""}`
|
: nothing}`
|
||||||
: ""}
|
: nothing}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</ha-card>
|
</ha-card>
|
||||||
@@ -737,7 +782,7 @@ class HassioAddonInfo extends LitElement {
|
|||||||
</div>
|
</div>
|
||||||
</ha-card>
|
</ha-card>
|
||||||
`
|
`
|
||||||
: ""}
|
: nothing}
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -822,6 +867,13 @@ class HassioAddonInfo extends LitElement {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private _showSystemManagedDialog() {
|
||||||
|
showSystemManagedDialog(this, {
|
||||||
|
addon: this.addon as HassioAddonDetails,
|
||||||
|
supervisor: this.supervisor,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
private get _computeIsRunning(): boolean {
|
private get _computeIsRunning(): boolean {
|
||||||
return (this.addon as HassioAddonDetails)?.state === "started";
|
return (this.addon as HassioAddonDetails)?.state === "started";
|
||||||
}
|
}
|
||||||
@@ -1014,6 +1066,10 @@ class HassioAddonInfo extends LitElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private async _stopClicked(ev: CustomEvent): Promise<void> {
|
private async _stopClicked(ev: CustomEvent): Promise<void> {
|
||||||
|
if (this._isSystemManaged(this.addon) && !this.controlEnabled) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const button = ev.currentTarget as any;
|
const button = ev.currentTarget as any;
|
||||||
button.progress = true;
|
button.progress = true;
|
||||||
|
|
||||||
@@ -1125,6 +1181,10 @@ class HassioAddonInfo extends LitElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private async _uninstallClicked(ev: CustomEvent): Promise<void> {
|
private async _uninstallClicked(ev: CustomEvent): Promise<void> {
|
||||||
|
if (this._isSystemManaged(this.addon) && !this.controlEnabled) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const button = ev.currentTarget as any;
|
const button = ev.currentTarget as any;
|
||||||
button.progress = true;
|
button.progress = true;
|
||||||
let removeData = false;
|
let removeData = false;
|
||||||
@@ -1179,6 +1239,11 @@ class HassioAddonInfo extends LitElement {
|
|||||||
button.progress = false;
|
button.progress = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private _isSystemManaged = memoizeOne(
|
||||||
|
(addon: HassioAddonDetails | StoreAddonDetails) =>
|
||||||
|
"system_managed" in addon && addon.system_managed
|
||||||
|
);
|
||||||
|
|
||||||
static get styles(): CSSResultGroup {
|
static get styles(): CSSResultGroup {
|
||||||
return [
|
return [
|
||||||
haStyle,
|
haStyle,
|
||||||
@@ -1201,7 +1266,7 @@ class HassioAddonInfo extends LitElement {
|
|||||||
ha-card.warning .card-content {
|
ha-card.warning .card-content {
|
||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
ha-card.warning mwc-button {
|
ha-card.warning ha-button {
|
||||||
--mdc-theme-primary: white !important;
|
--mdc-theme-primary: white !important;
|
||||||
}
|
}
|
||||||
.warning {
|
.warning {
|
||||||
@@ -1246,7 +1311,7 @@ class HassioAddonInfo extends LitElement {
|
|||||||
ha-svg-icon.stopped {
|
ha-svg-icon.stopped {
|
||||||
color: var(--error-color);
|
color: var(--error-color);
|
||||||
}
|
}
|
||||||
protection-enable mwc-button {
|
protection-enable ha-button {
|
||||||
--mdc-theme-primary: white;
|
--mdc-theme-primary: white;
|
||||||
}
|
}
|
||||||
.description a {
|
.description a {
|
||||||
@@ -1328,9 +1393,15 @@ class HassioAddonInfo extends LitElement {
|
|||||||
align-self: end;
|
align-self: end;
|
||||||
}
|
}
|
||||||
|
|
||||||
ha-alert mwc-button {
|
ha-alert ha-button {
|
||||||
--mdc-theme-primary: var(--primary-text-color);
|
--mdc-theme-primary: var(--primary-text-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
:host > ha-alert {
|
||||||
|
display: block;
|
||||||
|
margin-bottom: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
a {
|
a {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
60
hassio/src/addon-view/info/hassio-addon-system-managed.ts
Normal file
60
hassio/src/addon-view/info/hassio-addon-system-managed.ts
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
import "@material/mwc-button";
|
||||||
|
import type { TemplateResult } from "lit";
|
||||||
|
import { LitElement, css, html, nothing } from "lit";
|
||||||
|
import { customElement, property } from "lit/decorators";
|
||||||
|
import { fireEvent } from "../../../../src/common/dom/fire_event";
|
||||||
|
import "../../../../src/components/ha-alert";
|
||||||
|
import "../../../../src/components/ha-button";
|
||||||
|
import type { Supervisor } from "../../../../src/data/supervisor/supervisor";
|
||||||
|
|
||||||
|
@customElement("hassio-addon-system-managed")
|
||||||
|
class HassioAddonSystemManaged extends LitElement {
|
||||||
|
@property({ type: Boolean }) public narrow = false;
|
||||||
|
|
||||||
|
@property({ attribute: false }) public supervisor!: Supervisor;
|
||||||
|
|
||||||
|
@property({ type: Boolean, attribute: "hide-button" }) public hideButton =
|
||||||
|
false;
|
||||||
|
|
||||||
|
protected render(): TemplateResult {
|
||||||
|
return html`
|
||||||
|
<ha-alert
|
||||||
|
alert-type="warning"
|
||||||
|
.title=${this.supervisor.localize("addon.system_managed.title")}
|
||||||
|
.narrow=${this.narrow}
|
||||||
|
>
|
||||||
|
${this.supervisor.localize("addon.system_managed.description")}
|
||||||
|
${!this.hideButton
|
||||||
|
? html`
|
||||||
|
<ha-button slot="action" @click=${this._takeControl}>
|
||||||
|
${this.supervisor.localize("addon.system_managed.take_control")}
|
||||||
|
</ha-button>
|
||||||
|
`
|
||||||
|
: nothing}
|
||||||
|
</ha-alert>
|
||||||
|
`;
|
||||||
|
}
|
||||||
|
|
||||||
|
private _takeControl() {
|
||||||
|
fireEvent(this, "system-managed-take-control");
|
||||||
|
}
|
||||||
|
|
||||||
|
static styles = css`
|
||||||
|
ha-alert {
|
||||||
|
display: block;
|
||||||
|
margin-bottom: 16px;
|
||||||
|
}
|
||||||
|
ha-button {
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
}
|
||||||
|
declare global {
|
||||||
|
interface HTMLElementTagNameMap {
|
||||||
|
"hassio-addon-system-managed": HassioAddonSystemManaged;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface HASSDomEvents {
|
||||||
|
"system-managed-take-control": undefined;
|
||||||
|
}
|
||||||
|
}
|
@@ -6,7 +6,7 @@ import {
|
|||||||
type TemplateResult,
|
type TemplateResult,
|
||||||
} from "lit";
|
} from "lit";
|
||||||
import { customElement, property, state } from "lit/decorators";
|
import { customElement, property, state } from "lit/decorators";
|
||||||
import "../../../../src/components/ha-circular-progress";
|
import "../../../../src/components/ha-spinner";
|
||||||
import type { HassioAddonDetails } from "../../../../src/data/hassio/addon";
|
import type { HassioAddonDetails } from "../../../../src/data/hassio/addon";
|
||||||
import type { Supervisor } from "../../../../src/data/supervisor/supervisor";
|
import type { Supervisor } from "../../../../src/data/supervisor/supervisor";
|
||||||
import { haStyle } from "../../../../src/resources/styles";
|
import { haStyle } from "../../../../src/resources/styles";
|
||||||
@@ -28,9 +28,7 @@ class HassioAddonLogDashboard extends LitElement {
|
|||||||
|
|
||||||
protected render(): TemplateResult {
|
protected render(): TemplateResult {
|
||||||
if (!this.addon) {
|
if (!this.addon) {
|
||||||
return html`
|
return html` <ha-spinner></ha-spinner> `;
|
||||||
<ha-circular-progress indeterminate></ha-circular-progress>
|
|
||||||
`;
|
|
||||||
}
|
}
|
||||||
return html`
|
return html`
|
||||||
<div class="search">
|
<div class="search">
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
import "@material/mwc-button";
|
import "@material/mwc-button";
|
||||||
import type { ActionDetail } from "@material/mwc-list";
|
import type { ActionDetail } from "@material/mwc-list";
|
||||||
import "@material/mwc-list/mwc-list-item";
|
|
||||||
import { mdiBackupRestore, mdiDelete, mdiDotsVertical, mdiPlus } from "@mdi/js";
|
import { mdiBackupRestore, mdiDelete, mdiDotsVertical, mdiPlus } from "@mdi/js";
|
||||||
import type { CSSResultGroup, PropertyValues } from "lit";
|
import type { CSSResultGroup, PropertyValues } from "lit";
|
||||||
import { LitElement, css, html, nothing } from "lit";
|
import { LitElement, css, html, nothing } from "lit";
|
||||||
@@ -18,6 +18,7 @@ import type {
|
|||||||
import "../../../src/components/ha-button-menu";
|
import "../../../src/components/ha-button-menu";
|
||||||
import "../../../src/components/ha-fab";
|
import "../../../src/components/ha-fab";
|
||||||
import "../../../src/components/ha-icon-button";
|
import "../../../src/components/ha-icon-button";
|
||||||
|
import "../../../src/components/ha-list-item";
|
||||||
import "../../../src/components/ha-svg-icon";
|
import "../../../src/components/ha-svg-icon";
|
||||||
import type { HassioBackup } from "../../../src/data/hassio/backup";
|
import type { HassioBackup } from "../../../src/data/hassio/backup";
|
||||||
import {
|
import {
|
||||||
@@ -32,6 +33,7 @@ import {
|
|||||||
showAlertDialog,
|
showAlertDialog,
|
||||||
showConfirmationDialog,
|
showConfirmationDialog,
|
||||||
} from "../../../src/dialogs/generic/show-dialog-box";
|
} from "../../../src/dialogs/generic/show-dialog-box";
|
||||||
|
import "../../../src/layouts/hass-loading-screen";
|
||||||
import "../../../src/layouts/hass-tabs-subpage-data-table";
|
import "../../../src/layouts/hass-tabs-subpage-data-table";
|
||||||
import type { HaTabsSubpageDataTable } from "../../../src/layouts/hass-tabs-subpage-data-table";
|
import type { HaTabsSubpageDataTable } from "../../../src/layouts/hass-tabs-subpage-data-table";
|
||||||
import { haStyle } from "../../../src/resources/styles";
|
import { haStyle } from "../../../src/resources/styles";
|
||||||
@@ -42,7 +44,6 @@ import { showHassioBackupDialog } from "../dialogs/backup/show-dialog-hassio-bac
|
|||||||
import { showHassioCreateBackupDialog } from "../dialogs/backup/show-dialog-hassio-create-backup";
|
import { showHassioCreateBackupDialog } from "../dialogs/backup/show-dialog-hassio-create-backup";
|
||||||
import { supervisorTabs } from "../hassio-tabs";
|
import { supervisorTabs } from "../hassio-tabs";
|
||||||
import { hassioStyle } from "../resources/hassio-style";
|
import { hassioStyle } from "../resources/hassio-style";
|
||||||
import "../../../src/layouts/hass-loading-screen";
|
|
||||||
|
|
||||||
type BackupItem = HassioBackup & {
|
type BackupItem = HassioBackup & {
|
||||||
secondary: string;
|
secondary: string;
|
||||||
@@ -211,16 +212,16 @@ export class HassioBackups extends LitElement {
|
|||||||
.path=${mdiDotsVertical}
|
.path=${mdiDotsVertical}
|
||||||
slot="trigger"
|
slot="trigger"
|
||||||
></ha-icon-button>
|
></ha-icon-button>
|
||||||
<mwc-list-item>
|
<ha-list-item>
|
||||||
${this.supervisor.localize("common.reload")}
|
${this.supervisor.localize("common.reload")}
|
||||||
</mwc-list-item>
|
</ha-list-item>
|
||||||
<mwc-list-item>
|
<ha-list-item>
|
||||||
${this.supervisor.localize("dialog.backup_location.title")}
|
${this.supervisor.localize("dialog.backup_location.title")}
|
||||||
</mwc-list-item>
|
</ha-list-item>
|
||||||
${atLeastVersion(this.hass.config.version, 0, 116)
|
${atLeastVersion(this.hass.config.version, 0, 116)
|
||||||
? html`<mwc-list-item>
|
? html`<ha-list-item>
|
||||||
${this.supervisor.localize("backup.upload_backup")}
|
${this.supervisor.localize("backup.upload_backup")}
|
||||||
</mwc-list-item>`
|
</ha-list-item>`
|
||||||
: ""}
|
: ""}
|
||||||
</ha-button-menu>
|
</ha-button-menu>
|
||||||
|
|
||||||
@@ -253,13 +254,9 @@ export class HassioBackups extends LitElement {
|
|||||||
"backup.delete_selected"
|
"backup.delete_selected"
|
||||||
)}
|
)}
|
||||||
.path=${mdiDelete}
|
.path=${mdiDelete}
|
||||||
id="delete-btn"
|
|
||||||
class="warning"
|
class="warning"
|
||||||
@click=${this._deleteSelected}
|
@click=${this._deleteSelected}
|
||||||
></ha-icon-button>
|
></ha-icon-button>
|
||||||
<simple-tooltip animation-delay="0" for="delete-btn">
|
|
||||||
${this.supervisor.localize("backup.delete_selected")}
|
|
||||||
</simple-tooltip>
|
|
||||||
`}
|
`}
|
||||||
</div>
|
</div>
|
||||||
</div> `
|
</div> `
|
||||||
|
@@ -85,7 +85,7 @@ class HassioCardContent extends LitElement {
|
|||||||
}
|
}
|
||||||
ha-svg-icon.hassupdate,
|
ha-svg-icon.hassupdate,
|
||||||
ha-svg-icon.backup {
|
ha-svg-icon.backup {
|
||||||
color: var(--paper-item-icon-color);
|
color: var(--state-icon-color);
|
||||||
}
|
}
|
||||||
ha-svg-icon.not_available {
|
ha-svg-icon.not_available {
|
||||||
color: var(--error-color);
|
color: var(--error-color);
|
||||||
|
@@ -1,8 +1,6 @@
|
|||||||
import type { IFuseOptions } from "fuse.js";
|
import type { IFuseOptions } from "fuse.js";
|
||||||
import Fuse from "fuse.js";
|
import Fuse from "fuse.js";
|
||||||
import { stripDiacritics } from "../../../src/common/string/strip-diacritics";
|
|
||||||
import type { StoreAddon } from "../../../src/data/supervisor/store";
|
import type { StoreAddon } from "../../../src/data/supervisor/store";
|
||||||
import { getStripDiacriticsFn } from "../../../src/util/fuse";
|
|
||||||
|
|
||||||
export function filterAndSort(addons: StoreAddon[], filter: string) {
|
export function filterAndSort(addons: StoreAddon[], filter: string) {
|
||||||
const options: IFuseOptions<StoreAddon> = {
|
const options: IFuseOptions<StoreAddon> = {
|
||||||
@@ -10,8 +8,8 @@ export function filterAndSort(addons: StoreAddon[], filter: string) {
|
|||||||
isCaseSensitive: false,
|
isCaseSensitive: false,
|
||||||
minMatchCharLength: Math.min(filter.length, 2),
|
minMatchCharLength: Math.min(filter.length, 2),
|
||||||
threshold: 0.2,
|
threshold: 0.2,
|
||||||
getFn: getStripDiacriticsFn,
|
ignoreDiacritics: true,
|
||||||
};
|
};
|
||||||
const fuse = new Fuse(addons, options);
|
const fuse = new Fuse(addons, options);
|
||||||
return fuse.search(stripDiacritics(filter)).map((result) => result.item);
|
return fuse.search(filter).map((result) => result.item);
|
||||||
}
|
}
|
||||||
|
@@ -3,7 +3,6 @@ import type { TemplateResult } from "lit";
|
|||||||
import { html, LitElement } from "lit";
|
import { html, LitElement } from "lit";
|
||||||
import { customElement, property, state } from "lit/decorators";
|
import { customElement, property, state } from "lit/decorators";
|
||||||
import { fireEvent } from "../../../src/common/dom/fire_event";
|
import { fireEvent } from "../../../src/common/dom/fire_event";
|
||||||
import "../../../src/components/ha-circular-progress";
|
|
||||||
import "../../../src/components/ha-file-upload";
|
import "../../../src/components/ha-file-upload";
|
||||||
import type { HassioBackup } from "../../../src/data/hassio/backup";
|
import type { HassioBackup } from "../../../src/data/hassio/backup";
|
||||||
import { uploadBackup } from "../../../src/data/hassio/backup";
|
import { uploadBackup } from "../../../src/data/hassio/backup";
|
||||||
@@ -14,7 +13,7 @@ import type { LocalizeFunc } from "../../../src/common/translations/localize";
|
|||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
interface HASSDomEvents {
|
interface HASSDomEvents {
|
||||||
"backup-uploaded": { backup: HassioBackup };
|
"hassio-backup-uploaded": { backup: HassioBackup };
|
||||||
"backup-cleared": undefined;
|
"backup-cleared": undefined;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -70,7 +69,7 @@ export class HassioUploadBackup extends LitElement {
|
|||||||
this._uploading = true;
|
this._uploading = true;
|
||||||
try {
|
try {
|
||||||
const backup = await uploadBackup(this.hass, file);
|
const backup = await uploadBackup(this.hass, file);
|
||||||
fireEvent(this, "backup-uploaded", { backup: backup.data });
|
fireEvent(this, "hassio-backup-uploaded", { backup: backup.data });
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
showAlertDialog(this, {
|
showAlertDialog(this, {
|
||||||
title: "Upload failed",
|
title: "Upload failed",
|
||||||
|
@@ -5,7 +5,6 @@ import { customElement, property, query } from "lit/decorators";
|
|||||||
import { atLeastVersion } from "../../../src/common/config/version";
|
import { atLeastVersion } from "../../../src/common/config/version";
|
||||||
import { formatDate } from "../../../src/common/datetime/format_date";
|
import { formatDate } from "../../../src/common/datetime/format_date";
|
||||||
import { formatDateTime } from "../../../src/common/datetime/format_date_time";
|
import { formatDateTime } from "../../../src/common/datetime/format_date_time";
|
||||||
import type { LocalizeFunc } from "../../../src/common/translations/localize";
|
|
||||||
import "../../../src/components/ha-checkbox";
|
import "../../../src/components/ha-checkbox";
|
||||||
import "../../../src/components/ha-formfield";
|
import "../../../src/components/ha-formfield";
|
||||||
import "../../../src/components/ha-textfield";
|
import "../../../src/components/ha-textfield";
|
||||||
@@ -19,13 +18,10 @@ import type {
|
|||||||
} from "../../../src/data/hassio/backup";
|
} from "../../../src/data/hassio/backup";
|
||||||
import type { Supervisor } from "../../../src/data/supervisor/supervisor";
|
import type { Supervisor } from "../../../src/data/supervisor/supervisor";
|
||||||
import { mdiHomeAssistant } from "../../../src/resources/home-assistant-logo-svg";
|
import { mdiHomeAssistant } from "../../../src/resources/home-assistant-logo-svg";
|
||||||
import type { HomeAssistant, TranslationDict } from "../../../src/types";
|
import type { HomeAssistant } from "../../../src/types";
|
||||||
import "./supervisor-formfield-label";
|
import "./supervisor-formfield-label";
|
||||||
import type { HaTextField } from "../../../src/components/ha-textfield";
|
import type { HaTextField } from "../../../src/components/ha-textfield";
|
||||||
|
|
||||||
type BackupOrRestoreKey = keyof TranslationDict["supervisor"]["backup"] &
|
|
||||||
keyof TranslationDict["ui"]["panel"]["page-onboarding"]["restore"];
|
|
||||||
|
|
||||||
interface CheckboxItem {
|
interface CheckboxItem {
|
||||||
slug: string;
|
slug: string;
|
||||||
checked: boolean;
|
checked: boolean;
|
||||||
@@ -67,8 +63,6 @@ const _computeAddons = (addons): AddonCheckboxItem[] =>
|
|||||||
export class SupervisorBackupContent extends LitElement {
|
export class SupervisorBackupContent extends LitElement {
|
||||||
@property({ attribute: false }) public hass?: HomeAssistant;
|
@property({ attribute: false }) public hass?: HomeAssistant;
|
||||||
|
|
||||||
@property({ attribute: false }) public localize?: LocalizeFunc;
|
|
||||||
|
|
||||||
@property({ attribute: false }) public supervisor?: Supervisor;
|
@property({ attribute: false }) public supervisor?: Supervisor;
|
||||||
|
|
||||||
@property({ attribute: false }) public backup?: HassioBackupDetail;
|
@property({ attribute: false }) public backup?: HassioBackupDetail;
|
||||||
@@ -115,10 +109,6 @@ export class SupervisorBackupContent extends LitElement {
|
|||||||
this._focusTarget?.focus();
|
this._focusTarget?.focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
private _localize = (key: BackupOrRestoreKey) =>
|
|
||||||
this.supervisor?.localize(`backup.${key}`) ||
|
|
||||||
this.localize!(`ui.panel.page-onboarding.restore.${key}`);
|
|
||||||
|
|
||||||
protected render() {
|
protected render() {
|
||||||
if (!this.onboarding && !this.supervisor) {
|
if (!this.onboarding && !this.supervisor) {
|
||||||
return nothing;
|
return nothing;
|
||||||
@@ -132,8 +122,8 @@ export class SupervisorBackupContent extends LitElement {
|
|||||||
${this.backup
|
${this.backup
|
||||||
? html`<div class="details">
|
? html`<div class="details">
|
||||||
${this.backup.type === "full"
|
${this.backup.type === "full"
|
||||||
? this._localize("full_backup")
|
? this.supervisor?.localize("backup.full_backup")
|
||||||
: this._localize("partial_backup")}
|
: this.supervisor?.localize("backup.partial_backup")}
|
||||||
(${Math.ceil(this.backup.size * 10) / 10 + " MB"})<br />
|
(${Math.ceil(this.backup.size * 10) / 10 + " MB"})<br />
|
||||||
${this.hass
|
${this.hass
|
||||||
? formatDateTime(
|
? formatDateTime(
|
||||||
@@ -145,7 +135,7 @@ export class SupervisorBackupContent extends LitElement {
|
|||||||
</div>`
|
</div>`
|
||||||
: html`<ha-textfield
|
: html`<ha-textfield
|
||||||
name="backupName"
|
name="backupName"
|
||||||
.label=${this._localize("name")}
|
.label=${this.supervisor?.localize("backup.name")}
|
||||||
.value=${this.backupName}
|
.value=${this.backupName}
|
||||||
@change=${this._handleTextValueChanged}
|
@change=${this._handleTextValueChanged}
|
||||||
>
|
>
|
||||||
@@ -153,11 +143,13 @@ export class SupervisorBackupContent extends LitElement {
|
|||||||
${!this.backup || this.backup.type === "full"
|
${!this.backup || this.backup.type === "full"
|
||||||
? html`<div class="sub-header">
|
? html`<div class="sub-header">
|
||||||
${!this.backup
|
${!this.backup
|
||||||
? this._localize("type")
|
? this.supervisor?.localize("backup.type")
|
||||||
: this._localize("select_type")}
|
: this.supervisor?.localize("backup.select_type")}
|
||||||
</div>
|
</div>
|
||||||
<div class="backup-types">
|
<div class="backup-types">
|
||||||
<ha-formfield .label=${this._localize("full_backup")}>
|
<ha-formfield
|
||||||
|
.label=${this.supervisor?.localize("backup.full_backup")}
|
||||||
|
>
|
||||||
<ha-radio
|
<ha-radio
|
||||||
@change=${this._handleRadioValueChanged}
|
@change=${this._handleRadioValueChanged}
|
||||||
value="full"
|
value="full"
|
||||||
@@ -166,7 +158,9 @@ export class SupervisorBackupContent extends LitElement {
|
|||||||
>
|
>
|
||||||
</ha-radio>
|
</ha-radio>
|
||||||
</ha-formfield>
|
</ha-formfield>
|
||||||
<ha-formfield .label=${this._localize("partial_backup")}>
|
<ha-formfield
|
||||||
|
.label=${this.supervisor?.localize("backup.partial_backup")}
|
||||||
|
>
|
||||||
<ha-radio
|
<ha-radio
|
||||||
@change=${this._handleRadioValueChanged}
|
@change=${this._handleRadioValueChanged}
|
||||||
value="partial"
|
value="partial"
|
||||||
@@ -202,7 +196,7 @@ export class SupervisorBackupContent extends LitElement {
|
|||||||
? html`
|
? html`
|
||||||
<ha-formfield
|
<ha-formfield
|
||||||
.label=${html`<supervisor-formfield-label
|
.label=${html`<supervisor-formfield-label
|
||||||
.label=${this._localize("folders")}
|
.label=${this.supervisor?.localize("backup.folders")}
|
||||||
.iconPath=${mdiFolder}
|
.iconPath=${mdiFolder}
|
||||||
>
|
>
|
||||||
</supervisor-formfield-label>`}
|
</supervisor-formfield-label>`}
|
||||||
@@ -222,7 +216,7 @@ export class SupervisorBackupContent extends LitElement {
|
|||||||
? html`
|
? html`
|
||||||
<ha-formfield
|
<ha-formfield
|
||||||
.label=${html`<supervisor-formfield-label
|
.label=${html`<supervisor-formfield-label
|
||||||
.label=${this._localize("addons")}
|
.label=${this.supervisor?.localize("backup.addons")}
|
||||||
.iconPath=${mdiPuzzle}
|
.iconPath=${mdiPuzzle}
|
||||||
>
|
>
|
||||||
</supervisor-formfield-label>`}
|
</supervisor-formfield-label>`}
|
||||||
@@ -247,7 +241,7 @@ export class SupervisorBackupContent extends LitElement {
|
|||||||
${!this.backup
|
${!this.backup
|
||||||
? html`<ha-formfield
|
? html`<ha-formfield
|
||||||
class="password"
|
class="password"
|
||||||
.label=${this._localize("password_protection")}
|
.label=${this.supervisor?.localize("backup.password_protection")}
|
||||||
>
|
>
|
||||||
<ha-checkbox
|
<ha-checkbox
|
||||||
.checked=${this.backupHasPassword}
|
.checked=${this.backupHasPassword}
|
||||||
@@ -259,7 +253,7 @@ export class SupervisorBackupContent extends LitElement {
|
|||||||
${this.backupHasPassword
|
${this.backupHasPassword
|
||||||
? html`
|
? html`
|
||||||
<ha-password-field
|
<ha-password-field
|
||||||
.label=${this._localize("password")}
|
.label=${this.supervisor?.localize("backup.password")}
|
||||||
name="backupPassword"
|
name="backupPassword"
|
||||||
.value=${this.backupPassword}
|
.value=${this.backupPassword}
|
||||||
@change=${this._handleTextValueChanged}
|
@change=${this._handleTextValueChanged}
|
||||||
@@ -267,7 +261,7 @@ export class SupervisorBackupContent extends LitElement {
|
|||||||
</ha-password-field>
|
</ha-password-field>
|
||||||
${!this.backup
|
${!this.backup
|
||||||
? html`<ha-password-field
|
? html`<ha-password-field
|
||||||
.label=${this._localize("confirm_password")}
|
.label=${this.supervisor?.localize("backup.confirm_password")}
|
||||||
name="confirmBackupPassword"
|
name="confirmBackupPassword"
|
||||||
.value=${this.confirmBackupPassword}
|
.value=${this.confirmBackupPassword}
|
||||||
@change=${this._handleTextValueChanged}
|
@change=${this._handleTextValueChanged}
|
||||||
|
@@ -130,7 +130,7 @@ export class HassioUpdate extends LitElement {
|
|||||||
color: var(--primary-text-color);
|
color: var(--primary-text-color);
|
||||||
}
|
}
|
||||||
.update-heading {
|
.update-heading {
|
||||||
font-size: var(--paper-font-subhead_-_font-size);
|
font-size: var(--ha-font-size-l);
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
margin-bottom: 0.5em;
|
margin-bottom: 0.5em;
|
||||||
color: var(--primary-text-color);
|
color: var(--primary-text-color);
|
||||||
|
@@ -72,7 +72,7 @@ export class DialogHassioBackupUpload
|
|||||||
</ha-header-bar>
|
</ha-header-bar>
|
||||||
</div>
|
</div>
|
||||||
<hassio-upload-backup
|
<hassio-upload-backup
|
||||||
@backup-uploaded=${this._backupUploaded}
|
@hassio-backup-uploaded=${this._backupUploaded}
|
||||||
.hass=${this.hass}
|
.hass=${this.hass}
|
||||||
></hassio-upload-backup>
|
></hassio-upload-backup>
|
||||||
</ha-dialog>
|
</ha-dialog>
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
import type { ActionDetail } from "@material/mwc-list";
|
import type { ActionDetail } from "@material/mwc-list";
|
||||||
import "@material/mwc-list/mwc-list-item";
|
|
||||||
import { mdiClose, mdiDotsVertical } from "@mdi/js";
|
import { mdiClose, mdiDotsVertical } from "@mdi/js";
|
||||||
import type { CSSResultGroup } from "lit";
|
import type { CSSResultGroup } from "lit";
|
||||||
import { css, html, LitElement, nothing } from "lit";
|
import { css, html, LitElement, nothing } from "lit";
|
||||||
@@ -8,14 +8,17 @@ import { atLeastVersion } from "../../../../src/common/config/version";
|
|||||||
import { fireEvent } from "../../../../src/common/dom/fire_event";
|
import { fireEvent } from "../../../../src/common/dom/fire_event";
|
||||||
import { stopPropagation } from "../../../../src/common/dom/stop_propagation";
|
import { stopPropagation } from "../../../../src/common/dom/stop_propagation";
|
||||||
import { slugify } from "../../../../src/common/string/slugify";
|
import { slugify } from "../../../../src/common/string/slugify";
|
||||||
import "../../../../src/components/ha-md-dialog";
|
|
||||||
import "../../../../src/components/ha-dialog-header";
|
|
||||||
import "../../../../src/components/buttons/ha-progress-button";
|
import "../../../../src/components/buttons/ha-progress-button";
|
||||||
import "../../../../src/components/ha-alert";
|
import "../../../../src/components/ha-alert";
|
||||||
import "../../../../src/components/ha-button";
|
import "../../../../src/components/ha-button";
|
||||||
import "../../../../src/components/ha-button-menu";
|
import "../../../../src/components/ha-button-menu";
|
||||||
|
import "../../../../src/components/ha-dialog-header";
|
||||||
import "../../../../src/components/ha-header-bar";
|
import "../../../../src/components/ha-header-bar";
|
||||||
import "../../../../src/components/ha-icon-button";
|
import "../../../../src/components/ha-icon-button";
|
||||||
|
import "../../../../src/components/ha-list-item";
|
||||||
|
import "../../../../src/components/ha-md-dialog";
|
||||||
|
import type { HaMdDialog } from "../../../../src/components/ha-md-dialog";
|
||||||
|
import "../../../../src/components/ha-spinner";
|
||||||
import { getSignedPath } from "../../../../src/data/auth";
|
import { getSignedPath } from "../../../../src/data/auth";
|
||||||
import type { HassioBackupDetail } from "../../../../src/data/hassio/backup";
|
import type { HassioBackupDetail } from "../../../../src/data/hassio/backup";
|
||||||
import {
|
import {
|
||||||
@@ -35,15 +38,13 @@ import { fileDownload } from "../../../../src/util/file_download";
|
|||||||
import "../../components/supervisor-backup-content";
|
import "../../components/supervisor-backup-content";
|
||||||
import type { SupervisorBackupContent } from "../../components/supervisor-backup-content";
|
import type { SupervisorBackupContent } from "../../components/supervisor-backup-content";
|
||||||
import type { HassioBackupDialogParams } from "./show-dialog-hassio-backup";
|
import type { HassioBackupDialogParams } from "./show-dialog-hassio-backup";
|
||||||
import type { BackupOrRestoreKey } from "../../util/translations";
|
|
||||||
import type { HaMdDialog } from "../../../../src/components/ha-md-dialog";
|
|
||||||
|
|
||||||
@customElement("dialog-hassio-backup")
|
@customElement("dialog-hassio-backup")
|
||||||
class HassioBackupDialog
|
class HassioBackupDialog
|
||||||
extends LitElement
|
extends LitElement
|
||||||
implements HassDialog<HassioBackupDialogParams>
|
implements HassDialog<HassioBackupDialogParams>
|
||||||
{
|
{
|
||||||
@property({ attribute: false }) public hass?: HomeAssistant;
|
@property({ attribute: false }) public hass!: HomeAssistant;
|
||||||
|
|
||||||
@state() private _error?: string;
|
@state() private _error?: string;
|
||||||
|
|
||||||
@@ -62,9 +63,13 @@ class HassioBackupDialog
|
|||||||
this._dialogParams = dialogParams;
|
this._dialogParams = dialogParams;
|
||||||
this._backup = await fetchHassioBackupInfo(this.hass, dialogParams.slug);
|
this._backup = await fetchHassioBackupInfo(this.hass, dialogParams.slug);
|
||||||
if (!this._backup) {
|
if (!this._backup) {
|
||||||
this._error = this._localize("no_backup_found");
|
this._error = this._dialogParams.supervisor?.localize(
|
||||||
|
"backup.no_backup_found"
|
||||||
|
);
|
||||||
} else if (this._dialogParams.onboarding && !this._backup.homeassistant) {
|
} else if (this._dialogParams.onboarding && !this._backup.homeassistant) {
|
||||||
this._error = this._localize("restore_no_home_assistant");
|
this._error = this._dialogParams.supervisor?.localize(
|
||||||
|
"backup.restore_no_home_assistant"
|
||||||
|
);
|
||||||
}
|
}
|
||||||
this._restoringBackup = false;
|
this._restoringBackup = false;
|
||||||
}
|
}
|
||||||
@@ -82,13 +87,6 @@ class HassioBackupDialog
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private _localize(key: BackupOrRestoreKey) {
|
|
||||||
return (
|
|
||||||
this._dialogParams!.supervisor?.localize(`backup.${key}`) ||
|
|
||||||
this._dialogParams!.localize!(`ui.panel.page-onboarding.restore.${key}`)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected render() {
|
protected render() {
|
||||||
if (!this._dialogParams || !this._backup) {
|
if (!this._dialogParams || !this._backup) {
|
||||||
return nothing;
|
return nothing;
|
||||||
@@ -102,7 +100,7 @@ class HassioBackupDialog
|
|||||||
<ha-dialog-header slot="headline">
|
<ha-dialog-header slot="headline">
|
||||||
<ha-icon-button
|
<ha-icon-button
|
||||||
slot="navigationIcon"
|
slot="navigationIcon"
|
||||||
.label=${this._localize("close")}
|
.label=${this._dialogParams.supervisor?.localize("backup.close")}
|
||||||
.path=${mdiClose}
|
.path=${mdiClose}
|
||||||
@click=${this.closeDialog}
|
@click=${this.closeDialog}
|
||||||
.disabled=${this._restoringBackup}
|
.disabled=${this._restoringBackup}
|
||||||
@@ -124,15 +122,15 @@ class HassioBackupDialog
|
|||||||
.path=${mdiDotsVertical}
|
.path=${mdiDotsVertical}
|
||||||
slot="trigger"
|
slot="trigger"
|
||||||
></ha-icon-button>
|
></ha-icon-button>
|
||||||
<mwc-list-item
|
<ha-list-item
|
||||||
>${this._dialogParams.supervisor.localize(
|
>${this._dialogParams.supervisor.localize(
|
||||||
"backup.download_backup"
|
"backup.download_backup"
|
||||||
)}</mwc-list-item
|
)}</ha-list-item
|
||||||
>
|
>
|
||||||
<mwc-list-item class="error"
|
<ha-list-item class="error"
|
||||||
>${this._dialogParams.supervisor.localize(
|
>${this._dialogParams.supervisor.localize(
|
||||||
"backup.delete_backup_title"
|
"backup.delete_backup_title"
|
||||||
)}</mwc-list-item
|
)}</ha-list-item
|
||||||
>
|
>
|
||||||
</ha-button-menu>`
|
</ha-button-menu>`
|
||||||
: nothing}
|
: nothing}
|
||||||
@@ -142,7 +140,7 @@ class HassioBackupDialog
|
|||||||
? html`<ha-alert alert-type="error">${this._error}</ha-alert>`
|
? html`<ha-alert alert-type="error">${this._error}</ha-alert>`
|
||||||
: this._restoringBackup
|
: this._restoringBackup
|
||||||
? html`<div class="loading">
|
? html`<div class="loading">
|
||||||
<ha-circular-progress indeterminate></ha-circular-progress>
|
<ha-spinner></ha-spinner>
|
||||||
</div>`
|
</div>`
|
||||||
: html`
|
: html`
|
||||||
<supervisor-backup-content
|
<supervisor-backup-content
|
||||||
@@ -150,7 +148,6 @@ class HassioBackupDialog
|
|||||||
.supervisor=${this._dialogParams.supervisor}
|
.supervisor=${this._dialogParams.supervisor}
|
||||||
.backup=${this._backup}
|
.backup=${this._backup}
|
||||||
.onboarding=${this._dialogParams.onboarding || false}
|
.onboarding=${this._dialogParams.onboarding || false}
|
||||||
.localize=${this._dialogParams.localize}
|
|
||||||
dialogInitialFocus
|
dialogInitialFocus
|
||||||
>
|
>
|
||||||
</supervisor-backup-content>
|
</supervisor-backup-content>
|
||||||
@@ -161,7 +158,7 @@ class HassioBackupDialog
|
|||||||
.disabled=${this._restoringBackup || !!this._error}
|
.disabled=${this._restoringBackup || !!this._error}
|
||||||
@click=${this._restoreClicked}
|
@click=${this._restoreClicked}
|
||||||
>
|
>
|
||||||
${this._localize("restore")}
|
${this._dialogParams.supervisor?.localize("backup.restore")}
|
||||||
</ha-button>
|
</ha-button>
|
||||||
</div>
|
</div>
|
||||||
</ha-md-dialog>
|
</ha-md-dialog>
|
||||||
@@ -196,18 +193,22 @@ class HassioBackupDialog
|
|||||||
}
|
}
|
||||||
if (
|
if (
|
||||||
!(await showConfirmationDialog(this, {
|
!(await showConfirmationDialog(this, {
|
||||||
title: this._localize(
|
title: supervisor?.localize(
|
||||||
this._backup!.type === "full"
|
`backup.${
|
||||||
? "confirm_restore_full_backup_title"
|
this._backup!.type === "full"
|
||||||
: "confirm_restore_partial_backup_title"
|
? "confirm_restore_full_backup_title"
|
||||||
|
: "confirm_restore_partial_backup_title"
|
||||||
|
}`
|
||||||
),
|
),
|
||||||
text: this._localize(
|
text: supervisor?.localize(
|
||||||
this._backup!.type === "full"
|
`backup.${
|
||||||
? "confirm_restore_full_backup_text"
|
this._backup!.type === "full"
|
||||||
: "confirm_restore_partial_backup_text"
|
? "confirm_restore_full_backup_text"
|
||||||
|
: "confirm_restore_partial_backup_text"
|
||||||
|
}`
|
||||||
),
|
),
|
||||||
confirmText: this._localize("restore"),
|
confirmText: supervisor?.localize("backup.restore"),
|
||||||
dismissText: this._localize("cancel"),
|
dismissText: supervisor?.localize("backup.cancel"),
|
||||||
}))
|
}))
|
||||||
) {
|
) {
|
||||||
this._restoringBackup = false;
|
this._restoringBackup = false;
|
||||||
@@ -227,7 +228,8 @@ class HassioBackupDialog
|
|||||||
this.closeDialog();
|
this.closeDialog();
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
this._error =
|
this._error =
|
||||||
error?.body?.message || this._localize("restore_start_failed");
|
error?.body?.message ||
|
||||||
|
supervisor?.localize("backup.restore_start_failed");
|
||||||
} finally {
|
} finally {
|
||||||
this._restoringBackup = false;
|
this._restoringBackup = false;
|
||||||
}
|
}
|
||||||
@@ -286,7 +288,7 @@ class HassioBackupDialog
|
|||||||
title: supervisor.localize("backup.remote_download_title"),
|
title: supervisor.localize("backup.remote_download_title"),
|
||||||
text: supervisor.localize("backup.remote_download_text"),
|
text: supervisor.localize("backup.remote_download_text"),
|
||||||
confirmText: supervisor.localize("backup.download"),
|
confirmText: supervisor.localize("backup.download"),
|
||||||
dismissText: this._localize("cancel"),
|
dismissText: supervisor?.localize("backup.cancel"),
|
||||||
});
|
});
|
||||||
if (!confirm) {
|
if (!confirm) {
|
||||||
return;
|
return;
|
||||||
@@ -302,7 +304,7 @@ class HassioBackupDialog
|
|||||||
private get _computeName() {
|
private get _computeName() {
|
||||||
return this._backup
|
return this._backup
|
||||||
? this._backup.name || this._backup.slug
|
? this._backup.name || this._backup.slug
|
||||||
: this._localize("unnamed_backup");
|
: this._dialogParams!.supervisor?.localize("backup.unnamed_backup") || "";
|
||||||
}
|
}
|
||||||
|
|
||||||
static get styles(): CSSResultGroup {
|
static get styles(): CSSResultGroup {
|
||||||
@@ -310,10 +312,6 @@ class HassioBackupDialog
|
|||||||
haStyle,
|
haStyle,
|
||||||
haStyleDialog,
|
haStyleDialog,
|
||||||
css`
|
css`
|
||||||
ha-circular-progress {
|
|
||||||
display: block;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
ha-header-bar {
|
ha-header-bar {
|
||||||
--mdc-theme-on-primary: var(--primary-text-color);
|
--mdc-theme-on-primary: var(--primary-text-color);
|
||||||
--mdc-theme-primary: var(--mdc-theme-surface);
|
--mdc-theme-primary: var(--mdc-theme-surface);
|
||||||
|
@@ -5,6 +5,7 @@ import { customElement, property, query, state } from "lit/decorators";
|
|||||||
import { fireEvent } from "../../../../src/common/dom/fire_event";
|
import { fireEvent } from "../../../../src/common/dom/fire_event";
|
||||||
import "../../../../src/components/buttons/ha-progress-button";
|
import "../../../../src/components/buttons/ha-progress-button";
|
||||||
import "../../../../src/components/ha-alert";
|
import "../../../../src/components/ha-alert";
|
||||||
|
import "../../../../src/components/ha-spinner";
|
||||||
import { createCloseHeading } from "../../../../src/components/ha-dialog";
|
import { createCloseHeading } from "../../../../src/components/ha-dialog";
|
||||||
import {
|
import {
|
||||||
createHassioFullBackup,
|
createHassioFullBackup,
|
||||||
@@ -58,7 +59,7 @@ class HassioCreateBackupDialog extends LitElement {
|
|||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
${this._creatingBackup
|
${this._creatingBackup
|
||||||
? html`<ha-circular-progress indeterminate></ha-circular-progress>`
|
? html`<ha-spinner></ha-spinner>`
|
||||||
: html`<supervisor-backup-content
|
: html`<supervisor-backup-content
|
||||||
.hass=${this.hass}
|
.hass=${this.hass}
|
||||||
.supervisor=${this._dialogParams.supervisor}
|
.supervisor=${this._dialogParams.supervisor}
|
||||||
@@ -142,10 +143,6 @@ class HassioCreateBackupDialog extends LitElement {
|
|||||||
:host {
|
:host {
|
||||||
direction: var(--direction);
|
direction: var(--direction);
|
||||||
}
|
}
|
||||||
ha-circular-progress {
|
|
||||||
display: block;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
`,
|
`,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
@@ -1,5 +1,4 @@
|
|||||||
import { fireEvent } from "../../../../src/common/dom/fire_event";
|
import { fireEvent } from "../../../../src/common/dom/fire_event";
|
||||||
import type { LocalizeFunc } from "../../../../src/common/translations/localize";
|
|
||||||
import type { Supervisor } from "../../../../src/data/supervisor/supervisor";
|
import type { Supervisor } from "../../../../src/data/supervisor/supervisor";
|
||||||
|
|
||||||
export interface HassioBackupDialogParams {
|
export interface HassioBackupDialogParams {
|
||||||
@@ -8,7 +7,6 @@ export interface HassioBackupDialogParams {
|
|||||||
onRestoring?: () => void;
|
onRestoring?: () => void;
|
||||||
onboarding?: boolean;
|
onboarding?: boolean;
|
||||||
supervisor?: Supervisor;
|
supervisor?: Supervisor;
|
||||||
localize?: LocalizeFunc;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export const showHassioBackupDialog = (
|
export const showHassioBackupDialog = (
|
||||||
|
@@ -1,12 +1,12 @@
|
|||||||
import "@material/mwc-list/mwc-list-item";
|
|
||||||
import type { CSSResultGroup } from "lit";
|
import type { CSSResultGroup } from "lit";
|
||||||
import { css, html, LitElement, nothing } from "lit";
|
import { css, html, LitElement, nothing } from "lit";
|
||||||
import { customElement, property, state } from "lit/decorators";
|
import { customElement, property, state } from "lit/decorators";
|
||||||
import memoizeOne from "memoize-one";
|
import memoizeOne from "memoize-one";
|
||||||
import { fireEvent } from "../../../../src/common/dom/fire_event";
|
import { fireEvent } from "../../../../src/common/dom/fire_event";
|
||||||
import "../../../../src/components/ha-circular-progress";
|
|
||||||
import "../../../../src/components/ha-select";
|
|
||||||
import "../../../../src/components/ha-dialog";
|
import "../../../../src/components/ha-dialog";
|
||||||
|
import "../../../../src/components/ha-list-item";
|
||||||
|
import "../../../../src/components/ha-select";
|
||||||
|
import "../../../../src/components/ha-spinner";
|
||||||
import {
|
import {
|
||||||
extractApiErrorMessage,
|
extractApiErrorMessage,
|
||||||
ignoreSupervisorError,
|
ignoreSupervisorError,
|
||||||
@@ -69,12 +69,7 @@ class HassioDatadiskDialog extends LitElement {
|
|||||||
?hideActions=${this.moving}
|
?hideActions=${this.moving}
|
||||||
>
|
>
|
||||||
${this.moving
|
${this.moving
|
||||||
? html` <ha-circular-progress
|
? html`<ha-spinner aria-label="Moving" size="large"></ha-spinner>
|
||||||
aria-label="Moving"
|
|
||||||
size="large"
|
|
||||||
indeterminate
|
|
||||||
>
|
|
||||||
</ha-circular-progress>
|
|
||||||
<p class="progress-text">
|
<p class="progress-text">
|
||||||
${this.dialogParams.supervisor.localize(
|
${this.dialogParams.supervisor.localize(
|
||||||
"dialog.datadisk_move.moving_desc"
|
"dialog.datadisk_move.moving_desc"
|
||||||
@@ -100,8 +95,8 @@ class HassioDatadiskDialog extends LitElement {
|
|||||||
>
|
>
|
||||||
${this.devices.map(
|
${this.devices.map(
|
||||||
(device) =>
|
(device) =>
|
||||||
html`<mwc-list-item .value=${device}
|
html`<ha-list-item .value=${device}
|
||||||
>${device}</mwc-list-item
|
>${device}</ha-list-item
|
||||||
>`
|
>`
|
||||||
)}
|
)}
|
||||||
</ha-select>
|
</ha-select>
|
||||||
@@ -166,7 +161,7 @@ class HassioDatadiskDialog extends LitElement {
|
|||||||
ha-select {
|
ha-select {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
ha-circular-progress {
|
ha-spinner {
|
||||||
display: block;
|
display: block;
|
||||||
margin: 32px;
|
margin: 32px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
@@ -16,23 +16,14 @@ import type { HomeAssistant } from "../../../../src/types";
|
|||||||
import type { HassioHardwareDialogParams } from "./show-dialog-hassio-hardware";
|
import type { HassioHardwareDialogParams } from "./show-dialog-hassio-hardware";
|
||||||
|
|
||||||
const _filterDevices = memoizeOne(
|
const _filterDevices = memoizeOne(
|
||||||
(
|
(hardware: HassioHardwareInfo, filter: string, language: string) =>
|
||||||
showAdvanced: boolean,
|
|
||||||
hardware: HassioHardwareInfo,
|
|
||||||
filter: string,
|
|
||||||
language: string
|
|
||||||
) =>
|
|
||||||
hardware.devices
|
hardware.devices
|
||||||
.filter(
|
.filter(
|
||||||
(device) =>
|
(device) =>
|
||||||
(showAdvanced ||
|
device.by_id?.toLowerCase().includes(filter) ||
|
||||||
["tty", "gpio", "input"].includes(device.subsystem)) &&
|
device.name.toLowerCase().includes(filter) ||
|
||||||
(device.by_id?.toLowerCase().includes(filter) ||
|
device.dev_path.toLocaleLowerCase().includes(filter) ||
|
||||||
device.name.toLowerCase().includes(filter) ||
|
JSON.stringify(device.attributes).toLocaleLowerCase().includes(filter)
|
||||||
device.dev_path.toLocaleLowerCase().includes(filter) ||
|
|
||||||
JSON.stringify(device.attributes)
|
|
||||||
.toLocaleLowerCase()
|
|
||||||
.includes(filter))
|
|
||||||
)
|
)
|
||||||
.sort((a, b) => stringCompare(a.name, b.name, language))
|
.sort((a, b) => stringCompare(a.name, b.name, language))
|
||||||
);
|
);
|
||||||
@@ -60,7 +51,6 @@ class HassioHardwareDialog extends LitElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const devices = _filterDevices(
|
const devices = _filterDevices(
|
||||||
this.hass.userData?.showAdvanced || false,
|
|
||||||
this._dialogParams.hardware,
|
this._dialogParams.hardware,
|
||||||
(this._filter || "").toLowerCase(),
|
(this._filter || "").toLowerCase(),
|
||||||
this.hass.locale.language
|
this.hass.locale.language
|
||||||
@@ -180,7 +170,7 @@ class HassioHardwareDialog extends LitElement {
|
|||||||
padding: 16px;
|
padding: 16px;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
line-height: 1.45;
|
line-height: 1.45;
|
||||||
font-family: var(--code-font-family, monospace);
|
font-family: var(--ha-font-family-code);
|
||||||
}
|
}
|
||||||
code {
|
code {
|
||||||
font-size: 85%;
|
font-size: 85%;
|
||||||
|
@@ -38,6 +38,7 @@ class HassioMarkdownDialog extends LitElement {
|
|||||||
open
|
open
|
||||||
@closed=${this.closeDialog}
|
@closed=${this.closeDialog}
|
||||||
.heading=${createCloseHeading(this.hass, this.title)}
|
.heading=${createCloseHeading(this.hass, this.title)}
|
||||||
|
hideactions
|
||||||
>
|
>
|
||||||
<ha-markdown
|
<ha-markdown
|
||||||
.content=${this.content || ""}
|
.content=${this.content || ""}
|
||||||
|
@@ -1,8 +1,4 @@
|
|||||||
import "@material/mwc-button/mwc-button";
|
import "@material/mwc-button/mwc-button";
|
||||||
import "@material/mwc-list/mwc-list";
|
|
||||||
import "@material/mwc-list/mwc-list-item";
|
|
||||||
import "@material/mwc-tab";
|
|
||||||
import "@material/mwc-tab-bar";
|
|
||||||
import { mdiClose } from "@mdi/js";
|
import { mdiClose } from "@mdi/js";
|
||||||
import type { CSSResultGroup } from "lit";
|
import type { CSSResultGroup } from "lit";
|
||||||
import { css, html, LitElement, nothing } from "lit";
|
import { css, html, LitElement, nothing } from "lit";
|
||||||
@@ -10,14 +6,16 @@ import { customElement, property, state } from "lit/decorators";
|
|||||||
import { cache } from "lit/directives/cache";
|
import { cache } from "lit/directives/cache";
|
||||||
import { fireEvent } from "../../../../src/common/dom/fire_event";
|
import { fireEvent } from "../../../../src/common/dom/fire_event";
|
||||||
import "../../../../src/components/ha-alert";
|
import "../../../../src/components/ha-alert";
|
||||||
import "../../../../src/components/ha-circular-progress";
|
|
||||||
import "../../../../src/components/ha-dialog";
|
import "../../../../src/components/ha-dialog";
|
||||||
import "../../../../src/components/ha-expansion-panel";
|
import "../../../../src/components/ha-expansion-panel";
|
||||||
import "../../../../src/components/ha-formfield";
|
import "../../../../src/components/ha-formfield";
|
||||||
import "../../../../src/components/ha-header-bar";
|
import "../../../../src/components/ha-header-bar";
|
||||||
import "../../../../src/components/ha-icon-button";
|
import "../../../../src/components/ha-icon-button";
|
||||||
|
import "../../../../src/components/ha-list";
|
||||||
|
import "../../../../src/components/ha-list-item";
|
||||||
import "../../../../src/components/ha-password-field";
|
import "../../../../src/components/ha-password-field";
|
||||||
import "../../../../src/components/ha-radio";
|
import "../../../../src/components/ha-radio";
|
||||||
|
import "../../../../src/components/ha-spinner";
|
||||||
import "../../../../src/components/ha-textfield";
|
import "../../../../src/components/ha-textfield";
|
||||||
import type { HaTextField } from "../../../../src/components/ha-textfield";
|
import type { HaTextField } from "../../../../src/components/ha-textfield";
|
||||||
import { extractApiErrorMessage } from "../../../../src/data/hassio/common";
|
import { extractApiErrorMessage } from "../../../../src/data/hassio/common";
|
||||||
@@ -39,6 +37,7 @@ import type { HassDialog } from "../../../../src/dialogs/make-dialog-manager";
|
|||||||
import { haStyleDialog } from "../../../../src/resources/styles";
|
import { haStyleDialog } from "../../../../src/resources/styles";
|
||||||
import type { HomeAssistant } from "../../../../src/types";
|
import type { HomeAssistant } from "../../../../src/types";
|
||||||
import type { HassioNetworkDialogParams } from "./show-dialog-network";
|
import type { HassioNetworkDialogParams } from "./show-dialog-network";
|
||||||
|
import "../../../../src/components/sl-tab-group";
|
||||||
|
|
||||||
const IP_VERSIONS = ["ipv4", "ipv6"];
|
const IP_VERSIONS = ["ipv4", "ipv6"];
|
||||||
|
|
||||||
@@ -116,19 +115,19 @@ export class DialogHassioNetwork
|
|||||||
></ha-icon-button>
|
></ha-icon-button>
|
||||||
</ha-header-bar>
|
</ha-header-bar>
|
||||||
${this._interfaces.length > 1
|
${this._interfaces.length > 1
|
||||||
? html`<mwc-tab-bar
|
? html`<sl-tab-group @sl-tab-show=${this._handleTabActivated}
|
||||||
.activeIndex=${this._curTabIndex}
|
|
||||||
@MDCTabBar:activated=${this._handleTabActivated}
|
|
||||||
>${this._interfaces.map(
|
>${this._interfaces.map(
|
||||||
(device) =>
|
(device, index) =>
|
||||||
html`<mwc-tab
|
html`<sl-tab
|
||||||
|
slot="nav"
|
||||||
.id=${device.interface}
|
.id=${device.interface}
|
||||||
.label=${device.interface}
|
.panel=${index.toString()}
|
||||||
dialogInitialFocus
|
.active=${this._curTabIndex === index}
|
||||||
>
|
>
|
||||||
</mwc-tab>`
|
${device.interface}
|
||||||
|
</sl-tab>`
|
||||||
)}
|
)}
|
||||||
</mwc-tab-bar>`
|
</sl-tab-group>`
|
||||||
: ""}
|
: ""}
|
||||||
</div>
|
</div>
|
||||||
${cache(this._renderTab())}
|
${cache(this._renderTab())}
|
||||||
@@ -161,24 +160,20 @@ export class DialogHassioNetwork
|
|||||||
.disabled=${this._scanning}
|
.disabled=${this._scanning}
|
||||||
>
|
>
|
||||||
${this._scanning
|
${this._scanning
|
||||||
? html`<ha-circular-progress
|
? html`<ha-spinner aria-label="Scanning" size="small">
|
||||||
aria-label="Scanning"
|
</ha-spinner>`
|
||||||
indeterminate
|
|
||||||
size="small"
|
|
||||||
>
|
|
||||||
</ha-circular-progress>`
|
|
||||||
: this.supervisor.localize("dialog.network.scan_ap")}
|
: this.supervisor.localize("dialog.network.scan_ap")}
|
||||||
</mwc-button>
|
</mwc-button>
|
||||||
${this._accessPoints &&
|
${this._accessPoints &&
|
||||||
this._accessPoints.accesspoints &&
|
this._accessPoints.accesspoints &&
|
||||||
this._accessPoints.accesspoints.length !== 0
|
this._accessPoints.accesspoints.length !== 0
|
||||||
? html`
|
? html`
|
||||||
<mwc-list>
|
<ha-list>
|
||||||
${this._accessPoints.accesspoints
|
${this._accessPoints.accesspoints
|
||||||
.filter((ap) => ap.ssid)
|
.filter((ap) => ap.ssid)
|
||||||
.map(
|
.map(
|
||||||
(ap) => html`
|
(ap) => html`
|
||||||
<mwc-list-item
|
<ha-list-item
|
||||||
twoline
|
twoline
|
||||||
@click=${this._selectAP}
|
@click=${this._selectAP}
|
||||||
.activated=${ap.ssid ===
|
.activated=${ap.ssid ===
|
||||||
@@ -193,10 +188,10 @@ export class DialogHassioNetwork
|
|||||||
)}:
|
)}:
|
||||||
${ap.signal}
|
${ap.signal}
|
||||||
</span>
|
</span>
|
||||||
</mwc-list-item>
|
</ha-list-item>
|
||||||
`
|
`
|
||||||
)}
|
)}
|
||||||
</mwc-list>
|
</ha-list>
|
||||||
`
|
`
|
||||||
: ""}
|
: ""}
|
||||||
${this._wifiConfiguration
|
${this._wifiConfiguration
|
||||||
@@ -282,8 +277,7 @@ export class DialogHassioNetwork
|
|||||||
</mwc-button>
|
</mwc-button>
|
||||||
<mwc-button @click=${this._updateNetwork} .disabled=${!this._dirty}>
|
<mwc-button @click=${this._updateNetwork} .disabled=${!this._dirty}>
|
||||||
${this._processing
|
${this._processing
|
||||||
? html`<ha-circular-progress indeterminate size="small">
|
? html`<ha-spinner size="small"> </ha-spinner>`
|
||||||
</ha-circular-progress>`
|
|
||||||
: this.supervisor.localize("common.save")}
|
: this.supervisor.localize("common.save")}
|
||||||
</mwc-button>
|
</mwc-button>
|
||||||
</div>`;
|
</div>`;
|
||||||
@@ -490,8 +484,8 @@ export class DialogHassioNetwork
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this._curTabIndex = ev.detail.index;
|
this._curTabIndex = Number(ev.detail.name);
|
||||||
this._interface = { ...this._interfaces[ev.detail.index] };
|
this._interface = { ...this._interfaces[this._curTabIndex] };
|
||||||
}
|
}
|
||||||
|
|
||||||
private _handleRadioValueChanged(ev: CustomEvent): void {
|
private _handleRadioValueChanged(ev: CustomEvent): void {
|
||||||
@@ -565,11 +559,6 @@ export class DialogHassioNetwork
|
|||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
mwc-tab-bar {
|
|
||||||
border-bottom: 1px solid
|
|
||||||
var(--mdc-dialog-scroll-divider-color, rgba(0, 0, 0, 0.12));
|
|
||||||
}
|
|
||||||
|
|
||||||
ha-dialog {
|
ha-dialog {
|
||||||
--dialog-content-position: static;
|
--dialog-content-position: static;
|
||||||
--dialog-content-padding: 0;
|
--dialog-content-padding: 0;
|
||||||
@@ -639,9 +628,17 @@ export class DialogHassioNetwork
|
|||||||
ha-textfield {
|
ha-textfield {
|
||||||
padding: 0 14px;
|
padding: 0 14px;
|
||||||
}
|
}
|
||||||
mwc-list-item {
|
ha-list-item {
|
||||||
--mdc-list-side-padding: 10px;
|
--mdc-list-side-padding: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sl-tab {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
sl-tab::part(base) {
|
||||||
|
width: 100%;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
`,
|
`,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
import "@material/mwc-button/mwc-button";
|
import "@material/mwc-button/mwc-button";
|
||||||
import { mdiDelete, mdiDeleteOff } from "@mdi/js";
|
import { mdiDelete, mdiDeleteOff } from "@mdi/js";
|
||||||
import "@lrnwebcomponents/simple-tooltip/simple-tooltip";
|
|
||||||
import type { CSSResultGroup } from "lit";
|
import type { CSSResultGroup } from "lit";
|
||||||
import { css, html, LitElement, nothing } from "lit";
|
import { css, html, LitElement, nothing } from "lit";
|
||||||
import { customElement, property, query, state } from "lit/decorators";
|
import { customElement, property, query, state } from "lit/decorators";
|
||||||
@@ -8,7 +7,8 @@ import memoizeOne from "memoize-one";
|
|||||||
import { fireEvent } from "../../../../src/common/dom/fire_event";
|
import { fireEvent } from "../../../../src/common/dom/fire_event";
|
||||||
import { caseInsensitiveStringCompare } from "../../../../src/common/string/compare";
|
import { caseInsensitiveStringCompare } from "../../../../src/common/string/compare";
|
||||||
import "../../../../src/components/ha-alert";
|
import "../../../../src/components/ha-alert";
|
||||||
import "../../../../src/components/ha-circular-progress";
|
import "../../../../src/components/ha-tooltip";
|
||||||
|
import "../../../../src/components/ha-spinner";
|
||||||
import { createCloseHeading } from "../../../../src/components/ha-dialog";
|
import { createCloseHeading } from "../../../../src/components/ha-dialog";
|
||||||
import "../../../../src/components/ha-icon-button";
|
import "../../../../src/components/ha-icon-button";
|
||||||
import type {
|
import type {
|
||||||
@@ -118,28 +118,27 @@ class HassioRepositoriesDialog extends LitElement {
|
|||||||
<div>${repo.maintainer}</div>
|
<div>${repo.maintainer}</div>
|
||||||
<div>${repo.url}</div>
|
<div>${repo.url}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="delete" slot="end">
|
<ha-tooltip
|
||||||
<ha-icon-button
|
class="delete"
|
||||||
.disabled=${usedRepositories.includes(repo.slug)}
|
slot="end"
|
||||||
.slug=${repo.slug}
|
.content=${this._dialogParams!.supervisor.localize(
|
||||||
.path=${usedRepositories.includes(repo.slug)
|
usedRepositories.includes(repo.slug)
|
||||||
? mdiDeleteOff
|
? "dialog.repositories.used"
|
||||||
: mdiDelete}
|
: "dialog.repositories.remove"
|
||||||
@click=${this._removeRepository}
|
)}
|
||||||
>
|
>
|
||||||
</ha-icon-button>
|
<div>
|
||||||
<simple-tooltip
|
<ha-icon-button
|
||||||
animation-delay="0"
|
.disabled=${usedRepositories.includes(repo.slug)}
|
||||||
position="bottom"
|
.slug=${repo.slug}
|
||||||
offset="1"
|
.path=${usedRepositories.includes(repo.slug)
|
||||||
>
|
? mdiDeleteOff
|
||||||
${this._dialogParams!.supervisor.localize(
|
: mdiDelete}
|
||||||
usedRepositories.includes(repo.slug)
|
@click=${this._removeRepository}
|
||||||
? "dialog.repositories.used"
|
>
|
||||||
: "dialog.repositories.remove"
|
</ha-icon-button>
|
||||||
)}
|
</div>
|
||||||
</simple-tooltip>
|
</ha-tooltip>
|
||||||
</div>
|
|
||||||
</ha-md-list-item>
|
</ha-md-list-item>
|
||||||
`
|
`
|
||||||
)
|
)
|
||||||
@@ -162,10 +161,7 @@ class HassioRepositoriesDialog extends LitElement {
|
|||||||
></ha-textfield>
|
></ha-textfield>
|
||||||
<mwc-button @click=${this._addRepository}>
|
<mwc-button @click=${this._addRepository}>
|
||||||
${this._processing
|
${this._processing
|
||||||
? html`<ha-circular-progress
|
? html`<ha-spinner size="small"></ha-spinner>`
|
||||||
indeterminate
|
|
||||||
size="small"
|
|
||||||
></ha-circular-progress>`
|
|
||||||
: this._dialogParams!.supervisor.localize(
|
: this._dialogParams!.supervisor.localize(
|
||||||
"dialog.repositories.add"
|
"dialog.repositories.add"
|
||||||
)}
|
)}
|
||||||
@@ -187,9 +183,6 @@ class HassioRepositoriesDialog extends LitElement {
|
|||||||
ha-dialog.button-left {
|
ha-dialog.button-left {
|
||||||
--justify-action-buttons: flex-start;
|
--justify-action-buttons: flex-start;
|
||||||
}
|
}
|
||||||
paper-icon-item {
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
.form {
|
.form {
|
||||||
color: var(--primary-text-color);
|
color: var(--primary-text-color);
|
||||||
}
|
}
|
||||||
@@ -203,7 +196,7 @@ class HassioRepositoriesDialog extends LitElement {
|
|||||||
margin-inline-start: 8px;
|
margin-inline-start: 8px;
|
||||||
margin-inline-end: initial;
|
margin-inline-end: initial;
|
||||||
}
|
}
|
||||||
ha-circular-progress {
|
ha-spinner {
|
||||||
display: block;
|
display: block;
|
||||||
margin: 32px;
|
margin: 32px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user