Compare commits
625 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
8eeb8f3f10 | ||
![]() |
31b69f676c | ||
![]() |
9fc3b41247 | ||
![]() |
af946a4a51 | ||
![]() |
85a69ed922 | ||
![]() |
80a4b7bdfc | ||
![]() |
bcbc6e3b46 | ||
![]() |
4828156c7a | ||
![]() |
93119dbfca | ||
![]() |
393c113d77 | ||
![]() |
a6e5c317ae | ||
![]() |
5d22cab164 | ||
![]() |
745923d0b9 | ||
![]() |
e6e3c59e63 | ||
![]() |
55bc4f47bb | ||
![]() |
6484a1baff | ||
![]() |
493186ce53 | ||
![]() |
9a72184f94 | ||
![]() |
6e845eff7d | ||
![]() |
5596dce8ef | ||
![]() |
48b2547759 | ||
![]() |
f616cb9b8f | ||
![]() |
4441bc7e05 | ||
![]() |
7b249a82d7 | ||
![]() |
d8f4c29073 | ||
![]() |
f5485fae2f | ||
![]() |
0bd1700872 | ||
![]() |
e7ac91a322 | ||
![]() |
dc42a2a992 | ||
![]() |
846f1cca16 | ||
![]() |
c11f43b637 | ||
![]() |
6a02bb7f51 | ||
![]() |
2238a231f0 | ||
![]() |
c5c4168afe | ||
![]() |
f49f37992d | ||
![]() |
6fe08475ff | ||
![]() |
99618d75ec | ||
![]() |
f8f2d007a2 | ||
![]() |
4db27f4623 | ||
![]() |
5cd4209ec5 | ||
![]() |
1bd5204d24 | ||
![]() |
c6bd1358e3 | ||
![]() |
d6c9ce84ea | ||
![]() |
1fdf5367b6 | ||
![]() |
e5234b0945 | ||
![]() |
a146505c5a | ||
![]() |
20a1ae3374 | ||
![]() |
8a19a93b4d | ||
![]() |
f9c51e04e1 | ||
![]() |
1afc212e71 | ||
![]() |
d44224d23e | ||
![]() |
e1cca33379 | ||
![]() |
e48936484d | ||
![]() |
911b72508b | ||
![]() |
8575555204 | ||
![]() |
4775632c51 | ||
![]() |
b198864063 | ||
![]() |
0896844e96 | ||
![]() |
3c27e8105e | ||
![]() |
269971ab60 | ||
![]() |
b98bde71df | ||
![]() |
0238515b42 | ||
![]() |
be2f2f4575 | ||
![]() |
38494c9704 | ||
![]() |
fa6fa3f1ea | ||
![]() |
8632f1eedf | ||
![]() |
944c7b072b | ||
![]() |
a08df2fd12 | ||
![]() |
c0804b6940 | ||
![]() |
ebdc2e4105 | ||
![]() |
a0a4346cc4 | ||
![]() |
336cac78c7 | ||
![]() |
fc9389ab30 | ||
![]() |
eb52a37f77 | ||
![]() |
cc68ad492a | ||
![]() |
a1c3829572 | ||
![]() |
32890f17c0 | ||
![]() |
3f8ee9b4fc | ||
![]() |
3eb15a6e66 | ||
![]() |
b62f54ef05 | ||
![]() |
95abe8bb4d | ||
![]() |
8f3ab68705 | ||
![]() |
dce6df7783 | ||
![]() |
7b3426d2f9 | ||
![]() |
0cfbdf368f | ||
![]() |
e7bc93a5e2 | ||
![]() |
d9559f2a8f | ||
![]() |
6531c7eaa7 | ||
![]() |
986bdf8e24 | ||
![]() |
2188eef202 | ||
![]() |
87850edc0e | ||
![]() |
3a9c69d828 | ||
![]() |
ff64d949ec | ||
![]() |
596ef10ba4 | ||
![]() |
ba1008cc95 | ||
![]() |
89173d0f58 | ||
![]() |
736f3728f6 | ||
![]() |
d5d2341e69 | ||
![]() |
b9cdae6832 | ||
![]() |
c6565d0246 | ||
![]() |
84503a87c2 | ||
![]() |
d454a16ff6 | ||
![]() |
fb90ae7b93 | ||
![]() |
8241bb2679 | ||
![]() |
fac506e0b3 | ||
![]() |
34e9c47508 | ||
![]() |
b1512df789 | ||
![]() |
902d63d302 | ||
![]() |
0d83541ebb | ||
![]() |
69d51ec091 | ||
![]() |
5bf0ffeae9 | ||
![]() |
e1e21554e8 | ||
![]() |
6331cd1fab | ||
![]() |
44d335fb7f | ||
![]() |
7f729bb839 | ||
![]() |
515e46ea08 | ||
![]() |
b837a23fbe | ||
![]() |
8ace6dc92e | ||
![]() |
2cffcbefa4 | ||
![]() |
97d9173821 | ||
![]() |
8a2a0d8013 | ||
![]() |
f3096a0a08 | ||
![]() |
378f020f01 | ||
![]() |
0776ae0090 | ||
![]() |
12165e480b | ||
![]() |
9cb93d7971 | ||
![]() |
a20756aec4 | ||
![]() |
40df352872 | ||
![]() |
94c5353328 | ||
![]() |
c411394149 | ||
![]() |
8fce065c18 | ||
![]() |
a628df7591 | ||
![]() |
0c84032726 | ||
![]() |
4e0854d5ea | ||
![]() |
f210c82af3 | ||
![]() |
938d9bfcdc | ||
![]() |
bb97b55af2 | ||
![]() |
6e3aa05f4e | ||
![]() |
aae0f9a3cb | ||
![]() |
ef0d517982 | ||
![]() |
b8aeadf4d6 | ||
![]() |
27ebf58ff9 | ||
![]() |
cbbd9aa742 | ||
![]() |
20c397695f | ||
![]() |
87dd6d343d | ||
![]() |
9766184c59 | ||
![]() |
926fce143e | ||
![]() |
c466dcb594 | ||
![]() |
966941b646 | ||
![]() |
0468035b46 | ||
![]() |
686d444f0d | ||
![]() |
59f61f97b3 | ||
![]() |
a89849a129 | ||
![]() |
70622551ff | ||
![]() |
bca3f78c0b | ||
![]() |
e11c0548e0 | ||
![]() |
33ebe81793 | ||
![]() |
dcf071bdf2 | ||
![]() |
650d2ac24e | ||
![]() |
e18105632b | ||
![]() |
6d34826036 | ||
![]() |
36bd5f9ed7 | ||
![]() |
c180f3faff | ||
![]() |
76b81f8605 | ||
![]() |
e08227cf4c | ||
![]() |
7321fd3d4f | ||
![]() |
d680c345e1 | ||
![]() |
16fdacdafb | ||
![]() |
487400f00d | ||
![]() |
0df75cdd48 | ||
![]() |
8bcd849b83 | ||
![]() |
6610563241 | ||
![]() |
0e732a548b | ||
![]() |
dced067821 | ||
![]() |
f279f1a1e5 | ||
![]() |
db3b8cc718 | ||
![]() |
77058c0472 | ||
![]() |
c35c8791f9 | ||
![]() |
b94c97017c | ||
![]() |
37fc878f37 | ||
![]() |
fac5b7bb3f | ||
![]() |
ff860fbb0c | ||
![]() |
7624405bb4 | ||
![]() |
24bc15c4ea | ||
![]() |
3fd69a1c29 | ||
![]() |
6cdcd96902 | ||
![]() |
9257824f45 | ||
![]() |
fb474d96fd | ||
![]() |
ba67449f03 | ||
![]() |
2bdb85a420 | ||
![]() |
c008a3478e | ||
![]() |
a5ecdeb5ea | ||
![]() |
82e3348122 | ||
![]() |
4c659b80fd | ||
![]() |
ba10b89006 | ||
![]() |
496f0288dc | ||
![]() |
a90496dc1b | ||
![]() |
f7eeb8df14 | ||
![]() |
99c6c5220a | ||
![]() |
19f0ea4310 | ||
![]() |
e88fc8a2b4 | ||
![]() |
3ed5ccd2ee | ||
![]() |
f9a493a53e | ||
![]() |
75b7811541 | ||
![]() |
589b7ea46c | ||
![]() |
2505ee89d0 | ||
![]() |
ab9d436057 | ||
![]() |
7c75089b71 | ||
![]() |
548257ba8b | ||
![]() |
02ff97990c | ||
![]() |
dfbe19b4d0 | ||
![]() |
4ded6f6528 | ||
![]() |
f21e6efad3 | ||
![]() |
5089b444b1 | ||
![]() |
9ad5d10bda | ||
![]() |
9719017bf6 | ||
![]() |
08d476a9cf | ||
![]() |
a2b633d3a5 | ||
![]() |
f7f7bccbe3 | ||
![]() |
14723732f2 | ||
![]() |
19b23f61bb | ||
![]() |
45de0d3936 | ||
![]() |
b96e200d4a | ||
![]() |
bdea4109c8 | ||
![]() |
be7fabd4ce | ||
![]() |
68aab556d6 | ||
![]() |
2fad5b741e | ||
![]() |
1bf95721dd | ||
![]() |
0e4f141075 | ||
![]() |
7cd74373be | ||
![]() |
15d959e871 | ||
![]() |
aac6d024ae | ||
![]() |
80e67fed22 | ||
![]() |
05a19b188b | ||
![]() |
f706034efb | ||
![]() |
e8538a970b | ||
![]() |
f5013096d2 | ||
![]() |
639b8e561c | ||
![]() |
fe03ca12ed | ||
![]() |
375a98b013 | ||
![]() |
522ce2d8a6 | ||
![]() |
6a981ae30b | ||
![]() |
3851206185 | ||
![]() |
beed2d44ca | ||
![]() |
860f1e39fb | ||
![]() |
956d3dc6b1 | ||
![]() |
3582addb62 | ||
![]() |
e392ede4c1 | ||
![]() |
61ee0c4d02 | ||
![]() |
e451190e3c | ||
![]() |
cf83bd3798 | ||
![]() |
4165056c12 | ||
![]() |
596d75adc1 | ||
![]() |
45f6e59583 | ||
![]() |
ff3f606aea | ||
![]() |
e7311a21e9 | ||
![]() |
c4a4255a7a | ||
![]() |
247053665c | ||
![]() |
141c890b9c | ||
![]() |
ccb5d90634 | ||
![]() |
8c61b8a778 | ||
![]() |
093aa66797 | ||
![]() |
669c339f87 | ||
![]() |
e6ab403e3e | ||
![]() |
fcbcdfe660 | ||
![]() |
450073d418 | ||
![]() |
8b0ba30b9f | ||
![]() |
34abc9813b | ||
![]() |
3df0c71a5a | ||
![]() |
1d9206886a | ||
![]() |
4b346b5428 | ||
![]() |
5f51049c1a | ||
![]() |
5e1f652225 | ||
![]() |
1622977991 | ||
![]() |
9a5021110d | ||
![]() |
05d842b69b | ||
![]() |
4a24bd5d90 | ||
![]() |
0fdc780eca | ||
![]() |
6f8bf46c01 | ||
![]() |
7de78365b0 | ||
![]() |
5f87123fb2 | ||
![]() |
fa1cb5fb4b | ||
![]() |
d973d6c60f | ||
![]() |
b002c59578 | ||
![]() |
ec981dc24d | ||
![]() |
12d625f561 | ||
![]() |
37a7d32bc8 | ||
![]() |
044a39abc9 | ||
![]() |
7bedfc5122 | ||
![]() |
1031b2912c | ||
![]() |
732e494400 | ||
![]() |
0a700fc6c3 | ||
![]() |
af069f25e2 | ||
![]() |
c50257fec4 | ||
![]() |
025927577e | ||
![]() |
39bbe54992 | ||
![]() |
f94c7fd607 | ||
![]() |
e3a0a4bc5e | ||
![]() |
44ab6cf9b7 | ||
![]() |
1c23db3b55 | ||
![]() |
ac727885c4 | ||
![]() |
0e8482e28d | ||
![]() |
46720e3236 | ||
![]() |
c3693f5d44 | ||
![]() |
d4f3c6ebf4 | ||
![]() |
3cc4c5d1b4 | ||
![]() |
5cea920270 | ||
![]() |
0dcba9861a | ||
![]() |
03e299ecc6 | ||
![]() |
5e1e63c37b | ||
![]() |
59e73616cd | ||
![]() |
e03e96f61b | ||
![]() |
01cd2cc4b1 | ||
![]() |
f00a4cf38f | ||
![]() |
9d5860a452 | ||
![]() |
24bbbd3e96 | ||
![]() |
673cc2f9f9 | ||
![]() |
db12702baa | ||
![]() |
807cb0aac4 | ||
![]() |
4033885eb7 | ||
![]() |
4deee0d6c1 | ||
![]() |
58ef772764 | ||
![]() |
f9707f796e | ||
![]() |
37f4be68aa | ||
![]() |
84a4491104 | ||
![]() |
2b2453a397 | ||
![]() |
cc6443bb6c | ||
![]() |
58482ecc63 | ||
![]() |
00b9a3e773 | ||
![]() |
249d487813 | ||
![]() |
f6176eca6f | ||
![]() |
f4cf07b565 | ||
![]() |
581b31964e | ||
![]() |
01bc47a6b7 | ||
![]() |
7fc5228297 | ||
![]() |
6153a8ba9f | ||
![]() |
adf029cf72 | ||
![]() |
aa2989d485 | ||
![]() |
df9abb0241 | ||
![]() |
d54e6125f4 | ||
![]() |
fe6516ac44 | ||
![]() |
7a59edbe71 | ||
![]() |
f7f3ef181d | ||
![]() |
b303291ec4 | ||
![]() |
89b67e534e | ||
![]() |
928d60985b | ||
![]() |
403f988248 | ||
![]() |
2099b1b3c2 | ||
![]() |
8ab5e2f976 | ||
![]() |
92227484ac | ||
![]() |
2ede6f6a83 | ||
![]() |
dce39a6075 | ||
![]() |
15e6c42692 | ||
![]() |
f061ff53f2 | ||
![]() |
b8a0207078 | ||
![]() |
4ec09ad650 | ||
![]() |
59f1f5e986 | ||
![]() |
91bdefd9ba | ||
![]() |
382c47aae0 | ||
![]() |
b6bcb852e5 | ||
![]() |
a91a2604dc | ||
![]() |
43e9768819 | ||
![]() |
b45da4edc8 | ||
![]() |
f42abb3c52 | ||
![]() |
ac171b1d61 | ||
![]() |
62a1ce526a | ||
![]() |
ce4abc28a7 | ||
![]() |
c9bafa74d1 | ||
![]() |
37f324a458 | ||
![]() |
bb2a4c69ad | ||
![]() |
c1b70332fc | ||
![]() |
0270b56185 | ||
![]() |
e09351760d | ||
![]() |
bba98b46f5 | ||
![]() |
874cf0ed7d | ||
![]() |
9ba0cbb3c7 | ||
![]() |
3587f179a4 | ||
![]() |
5a9b4e56b7 | ||
![]() |
71780a707a | ||
![]() |
8e390eef05 | ||
![]() |
96f1342c84 | ||
![]() |
2f93202d1d | ||
![]() |
29ba16a68f | ||
![]() |
5da0ef1f0d | ||
![]() |
878e846150 | ||
![]() |
aebbe3dbfd | ||
![]() |
b9132ac5cb | ||
![]() |
bbbaaaa61c | ||
![]() |
9795efd965 | ||
![]() |
c350b99465 | ||
![]() |
6a64ea5254 | ||
![]() |
ad469c08fe | ||
![]() |
661ada154e | ||
![]() |
a8bbdea224 | ||
![]() |
4c0bf62b7b | ||
![]() |
f5b096e6d4 | ||
![]() |
463edc2822 | ||
![]() |
02ef0fcd5e | ||
![]() |
556f622527 | ||
![]() |
8bb194ddda | ||
![]() |
4a040be01e | ||
![]() |
8d90dcca0e | ||
![]() |
9f7643b0d3 | ||
![]() |
528852ba83 | ||
![]() |
7d92f24a02 | ||
![]() |
d66afd0e13 | ||
![]() |
e1c3329d75 | ||
![]() |
a8635d0882 | ||
![]() |
0c75e46a3b | ||
![]() |
450349b006 | ||
![]() |
b416570ebf | ||
![]() |
bb6b4921b4 | ||
![]() |
857fb7feeb | ||
![]() |
84dbe1f2df | ||
![]() |
96d86ca93f | ||
![]() |
47a5362863 | ||
![]() |
f7740e3030 | ||
![]() |
1187dfe4a9 | ||
![]() |
e652800a65 | ||
![]() |
12bc1025c7 | ||
![]() |
800720e578 | ||
![]() |
aba9c73974 | ||
![]() |
8faafb1014 | ||
![]() |
88f1816c62 | ||
![]() |
35e8e5f525 | ||
![]() |
2d845069c1 | ||
![]() |
64c65d35c9 | ||
![]() |
8925b20447 | ||
![]() |
ca0680519c | ||
![]() |
e9036ebeac | ||
![]() |
f35d47ee4f | ||
![]() |
d6e6e7e511 | ||
![]() |
903fa12ac4 | ||
![]() |
9071c8ca23 | ||
![]() |
6bff52c951 | ||
![]() |
7c450ec6b2 | ||
![]() |
e791190558 | ||
![]() |
a6e6c425a5 | ||
![]() |
14dcb22afe | ||
![]() |
1e25a45b4a | ||
![]() |
3e5a722b66 | ||
![]() |
524e5511c9 | ||
![]() |
946306c28b | ||
![]() |
c2d9416fec | ||
![]() |
d55f54d90b | ||
![]() |
cbb6a7ab9a | ||
![]() |
2e7caf7118 | ||
![]() |
bf56659907 | ||
![]() |
dfa95dbd78 | ||
![]() |
d41021b3cc | ||
![]() |
0ddc1bed76 | ||
![]() |
8f7f10dc8f | ||
![]() |
dea7ee8ee1 | ||
![]() |
b79d618aaa | ||
![]() |
b2c0af2307 | ||
![]() |
44cf23ec08 | ||
![]() |
7b9cc47875 | ||
![]() |
6e59ea007c | ||
![]() |
f580c72f1d | ||
![]() |
1ae91b3ea7 | ||
![]() |
60d7f546c1 | ||
![]() |
a3c834696d | ||
![]() |
00e33d6d1e | ||
![]() |
c9de6ef26b | ||
![]() |
8660d0ced4 | ||
![]() |
23fa0c100c | ||
![]() |
8376a049ad | ||
![]() |
7bd26b542a | ||
![]() |
949ec282c1 | ||
![]() |
00652f59c3 | ||
![]() |
0502410b22 | ||
![]() |
34eac02101 | ||
![]() |
480db40f10 | ||
![]() |
4ad047aed7 | ||
![]() |
d50e59eadb | ||
![]() |
067f5b3342 | ||
![]() |
c23c696adf | ||
![]() |
ea50332799 | ||
![]() |
9ce04e4945 | ||
![]() |
39d7ebb7e9 | ||
![]() |
6c97c8bd20 | ||
![]() |
c32d8f3497 | ||
![]() |
73d27a6a49 | ||
![]() |
aa3be39f89 | ||
![]() |
7c0317f38a | ||
![]() |
c2f759f52a | ||
![]() |
347f1c4840 | ||
![]() |
24bb1d70da | ||
![]() |
3187545bb7 | ||
![]() |
e6f5a3d93f | ||
![]() |
387ff7d950 | ||
![]() |
84f5d558fb | ||
![]() |
22452d9da6 | ||
![]() |
373429ce57 | ||
![]() |
a697e063a6 | ||
![]() |
25131a5e92 | ||
![]() |
8f9d6b2be8 | ||
![]() |
bc78ef49c6 | ||
![]() |
c25e7cab77 | ||
![]() |
e391524d69 | ||
![]() |
bbf3faf1e3 | ||
![]() |
902deb020b | ||
![]() |
a37d28d6db | ||
![]() |
f547122b41 | ||
![]() |
a9f9560728 | ||
![]() |
48cf9d4008 | ||
![]() |
2dd527864e | ||
![]() |
1364a69b35 | ||
![]() |
bd33689d8b | ||
![]() |
e1fad67107 | ||
![]() |
aa63b04e2a | ||
![]() |
81b0b63da4 | ||
![]() |
aaf575354d | ||
![]() |
d4428d1fc3 | ||
![]() |
debac7551b | ||
![]() |
eaf5b6166d | ||
![]() |
d931d88d69 | ||
![]() |
f64d5dfb82 | ||
![]() |
329ae39e96 | ||
![]() |
f381176333 | ||
![]() |
6ddfc8b924 | ||
![]() |
1df4e83e4a | ||
![]() |
ee8a6e7e7a | ||
![]() |
d54b17e2f3 | ||
![]() |
efc61d9e26 | ||
![]() |
6c52e0496d | ||
![]() |
01664bf104 | ||
![]() |
b19916513e | ||
![]() |
df715595de | ||
![]() |
58e5ab2e7c | ||
![]() |
3fd4318062 | ||
![]() |
ccb72b3c5d | ||
![]() |
13eb3ed832 | ||
![]() |
03c2e214e1 | ||
![]() |
589b5f698c | ||
![]() |
522eb03086 | ||
![]() |
621ac4feee | ||
![]() |
5e8489fff3 | ||
![]() |
56c4e802fe | ||
![]() |
dccf627506 | ||
![]() |
94def009c2 | ||
![]() |
82a57957b1 | ||
![]() |
04a0e91175 | ||
![]() |
77273fe052 | ||
![]() |
82ffa7a499 | ||
![]() |
6c86ea5e7a | ||
![]() |
1ba2b6a4cc | ||
![]() |
57bf1008b0 | ||
![]() |
078582e40c | ||
![]() |
c8a963ae14 | ||
![]() |
32ed3d16fd | ||
![]() |
70467e2924 | ||
![]() |
c9e12c666e | ||
![]() |
f2e082e732 | ||
![]() |
0f8a38b807 | ||
![]() |
ee936b74bf | ||
![]() |
3a24d91aa4 | ||
![]() |
42ae468780 | ||
![]() |
1fda886849 | ||
![]() |
3bf66f1346 | ||
![]() |
93084d57b0 | ||
![]() |
eb72951ec6 | ||
![]() |
ea78c46bb4 | ||
![]() |
fac1c8ec88 | ||
![]() |
a494e03f3d | ||
![]() |
8b5d50bf8b | ||
![]() |
b512353dfb | ||
![]() |
a18afbb6dc | ||
![]() |
70a333e790 | ||
![]() |
fc55327df5 | ||
![]() |
aa93bc3d74 | ||
![]() |
3ad1f4f59e | ||
![]() |
576e63584a | ||
![]() |
974879b54d | ||
![]() |
1cfe0637f4 | ||
![]() |
f58a9bcaf6 | ||
![]() |
dd6d71f023 | ||
![]() |
140eb5bd6a | ||
![]() |
16f41aad69 | ||
![]() |
323e57d2b1 | ||
![]() |
ba550b9617 | ||
![]() |
4afcfcb41a | ||
![]() |
06da6970cb | ||
![]() |
5a8e71f2f2 | ||
![]() |
38164d3136 | ||
![]() |
7ebc00a140 | ||
![]() |
49c05b9e5f | ||
![]() |
24381a9081 | ||
![]() |
1a0acad3c2 | ||
![]() |
206cf974c0 | ||
![]() |
d42fe4f107 | ||
![]() |
60e095fbc7 | ||
![]() |
b54d99ff3d | ||
![]() |
f3edf9a469 | ||
![]() |
a7ba9d88c3 | ||
![]() |
dc00aa4836 | ||
![]() |
d1a2932245 | ||
![]() |
26d7dc3031 | ||
![]() |
48ff7d7d5a | ||
![]() |
bc71547d92 | ||
![]() |
054383ed8e | ||
![]() |
005912dfe8 | ||
![]() |
32e7d2db5c | ||
![]() |
15a2662d10 | ||
![]() |
ee472bad35 | ||
![]() |
619c663438 | ||
![]() |
dd16d44b3a | ||
![]() |
01c4d029bd | ||
![]() |
4fbc2b99b0 | ||
![]() |
ea7ddc7d9a | ||
![]() |
c25c9a285e | ||
![]() |
c10e5e918f | ||
![]() |
7dc59bd5a8 | ||
![]() |
d2b9a2cb7d | ||
![]() |
6b21bbac58 | ||
![]() |
0d4ebe3d96 | ||
![]() |
c856f460e6 | ||
![]() |
6a969d2cd2 | ||
![]() |
4d84b14168 | ||
![]() |
b6cbd42d8b | ||
![]() |
7237c2b05a | ||
![]() |
19a217923e | ||
![]() |
7f160e9421 | ||
![]() |
d0c245d0d5 | ||
![]() |
693edab597 |
173
.all-contributorsrc
Normal file
@@ -0,0 +1,173 @@
|
|||||||
|
{
|
||||||
|
"files": [
|
||||||
|
"README.md"
|
||||||
|
],
|
||||||
|
"imageSize": 100,
|
||||||
|
"commit": false,
|
||||||
|
"contributors": [
|
||||||
|
{
|
||||||
|
"login": "mezner",
|
||||||
|
"name": "Russell Myers",
|
||||||
|
"avatar_url": "https://avatars2.githubusercontent.com/u/184085?v=4",
|
||||||
|
"profile": "http://www.russellmyers.com",
|
||||||
|
"contributions": [
|
||||||
|
"code"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"login": "ehwarren",
|
||||||
|
"name": "Austin Warren",
|
||||||
|
"avatar_url": "https://avatars1.githubusercontent.com/u/3991658?v=4",
|
||||||
|
"profile": "http://www.morwire.com",
|
||||||
|
"contributions": [
|
||||||
|
"code"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"login": "Drachenkaetzchen",
|
||||||
|
"name": "Felicia Hummel",
|
||||||
|
"avatar_url": "https://avatars1.githubusercontent.com/u/162974?v=4",
|
||||||
|
"profile": "https://github.com/Drachenkaetzchen",
|
||||||
|
"contributions": [
|
||||||
|
"code"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"login": "mikemaccana",
|
||||||
|
"name": "Mike MacCana",
|
||||||
|
"avatar_url": "https://avatars2.githubusercontent.com/u/172594?v=4",
|
||||||
|
"profile": "https://github.com/mikemaccana",
|
||||||
|
"contributions": [
|
||||||
|
"test",
|
||||||
|
"design"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"login": "yxuko",
|
||||||
|
"name": "Yacine Kanzari",
|
||||||
|
"avatar_url": "https://avatars1.githubusercontent.com/u/1786317?v=4",
|
||||||
|
"profile": "https://github.com/yxuko",
|
||||||
|
"contributions": [
|
||||||
|
"code"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"login": "BBJip",
|
||||||
|
"name": "BBJip",
|
||||||
|
"avatar_url": "https://avatars2.githubusercontent.com/u/32908927?v=4",
|
||||||
|
"profile": "https://github.com/BBJip",
|
||||||
|
"contributions": [
|
||||||
|
"code"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"login": "Futagirl",
|
||||||
|
"name": "Futagirl",
|
||||||
|
"avatar_url": "https://avatars2.githubusercontent.com/u/33533958?v=4",
|
||||||
|
"profile": "https://github.com/Futagirl",
|
||||||
|
"contributions": [
|
||||||
|
"design"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"login": "levrik",
|
||||||
|
"name": "Levin Rickert",
|
||||||
|
"avatar_url": "https://avatars3.githubusercontent.com/u/9491603?v=4",
|
||||||
|
"profile": "https://www.levrik.io",
|
||||||
|
"contributions": [
|
||||||
|
"code"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"login": "kwonoj",
|
||||||
|
"name": "OJ Kwon",
|
||||||
|
"avatar_url": "https://avatars2.githubusercontent.com/u/1210596?v=4",
|
||||||
|
"profile": "https://kwonoj.github.io",
|
||||||
|
"contributions": [
|
||||||
|
"code"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"login": "Domain",
|
||||||
|
"name": "domain",
|
||||||
|
"avatar_url": "https://avatars2.githubusercontent.com/u/903197?v=4",
|
||||||
|
"profile": "https://github.com/Domain",
|
||||||
|
"contributions": [
|
||||||
|
"plugin",
|
||||||
|
"code"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"login": "kbjr",
|
||||||
|
"name": "James Brumond",
|
||||||
|
"avatar_url": "https://avatars1.githubusercontent.com/u/195127?v=4",
|
||||||
|
"profile": "http://www.jbrumond.me",
|
||||||
|
"contributions": [
|
||||||
|
"plugin"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"login": "Tyriar",
|
||||||
|
"name": "Daniel Imms",
|
||||||
|
"avatar_url": "https://avatars0.githubusercontent.com/u/2193314?v=4",
|
||||||
|
"profile": "http://www.growingwiththeweb.com",
|
||||||
|
"contributions": [
|
||||||
|
"code",
|
||||||
|
"plugin",
|
||||||
|
"test"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"login": "baflo",
|
||||||
|
"name": "Florian Bachmann",
|
||||||
|
"avatar_url": "https://avatars2.githubusercontent.com/u/834350?v=4",
|
||||||
|
"profile": "https://github.com/baflo",
|
||||||
|
"contributions": [
|
||||||
|
"code"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"login": "mischah",
|
||||||
|
"name": "Michael Kühnel",
|
||||||
|
"avatar_url": "https://avatars2.githubusercontent.com/u/441011?v=4",
|
||||||
|
"profile": "http://michael-kuehnel.de",
|
||||||
|
"contributions": [
|
||||||
|
"code",
|
||||||
|
"design"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"login": "NieLeben",
|
||||||
|
"name": "Tilmann Meyer",
|
||||||
|
"avatar_url": "https://avatars3.githubusercontent.com/u/47182955?v=4",
|
||||||
|
"profile": "https://github.com/NieLeben",
|
||||||
|
"contributions": [
|
||||||
|
"code"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"login": "PMExtra",
|
||||||
|
"name": "PM Extra",
|
||||||
|
"avatar_url": "https://avatars3.githubusercontent.com/u/11289158?v=4",
|
||||||
|
"profile": "http://www.jubeat.net",
|
||||||
|
"contributions": [
|
||||||
|
"bug"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"login": "IgnusG",
|
||||||
|
"name": "Jonathan",
|
||||||
|
"avatar_url": "https://avatars1.githubusercontent.com/u/6438760?v=4",
|
||||||
|
"profile": "https://jjuhas.keybase.pub//",
|
||||||
|
"contributions": [
|
||||||
|
"code"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"contributorsPerLine": 7,
|
||||||
|
"projectName": "terminus",
|
||||||
|
"projectOwner": "Eugeny",
|
||||||
|
"repoType": "github",
|
||||||
|
"repoHost": "https://github.com",
|
||||||
|
"commitConvention": "none"
|
||||||
|
}
|
82
.eslintrc.yml
Normal file
@@ -0,0 +1,82 @@
|
|||||||
|
parser: '@typescript-eslint/parser'
|
||||||
|
parserOptions:
|
||||||
|
project: tsconfig.json
|
||||||
|
extends:
|
||||||
|
- 'plugin:@typescript-eslint/all'
|
||||||
|
plugins:
|
||||||
|
- '@typescript-eslint'
|
||||||
|
env:
|
||||||
|
browser: true
|
||||||
|
es6: true
|
||||||
|
node: true
|
||||||
|
commonjs: true
|
||||||
|
rules:
|
||||||
|
'@typescript-eslint/semi':
|
||||||
|
- error
|
||||||
|
- never
|
||||||
|
'@typescript-eslint/indent':
|
||||||
|
- error
|
||||||
|
- 4
|
||||||
|
'@typescript-eslint/explicit-member-accessibility':
|
||||||
|
- error
|
||||||
|
- accessibility: no-public
|
||||||
|
overrides:
|
||||||
|
parameterProperties: explicit
|
||||||
|
'@typescript-eslint/no-require-imports': off
|
||||||
|
'@typescript-eslint/no-parameter-properties': off
|
||||||
|
'@typescript-eslint/explicit-function-return-type': off
|
||||||
|
'@typescript-eslint/no-explicit-any': off
|
||||||
|
'@typescript-eslint/no-magic-numbers': off
|
||||||
|
'@typescript-eslint/member-delimiter-style': off
|
||||||
|
'@typescript-eslint/promise-function-async': off
|
||||||
|
'@typescript-eslint/no-unnecessary-type-assertion': off
|
||||||
|
'@typescript-eslint/require-array-sort-compare': off
|
||||||
|
'@typescript-eslint/no-use-before-define':
|
||||||
|
- error
|
||||||
|
- classes: false
|
||||||
|
no-duplicate-imports: error
|
||||||
|
array-bracket-spacing:
|
||||||
|
- error
|
||||||
|
- never
|
||||||
|
block-scoped-var: error
|
||||||
|
brace-style:
|
||||||
|
- error
|
||||||
|
- 1tbs
|
||||||
|
- allowSingleLine: true
|
||||||
|
computed-property-spacing:
|
||||||
|
- error
|
||||||
|
- never
|
||||||
|
comma-dangle:
|
||||||
|
- error
|
||||||
|
- always-multiline
|
||||||
|
curly: error
|
||||||
|
eol-last: error
|
||||||
|
eqeqeq:
|
||||||
|
- error
|
||||||
|
- smart
|
||||||
|
linebreak-style:
|
||||||
|
- error
|
||||||
|
- unix
|
||||||
|
max-depth:
|
||||||
|
- 1
|
||||||
|
- 5
|
||||||
|
max-statements:
|
||||||
|
- 1
|
||||||
|
- 80
|
||||||
|
no-multiple-empty-lines: error
|
||||||
|
no-mixed-spaces-and-tabs: error
|
||||||
|
no-trailing-spaces: error
|
||||||
|
'@typescript-eslint/no-unused-vars':
|
||||||
|
- error
|
||||||
|
- vars: all
|
||||||
|
args: after-used
|
||||||
|
argsIgnorePattern: ^_
|
||||||
|
no-undef: error
|
||||||
|
object-curly-spacing:
|
||||||
|
- error
|
||||||
|
- always
|
||||||
|
quote-props:
|
||||||
|
- warn
|
||||||
|
- as-needed
|
||||||
|
- keywords: true
|
||||||
|
numbers: true
|
3
.github/FUNDING.yml
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
github: eugeny
|
||||||
|
open_collective: terminus
|
||||||
|
ko_fi: eugeny
|
2
.github/stale.yml
vendored
@@ -5,7 +5,7 @@ daysUntilClose: 14
|
|||||||
# Issues with these labels will never be considered stale
|
# Issues with these labels will never be considered stale
|
||||||
exemptLabels:
|
exemptLabels:
|
||||||
- "T: Enhancement"
|
- "T: Enhancement"
|
||||||
- "S: Triaged"
|
- "S: Confirmed"
|
||||||
# Label to use when marking an issue as stale
|
# Label to use when marking an issue as stale
|
||||||
staleLabel: "S: Stale"
|
staleLabel: "S: Stale"
|
||||||
# Comment to post when marking an issue as stale. Set to `false` to disable
|
# Comment to post when marking an issue as stale. Set to `false` to disable
|
||||||
|
3
.gitignore
vendored
@@ -6,6 +6,8 @@ node_modules
|
|||||||
build/files.wxs
|
build/files.wxs
|
||||||
dist
|
dist
|
||||||
*/dist
|
*/dist
|
||||||
|
*/typings
|
||||||
|
*.tsbuildinfo
|
||||||
|
|
||||||
*.xcworkspacedata
|
*.xcworkspacedata
|
||||||
*.xcuserstate
|
*.xcuserstate
|
||||||
@@ -21,3 +23,4 @@ yarn-error.log
|
|||||||
|
|
||||||
docs/api
|
docs/api
|
||||||
.travis.ssh.key
|
.travis.ssh.key
|
||||||
|
*.code-workspace
|
||||||
|
26
.travis.yml
@@ -9,31 +9,40 @@ stages:
|
|||||||
jobs:
|
jobs:
|
||||||
include:
|
include:
|
||||||
- stage: 'Build'
|
- stage: 'Build'
|
||||||
|
if: branch = xxx
|
||||||
os: linux
|
os: linux
|
||||||
before_install:
|
before_install:
|
||||||
- yarn
|
- set -e
|
||||||
- rm app/node_modules/.yarn-integrity || true
|
- rm app/node_modules/.yarn-integrity || true
|
||||||
- scripts/install-deps.js
|
- yarn
|
||||||
script:
|
script:
|
||||||
|
- set -e
|
||||||
|
- python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)" # https://github.com/travis-ci/travis-ci/issues/8920
|
||||||
- scripts/build-native.js
|
- scripts/build-native.js
|
||||||
|
- yarn run build:typings
|
||||||
- yarn run build
|
- yarn run build
|
||||||
- scripts/prepackage-plugins.js
|
- scripts/prepackage-plugins.js
|
||||||
- scripts/build-linux.js
|
- travis_wait scripts/build-linux.js
|
||||||
|
|
||||||
- stage: 'Build'
|
- stage: 'Build'
|
||||||
os: osx
|
os: osx
|
||||||
before_install:
|
before_install:
|
||||||
|
- set -e
|
||||||
- rm app/node_modules/.yarn-integrity || true
|
- rm app/node_modules/.yarn-integrity || true
|
||||||
- yarn
|
- yarn
|
||||||
script:
|
script:
|
||||||
|
- set -e
|
||||||
- scripts/build-native.js
|
- scripts/build-native.js
|
||||||
|
- yarn run build:typings
|
||||||
- yarn run build
|
- yarn run build
|
||||||
- scripts/prepackage-plugins.js
|
- scripts/prepackage-plugins.js
|
||||||
- scripts/build-macos.js
|
- travis_wait scripts/build-macos.js
|
||||||
|
|
||||||
- stage: 'Docs'
|
- stage: 'Docs'
|
||||||
os: linux
|
os: linux
|
||||||
|
if: branch = master
|
||||||
script:
|
script:
|
||||||
|
- set -e
|
||||||
- openssl aes-256-cbc -K $encrypted_4e2fb4889ef8_key -iv $encrypted_4e2fb4889ef8_iv -in .travis.ssh.key.enc -out .travis.ssh.key -d
|
- openssl aes-256-cbc -K $encrypted_4e2fb4889ef8_key -iv $encrypted_4e2fb4889ef8_iv -in .travis.ssh.key.enc -out .travis.ssh.key -d
|
||||||
- eval "$(ssh-agent -s)"
|
- eval "$(ssh-agent -s)"
|
||||||
- chmod 600 .travis.ssh.key
|
- chmod 600 .travis.ssh.key
|
||||||
@@ -50,6 +59,15 @@ addons:
|
|||||||
packages:
|
packages:
|
||||||
- rpm
|
- rpm
|
||||||
- yarn
|
- yarn
|
||||||
|
- libsecret-1-dev
|
||||||
sources:
|
sources:
|
||||||
- sourceline: 'deb https://dl.yarnpkg.com/debian/ stable main'
|
- sourceline: 'deb https://dl.yarnpkg.com/debian/ stable main'
|
||||||
key_url: 'https://dl.yarnpkg.com/debian/pubkey.gpg'
|
key_url: 'https://dl.yarnpkg.com/debian/pubkey.gpg'
|
||||||
|
|
||||||
|
|
||||||
|
cache:
|
||||||
|
directories:
|
||||||
|
- 'terminus-*/node_modules'
|
||||||
|
- $HOME/.cache/yarn
|
||||||
|
- $HOME/.cache/electron
|
||||||
|
- $HOME/.cache/electron-builder
|
||||||
|
@@ -92,11 +92,11 @@ Plugins provide functionality by exporting singular or multi providers:
|
|||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
import { NgModule, Injectable } from '@angular/core'
|
import { NgModule, Injectable } from '@angular/core'
|
||||||
import { ToolbarButtonProvider, IToolbarButton } from 'terminus-core'
|
import { ToolbarButtonProvider, ToolbarButton } from 'terminus-core'
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class MyButtonProvider extends ToolbarButtonProvider {
|
export class MyButtonProvider extends ToolbarButtonProvider {
|
||||||
provide (): IToolbarButton[] {
|
provide (): ToolbarButton[] {
|
||||||
return [{
|
return [{
|
||||||
icon: 'star',
|
icon: 'star',
|
||||||
title: 'Foobar',
|
title: 'Foobar',
|
||||||
|
BIN
app/assets/activity.png
Normal file
After Width: | Height: | Size: 4.9 KiB |
4
app/dev-app-update.yml
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
owner: eugeny
|
||||||
|
repo: terminus
|
||||||
|
provider: github
|
||||||
|
updaterCacheDirName: terminus-updater
|
@@ -19,12 +19,16 @@ export class Application {
|
|||||||
}
|
}
|
||||||
|
|
||||||
app.commandLine.appendSwitch('disable-http-cache')
|
app.commandLine.appendSwitch('disable-http-cache')
|
||||||
app.commandLine.appendSwitch('force_discrete_gpu', '0')
|
|
||||||
app.commandLine.appendSwitch('lang', 'EN')
|
app.commandLine.appendSwitch('lang', 'EN')
|
||||||
|
|
||||||
|
for (const flag of configData.flags || [['force_discrete_gpu', '0']]) {
|
||||||
|
console.log('Setting Electron flag:', flag.join('='))
|
||||||
|
app.commandLine.appendSwitch(flag[0], flag[1])
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
init () {
|
init () {
|
||||||
electron.screen.on('display-metrics-changed', () => this.broadcast('host:display-metrics-changed'))
|
electron.screen.on('display-metrics-changed', () => this.broadcast('host:display-metrics-changed'))
|
||||||
}
|
}
|
||||||
|
|
||||||
async newWindow (options?: WindowOptions): Promise<Window> {
|
async newWindow (options?: WindowOptions): Promise<Window> {
|
||||||
|
@@ -41,6 +41,5 @@ export function parseArgs (argv, cwd) {
|
|||||||
type: 'boolean'
|
type: 'boolean'
|
||||||
})
|
})
|
||||||
.help('help')
|
.help('help')
|
||||||
.strict()
|
|
||||||
.parse(argv.slice(1))
|
.parse(argv.slice(1))
|
||||||
}
|
}
|
||||||
|
@@ -1,9 +1,8 @@
|
|||||||
import './lru'
|
import './lru'
|
||||||
import { app, ipcMain, Menu } from 'electron'
|
import { app, ipcMain, Menu } from 'electron'
|
||||||
import electronDebug = require('electron-debug')
|
|
||||||
import { parseArgs } from './cli'
|
import { parseArgs } from './cli'
|
||||||
import { Application } from './app'
|
import { Application } from './app'
|
||||||
if (process.platform === 'win32' && require('electron-squirrel-startup')) process.exit(0)
|
import electronDebug = require('electron-debug')
|
||||||
|
|
||||||
if (!process.env.TERMINUS_PLUGINS) {
|
if (!process.env.TERMINUS_PLUGINS) {
|
||||||
process.env.TERMINUS_PLUGINS = ''
|
process.env.TERMINUS_PLUGINS = ''
|
||||||
@@ -44,7 +43,11 @@ if (!app.requestSingleInstanceLock()) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (argv.d) {
|
if (argv.d) {
|
||||||
electronDebug({ enabled: true, showDevTools: 'undocked' })
|
electronDebug({
|
||||||
|
isEnabled: true,
|
||||||
|
showDevTools: true,
|
||||||
|
devToolsMode: 'undocked'
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
app.on('ready', () => {
|
app.on('ready', () => {
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
import { Subject, Observable } from 'rxjs'
|
import { Subject, Observable } from 'rxjs'
|
||||||
import { debounceTime } from 'rxjs/operators'
|
import { debounceTime } from 'rxjs/operators'
|
||||||
import { BrowserWindow, app, ipcMain, Rectangle } from 'electron'
|
import { BrowserWindow, app, ipcMain, Rectangle, screen } from 'electron'
|
||||||
import ElectronConfig = require('electron-config')
|
import ElectronConfig = require('electron-config')
|
||||||
import * as os from 'os'
|
import * as os from 'os'
|
||||||
|
|
||||||
@@ -51,7 +51,19 @@ export class Window {
|
|||||||
show: false,
|
show: false,
|
||||||
backgroundColor: '#00000000'
|
backgroundColor: '#00000000'
|
||||||
}
|
}
|
||||||
Object.assign(bwOptions, this.windowBounds)
|
|
||||||
|
if (this.windowBounds) {
|
||||||
|
Object.assign(bwOptions, this.windowBounds)
|
||||||
|
const closestDisplay = screen.getDisplayNearestPoint( {x: this.windowBounds.x, y: this.windowBounds.y} )
|
||||||
|
|
||||||
|
const [left1, top1, right1, bottom1] = [this.windowBounds.x, this.windowBounds.y, this.windowBounds.x + this.windowBounds.width, this.windowBounds.y + this.windowBounds.height];
|
||||||
|
const [left2, top2, right2, bottom2] = [closestDisplay.bounds.x, closestDisplay.bounds.y, closestDisplay.bounds.x + closestDisplay.bounds.width, closestDisplay.bounds.y + closestDisplay.bounds.height];
|
||||||
|
|
||||||
|
if ((left2 > right1 || right2 < left1 || top2 > bottom1 || bottom2 < top1) && !maximized) {
|
||||||
|
bwOptions.x = closestDisplay.bounds.width / 2 - bwOptions.width / 2;
|
||||||
|
bwOptions.y = closestDisplay.bounds.height / 2 - bwOptions.height / 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ((configData.appearance || {}).frame === 'native') {
|
if ((configData.appearance || {}).frame === 'native') {
|
||||||
bwOptions.frame = true
|
bwOptions.frame = true
|
||||||
@@ -82,6 +94,7 @@ export class Window {
|
|||||||
this.window.focus()
|
this.window.focus()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
this.window.loadURL(`file://${app.getAppPath()}/dist/index.html?${this.window.id}`, { extraHeaders: 'pragma: no-cache\n' })
|
this.window.loadURL(`file://${app.getAppPath()}/dist/index.html?${this.window.id}`, { extraHeaders: 'pragma: no-cache\n' })
|
||||||
|
|
||||||
if (process.platform !== 'darwin') {
|
if (process.platform !== 'darwin') {
|
||||||
|
@@ -20,25 +20,33 @@
|
|||||||
"@angular/forms": "7.2.8",
|
"@angular/forms": "7.2.8",
|
||||||
"@angular/platform-browser": "7.2.8",
|
"@angular/platform-browser": "7.2.8",
|
||||||
"@angular/platform-browser-dynamic": "7.2.8",
|
"@angular/platform-browser-dynamic": "7.2.8",
|
||||||
"@ng-bootstrap/ng-bootstrap": "^3.3.1",
|
"@ng-bootstrap/ng-bootstrap": "^4.2.0",
|
||||||
"devtron": "1.4.0",
|
"devtron": "1.4.0",
|
||||||
"electron-config": "0.2.1",
|
"fontmanager-redux": "0.3.2",
|
||||||
"electron-debug": "^2.0.0",
|
"electron-config": "2.0.0",
|
||||||
"electron-is-dev": "0.1.2",
|
"electron-debug": "^3.0.1",
|
||||||
"electron-squirrel-startup": "^1.0.0",
|
"electron-is-dev": "1.1.0",
|
||||||
"js-yaml": "3.8.2",
|
"electron-updater": "^4.0.6",
|
||||||
"mz": "^2.6.0",
|
"js-yaml": "3.13.1",
|
||||||
"ngx-toastr": "^9.1.1",
|
"keytar": "^4.7.0",
|
||||||
|
"mz": "^2.7.0",
|
||||||
|
"ngx-toastr": "^10.0.4",
|
||||||
|
"node-pty": "^0.9.0-beta18",
|
||||||
|
"npm": "~6.9.0",
|
||||||
"path": "0.12.7",
|
"path": "0.12.7",
|
||||||
"rxjs": "^6.3.3",
|
"rxjs": "^6.5.2",
|
||||||
"yargs": "^12.0.1",
|
"rxjs-compat": "^6.5.2",
|
||||||
"zone.js": "^0.8.26"
|
"yargs": "^13.2.4",
|
||||||
|
"zone.js": "^0.8.29"
|
||||||
},
|
},
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
"windows-blurbehind": "^1.0.0",
|
"@terminus-term/windows-process-tree": "^0.2.4",
|
||||||
"windows-swca": "^2.0.1"
|
"macos-native-processlist": "^1.0.1",
|
||||||
|
"windows-blurbehind": "^1.0.1",
|
||||||
|
"windows-native-registry": "^1.0.14",
|
||||||
|
"windows-swca": "^2.0.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/mz": "0.0.31"
|
"@types/mz": "0.0.32"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -4,18 +4,19 @@ import { NgbModule } from '@ng-bootstrap/ng-bootstrap'
|
|||||||
import { ToastrModule } from 'ngx-toastr'
|
import { ToastrModule } from 'ngx-toastr'
|
||||||
|
|
||||||
export function getRootModule (plugins: any[]) {
|
export function getRootModule (plugins: any[]) {
|
||||||
let imports = [
|
const imports = [
|
||||||
BrowserModule,
|
BrowserModule,
|
||||||
...plugins,
|
...plugins,
|
||||||
NgbModule.forRoot(),
|
NgbModule.forRoot(),
|
||||||
ToastrModule.forRoot({
|
ToastrModule.forRoot({
|
||||||
positionClass: 'toast-bottom-center',
|
positionClass: 'toast-bottom-center',
|
||||||
|
toastClass: 'toast',
|
||||||
preventDuplicates: true,
|
preventDuplicates: true,
|
||||||
extendedTimeOut: 5000,
|
extendedTimeOut: 5000,
|
||||||
}),
|
}),
|
||||||
]
|
]
|
||||||
let bootstrap = [
|
const bootstrap = [
|
||||||
...(plugins.filter(x => x.bootstrap).map(x => x.bootstrap)),
|
...plugins.filter(x => x.bootstrap).map(x => x.bootstrap),
|
||||||
]
|
]
|
||||||
|
|
||||||
if (bootstrap.length === 0) {
|
if (bootstrap.length === 0) {
|
||||||
@@ -25,7 +26,7 @@ export function getRootModule (plugins: any[]) {
|
|||||||
@NgModule({
|
@NgModule({
|
||||||
imports,
|
imports,
|
||||||
bootstrap,
|
bootstrap,
|
||||||
}) class RootModule { }
|
}) class RootModule { } // eslint-disable-line @typescript-eslint/no-extraneous-class
|
||||||
|
|
||||||
return RootModule
|
return RootModule
|
||||||
}
|
}
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
import '../lib/lru'
|
import '../lib/lru'
|
||||||
import 'source-sans-pro'
|
import 'source-sans-pro/source-sans-pro.css'
|
||||||
import 'source-code-pro/source-code-pro.css'
|
import 'source-code-pro/source-code-pro.css'
|
||||||
import '@fortawesome/fontawesome-free/css/solid.css'
|
import '@fortawesome/fontawesome-free/css/solid.css'
|
||||||
import '@fortawesome/fontawesome-free/css/brands.css'
|
import '@fortawesome/fontawesome-free/css/brands.css'
|
||||||
@@ -16,20 +16,20 @@ Raven.config(
|
|||||||
{
|
{
|
||||||
release: require('electron').remote.app.getVersion(),
|
release: require('electron').remote.app.getVersion(),
|
||||||
dataCallback: (data: any) => {
|
dataCallback: (data: any) => {
|
||||||
const normalize = (filename) => {
|
const normalize = (filename: string) => {
|
||||||
let splitArray = filename.split('/')
|
const splitArray = filename.split('/')
|
||||||
return splitArray[splitArray.length - 1]
|
return splitArray[splitArray.length - 1]
|
||||||
}
|
}
|
||||||
|
|
||||||
data.exception.values[0].stacktrace.frames.forEach(frame => {
|
data.exception.values[0].stacktrace.frames.forEach((frame: any) => {
|
||||||
frame.filename = normalize(frame.filename)
|
frame.filename = normalize(frame.filename)
|
||||||
})
|
})
|
||||||
|
|
||||||
data.culprit = data.exception.values[0].stacktrace.frames[0].filename
|
data.culprit = data.exception.values[0].stacktrace.frames[0].filename
|
||||||
|
|
||||||
return data
|
return data
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
process.on('uncaughtException' as any, (err) => {
|
process.on('uncaughtException' as any, (err) => {
|
||||||
|
@@ -1,19 +1,20 @@
|
|||||||
import 'zone.js'
|
import 'zone.js'
|
||||||
import 'core-js/es7/reflect'
|
import 'core-js/proposals/reflect-metadata'
|
||||||
import 'core-js/core/delay'
|
|
||||||
import 'rxjs'
|
import 'rxjs'
|
||||||
|
|
||||||
|
import * as isDev from 'electron-is-dev'
|
||||||
|
|
||||||
import './global.scss'
|
import './global.scss'
|
||||||
import './toastr.scss'
|
import './toastr.scss'
|
||||||
|
|
||||||
// Always land on the start view
|
|
||||||
location.hash = ''
|
|
||||||
|
|
||||||
import { enableProdMode, NgModuleRef } from '@angular/core'
|
import { enableProdMode, NgModuleRef } from '@angular/core'
|
||||||
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'
|
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'
|
||||||
|
|
||||||
import { getRootModule } from './app.module'
|
import { getRootModule } from './app.module'
|
||||||
import { findPlugins, loadPlugins, IPluginInfo } from './plugins'
|
import { findPlugins, loadPlugins, PluginInfo } from './plugins'
|
||||||
|
|
||||||
|
// Always land on the start view
|
||||||
|
location.hash = ''
|
||||||
|
|
||||||
;(process as any).enablePromiseAPI = true
|
;(process as any).enablePromiseAPI = true
|
||||||
|
|
||||||
@@ -21,20 +22,20 @@ if (process.platform === 'win32') {
|
|||||||
process.env.HOME = process.env.HOMEDRIVE + process.env.HOMEPATH
|
process.env.HOME = process.env.HOMEDRIVE + process.env.HOMEPATH
|
||||||
}
|
}
|
||||||
|
|
||||||
if (require('electron-is-dev')) {
|
if (isDev) {
|
||||||
console.warn('Running in debug mode')
|
console.warn('Running in debug mode')
|
||||||
} else {
|
} else {
|
||||||
enableProdMode()
|
enableProdMode()
|
||||||
}
|
}
|
||||||
|
|
||||||
async function bootstrap (plugins: IPluginInfo[], safeMode = false): Promise<NgModuleRef<any>> {
|
async function bootstrap (plugins: PluginInfo[], safeMode = false): Promise<NgModuleRef<any>> {
|
||||||
if (safeMode) {
|
if (safeMode) {
|
||||||
plugins = plugins.filter(x => x.isBuiltin)
|
plugins = plugins.filter(x => x.isBuiltin)
|
||||||
}
|
}
|
||||||
let pluginsModules = await loadPlugins(plugins, (current, total) => {
|
const pluginsModules = await loadPlugins(plugins, (current, total) => {
|
||||||
(document.querySelector('.progress .bar') as HTMLElement).style.width = 100 * current / total + '%'
|
(document.querySelector('.progress .bar') as HTMLElement).style.width = `${100 * current / total}%` // eslint-disable-line
|
||||||
})
|
})
|
||||||
let module = getRootModule(pluginsModules)
|
const module = getRootModule(pluginsModules)
|
||||||
window['rootModule'] = module
|
window['rootModule'] = module
|
||||||
return platformBrowserDynamic().bootstrapModule(module)
|
return platformBrowserDynamic().bootstrapModule(module)
|
||||||
}
|
}
|
||||||
|
@@ -1,10 +1,8 @@
|
|||||||
import * as fs from 'mz/fs'
|
import * as fs from 'mz/fs'
|
||||||
import * as path from 'path'
|
import * as path from 'path'
|
||||||
const nodeModule = require('module')
|
const nodeModule = require('module') // eslint-disable-line @typescript-eslint/no-var-requires
|
||||||
const nodeRequire = (global as any).require
|
const nodeRequire = (global as any).require
|
||||||
|
|
||||||
declare function delay (ms: number): Promise<void>
|
|
||||||
|
|
||||||
function normalizePath (path: string): string {
|
function normalizePath (path: string): string {
|
||||||
const cygwinPrefix = '/cygdrive/'
|
const cygwinPrefix = '/cygdrive/'
|
||||||
if (path.startsWith(cygwinPrefix)) {
|
if (path.startsWith(cygwinPrefix)) {
|
||||||
@@ -14,7 +12,7 @@ function normalizePath (path: string): string {
|
|||||||
return path
|
return path
|
||||||
}
|
}
|
||||||
|
|
||||||
nodeRequire.main.paths.map(x => nodeModule.globalPaths.push(normalizePath(x)))
|
nodeRequire.main.paths.map((x: string) => nodeModule.globalPaths.push(normalizePath(x)))
|
||||||
|
|
||||||
if (process.env.TERMINUS_DEV) {
|
if (process.env.TERMINUS_DEV) {
|
||||||
nodeModule.globalPaths.unshift(path.dirname(require('electron').remote.app.getAppPath()))
|
nodeModule.globalPaths.unshift(path.dirname(require('electron').remote.app.getAppPath()))
|
||||||
@@ -28,6 +26,10 @@ const userPluginsPath = path.join(
|
|||||||
'plugins',
|
'plugins',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if (!fs.existsSync(userPluginsPath)) {
|
||||||
|
fs.mkdir(userPluginsPath)
|
||||||
|
}
|
||||||
|
|
||||||
Object.assign(window, { builtinPluginsPath, userPluginsPath })
|
Object.assign(window, { builtinPluginsPath, userPluginsPath })
|
||||||
nodeModule.globalPaths.unshift(builtinPluginsPath)
|
nodeModule.globalPaths.unshift(builtinPluginsPath)
|
||||||
nodeModule.globalPaths.unshift(path.join(userPluginsPath, 'node_modules'))
|
nodeModule.globalPaths.unshift(path.join(userPluginsPath, 'node_modules'))
|
||||||
@@ -36,9 +38,9 @@ if (process.env.TERMINUS_PLUGINS) {
|
|||||||
process.env.TERMINUS_PLUGINS.split(':').map(x => nodeModule.globalPaths.push(normalizePath(x)))
|
process.env.TERMINUS_PLUGINS.split(':').map(x => nodeModule.globalPaths.push(normalizePath(x)))
|
||||||
}
|
}
|
||||||
|
|
||||||
export declare type ProgressCallback = (current, total) => void
|
export type ProgressCallback = (current: number, total: number) => void // eslint-disable-line @typescript-eslint/no-type-alias
|
||||||
|
|
||||||
export interface IPluginInfo {
|
export interface PluginInfo {
|
||||||
name: string
|
name: string
|
||||||
description: string
|
description: string
|
||||||
packageName: string
|
packageName: string
|
||||||
@@ -62,6 +64,7 @@ const builtinModules = [
|
|||||||
'ngx-toastr',
|
'ngx-toastr',
|
||||||
'rxjs',
|
'rxjs',
|
||||||
'rxjs/operators',
|
'rxjs/operators',
|
||||||
|
'rxjs-compat/Subject',
|
||||||
'terminus-core',
|
'terminus-core',
|
||||||
'terminus-settings',
|
'terminus-settings',
|
||||||
'terminus-terminal',
|
'terminus-terminal',
|
||||||
@@ -70,47 +73,61 @@ const builtinModules = [
|
|||||||
|
|
||||||
const cachedBuiltinModules = {}
|
const cachedBuiltinModules = {}
|
||||||
builtinModules.forEach(m => {
|
builtinModules.forEach(m => {
|
||||||
|
const label = 'Caching ' + m
|
||||||
|
console.time(label)
|
||||||
cachedBuiltinModules[m] = nodeRequire(m)
|
cachedBuiltinModules[m] = nodeRequire(m)
|
||||||
|
console.timeEnd(label)
|
||||||
})
|
})
|
||||||
|
|
||||||
const originalRequire = nodeRequire('module').prototype.require
|
const originalRequire = (global as any).require
|
||||||
nodeRequire('module').prototype.require = function (query) {
|
;(global as any).require = function (query: string) {
|
||||||
if (cachedBuiltinModules[query]) {
|
if (cachedBuiltinModules[query]) {
|
||||||
return cachedBuiltinModules[query]
|
return cachedBuiltinModules[query]
|
||||||
}
|
}
|
||||||
return originalRequire.apply(this, arguments)
|
return originalRequire.apply(this, arguments)
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function findPlugins (): Promise<IPluginInfo[]> {
|
const originalModuleRequire = nodeModule.prototype.require
|
||||||
let paths = nodeModule.globalPaths
|
nodeModule.prototype.require = function (query: string) {
|
||||||
let foundPlugins: IPluginInfo[] = []
|
if (cachedBuiltinModules[query]) {
|
||||||
let candidateLocations: { pluginDir: string, packageName: string }[] = []
|
return cachedBuiltinModules[query]
|
||||||
|
}
|
||||||
|
return originalModuleRequire.call(this, query)
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function findPlugins (): Promise<PluginInfo[]> {
|
||||||
|
const paths = nodeModule.globalPaths
|
||||||
|
let foundPlugins: PluginInfo[] = []
|
||||||
|
const candidateLocations: { pluginDir: string, packageName: string }[] = []
|
||||||
|
const PREFIX = 'terminus-'
|
||||||
|
|
||||||
for (let pluginDir of paths) {
|
for (let pluginDir of paths) {
|
||||||
pluginDir = normalizePath(pluginDir)
|
pluginDir = normalizePath(pluginDir)
|
||||||
if (!await fs.exists(pluginDir)) {
|
if (!await fs.exists(pluginDir)) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
let pluginNames = await fs.readdir(pluginDir)
|
const pluginNames = await fs.readdir(pluginDir)
|
||||||
if (await fs.exists(path.join(pluginDir, 'package.json'))) {
|
if (await fs.exists(path.join(pluginDir, 'package.json'))) {
|
||||||
candidateLocations.push({
|
candidateLocations.push({
|
||||||
pluginDir: path.dirname(pluginDir),
|
pluginDir: path.dirname(pluginDir),
|
||||||
packageName: path.basename(pluginDir)
|
packageName: path.basename(pluginDir),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
for (let packageName of pluginNames) {
|
for (const packageName of pluginNames) {
|
||||||
candidateLocations.push({ pluginDir, packageName })
|
if (packageName.startsWith(PREFIX)) {
|
||||||
|
candidateLocations.push({ pluginDir, packageName })
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (let { pluginDir, packageName } of candidateLocations) {
|
for (const { pluginDir, packageName } of candidateLocations) {
|
||||||
let pluginPath = path.join(pluginDir, packageName)
|
const pluginPath = path.join(pluginDir, packageName)
|
||||||
let infoPath = path.join(pluginPath, 'package.json')
|
const infoPath = path.join(pluginPath, 'package.json')
|
||||||
if (!await fs.exists(infoPath)) {
|
if (!await fs.exists(infoPath)) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
let name = packageName.substring('terminus-'.length)
|
const name = packageName.substring(PREFIX.length)
|
||||||
|
|
||||||
if (foundPlugins.some(x => x.name === name)) {
|
if (foundPlugins.some(x => x.name === name)) {
|
||||||
console.info(`Plugin ${packageName} already exists, overriding`)
|
console.info(`Plugin ${packageName} already exists, overriding`)
|
||||||
@@ -118,7 +135,7 @@ export async function findPlugins (): Promise<IPluginInfo[]> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
let info = JSON.parse(await fs.readFile(infoPath, { encoding: 'utf-8' }))
|
const info = JSON.parse(await fs.readFile(infoPath, { encoding: 'utf-8' }))
|
||||||
if (!info.keywords || !(info.keywords.includes('terminus-plugin') || info.keywords.includes('terminus-builtin-plugin'))) {
|
if (!info.keywords || !(info.keywords.includes('terminus-plugin') || info.keywords.includes('terminus-builtin-plugin'))) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
@@ -143,23 +160,26 @@ export async function findPlugins (): Promise<IPluginInfo[]> {
|
|||||||
return foundPlugins
|
return foundPlugins
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function loadPlugins (foundPlugins: IPluginInfo[], progress: ProgressCallback): Promise<any[]> {
|
export async function loadPlugins (foundPlugins: PluginInfo[], progress: ProgressCallback): Promise<any[]> {
|
||||||
let plugins: any[] = []
|
const plugins: any[] = []
|
||||||
progress(0, 1)
|
progress(0, 1)
|
||||||
let index = 0
|
let index = 0
|
||||||
for (let foundPlugin of foundPlugins) {
|
for (const foundPlugin of foundPlugins) {
|
||||||
console.info(`Loading ${foundPlugin.name}: ${nodeRequire.resolve(foundPlugin.path)}`)
|
console.info(`Loading ${foundPlugin.name}: ${nodeRequire.resolve(foundPlugin.path)}`)
|
||||||
progress(index, foundPlugins.length)
|
progress(index, foundPlugins.length)
|
||||||
try {
|
try {
|
||||||
let packageModule = nodeRequire(foundPlugin.path)
|
const label = 'Loading ' + foundPlugin.name
|
||||||
let pluginModule = packageModule.default.forRoot ? packageModule.default.forRoot() : packageModule.default
|
console.time(label)
|
||||||
|
const packageModule = nodeRequire(foundPlugin.path)
|
||||||
|
const pluginModule = packageModule.default.forRoot ? packageModule.default.forRoot() : packageModule.default
|
||||||
pluginModule['pluginName'] = foundPlugin.name
|
pluginModule['pluginName'] = foundPlugin.name
|
||||||
pluginModule['bootstrap'] = packageModule.bootstrap
|
pluginModule['bootstrap'] = packageModule.bootstrap
|
||||||
plugins.push(pluginModule)
|
plugins.push(pluginModule)
|
||||||
|
console.timeEnd(label)
|
||||||
|
await (new Promise(x => setTimeout(x, 50)))
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(`Could not load ${foundPlugin.name}:`, error)
|
console.error(`Could not load ${foundPlugin.name}:`, error)
|
||||||
}
|
}
|
||||||
await delay(1)
|
|
||||||
index++
|
index++
|
||||||
}
|
}
|
||||||
progress(1, 1)
|
progress(1, 1)
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
import { Component } from '@angular/core'
|
import { Component } from '@angular/core'
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
template: '<app-root></app-root>'
|
template: '<app-root></app-root>',
|
||||||
})
|
})
|
||||||
export class RootComponent { }
|
export class RootComponent { } // eslint-disable-line @typescript-eslint/no-extraneous-class
|
||||||
|
@@ -2,6 +2,7 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
padding: 20px;
|
||||||
|
|
||||||
.toast {
|
.toast {
|
||||||
box-shadow: 0 1px 0 rgba(0,0,0,.25);
|
box-shadow: 0 1px 0 rgba(0,0,0,.25);
|
||||||
|
@@ -5,7 +5,7 @@ module.exports = {
|
|||||||
name: 'terminus',
|
name: 'terminus',
|
||||||
target: 'node',
|
target: 'node',
|
||||||
entry: {
|
entry: {
|
||||||
'index.ignore': 'file-loader?name=index.html!val-loader!pug-html-loader!' + path.resolve(__dirname, './index.pug'),
|
'index.ignore': 'file-loader?name=index.html!pug-html-loader!' + path.resolve(__dirname, './index.pug'),
|
||||||
preload: path.resolve(__dirname, 'src/entry.preload.ts'),
|
preload: path.resolve(__dirname, 'src/entry.preload.ts'),
|
||||||
bundle: path.resolve(__dirname, 'src/entry.ts'),
|
bundle: path.resolve(__dirname, 'src/entry.ts'),
|
||||||
},
|
},
|
||||||
|
@@ -36,7 +36,6 @@ module.exports = {
|
|||||||
electron: 'commonjs electron',
|
electron: 'commonjs electron',
|
||||||
'electron-config': 'commonjs electron-config',
|
'electron-config': 'commonjs electron-config',
|
||||||
'electron-vibrancy': 'commonjs electron-vibrancy',
|
'electron-vibrancy': 'commonjs electron-vibrancy',
|
||||||
'electron-squirrel-startup': 'commonjs electron-squirrel-startup',
|
|
||||||
fs: 'commonjs fs',
|
fs: 'commonjs fs',
|
||||||
mz: 'commonjs mz',
|
mz: 'commonjs mz',
|
||||||
path: 'commonjs path',
|
path: 'commonjs path',
|
||||||
|
3228
app/yarn.lock
12
appveyor.yml
@@ -6,10 +6,6 @@ platform:
|
|||||||
environment:
|
environment:
|
||||||
nodejs_version: "10"
|
nodejs_version: "10"
|
||||||
|
|
||||||
cache:
|
|
||||||
- "%USERPROFILE%\\.electron"
|
|
||||||
- "%LOCALAPPDATA%\\Yarn"
|
|
||||||
|
|
||||||
version: "{build}"
|
version: "{build}"
|
||||||
|
|
||||||
install:
|
install:
|
||||||
@@ -23,6 +19,10 @@ build_script:
|
|||||||
- node scripts/build-windows.js
|
- node scripts/build-windows.js
|
||||||
|
|
||||||
artifacts:
|
artifacts:
|
||||||
- path: 'dist\win\*.exe'
|
|
||||||
- path: 'dist\squirrel-windows\*.exe'
|
|
||||||
- path: 'dist\*.exe'
|
- path: 'dist\*.exe'
|
||||||
|
|
||||||
|
cache:
|
||||||
|
- node_modules
|
||||||
|
- "*\\node_modules"
|
||||||
|
- "%USERPROFILE%\\.electron"
|
||||||
|
- "%LOCALAPPDATA%\\Yarn"
|
||||||
|
207
azure-pipelines.yml
Normal file
@@ -0,0 +1,207 @@
|
|||||||
|
trigger:
|
||||||
|
tags:
|
||||||
|
include:
|
||||||
|
- v*
|
||||||
|
branches:
|
||||||
|
include:
|
||||||
|
- master
|
||||||
|
|
||||||
|
variables:
|
||||||
|
- group: Vars
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
# - job: Windows
|
||||||
|
# pool:
|
||||||
|
# vmImage: 'vs2017-win2016'
|
||||||
|
|
||||||
|
# steps:
|
||||||
|
# - task: NodeTool@0
|
||||||
|
# inputs:
|
||||||
|
# versionSpec: '10.x'
|
||||||
|
# displayName: 'Install Node.js'
|
||||||
|
|
||||||
|
# - script: yarn --network-timeout 100000
|
||||||
|
# displayName: 'Install dependencies'
|
||||||
|
|
||||||
|
# - script: node scripts/build-native.js
|
||||||
|
# displayName: 'Rebuild native dependencies'
|
||||||
|
|
||||||
|
# - script: yarn run build
|
||||||
|
# displayName: 'Build'
|
||||||
|
|
||||||
|
# - script: node scripts/prepackage-plugins.js
|
||||||
|
# displayName: 'Prepackage plugins'
|
||||||
|
|
||||||
|
# - script: node scripts/build-windows.js
|
||||||
|
# displayName: 'Package'
|
||||||
|
# env:
|
||||||
|
# WIN_CSC_LINK: $(WIN_CSC_LINK)
|
||||||
|
# WIN_CSC_KEY_PASSWORD: $(WIN_CSC_KEY_PASSWORD)
|
||||||
|
# BT_TOKEN: $(BT_TOKEN)
|
||||||
|
# GH_TOKEN: $(GH_TOKEN)
|
||||||
|
# DEBUG: electron-builder
|
||||||
|
|
||||||
|
# - task: CopyFiles@2
|
||||||
|
# inputs:
|
||||||
|
# contents: 'dist\\*-setup.exe'
|
||||||
|
# targetFolder: $(Build.ArtifactStagingDirectory)
|
||||||
|
# flattenFolders: true
|
||||||
|
# cleanTargetFolder: true
|
||||||
|
|
||||||
|
# - task: PublishBuildArtifacts@1
|
||||||
|
# inputs:
|
||||||
|
# pathtoPublish: $(Build.ArtifactStagingDirectory)
|
||||||
|
# artifactName: Windows - Installer
|
||||||
|
# condition: eq(variables['Build.SourceBranch'], 'refs/heads/master')
|
||||||
|
|
||||||
|
# - task: CopyFiles@2
|
||||||
|
# inputs:
|
||||||
|
# contents: 'dist\\*-portable.exe'
|
||||||
|
# targetFolder: $(Build.ArtifactStagingDirectory)
|
||||||
|
# flattenFolders: true
|
||||||
|
# cleanTargetFolder: true
|
||||||
|
|
||||||
|
# - task: PublishBuildArtifacts@1
|
||||||
|
# inputs:
|
||||||
|
# pathtoPublish: $(Build.ArtifactStagingDirectory)
|
||||||
|
# artifactName: Windows - Portable build
|
||||||
|
# condition: eq(variables['Build.SourceBranch'], 'refs/heads/master')
|
||||||
|
|
||||||
|
- job: Linux
|
||||||
|
pool:
|
||||||
|
vmImage: 'ubuntu-16.04'
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- task: NodeTool@0
|
||||||
|
inputs:
|
||||||
|
versionSpec: '10.x'
|
||||||
|
displayName: 'Install Node.js'
|
||||||
|
|
||||||
|
- script: yarn
|
||||||
|
displayName: 'Install dependencies'
|
||||||
|
|
||||||
|
- script: node scripts/build-native.js
|
||||||
|
displayName: 'Rebuild native dependencies'
|
||||||
|
|
||||||
|
- script: yarn run build
|
||||||
|
displayName: 'Build'
|
||||||
|
|
||||||
|
- script: node scripts/prepackage-plugins.js
|
||||||
|
displayName: 'Prepackage plugins'
|
||||||
|
|
||||||
|
- script: node scripts/build-linux.js
|
||||||
|
displayName: 'Package'
|
||||||
|
env:
|
||||||
|
BT_TOKEN: $(BT_TOKEN)
|
||||||
|
GH_TOKEN: $(GH_TOKEN)
|
||||||
|
|
||||||
|
- task: CopyFiles@2
|
||||||
|
inputs:
|
||||||
|
contents: 'dist/*.deb'
|
||||||
|
targetFolder: $(Build.ArtifactStagingDirectory)
|
||||||
|
flattenFolders: true
|
||||||
|
cleanTargetFolder: true
|
||||||
|
|
||||||
|
- task: PublishBuildArtifacts@1
|
||||||
|
inputs:
|
||||||
|
pathtoPublish: $(Build.ArtifactStagingDirectory)
|
||||||
|
artifactName: Linux - DEB
|
||||||
|
condition: eq(variables['Build.SourceBranch'], 'refs/heads/master')
|
||||||
|
|
||||||
|
- task: CopyFiles@2
|
||||||
|
inputs:
|
||||||
|
contents: 'dist/*.rpm'
|
||||||
|
targetFolder: $(Build.ArtifactStagingDirectory)
|
||||||
|
flattenFolders: true
|
||||||
|
cleanTargetFolder: true
|
||||||
|
|
||||||
|
- task: PublishBuildArtifacts@1
|
||||||
|
inputs:
|
||||||
|
pathtoPublish: $(Build.ArtifactStagingDirectory)
|
||||||
|
artifactName: Linux - RPM
|
||||||
|
condition: eq(variables['Build.SourceBranch'], 'refs/heads/master')
|
||||||
|
|
||||||
|
- task: CopyFiles@2
|
||||||
|
inputs:
|
||||||
|
contents: 'dist/*.snap'
|
||||||
|
targetFolder: $(Build.ArtifactStagingDirectory)
|
||||||
|
flattenFolders: true
|
||||||
|
cleanTargetFolder: true
|
||||||
|
|
||||||
|
- task: PublishBuildArtifacts@1
|
||||||
|
inputs:
|
||||||
|
pathtoPublish: $(Build.ArtifactStagingDirectory)
|
||||||
|
artifactName: Linux - Snap
|
||||||
|
condition: eq(variables['Build.SourceBranch'], 'refs/heads/master')
|
||||||
|
|
||||||
|
- task: CopyFiles@2
|
||||||
|
inputs:
|
||||||
|
contents: 'dist/*.tar.gz'
|
||||||
|
targetFolder: $(Build.ArtifactStagingDirectory)
|
||||||
|
flattenFolders: true
|
||||||
|
cleanTargetFolder: true
|
||||||
|
|
||||||
|
- task: PublishBuildArtifacts@1
|
||||||
|
inputs:
|
||||||
|
pathtoPublish: $(Build.ArtifactStagingDirectory)
|
||||||
|
artifactName: Linux - tar.gz
|
||||||
|
condition: eq(variables['Build.SourceBranch'], 'refs/heads/master')
|
||||||
|
|
||||||
|
# - job: macOS
|
||||||
|
# pool:
|
||||||
|
# vmImage: 'macOS-10.14'
|
||||||
|
|
||||||
|
# steps:
|
||||||
|
# - task: NodeTool@0
|
||||||
|
# inputs:
|
||||||
|
# versionSpec: '10.x'
|
||||||
|
# displayName: 'Install Node.js'
|
||||||
|
|
||||||
|
# - script: yarn
|
||||||
|
# displayName: 'Install dependencies'
|
||||||
|
|
||||||
|
# - script: node scripts/build-native.js
|
||||||
|
# displayName: 'Rebuild native dependencies'
|
||||||
|
|
||||||
|
# - script: yarn run build
|
||||||
|
# displayName: 'Build'
|
||||||
|
|
||||||
|
# - script: node scripts/prepackage-plugins.js
|
||||||
|
# displayName: 'Prepackage plugins'
|
||||||
|
|
||||||
|
# - script: node scripts/build-macos.js
|
||||||
|
# displayName: 'Package'
|
||||||
|
# env:
|
||||||
|
# CSC_LINK: $(CSC_LINK)
|
||||||
|
# CSC_KEY_PASSWORD: $(CSC_KEY_PASSWORD)
|
||||||
|
# BT_TOKEN: $(BT_TOKEN)
|
||||||
|
# GH_TOKEN: $(GH_TOKEN)
|
||||||
|
# APPSTORE_USERNAME: $(APPSTORE_USERNAME)
|
||||||
|
# APPSTORE_PASSWORD: $(APPSTORE_PASSWORD)
|
||||||
|
# DEBUG: electron-builder
|
||||||
|
|
||||||
|
# - task: CopyFiles@2
|
||||||
|
# inputs:
|
||||||
|
# contents: 'dist/*.dmg'
|
||||||
|
# targetFolder: $(Build.ArtifactStagingDirectory)
|
||||||
|
# flattenFolders: true
|
||||||
|
# cleanTargetFolder: true
|
||||||
|
|
||||||
|
# - task: PublishBuildArtifacts@1
|
||||||
|
# inputs:
|
||||||
|
# pathtoPublish: $(Build.ArtifactStagingDirectory)
|
||||||
|
# artifactName: macOS - DMG
|
||||||
|
# condition: eq(variables['Build.SourceBranch'], 'refs/heads/master')
|
||||||
|
|
||||||
|
# - task: CopyFiles@2
|
||||||
|
# inputs:
|
||||||
|
# contents: 'dist/*.zip'
|
||||||
|
# targetFolder: $(Build.ArtifactStagingDirectory)
|
||||||
|
# flattenFolders: true
|
||||||
|
# cleanTargetFolder: true
|
||||||
|
|
||||||
|
# - task: PublishBuildArtifacts@1
|
||||||
|
# inputs:
|
||||||
|
# pathtoPublish: $(Build.ArtifactStagingDirectory)
|
||||||
|
# artifactName: macOS - app.zip
|
||||||
|
# condition: eq(variables['Build.SourceBranch'], 'refs/heads/master')
|
Before Width: | Height: | Size: 9.8 KiB After Width: | Height: | Size: 8.9 KiB |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 950 B |
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 3.9 KiB |
3
build/installer.nsh
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
!macro customInit
|
||||||
|
nsExec::Exec '"$LOCALAPPDATA\terminus\Update.exe" --uninstall -s'
|
||||||
|
!macroend
|
36
build/mac/afterSignHook.js
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
// See: https://medium.com/@TwitterArchiveEraser/notarize-electron-apps-7a5f988406db
|
||||||
|
|
||||||
|
const fs = require('fs')
|
||||||
|
const path = require('path')
|
||||||
|
const notarizer = require('electron-notarize')
|
||||||
|
|
||||||
|
module.exports = async function (params) {
|
||||||
|
console.log('env: ', process.env)
|
||||||
|
// notarize the app on Mac OS only.
|
||||||
|
if (process.platform !== 'darwin' || process.env.BUILD_SOURCEBRANCH !== 'refs/heads/master' || process.env.TRAVIS_BRANCH && !process.env.TRAVIS_PULL_REQUEST_BRANCH) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
console.log('afterSign hook triggered', params)
|
||||||
|
|
||||||
|
let appId = 'org.terminus'
|
||||||
|
|
||||||
|
let appPath = path.join(params.appOutDir, `${params.packager.appInfo.productFilename}.app`)
|
||||||
|
if (!fs.existsSync(appPath)) {
|
||||||
|
throw new Error(`Cannot find application at: ${appPath}`)
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log(`Notarizing ${appId} found at ${appPath}`)
|
||||||
|
|
||||||
|
try {
|
||||||
|
await notarizer.notarize({
|
||||||
|
appBundleId: appId,
|
||||||
|
appPath: appPath,
|
||||||
|
appleId: process.env.APPSTORE_USERNAME,
|
||||||
|
appleIdPassword: process.env.APPSTORE_PASSWORD,
|
||||||
|
})
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error)
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log(`Done notarizing ${appId}`)
|
||||||
|
}
|
12
build/mac/entitlements.plist
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>com.apple.security.cs.allow-jit</key>
|
||||||
|
<true/>
|
||||||
|
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
|
||||||
|
<true/>
|
||||||
|
<key>com.apple.security.cs.allow-dyld-environment-variables</key>
|
||||||
|
<true/>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
BIN
extras/UAC.exe
145
package.json
@@ -1,66 +1,66 @@
|
|||||||
{
|
{
|
||||||
"name": "term",
|
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@fortawesome/fontawesome-free": "^5.6.3",
|
"@fortawesome/fontawesome-free": "^5.9.0",
|
||||||
"@types/electron-config": "^0.2.1",
|
"@types/electron-config": "^3.2.2",
|
||||||
"@types/electron-debug": "^1.1.0",
|
"@types/electron-debug": "^2.1.0",
|
||||||
"@types/fs-promise": "1.0.1",
|
"@types/fs-promise": "1.0.3",
|
||||||
"@types/js-yaml": "^3.11.2",
|
"@types/js-yaml": "^3.12.1",
|
||||||
"@types/node": "^10.11.5",
|
"@types/node": "^12.0.12",
|
||||||
"@types/webpack-env": "1.13.0",
|
"@types/webpack-env": "1.13.9",
|
||||||
"app-builder-lib": "^20.28.4",
|
"@typescript-eslint/eslint-plugin": "^1.11.0",
|
||||||
"apply-loader": "0.1.0",
|
"@typescript-eslint/parser": "^1.11.0",
|
||||||
|
"app-builder-lib": "^21.0.8",
|
||||||
|
"apply-loader": "2.0.0",
|
||||||
"awesome-typescript-loader": "^5.0.0",
|
"awesome-typescript-loader": "^5.0.0",
|
||||||
"core-js": "2.4.1",
|
"core-js": "^3.1.4",
|
||||||
"cross-env": "4.0.0",
|
"cross-env": "5.2.0",
|
||||||
"css-loader": "0.28.0",
|
"css-loader": "3.0.0",
|
||||||
"electron": "4.0.5",
|
"electron": "^5.0.5",
|
||||||
"electron-builder": "^20.38.4",
|
"electron-builder": "^21.0.8",
|
||||||
"electron-builder-squirrel-windows": "^20.28.3",
|
"electron-installer-snap": "^4.0.0",
|
||||||
"electron-installer-snap": "^3.0.0",
|
"electron-notarize": "^0.1.1",
|
||||||
"electron-rebuild": "^1.8.2",
|
"electron-rebuild": "^1.8.5",
|
||||||
"file-loader": "^1.1.11",
|
"eslint": "^5.16.0",
|
||||||
"graceful-fs": "^4.1.11",
|
"file-loader": "^4.0.0",
|
||||||
"html-loader": "0.4.4",
|
"graceful-fs": "^4.1.15",
|
||||||
"json-loader": "0.5.4",
|
"html-loader": "0.5.5",
|
||||||
"node-abi": "^2.4.4",
|
"json-loader": "0.5.7",
|
||||||
"node-gyp": "^3.8.0",
|
"node-abi": "^2.9.0",
|
||||||
"node-sass": "^4.5.3",
|
"node-gyp": "^5.0.2",
|
||||||
"npmlog": "4.1.0",
|
"node-sass": "^4.12.0",
|
||||||
|
"npmlog": "4.1.2",
|
||||||
"npx": "^10.2.0",
|
"npx": "^10.2.0",
|
||||||
"pug": "^2.0.3",
|
"pug": "^2.0.4",
|
||||||
"pug-html-loader": "1.0.9",
|
"pug-html-loader": "1.1.5",
|
||||||
"pug-lint": "^2.5.0",
|
"pug-lint": "^2.6.0",
|
||||||
"pug-loader": "^2.4.0",
|
"pug-loader": "^2.4.0",
|
||||||
"pug-static-loader": "0.0.1",
|
"pug-static-loader": "2.0.0",
|
||||||
"raven-js": "3.16.0",
|
"raven-js": "3.27.2",
|
||||||
"raw-loader": "0.5.1",
|
"raw-loader": "3.0.0",
|
||||||
"sass-loader": "^7.0.1",
|
"sass-loader": "^7.0.1",
|
||||||
"shelljs": "0.7.7",
|
"shelljs": "0.8.3",
|
||||||
"source-code-pro": "^2.30.1",
|
"source-code-pro": "^2.30.1",
|
||||||
"source-sans-pro": "2.0.10",
|
"source-sans-pro": "2.45.0",
|
||||||
"style-loader": "^0.23.1",
|
"style-loader": "^0.23.1",
|
||||||
"svg-inline-loader": "^0.8.0",
|
"svg-inline-loader": "^0.8.0",
|
||||||
"to-string-loader": "1.1.5",
|
"to-string-loader": "1.1.5",
|
||||||
"tslint": "^5.12.0",
|
"tslib": "^1.10.0",
|
||||||
"tslint-config-standard": "^8.0.1",
|
|
||||||
"tslint-eslint-rules": "^5.4.0",
|
|
||||||
"typedoc": "^0.14.2",
|
"typedoc": "^0.14.2",
|
||||||
"typescript": "^3.1.3",
|
"typescript": "^3.5.2",
|
||||||
"url-loader": "^1.1.1",
|
"url-loader": "^2.0.0",
|
||||||
"val-loader": "0.5.0",
|
"val-loader": "1.1.1",
|
||||||
"webpack": "^4.27.1",
|
"webpack": "^4.35.2",
|
||||||
"webpack-cli": "^3.1.2",
|
"webpack-cli": "^3.3.5",
|
||||||
"yaml-loader": "0.4.0",
|
"yaml-loader": "0.5.0"
|
||||||
"yarn": "^1.10.1"
|
|
||||||
},
|
},
|
||||||
"resolutions": {
|
"resolutions": {
|
||||||
"*/node-abi": "^2.5.0"
|
"*/node-abi": "^2.8.0"
|
||||||
},
|
},
|
||||||
"build": {
|
"build": {
|
||||||
"appId": "org.terminus",
|
"appId": "org.terminus",
|
||||||
"productName": "Terminus",
|
"productName": "Terminus",
|
||||||
"compression": "normal",
|
"compression": "normal",
|
||||||
|
"afterSign": "./build/mac/afterSignHook.js",
|
||||||
"files": [
|
"files": [
|
||||||
"**/*",
|
"**/*",
|
||||||
"dist"
|
"dist"
|
||||||
@@ -71,16 +71,24 @@
|
|||||||
],
|
],
|
||||||
"win": {
|
"win": {
|
||||||
"icon": "./build/windows/icon.ico",
|
"icon": "./build/windows/icon.ico",
|
||||||
"publish": [
|
"artifactName": "terminus-${version}-setup.exe",
|
||||||
"github"
|
"rfc3161TimeStampServer": "http://sha256timestamp.ws.symantec.com/sha256/timestamp"
|
||||||
],
|
|
||||||
"artifactName": "terminus-${version}-setup.exe"
|
|
||||||
},
|
},
|
||||||
"squirrelWindows": {
|
"nsis": {
|
||||||
"iconUrl": "https://github.com/Eugeny/terminus/raw/master/build/windows/icon.ico",
|
"oneClick": false,
|
||||||
"loadingGif": "./build/windows/squirrel.gif",
|
"artifactName": "terminus-${version}-setup.${ext}",
|
||||||
"artifactName": "terminus-${version}-setup.exe"
|
"installerIcon": "./build/windows/icon.ico"
|
||||||
},
|
},
|
||||||
|
"publish": [
|
||||||
|
{
|
||||||
|
"provider": "bintray",
|
||||||
|
"token": "d993c4faa708a4cba84fa3a8e822457e7298d75c",
|
||||||
|
"component": "main"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"provider": "github"
|
||||||
|
}
|
||||||
|
],
|
||||||
"portable": {
|
"portable": {
|
||||||
"artifactName": "terminus-${version}-portable.exe"
|
"artifactName": "terminus-${version}-portable.exe"
|
||||||
},
|
},
|
||||||
@@ -88,34 +96,29 @@
|
|||||||
"category": "public.app-category.video",
|
"category": "public.app-category.video",
|
||||||
"icon": "./build/mac/icon.icns",
|
"icon": "./build/mac/icon.icns",
|
||||||
"artifactName": "terminus-${version}-macos.${ext}",
|
"artifactName": "terminus-${version}-macos.${ext}",
|
||||||
"publish": [
|
"hardenedRuntime": true,
|
||||||
"github"
|
"entitlements": "./build/mac/entitlements.plist",
|
||||||
],
|
|
||||||
"extendInfo": {
|
"extendInfo": {
|
||||||
"NSRequiresAquaSystemAppearance": false
|
"NSRequiresAquaSystemAppearance": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dmg": {
|
"pkg": {
|
||||||
"artifactName": "terminus-${version}-macos.dmg"
|
"artifactName": "terminus-${version}-macos.pkg"
|
||||||
},
|
},
|
||||||
"linux": {
|
"linux": {
|
||||||
"category": "Utilities",
|
"category": "Utilities",
|
||||||
"icon": "./build/icons",
|
"icon": "./build/icons",
|
||||||
"artifactName": "terminus-${version}-linux.${ext}",
|
"artifactName": "terminus-${version}-linux.${ext}"
|
||||||
"publish": [
|
|
||||||
"github"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
"deb": {
|
"deb": {
|
||||||
"depends": [
|
"depends": [
|
||||||
"screen",
|
|
||||||
"gconf2",
|
"gconf2",
|
||||||
"gconf-service",
|
"gconf-service",
|
||||||
"libnotify4",
|
"libnotify4",
|
||||||
|
"libsecret-1-0",
|
||||||
"libappindicator1",
|
"libappindicator1",
|
||||||
"libxtst6",
|
"libxtst6",
|
||||||
"libnss3",
|
"libnss3"
|
||||||
"tmux"
|
|
||||||
],
|
],
|
||||||
"afterInstall": "build/linux/after-install.tpl"
|
"afterInstall": "build/linux/after-install.tpl"
|
||||||
},
|
},
|
||||||
@@ -127,13 +130,17 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "webpack --color --config app/webpack.main.config.js && webpack --color --config app/webpack.config.js && webpack --color --config terminus-core/webpack.config.js && webpack --color --config terminus-settings/webpack.config.js && webpack --color --config terminus-terminal/webpack.config.js && webpack --color --config terminus-settings/webpack.config.js && webpack --color --config terminus-plugin-manager/webpack.config.js && webpack --color --config terminus-community-color-schemes/webpack.config.js && webpack --color --config terminus-ssh/webpack.config.js",
|
"build": "npm run build:typings && webpack --color --config app/webpack.main.config.js && webpack --color --config app/webpack.config.js && webpack --color --config terminus-core/webpack.config.js && webpack --color --config terminus-settings/webpack.config.js && webpack --color --config terminus-terminal/webpack.config.js && webpack --color --config terminus-plugin-manager/webpack.config.js && webpack --color --config terminus-community-color-schemes/webpack.config.js && webpack --color --config terminus-ssh/webpack.config.js",
|
||||||
|
"build:typings": "tsc --project terminus-core/tsconfig.typings.json && tsc --project terminus-settings/tsconfig.typings.json && tsc --project terminus-terminal/tsconfig.typings.json && tsc --project terminus-plugin-manager/tsconfig.typings.json && tsc --project terminus-ssh/tsconfig.typings.json",
|
||||||
"watch": "cross-env TERMINUS_DEV=1 webpack --progress --color --watch",
|
"watch": "cross-env TERMINUS_DEV=1 webpack --progress --color --watch",
|
||||||
"start": "cross-env TERMINUS_DEV=1 electron app --debug",
|
"start": "cross-env TERMINUS_DEV=1 electron app --debug",
|
||||||
"prod": "cross-env TERMINUS_DEV=1 electron app",
|
"prod": "cross-env TERMINUS_DEV=1 electron app",
|
||||||
"docs": "typedoc --out docs/api terminus-core/src && typedoc --out docs/api/terminal terminus-terminal/src && typedoc --out docs/api/settings terminus-settings/src",
|
"docs": "typedoc --out docs/api terminus-core/src && typedoc --out docs/api/terminal --tsconfig terminus-terminal/tsconfig.typings.json terminus-terminal/src && typedoc --out docs/api/settings --tsconfig terminus-settings/tsconfig.typings.json terminus-settings/src",
|
||||||
"lint": "tslint -c tslint.json -t stylish terminus-*/src/**/*.ts terminus-*/src/*.ts app/src/*.ts",
|
"lint": "eslint --ext ts */src",
|
||||||
"postinstall": "node ./scripts/install-deps.js"
|
"postinstall": "node ./scripts/install-deps.js"
|
||||||
},
|
},
|
||||||
"repository": "eugeny/terminus"
|
"repository": "eugeny/terminus",
|
||||||
|
"dependencies": {
|
||||||
|
"eslint-plugin-import": "^2.18.0"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -2,13 +2,15 @@
|
|||||||
const builder = require('electron-builder').build
|
const builder = require('electron-builder').build
|
||||||
const vars = require('./vars')
|
const vars = require('./vars')
|
||||||
|
|
||||||
|
const isTag = (process.env.BUILD_SOURCEBRANCH || '').startsWith('refs/tags/')
|
||||||
|
|
||||||
builder({
|
builder({
|
||||||
dir: true,
|
dir: true,
|
||||||
linux: ['snap', 'deb', 'rpm', 'tar.gz'],
|
linux: ['snap', 'deb', 'rpm', 'tar.gz'],
|
||||||
config: {
|
config: {
|
||||||
extraMetadata: {
|
extraMetadata: {
|
||||||
version: vars.version,
|
version: vars.version,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
publish: isTag ? 'always' : 'onTag',
|
||||||
publish: 'onTag',
|
}).catch(() => process.exit(1))
|
||||||
})
|
|
||||||
|
@@ -2,13 +2,15 @@
|
|||||||
const builder = require('electron-builder').build
|
const builder = require('electron-builder').build
|
||||||
const vars = require('./vars')
|
const vars = require('./vars')
|
||||||
|
|
||||||
|
const isTag = (process.env.BUILD_SOURCEBRANCH || '').startsWith('refs/tags/')
|
||||||
|
|
||||||
builder({
|
builder({
|
||||||
dir: true,
|
dir: true,
|
||||||
mac: ['dmg', 'zip'],
|
mac: ['pkg', 'zip'],
|
||||||
config: {
|
config: {
|
||||||
extraMetadata: {
|
extraMetadata: {
|
||||||
version: vars.version,
|
version: vars.version,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
publish: isTag ? 'always' : 'onTag',
|
||||||
publish: 'onTag',
|
}).catch(() => process.exit(1))
|
||||||
})
|
|
||||||
|
@@ -4,12 +4,14 @@ const path = require('path')
|
|||||||
const vars = require('./vars')
|
const vars = require('./vars')
|
||||||
|
|
||||||
lifecycles = []
|
lifecycles = []
|
||||||
for (let dir of ['app', 'terminus-ssh', 'terminus-terminal']) {
|
for (let dir of ['app', 'terminus-core', 'terminus-ssh', 'terminus-terminal']) {
|
||||||
lifecycles.push([rebuild({
|
build = rebuild({
|
||||||
buildPath: path.resolve(__dirname, '../' + dir),
|
buildPath: path.resolve(__dirname, '../' + dir),
|
||||||
electronVersion: vars.electronVersion,
|
electronVersion: vars.electronVersion,
|
||||||
force: true,
|
force: true,
|
||||||
}).lifecycle, dir])
|
})
|
||||||
|
build.catch(() => process.exit(1))
|
||||||
|
lifecycles.push([build.lifecycle, dir])
|
||||||
}
|
}
|
||||||
|
|
||||||
console.info('Building against Electron', vars.electronVersion)
|
console.info('Building against Electron', vars.electronVersion)
|
||||||
|
@@ -2,13 +2,15 @@
|
|||||||
const builder = require('electron-builder').build
|
const builder = require('electron-builder').build
|
||||||
const vars = require('./vars')
|
const vars = require('./vars')
|
||||||
|
|
||||||
|
const isTag = (process.env.BUILD_SOURCEBRANCH || '').startsWith('refs/tags/')
|
||||||
|
|
||||||
builder({
|
builder({
|
||||||
dir: true,
|
dir: true,
|
||||||
win: ['squirrel', 'portable'],
|
win: ['nsis', 'portable'],
|
||||||
config: {
|
config: {
|
||||||
extraMetadata: {
|
extraMetadata: {
|
||||||
version: vars.version,
|
version: vars.version,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
publish: isTag ? 'always' : 'onTag',
|
||||||
publish: 'onTag',
|
}).catch(() => process.exit(1))
|
||||||
})
|
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
const path = require('path')
|
const path = require('path')
|
||||||
const fs = require('fs')
|
const fs = require('fs')
|
||||||
|
const semver = require('semver')
|
||||||
const childProcess = require('child_process')
|
const childProcess = require('child_process')
|
||||||
|
|
||||||
const appInfo = JSON.parse(fs.readFileSync(path.resolve(__dirname, '../app/package.json')))
|
const appInfo = JSON.parse(fs.readFileSync(path.resolve(__dirname, '../app/package.json')))
|
||||||
@@ -9,6 +10,10 @@ exports.version = childProcess.execSync('git describe --tags', {encoding:'utf-8'
|
|||||||
exports.version = exports.version.substring(1).trim()
|
exports.version = exports.version.substring(1).trim()
|
||||||
exports.version = exports.version.replace('-', '-c')
|
exports.version = exports.version.replace('-', '-c')
|
||||||
|
|
||||||
|
if (exports.version.includes('-c')) {
|
||||||
|
exports.version = semver.inc(exports.version, 'prepatch').replace('-0', '-nightly.0')
|
||||||
|
}
|
||||||
|
|
||||||
exports.builtinPlugins = [
|
exports.builtinPlugins = [
|
||||||
'terminus-core',
|
'terminus-core',
|
||||||
'terminus-settings',
|
'terminus-settings',
|
||||||
|
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "terminus-community-color-schemes",
|
"name": "terminus-community-color-schemes",
|
||||||
"version": "1.0.73-c4-ga7d62b0",
|
"version": "1.0.83-nightly.0",
|
||||||
"description": "Community color schemes for Terminus",
|
"description": "Community color schemes for Terminus",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"terminus-builtin-plugin"
|
"terminus-builtin-plugin"
|
||||||
],
|
],
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"typings": "dist/index.d.ts",
|
"typings": "typings/index.d.ts",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "webpack --progress --color",
|
"build": "webpack --progress --color",
|
||||||
"watch": "webpack --progress --color --watch"
|
"watch": "webpack --progress --color --watch"
|
||||||
@@ -17,13 +17,8 @@
|
|||||||
"author": "Eugene Pankov",
|
"author": "Eugene Pankov",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@angular/core": "4.0.1",
|
"@angular/core": "^7",
|
||||||
"terminus-core": "*",
|
"terminus-core": "*",
|
||||||
"terminus-terminal": "*"
|
"terminus-terminal": "*"
|
||||||
},
|
}
|
||||||
"devDependencies": {
|
|
||||||
"@types/node": "7.0.12",
|
|
||||||
"@types/webpack-env": "^1.13.0"
|
|
||||||
},
|
|
||||||
"false": {}
|
|
||||||
}
|
}
|
||||||
|
@@ -1,26 +1,26 @@
|
|||||||
import { Injectable } from '@angular/core'
|
import { Injectable } from '@angular/core'
|
||||||
import { TerminalColorSchemeProvider, ITerminalColorScheme } from 'terminus-terminal'
|
import { TerminalColorSchemeProvider, TerminalColorScheme } from 'terminus-terminal'
|
||||||
|
|
||||||
const schemeContents = require.context('../schemes/', true, /.*/)
|
const schemeContents = require.context('../schemes/', true, /.*/)
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class ColorSchemes extends TerminalColorSchemeProvider {
|
export class ColorSchemes extends TerminalColorSchemeProvider {
|
||||||
async getSchemes (): Promise<ITerminalColorScheme[]> {
|
async getSchemes (): Promise<TerminalColorScheme[]> {
|
||||||
let schemes: ITerminalColorScheme[] = []
|
const schemes: TerminalColorScheme[] = []
|
||||||
|
|
||||||
schemeContents.keys().forEach(schemeFile => {
|
schemeContents.keys().forEach(schemeFile => {
|
||||||
let lines = (schemeContents(schemeFile) as string).split('\n')
|
const lines = (schemeContents(schemeFile).default as string).split('\n')
|
||||||
|
|
||||||
// process #define variables
|
// process #define variables
|
||||||
let variables: any = {}
|
const variables: any = {}
|
||||||
lines
|
lines
|
||||||
.filter(x => x.startsWith('#define'))
|
.filter(x => x.startsWith('#define'))
|
||||||
.map(x => x.split(' ').map(v => v.trim()))
|
.map(x => x.split(' ').map(v => v.trim()))
|
||||||
.forEach(([ignore, variableName, variableValue]) => {
|
.forEach(([_, variableName, variableValue]) => {
|
||||||
variables[variableName] = variableValue
|
variables[variableName] = variableValue
|
||||||
})
|
})
|
||||||
|
|
||||||
let values: any = {}
|
const values: any = {}
|
||||||
lines
|
lines
|
||||||
.filter(x => x.startsWith('*.'))
|
.filter(x => x.startsWith('*.'))
|
||||||
.map(x => x.substring(2))
|
.map(x => x.substring(2))
|
||||||
@@ -29,7 +29,7 @@ export class ColorSchemes extends TerminalColorSchemeProvider {
|
|||||||
values[key] = variables[value] ? variables[value] : value
|
values[key] = variables[value] ? variables[value] : value
|
||||||
})
|
})
|
||||||
|
|
||||||
let colors: string[] = []
|
const colors: string[] = []
|
||||||
let colorIndex = 0
|
let colorIndex = 0
|
||||||
while (values[`color${colorIndex}`]) {
|
while (values[`color${colorIndex}`]) {
|
||||||
colors.push(values[`color${colorIndex}`])
|
colors.push(values[`color${colorIndex}`])
|
||||||
|
@@ -8,4 +8,4 @@ import { ColorSchemes } from './colorSchemes'
|
|||||||
{ provide: TerminalColorSchemeProvider, useClass: ColorSchemes, multi: true },
|
{ provide: TerminalColorSchemeProvider, useClass: ColorSchemes, multi: true },
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
export default class PopularThemesModule { }
|
export default class PopularThemesModule { } // eslint-disable-line @typescript-eslint/no-extraneous-class
|
||||||
|
@@ -2,7 +2,6 @@
|
|||||||
"extends": "../tsconfig.json",
|
"extends": "../tsconfig.json",
|
||||||
"exclude": ["node_modules", "dist"],
|
"exclude": ["node_modules", "dist"],
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"baseUrl": "src",
|
"baseUrl": "src"
|
||||||
"declarationDir": "dist"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -2,51 +2,54 @@ const path = require('path')
|
|||||||
const webpack = require('webpack')
|
const webpack = require('webpack')
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
target: 'node',
|
target: 'node',
|
||||||
entry: 'src/index.ts',
|
entry: 'src/index.ts',
|
||||||
devtool: 'source-map',
|
devtool: 'source-map',
|
||||||
context: __dirname,
|
context: __dirname,
|
||||||
output: {
|
output: {
|
||||||
path: path.resolve(__dirname, 'dist'),
|
path: path.resolve(__dirname, 'dist'),
|
||||||
filename: 'index.js',
|
filename: 'index.js',
|
||||||
pathinfo: true,
|
pathinfo: true,
|
||||||
libraryTarget: 'umd',
|
libraryTarget: 'umd',
|
||||||
devtoolModuleFilenameTemplate: 'webpack-terminus-community-color-schemes:///[resource-path]',
|
devtoolModuleFilenameTemplate: 'webpack-terminus-community-color-schemes:///[resource-path]',
|
||||||
},
|
},
|
||||||
mode: process.env.TERMINUS_DEV ? 'development' : 'production',
|
mode: process.env.TERMINUS_DEV ? 'development' : 'production',
|
||||||
optimization:{
|
optimization:{
|
||||||
minimize: false,
|
minimize: false,
|
||||||
},
|
},
|
||||||
resolve: {
|
resolve: {
|
||||||
modules: ['.', 'src', 'node_modules', '../app/node_modules'].map(x => path.join(__dirname, x)),
|
modules: ['.', 'src', 'node_modules', '../app/node_modules'].map(x => path.join(__dirname, x)),
|
||||||
extensions: ['.ts', '.js'],
|
extensions: ['.ts', '.js'],
|
||||||
},
|
},
|
||||||
module: {
|
module: {
|
||||||
rules: [
|
rules: [
|
||||||
{
|
{
|
||||||
test: /\.ts$/,
|
test: /\.ts$/,
|
||||||
use: {
|
use: {
|
||||||
loader: 'awesome-typescript-loader',
|
loader: 'awesome-typescript-loader',
|
||||||
options: {
|
options: {
|
||||||
configFileName: path.resolve(__dirname, 'tsconfig.json'),
|
configFileName: path.resolve(__dirname, 'tsconfig.json'),
|
||||||
typeRoots: [path.resolve(__dirname, 'node_modules/@types')],
|
typeRoots: [
|
||||||
paths: {
|
path.resolve(__dirname, 'node_modules/@types'),
|
||||||
"terminus-*": [path.resolve(__dirname, '../terminus-*')],
|
path.resolve(__dirname, '../node_modules/@types'),
|
||||||
"*": [path.resolve(__dirname, '../app/node_modules/*')],
|
],
|
||||||
}
|
paths: {
|
||||||
}
|
"terminus-*": [path.resolve(__dirname, '../terminus-*')],
|
||||||
}
|
"*": [path.resolve(__dirname, '../app/node_modules/*')],
|
||||||
},
|
},
|
||||||
{ test: /[\\\/]schemes[\\\/]/, use: "raw-loader" },
|
},
|
||||||
]
|
},
|
||||||
},
|
},
|
||||||
externals: [
|
{ test: /[\\\/]schemes[\\\/]/, use: "raw-loader" },
|
||||||
/^rxjs/,
|
],
|
||||||
/^@angular/,
|
},
|
||||||
/^@ng-bootstrap/,
|
externals: [
|
||||||
/^terminus-/,
|
/^rxjs/,
|
||||||
],
|
/^@angular/,
|
||||||
plugins: [
|
/^@ng-bootstrap/,
|
||||||
new webpack.optimize.ModuleConcatenationPlugin(),
|
/^terminus-/,
|
||||||
],
|
],
|
||||||
|
plugins: [
|
||||||
|
new webpack.optimize.ModuleConcatenationPlugin(),
|
||||||
|
],
|
||||||
}
|
}
|
||||||
|
@@ -2,12 +2,3 @@
|
|||||||
# yarn lockfile v1
|
# yarn lockfile v1
|
||||||
|
|
||||||
|
|
||||||
"@types/node@7.0.12":
|
|
||||||
version "7.0.12"
|
|
||||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.12.tgz#ae5f67a19c15f752148004db07cbbb372e69efc9"
|
|
||||||
integrity sha1-rl9noZwV91IUgATbB8u7Ny5p78k=
|
|
||||||
|
|
||||||
"@types/webpack-env@^1.13.0":
|
|
||||||
version "1.13.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/@types/webpack-env/-/webpack-env-1.13.1.tgz#b45c222e24301bd006e3edfc762cc6b51bda236a"
|
|
||||||
integrity sha512-oHyg0NssP2RCpCvE35hhbSqMJRsc5lSW+GFe+Vc65JL+kHII1VMYM+0KeV/z4utFuUqPoQRmq8KMMp7ba0dj6Q==
|
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
Terminus Core Plugin
|
Terminus Core Plugin
|
||||||
--------------------
|
--------------------
|
||||||
|
|
||||||
See also: [Settings plugin API](./settings/), [Terminal plugin API](./settings/)
|
See also: [Settings plugin API](./settings/), [Terminal plugin API](./terminal/)
|
||||||
|
|
||||||
* tabbed interface services
|
* tabbed interface services
|
||||||
* toolbar UI
|
* toolbar UI
|
||||||
|
@@ -1,49 +1,45 @@
|
|||||||
{
|
{
|
||||||
"name": "terminus-core",
|
"name": "terminus-core",
|
||||||
"version": "1.0.73-c4-ga7d62b0",
|
"version": "1.0.83-nightly.4",
|
||||||
"description": "Terminus core",
|
"description": "Terminus core",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"terminus-builtin-plugin"
|
"terminus-builtin-plugin"
|
||||||
],
|
],
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"typings": "dist/index.d.ts",
|
"typings": "typings/index.d.ts",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "webpack --progress --color --display-modules",
|
"build": "webpack --progress --color --display-modules",
|
||||||
"watch": "webpack --progress --color --watch"
|
"watch": "webpack --progress --color --watch"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"dist"
|
"typings"
|
||||||
],
|
],
|
||||||
"author": "Eugene Pankov",
|
"author": "Eugene Pankov",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/js-yaml": "^3.9.0",
|
"@types/js-yaml": "^3.9.0",
|
||||||
"@types/node": "^7.0.37",
|
"@types/shell-escape": "^0.2.0",
|
||||||
"@types/webpack-env": "^1.13.0",
|
|
||||||
"@types/winston": "^2.3.6",
|
"@types/winston": "^2.3.6",
|
||||||
"axios": "^0.18.0",
|
"axios": "^0.19.0",
|
||||||
"bootstrap": "^4.1.3",
|
"bootstrap": "^4.1.3",
|
||||||
"core-js": "^2.4.1",
|
"core-js": "^3.1.2",
|
||||||
"electron-updater": "^2.8.9",
|
"deepmerge": "^3.2.0",
|
||||||
|
"electron-updater": "^4.0.6",
|
||||||
|
"js-yaml": "^3.9.0",
|
||||||
|
"mixpanel": "^0.10.2",
|
||||||
"ng2-dnd": "^5.0.2",
|
"ng2-dnd": "^5.0.2",
|
||||||
"ngx-perfect-scrollbar": "^6.0.0",
|
"ngx-perfect-scrollbar": "^6.0.0",
|
||||||
"rage-edit": "^1.2.0",
|
|
||||||
"shell-escape": "^0.2.0",
|
"shell-escape": "^0.2.0",
|
||||||
"universal-analytics": "^0.4.17"
|
"uuid": "^3.3.2",
|
||||||
|
"winston": "^3.2.1"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@angular/animations": "4.0.1",
|
"@angular/animations": "^7",
|
||||||
"@angular/common": "4.0.1",
|
"@angular/common": "^7",
|
||||||
"@angular/core": "4.0.1",
|
"@angular/core": "^7",
|
||||||
"@angular/forms": "4.0.1",
|
"@angular/forms": "^7",
|
||||||
"@angular/platform-browser": "4.0.1",
|
"@angular/platform-browser": "^7",
|
||||||
"@angular/platform-browser-dynamic": "4.0.1",
|
"@angular/platform-browser-dynamic": "^7",
|
||||||
"rxjs": "5.3.0",
|
"rxjs": "^5"
|
||||||
"zone.js": "0.8.4"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"deepmerge": "^1.5.0",
|
|
||||||
"js-yaml": "^3.9.0",
|
|
||||||
"winston": "^2.4.0"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
export interface IHotkeyDescription {
|
export interface HotkeyDescription {
|
||||||
id: string
|
id: string
|
||||||
name: string
|
name: string
|
||||||
}
|
}
|
||||||
@@ -8,7 +8,7 @@ export interface IHotkeyDescription {
|
|||||||
* must also provide the `hotkeys.foo` config options with the default values
|
* must also provide the `hotkeys.foo` config options with the default values
|
||||||
*/
|
*/
|
||||||
export abstract class HotkeyProvider {
|
export abstract class HotkeyProvider {
|
||||||
hotkeys: IHotkeyDescription[] = []
|
hotkeys: HotkeyDescription[] = []
|
||||||
|
|
||||||
abstract provide (): Promise<IHotkeyDescription[]>
|
abstract provide (): Promise<HotkeyDescription[]>
|
||||||
}
|
}
|
||||||
|
@@ -1,9 +1,9 @@
|
|||||||
export { BaseTabComponent, BaseTabProcess } from '../components/baseTab.component'
|
export { BaseTabComponent, BaseTabProcess } from '../components/baseTab.component'
|
||||||
export { SplitTabComponent, SplitContainer } from '../components/splitTab.component'
|
export { SplitTabComponent, SplitContainer } from '../components/splitTab.component'
|
||||||
export { TabRecoveryProvider, RecoveredTab } from './tabRecovery'
|
export { TabRecoveryProvider, RecoveredTab } from './tabRecovery'
|
||||||
export { ToolbarButtonProvider, IToolbarButton } from './toolbarButtonProvider'
|
export { ToolbarButtonProvider, ToolbarButton } from './toolbarButtonProvider'
|
||||||
export { ConfigProvider } from './configProvider'
|
export { ConfigProvider } from './configProvider'
|
||||||
export { HotkeyProvider, IHotkeyDescription } from './hotkeyProvider'
|
export { HotkeyProvider, HotkeyDescription } from './hotkeyProvider'
|
||||||
export { Theme } from './theme'
|
export { Theme } from './theme'
|
||||||
export { TabContextMenuItemProvider } from './tabContextMenuProvider'
|
export { TabContextMenuItemProvider } from './tabContextMenuProvider'
|
||||||
|
|
||||||
|
@@ -1,13 +1,11 @@
|
|||||||
import { SafeHtml } from '@angular/platform-browser'
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* See [[ToolbarButtonProvider]]
|
* See [[ToolbarButtonProvider]]
|
||||||
*/
|
*/
|
||||||
export interface IToolbarButton {
|
export interface ToolbarButton {
|
||||||
/**
|
/**
|
||||||
* Raw SVG icon code
|
* Raw SVG icon code
|
||||||
*/
|
*/
|
||||||
icon: SafeHtml
|
icon: string
|
||||||
|
|
||||||
title: string
|
title: string
|
||||||
|
|
||||||
@@ -23,12 +21,17 @@ export interface IToolbarButton {
|
|||||||
|
|
||||||
weight?: number
|
weight?: number
|
||||||
|
|
||||||
click: () => void
|
click?: () => void
|
||||||
|
|
||||||
|
submenu?: () => Promise<ToolbarButton[]>
|
||||||
|
|
||||||
|
/** @hidden */
|
||||||
|
submenuItems?: ToolbarButton[]
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Extend to add buttons to the toolbar
|
* Extend to add buttons to the toolbar
|
||||||
*/
|
*/
|
||||||
export abstract class ToolbarButtonProvider {
|
export abstract class ToolbarButtonProvider {
|
||||||
abstract provide (): IToolbarButton[]
|
abstract provide (): ToolbarButton[]
|
||||||
}
|
}
|
||||||
|
@@ -32,28 +32,54 @@ title-bar(
|
|||||||
)
|
)
|
||||||
|
|
||||||
.btn-group.background
|
.btn-group.background
|
||||||
button.btn.btn-secondary.btn-tab-bar(
|
.d-flex(
|
||||||
*ngFor='let button of leftToolbarButtons',
|
*ngFor='let button of leftToolbarButtons',
|
||||||
[title]='button.title',
|
ngbDropdown,
|
||||||
(click)='button.click()',
|
(openChange)='generateButtonSubmenu(button)',
|
||||||
[innerHTML]='button.icon',
|
|
||||||
)
|
)
|
||||||
|
button.btn.btn-secondary.btn-tab-bar(
|
||||||
|
[title]='button.title',
|
||||||
|
(click)='button.click && button.click()',
|
||||||
|
[innerHTML]='sanitizeIcon(button.icon)',
|
||||||
|
ngbDropdownToggle,
|
||||||
|
)
|
||||||
|
div(*ngIf='button.submenu', ngbDropdownMenu)
|
||||||
|
button.dropdown-item.d-flex.align-items-center(
|
||||||
|
*ngFor='let item of button.submenuItems',
|
||||||
|
(click)='item.click()',
|
||||||
|
ngbDropdownItem,
|
||||||
|
)
|
||||||
|
.icon-wrapper([innerHTML]='sanitizeIcon(item.icon)')
|
||||||
|
.ml-3 {{item.title}}
|
||||||
|
|
||||||
.drag-space.background([class.persistent]='config.store.appearance.frame == "thin" && hostApp.platform != Platform.macOS')
|
.drag-space.background([class.persistent]='config.store.appearance.frame == "thin" && hostApp.platform != Platform.macOS')
|
||||||
|
|
||||||
.btn-group.background
|
.btn-group.background
|
||||||
button.btn.btn-secondary.btn-tab-bar(
|
.d-flex(
|
||||||
*ngFor='let button of rightToolbarButtons',
|
*ngFor='let button of rightToolbarButtons',
|
||||||
[title]='button.title',
|
ngbDropdown,
|
||||||
(click)='button.click()',
|
(openChange)='generateButtonSubmenu(button)',
|
||||||
[innerHTML]='button.icon',
|
|
||||||
)
|
)
|
||||||
|
button.btn.btn-secondary.btn-tab-bar(
|
||||||
|
[title]='button.title',
|
||||||
|
(click)='button.click && button.click()',
|
||||||
|
[innerHTML]='sanitizeIcon(button.icon)',
|
||||||
|
ngbDropdownToggle,
|
||||||
|
)
|
||||||
|
div(*ngIf='button.submenu', ngbDropdownMenu)
|
||||||
|
button.dropdown-item.d-flex.align-items-center(
|
||||||
|
*ngFor='let item of button.submenuItems',
|
||||||
|
(click)='item.click()',
|
||||||
|
ngbDropdownItem,
|
||||||
|
)
|
||||||
|
.icon-wrapper([innerHTML]='sanitizeIcon(item.icon)')
|
||||||
|
.ml-3 {{item.title}}
|
||||||
|
|
||||||
button.btn.btn-secondary.btn-tab-bar.btn-update(
|
button.btn.btn-secondary.btn-tab-bar.btn-update(
|
||||||
*ngIf='updatesAvailable',
|
*ngIf='updatesAvailable',
|
||||||
title='Update available',
|
title='Update available',
|
||||||
(click)='updateApp()',
|
(click)='updateApp()',
|
||||||
[innerHTML]='updateIcon'
|
[innerHTML]='sanitizeIcon(updateIcon)'
|
||||||
)
|
)
|
||||||
|
|
||||||
window-controls.background(
|
window-controls.background(
|
||||||
|
@@ -48,6 +48,10 @@ $tab-border-radius: 4px;
|
|||||||
color: #aaa;
|
color: #aaa;
|
||||||
border: none;
|
border: none;
|
||||||
border-radius: 0;
|
border-radius: 0;
|
||||||
|
|
||||||
|
&.dropdown-toggle::after {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&>.tabs {
|
&>.tabs {
|
||||||
@@ -88,12 +92,20 @@ hotkey-hint {
|
|||||||
max-width: 300px;
|
max-width: 300px;
|
||||||
}
|
}
|
||||||
|
|
||||||
::ng-deep .btn-tab-bar svg {
|
::ng-deep .btn-tab-bar svg,
|
||||||
|
::ng-deep .btn-tab-bar + .dropdown-menu svg {
|
||||||
|
width: 16px;
|
||||||
height: 16px;
|
height: 16px;
|
||||||
fill: white;
|
fill: white;
|
||||||
fill-opacity: 0.75;
|
fill-opacity: 0.75;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.icon-wrapper {
|
||||||
|
display: flex;
|
||||||
|
width: 16px;
|
||||||
|
height: 17px;
|
||||||
|
}
|
||||||
|
|
||||||
::ng-deep .btn-update svg {
|
::ng-deep .btn-update svg {
|
||||||
fill: cyan;
|
fill: cyan;
|
||||||
}
|
}
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
import { Component, Inject, Input, HostListener, HostBinding } from '@angular/core'
|
import { Component, Inject, Input, HostListener, HostBinding } from '@angular/core'
|
||||||
import { trigger, style, animate, transition, state } from '@angular/animations'
|
import { trigger, style, animate, transition, state } from '@angular/animations'
|
||||||
import { DomSanitizer, SafeHtml } from '@angular/platform-browser'
|
import { DomSanitizer } from '@angular/platform-browser'
|
||||||
import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
|
import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
|
||||||
|
|
||||||
import { ElectronService } from '../services/electron.service'
|
import { ElectronService } from '../services/electron.service'
|
||||||
@@ -15,7 +15,7 @@ import { TouchbarService } from '../services/touchbar.service'
|
|||||||
|
|
||||||
import { BaseTabComponent } from './baseTab.component'
|
import { BaseTabComponent } from './baseTab.component'
|
||||||
import { SafeModeModalComponent } from './safeModeModal.component'
|
import { SafeModeModalComponent } from './safeModeModal.component'
|
||||||
import { AppService, IToolbarButton, ToolbarButtonProvider } from '../api'
|
import { AppService, ToolbarButton, ToolbarButtonProvider } from '../api'
|
||||||
|
|
||||||
/** @hidden */
|
/** @hidden */
|
||||||
@Component({
|
@Component({
|
||||||
@@ -26,47 +26,47 @@ import { AppService, IToolbarButton, ToolbarButtonProvider } from '../api'
|
|||||||
trigger('animateTab', [
|
trigger('animateTab', [
|
||||||
state('in', style({
|
state('in', style({
|
||||||
'flex-basis': '200px',
|
'flex-basis': '200px',
|
||||||
'width': '200px',
|
width: '200px',
|
||||||
})),
|
})),
|
||||||
transition(':enter', [
|
transition(':enter', [
|
||||||
style({
|
style({
|
||||||
'flex-basis': '1px',
|
'flex-basis': '1px',
|
||||||
'width': '1px',
|
width: '1px',
|
||||||
}),
|
}),
|
||||||
animate('250ms ease-in-out', style({
|
animate('250ms ease-in-out', style({
|
||||||
'flex-basis': '200px',
|
'flex-basis': '200px',
|
||||||
'width': '200px',
|
width: '200px',
|
||||||
}))
|
})),
|
||||||
]),
|
]),
|
||||||
transition(':leave', [
|
transition(':leave', [
|
||||||
style({
|
style({
|
||||||
'flex-basis': '200px',
|
'flex-basis': '200px',
|
||||||
'width': '200px',
|
width: '200px',
|
||||||
}),
|
}),
|
||||||
animate('250ms ease-in-out', style({
|
animate('250ms ease-in-out', style({
|
||||||
'flex-basis': '1px',
|
'flex-basis': '1px',
|
||||||
'width': '1px',
|
width: '1px',
|
||||||
}))
|
})),
|
||||||
])
|
]),
|
||||||
])
|
]),
|
||||||
]
|
],
|
||||||
})
|
})
|
||||||
export class AppRootComponent {
|
export class AppRootComponent {
|
||||||
Platform = Platform
|
Platform = Platform
|
||||||
@Input() ready = false
|
@Input() ready = false
|
||||||
@Input() leftToolbarButtons: IToolbarButton[]
|
@Input() leftToolbarButtons: ToolbarButton[]
|
||||||
@Input() rightToolbarButtons: IToolbarButton[]
|
@Input() rightToolbarButtons: ToolbarButton[]
|
||||||
@HostBinding('class.platform-win32') platformClassWindows = process.platform === 'win32'
|
@HostBinding('class.platform-win32') platformClassWindows = process.platform === 'win32'
|
||||||
@HostBinding('class.platform-darwin') platformClassMacOS = process.platform === 'darwin'
|
@HostBinding('class.platform-darwin') platformClassMacOS = process.platform === 'darwin'
|
||||||
@HostBinding('class.platform-linux') platformClassLinux = process.platform === 'linux'
|
@HostBinding('class.platform-linux') platformClassLinux = process.platform === 'linux'
|
||||||
@HostBinding('class.no-tabs') noTabs = true
|
@HostBinding('class.no-tabs') noTabs = true
|
||||||
tabsDragging = false
|
tabsDragging = false
|
||||||
unsortedTabs: BaseTabComponent[] = []
|
unsortedTabs: BaseTabComponent[] = []
|
||||||
updateIcon: SafeHtml
|
updateIcon: string
|
||||||
updatesAvailable = false
|
updatesAvailable = false
|
||||||
private logger: Logger
|
private logger: Logger
|
||||||
|
|
||||||
constructor (
|
private constructor (
|
||||||
private docking: DockingService,
|
private docking: DockingService,
|
||||||
private electron: ElectronService,
|
private electron: ElectronService,
|
||||||
private hotkeys: HotkeysService,
|
private hotkeys: HotkeysService,
|
||||||
@@ -75,10 +75,10 @@ export class AppRootComponent {
|
|||||||
public hostApp: HostAppService,
|
public hostApp: HostAppService,
|
||||||
public config: ConfigService,
|
public config: ConfigService,
|
||||||
public app: AppService,
|
public app: AppService,
|
||||||
|
private domSanitizer: DomSanitizer,
|
||||||
@Inject(ToolbarButtonProvider) private toolbarButtonProviders: ToolbarButtonProvider[],
|
@Inject(ToolbarButtonProvider) private toolbarButtonProviders: ToolbarButtonProvider[],
|
||||||
log: LogService,
|
log: LogService,
|
||||||
ngbModal: NgbModal,
|
ngbModal: NgbModal,
|
||||||
domSanitizer: DomSanitizer,
|
|
||||||
_themes: ThemesService,
|
_themes: ThemesService,
|
||||||
) {
|
) {
|
||||||
this.logger = log.create('main')
|
this.logger = log.create('main')
|
||||||
@@ -87,11 +87,11 @@ export class AppRootComponent {
|
|||||||
this.leftToolbarButtons = this.getToolbarButtons(false)
|
this.leftToolbarButtons = this.getToolbarButtons(false)
|
||||||
this.rightToolbarButtons = this.getToolbarButtons(true)
|
this.rightToolbarButtons = this.getToolbarButtons(true)
|
||||||
|
|
||||||
this.updateIcon = domSanitizer.bypassSecurityTrustHtml(require('../icons/gift.svg')),
|
this.updateIcon = require('../icons/gift.svg')
|
||||||
|
|
||||||
this.hotkeys.matchedHotkey.subscribe((hotkey) => {
|
this.hotkeys.matchedHotkey.subscribe((hotkey: string) => {
|
||||||
if (hotkey.startsWith('tab-')) {
|
if (hotkey.startsWith('tab-')) {
|
||||||
let index = parseInt(hotkey.split('-')[1])
|
const index = parseInt(hotkey.split('-')[1])
|
||||||
if (index <= this.app.tabs.length) {
|
if (index <= this.app.tabs.length) {
|
||||||
this.app.selectTab(this.app.tabs[index - 1])
|
this.app.selectTab(this.app.tabs[index - 1])
|
||||||
}
|
}
|
||||||
@@ -233,14 +233,24 @@ export class AppRootComponent {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
private getToolbarButtons (aboveZero: boolean): IToolbarButton[] {
|
async generateButtonSubmenu (button: ToolbarButton) {
|
||||||
let buttons: IToolbarButton[] = []
|
if (button.submenu) {
|
||||||
|
button.submenuItems = await button.submenu()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sanitizeIcon (icon: string): any {
|
||||||
|
return this.domSanitizer.bypassSecurityTrustHtml(icon || '')
|
||||||
|
}
|
||||||
|
|
||||||
|
private getToolbarButtons (aboveZero: boolean): ToolbarButton[] {
|
||||||
|
let buttons: ToolbarButton[] = []
|
||||||
this.config.enabledServices(this.toolbarButtonProviders).forEach(provider => {
|
this.config.enabledServices(this.toolbarButtonProviders).forEach(provider => {
|
||||||
buttons = buttons.concat(provider.provide())
|
buttons = buttons.concat(provider.provide())
|
||||||
})
|
})
|
||||||
return buttons
|
return buttons
|
||||||
.filter((button) => (button.weight > 0) === aboveZero)
|
.filter(button => button.weight > 0 === aboveZero)
|
||||||
.sort((a: IToolbarButton, b: IToolbarButton) => (a.weight || 0) - (b.weight || 0))
|
.sort((a: ToolbarButton, b: ToolbarButton) => (a.weight || 0) - (b.weight || 0))
|
||||||
}
|
}
|
||||||
|
|
||||||
private updateVibrancy () {
|
private updateVibrancy () {
|
||||||
|
@@ -91,7 +91,7 @@ export abstract class BaseTabComponent {
|
|||||||
}
|
}
|
||||||
this.progressClearTimeout = setTimeout(() => {
|
this.progressClearTimeout = setTimeout(() => {
|
||||||
this.setProgress(null)
|
this.setProgress(null)
|
||||||
}, 5000)
|
}, 5000) as any
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -8,7 +8,7 @@ import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'
|
|||||||
styles: [require('./checkbox.component.scss')],
|
styles: [require('./checkbox.component.scss')],
|
||||||
providers: [
|
providers: [
|
||||||
{ provide: NG_VALUE_ACCESSOR, useExisting: CheckboxComponent, multi: true },
|
{ provide: NG_VALUE_ACCESSOR, useExisting: CheckboxComponent, multi: true },
|
||||||
]
|
],
|
||||||
})
|
})
|
||||||
export class CheckboxComponent implements ControlValueAccessor {
|
export class CheckboxComponent implements ControlValueAccessor {
|
||||||
@HostBinding('class.active') @Input() model: boolean
|
@HostBinding('class.active') @Input() model: boolean
|
||||||
@@ -23,7 +23,7 @@ export class CheckboxComponent implements ControlValueAccessor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.model = !this.model
|
this.model = !this.model
|
||||||
for (let fx of this.changed) {
|
for (const fx of this.changed) {
|
||||||
fx(this.model)
|
fx(this.model)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -6,8 +6,8 @@ import { TabsService } from '../services/tabs.service'
|
|||||||
import { HotkeysService } from '../services/hotkeys.service'
|
import { HotkeysService } from '../services/hotkeys.service'
|
||||||
import { TabRecoveryService } from '../services/tabRecovery.service'
|
import { TabRecoveryService } from '../services/tabRecovery.service'
|
||||||
|
|
||||||
export declare type SplitOrientation = 'v' | 'h'
|
export type SplitOrientation = 'v' | 'h' // eslint-disable-line @typescript-eslint/no-type-alias
|
||||||
export declare type SplitDirection = 'r' | 't' | 'b' | 'l'
|
export type SplitDirection = 'r' | 't' | 'b' | 'l' // eslint-disable-line @typescript-eslint/no-type-alias
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Describes a horizontal or vertical split row or column
|
* Describes a horizontal or vertical split row or column
|
||||||
@@ -35,7 +35,7 @@ export class SplitContainer {
|
|||||||
*/
|
*/
|
||||||
getAllTabs () {
|
getAllTabs () {
|
||||||
let r = []
|
let r = []
|
||||||
for (let child of this.children) {
|
for (const child of this.children) {
|
||||||
if (child instanceof SplitContainer) {
|
if (child instanceof SplitContainer) {
|
||||||
r = r.concat(child.getAllTabs())
|
r = r.concat(child.getAllTabs())
|
||||||
} else {
|
} else {
|
||||||
@@ -50,7 +50,7 @@ export class SplitContainer {
|
|||||||
*/
|
*/
|
||||||
normalize () {
|
normalize () {
|
||||||
for (let i = 0; i < this.children.length; i++) {
|
for (let i = 0; i < this.children.length; i++) {
|
||||||
let child = this.children[i]
|
const child = this.children[i]
|
||||||
|
|
||||||
if (child instanceof SplitContainer) {
|
if (child instanceof SplitContainer) {
|
||||||
child.normalize()
|
child.normalize()
|
||||||
@@ -63,7 +63,7 @@ export class SplitContainer {
|
|||||||
} else if (child.children.length === 1) {
|
} else if (child.children.length === 1) {
|
||||||
this.children[i] = child.children[0]
|
this.children[i] = child.children[0]
|
||||||
} else if (child.orientation === this.orientation) {
|
} else if (child.orientation === this.orientation) {
|
||||||
let ratio = this.ratios[i]
|
const ratio = this.ratios[i]
|
||||||
this.children.splice(i, 1)
|
this.children.splice(i, 1)
|
||||||
this.ratios.splice(i, 1)
|
this.ratios.splice(i, 1)
|
||||||
for (let j = 0; j < child.children.length; j++) {
|
for (let j = 0; j < child.children.length; j++) {
|
||||||
@@ -76,7 +76,7 @@ export class SplitContainer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let s = 0
|
let s = 0
|
||||||
for (let x of this.ratios) {
|
for (const x of this.ratios) {
|
||||||
s += x
|
s += x
|
||||||
}
|
}
|
||||||
this.ratios = this.ratios.map(x => x / s)
|
this.ratios = this.ratios.map(x => x / s)
|
||||||
@@ -94,8 +94,8 @@ export class SplitContainer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async serialize () {
|
async serialize () {
|
||||||
let children = []
|
const children = []
|
||||||
for (let child of this.children) {
|
for (const child of this.children) {
|
||||||
if (child instanceof SplitContainer) {
|
if (child instanceof SplitContainer) {
|
||||||
children.push(await child.serialize())
|
children.push(await child.serialize())
|
||||||
} else {
|
} else {
|
||||||
@@ -189,7 +189,11 @@ export class SplitTabComponent extends BaseTabComponent implements OnInit, OnDes
|
|||||||
|
|
||||||
this.focused$.subscribe(() => {
|
this.focused$.subscribe(() => {
|
||||||
this.getAllTabs().forEach(x => x.emitFocused())
|
this.getAllTabs().forEach(x => x.emitFocused())
|
||||||
this.focus(this.focusedTab)
|
if (this.focusedTab) {
|
||||||
|
this.focus(this.focusedTab)
|
||||||
|
} else {
|
||||||
|
this.focusAnyIn(this.root)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
this.blurred$.subscribe(() => this.getAllTabs().forEach(x => x.emitBlurred()))
|
this.blurred$.subscribe(() => this.getAllTabs().forEach(x => x.emitBlurred()))
|
||||||
|
|
||||||
@@ -198,33 +202,33 @@ export class SplitTabComponent extends BaseTabComponent implements OnInit, OnDes
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
switch (hotkey) {
|
switch (hotkey) {
|
||||||
case 'split-right':
|
case 'split-right':
|
||||||
this.splitTab(this.focusedTab, 'r')
|
this.splitTab(this.focusedTab, 'r')
|
||||||
break
|
break
|
||||||
case 'split-bottom':
|
case 'split-bottom':
|
||||||
this.splitTab(this.focusedTab, 'b')
|
this.splitTab(this.focusedTab, 'b')
|
||||||
break
|
break
|
||||||
case 'split-top':
|
case 'split-top':
|
||||||
this.splitTab(this.focusedTab, 't')
|
this.splitTab(this.focusedTab, 't')
|
||||||
break
|
break
|
||||||
case 'split-left':
|
case 'split-left':
|
||||||
this.splitTab(this.focusedTab, 'l')
|
this.splitTab(this.focusedTab, 'l')
|
||||||
break
|
break
|
||||||
case 'pane-nav-left':
|
case 'pane-nav-left':
|
||||||
this.navigate('l')
|
this.navigate('l')
|
||||||
break
|
break
|
||||||
case 'pane-nav-right':
|
case 'pane-nav-right':
|
||||||
this.navigate('r')
|
this.navigate('r')
|
||||||
break
|
break
|
||||||
case 'pane-nav-up':
|
case 'pane-nav-up':
|
||||||
this.navigate('t')
|
this.navigate('t')
|
||||||
break
|
break
|
||||||
case 'pane-nav-down':
|
case 'pane-nav-down':
|
||||||
this.navigate('b')
|
this.navigate('b')
|
||||||
break
|
break
|
||||||
case 'close-pane':
|
case 'close-pane':
|
||||||
this.removeTab(this.focusedTab)
|
this.removeTab(this.focusedTab)
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -235,8 +239,10 @@ export class SplitTabComponent extends BaseTabComponent implements OnInit, OnDes
|
|||||||
await this.recoverContainer(this.root, this._recoveredState)
|
await this.recoverContainer(this.root, this._recoveredState)
|
||||||
this.layout()
|
this.layout()
|
||||||
setImmediate(() => {
|
setImmediate(() => {
|
||||||
this.getAllTabs().forEach(x => x.emitFocused())
|
if (this.hasFocus) {
|
||||||
this.focusAnyIn(this.root)
|
this.getAllTabs().forEach(x => x.emitFocused())
|
||||||
|
this.focusAnyIn(this.root)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -257,7 +263,7 @@ export class SplitTabComponent extends BaseTabComponent implements OnInit, OnDes
|
|||||||
|
|
||||||
focus (tab: BaseTabComponent) {
|
focus (tab: BaseTabComponent) {
|
||||||
this.focusedTab = tab
|
this.focusedTab = tab
|
||||||
for (let x of this.getAllTabs()) {
|
for (const x of this.getAllTabs()) {
|
||||||
if (x !== tab) {
|
if (x !== tab) {
|
||||||
x.emitBlurred()
|
x.emitBlurred()
|
||||||
}
|
}
|
||||||
@@ -291,11 +297,11 @@ export class SplitTabComponent extends BaseTabComponent implements OnInit, OnDes
|
|||||||
let insertIndex = target.children.indexOf(relative)
|
let insertIndex = target.children.indexOf(relative)
|
||||||
|
|
||||||
if (
|
if (
|
||||||
(target.orientation === 'v' && ['l', 'r'].includes(side)) ||
|
target.orientation === 'v' && ['l', 'r'].includes(side) ||
|
||||||
(target.orientation === 'h' && ['t', 'b'].includes(side))
|
target.orientation === 'h' && ['t', 'b'].includes(side)
|
||||||
) {
|
) {
|
||||||
let newContainer = new SplitContainer()
|
const newContainer = new SplitContainer()
|
||||||
newContainer.orientation = (target.orientation === 'v') ? 'h' : 'v'
|
newContainer.orientation = target.orientation === 'v' ? 'h' : 'v'
|
||||||
newContainer.children = [relative]
|
newContainer.children = [relative]
|
||||||
newContainer.ratios = [1]
|
newContainer.ratios = [1]
|
||||||
target.children[insertIndex] = newContainer
|
target.children[insertIndex] = newContainer
|
||||||
@@ -306,7 +312,7 @@ export class SplitTabComponent extends BaseTabComponent implements OnInit, OnDes
|
|||||||
if (insertIndex === -1) {
|
if (insertIndex === -1) {
|
||||||
insertIndex = 0
|
insertIndex = 0
|
||||||
} else {
|
} else {
|
||||||
insertIndex += (side === 'l' || side === 't') ? 0 : 1
|
insertIndex += side === 'l' || side === 't' ? 0 : 1
|
||||||
}
|
}
|
||||||
|
|
||||||
for (let i = 0; i < target.children.length; i++) {
|
for (let i = 0; i < target.children.length; i++) {
|
||||||
@@ -326,8 +332,8 @@ export class SplitTabComponent extends BaseTabComponent implements OnInit, OnDes
|
|||||||
}
|
}
|
||||||
|
|
||||||
removeTab (tab: BaseTabComponent) {
|
removeTab (tab: BaseTabComponent) {
|
||||||
let parent = this.getParentOf(tab)
|
const parent = this.getParentOf(tab)
|
||||||
let index = parent.children.indexOf(tab)
|
const index = parent.children.indexOf(tab)
|
||||||
parent.ratios.splice(index, 1)
|
parent.ratios.splice(index, 1)
|
||||||
parent.children.splice(index, 1)
|
parent.children.splice(index, 1)
|
||||||
|
|
||||||
@@ -350,7 +356,7 @@ export class SplitTabComponent extends BaseTabComponent implements OnInit, OnDes
|
|||||||
navigate (dir: SplitDirection) {
|
navigate (dir: SplitDirection) {
|
||||||
let rel: BaseTabComponent | SplitContainer = this.focusedTab
|
let rel: BaseTabComponent | SplitContainer = this.focusedTab
|
||||||
let parent = this.getParentOf(rel)
|
let parent = this.getParentOf(rel)
|
||||||
let orientation = ['l', 'r'].includes(dir) ? 'h' : 'v'
|
const orientation = ['l', 'r'].includes(dir) ? 'h' : 'v'
|
||||||
|
|
||||||
while (parent !== this.root && parent.orientation !== orientation) {
|
while (parent !== this.root && parent.orientation !== orientation) {
|
||||||
rel = parent
|
rel = parent
|
||||||
@@ -361,7 +367,7 @@ export class SplitTabComponent extends BaseTabComponent implements OnInit, OnDes
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
let index = parent.children.indexOf(rel)
|
const index = parent.children.indexOf(rel)
|
||||||
if (['l', 't'].includes(dir)) {
|
if (['l', 't'].includes(dir)) {
|
||||||
if (index > 0) {
|
if (index > 0) {
|
||||||
this.focusAnyIn(parent.children[index - 1])
|
this.focusAnyIn(parent.children[index - 1])
|
||||||
@@ -374,7 +380,7 @@ export class SplitTabComponent extends BaseTabComponent implements OnInit, OnDes
|
|||||||
}
|
}
|
||||||
|
|
||||||
async splitTab (tab: BaseTabComponent, dir: SplitDirection) {
|
async splitTab (tab: BaseTabComponent, dir: SplitDirection) {
|
||||||
let newTab = await this.tabsService.duplicate(tab)
|
const newTab = await this.tabsService.duplicate(tab)
|
||||||
this.addTab(newTab, tab, dir)
|
this.addTab(newTab, tab, dir)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -383,9 +389,9 @@ export class SplitTabComponent extends BaseTabComponent implements OnInit, OnDes
|
|||||||
*/
|
*/
|
||||||
getParentOf (tab: BaseTabComponent | SplitContainer, root?: SplitContainer): SplitContainer {
|
getParentOf (tab: BaseTabComponent | SplitContainer, root?: SplitContainer): SplitContainer {
|
||||||
root = root || this.root
|
root = root || this.root
|
||||||
for (let child of root.children) {
|
for (const child of root.children) {
|
||||||
if (child instanceof SplitContainer) {
|
if (child instanceof SplitContainer) {
|
||||||
let r = this.getParentOf(tab, child)
|
const r = this.getParentOf(tab, child)
|
||||||
if (r) {
|
if (r) {
|
||||||
return r
|
return r
|
||||||
}
|
}
|
||||||
@@ -419,7 +425,7 @@ export class SplitTabComponent extends BaseTabComponent implements OnInit, OnDes
|
|||||||
}
|
}
|
||||||
|
|
||||||
private attachTabView (tab: BaseTabComponent) {
|
private attachTabView (tab: BaseTabComponent) {
|
||||||
let ref = this.viewContainer.insert(tab.hostView) as EmbeddedViewRef<any>
|
const ref = this.viewContainer.insert(tab.hostView) as EmbeddedViewRef<any> // eslint-disable-line @typescript-eslint/no-unnecessary-type-assertion
|
||||||
this.viewRefs.set(tab, ref)
|
this.viewRefs.set(tab, ref)
|
||||||
|
|
||||||
ref.rootNodes[0].addEventListener('click', () => this.focus(tab))
|
ref.rootNodes[0].addEventListener('click', () => this.focus(tab))
|
||||||
@@ -436,7 +442,7 @@ export class SplitTabComponent extends BaseTabComponent implements OnInit, OnDes
|
|||||||
}
|
}
|
||||||
|
|
||||||
private detachTabView (tab: BaseTabComponent) {
|
private detachTabView (tab: BaseTabComponent) {
|
||||||
let ref = this.viewRefs.get(tab)
|
const ref = this.viewRefs.get(tab)
|
||||||
this.viewRefs.delete(tab)
|
this.viewRefs.delete(tab)
|
||||||
this.viewContainer.remove(this.viewContainer.indexOf(ref))
|
this.viewContainer.remove(this.viewContainer.indexOf(ref))
|
||||||
}
|
}
|
||||||
@@ -448,8 +454,8 @@ export class SplitTabComponent extends BaseTabComponent implements OnInit, OnDes
|
|||||||
}
|
}
|
||||||
|
|
||||||
private layoutInternal (root: SplitContainer, x: number, y: number, w: number, h: number) {
|
private layoutInternal (root: SplitContainer, x: number, y: number, w: number, h: number) {
|
||||||
let size = (root.orientation === 'v') ? h : w
|
const size = root.orientation === 'v' ? h : w
|
||||||
let sizes = root.ratios.map(x => x * size)
|
const sizes = root.ratios.map(x => x * size)
|
||||||
|
|
||||||
root.x = x
|
root.x = x
|
||||||
root.y = y
|
root.y = y
|
||||||
@@ -458,21 +464,21 @@ export class SplitTabComponent extends BaseTabComponent implements OnInit, OnDes
|
|||||||
|
|
||||||
let offset = 0
|
let offset = 0
|
||||||
root.children.forEach((child, i) => {
|
root.children.forEach((child, i) => {
|
||||||
let childX = (root.orientation === 'v') ? x : (x + offset)
|
const childX = root.orientation === 'v' ? x : x + offset
|
||||||
let childY = (root.orientation === 'v') ? (y + offset) : y
|
const childY = root.orientation === 'v' ? y + offset : y
|
||||||
let childW = (root.orientation === 'v') ? w : sizes[i]
|
const childW = root.orientation === 'v' ? w : sizes[i]
|
||||||
let childH = (root.orientation === 'v') ? sizes[i] : h
|
const childH = root.orientation === 'v' ? sizes[i] : h
|
||||||
if (child instanceof SplitContainer) {
|
if (child instanceof SplitContainer) {
|
||||||
this.layoutInternal(child, childX, childY, childW, childH)
|
this.layoutInternal(child, childX, childY, childW, childH)
|
||||||
} else {
|
} else {
|
||||||
let element = this.viewRefs.get(child).rootNodes[0]
|
const element = this.viewRefs.get(child).rootNodes[0]
|
||||||
element.style.position = 'absolute'
|
element.style.position = 'absolute'
|
||||||
element.style.left = `${childX}%`
|
element.style.left = `${childX}%`
|
||||||
element.style.top = `${childY}%`
|
element.style.top = `${childY}%`
|
||||||
element.style.width = `${childW}%`
|
element.style.width = `${childW}%`
|
||||||
element.style.height = `${childH}%`
|
element.style.height = `${childH}%`
|
||||||
|
|
||||||
element.style.opacity = (child === this.focusedTab) ? 1 : 0.75
|
element.style.opacity = child === this.focusedTab ? 1 : 0.75
|
||||||
}
|
}
|
||||||
offset += sizes[i]
|
offset += sizes[i]
|
||||||
|
|
||||||
@@ -486,19 +492,19 @@ export class SplitTabComponent extends BaseTabComponent implements OnInit, OnDes
|
|||||||
}
|
}
|
||||||
|
|
||||||
private async recoverContainer (root: SplitContainer, state: any) {
|
private async recoverContainer (root: SplitContainer, state: any) {
|
||||||
let children: (SplitContainer | BaseTabComponent)[] = []
|
const children: (SplitContainer | BaseTabComponent)[] = []
|
||||||
root.orientation = state.orientation
|
root.orientation = state.orientation
|
||||||
root.ratios = state.ratios
|
root.ratios = state.ratios
|
||||||
root.children = children
|
root.children = children
|
||||||
for (let childState of state.children) {
|
for (const childState of state.children) {
|
||||||
if (childState.type === 'app:split-tab') {
|
if (childState.type === 'app:split-tab') {
|
||||||
let child = new SplitContainer()
|
const child = new SplitContainer()
|
||||||
await this.recoverContainer(child, childState)
|
await this.recoverContainer(child, childState)
|
||||||
children.push(child)
|
children.push(child)
|
||||||
} else {
|
} else {
|
||||||
let recovered = await this.tabRecovery.recoverTab(childState)
|
const recovered = await this.tabRecovery.recoverTab(childState)
|
||||||
if (recovered) {
|
if (recovered) {
|
||||||
let tab = this.tabsService.create(recovered.type, recovered.options)
|
const tab = this.tabsService.create(recovered.type, recovered.options)
|
||||||
children.push(tab)
|
children.push(tab)
|
||||||
this.attachTabView(tab)
|
this.attachTabView(tab)
|
||||||
} else {
|
} else {
|
||||||
|
@@ -23,15 +23,15 @@ export class SplitTabSpannerComponent {
|
|||||||
constructor (private element: ElementRef) { }
|
constructor (private element: ElementRef) { }
|
||||||
|
|
||||||
ngAfterViewInit () {
|
ngAfterViewInit () {
|
||||||
this.element.nativeElement.addEventListener('mousedown', e => {
|
this.element.nativeElement.addEventListener('mousedown', (e: MouseEvent) => {
|
||||||
this.isActive = true
|
this.isActive = true
|
||||||
let start = this.isVertical ? e.pageY : e.pageX
|
const start = this.isVertical ? e.pageY : e.pageX
|
||||||
let current = start
|
let current = start
|
||||||
let oldPosition = this.isVertical ? this.element.nativeElement.offsetTop : this.element.nativeElement.offsetLeft
|
const oldPosition: number = this.isVertical ? this.element.nativeElement.offsetTop : this.element.nativeElement.offsetLeft
|
||||||
|
|
||||||
const dragHandler = e => {
|
const dragHandler = (e: MouseEvent) => {
|
||||||
current = this.isVertical ? e.pageY : e.pageX
|
current = this.isVertical ? e.pageY : e.pageX
|
||||||
let newPosition = oldPosition + (current - start)
|
const newPosition = oldPosition + (current - start)
|
||||||
if (this.isVertical) {
|
if (this.isVertical) {
|
||||||
this.element.nativeElement.style.top = `${newPosition - this.marginOffset}px`
|
this.element.nativeElement.style.top = `${newPosition - this.marginOffset}px`
|
||||||
} else {
|
} else {
|
||||||
|
@@ -1,14 +1,14 @@
|
|||||||
div
|
div
|
||||||
.terminus-logo
|
.terminus-logo
|
||||||
h1.terminus-title Terminus
|
h1.terminus-title Terminus
|
||||||
sup α
|
sup α
|
||||||
|
|
||||||
.list-group
|
.list-group
|
||||||
a.list-group-item.list-group-item-action.d-flex(
|
a.list-group-item.list-group-item-action.d-flex(
|
||||||
*ngFor='let button of getButtons()',
|
*ngFor='let button of getButtons()',
|
||||||
(click)='button.click()',
|
(click)='button.click()',
|
||||||
)
|
)
|
||||||
.d-flex.align-self-center([innerHTML]='button.icon')
|
.d-flex.align-self-center([innerHTML]='sanitizeIcon(button.icon)')
|
||||||
span {{button.title}}
|
span {{button.title}}
|
||||||
|
|
||||||
footer.d-flex.align-items-center
|
footer.d-flex.align-items-center
|
||||||
|
@@ -2,7 +2,6 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
flex: auto;
|
flex: auto;
|
||||||
-webkit-app-region: drag;
|
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -25,10 +24,6 @@ footer {
|
|||||||
background: rgba(0,0,0,.5);
|
background: rgba(0,0,0,.5);
|
||||||
}
|
}
|
||||||
|
|
||||||
a, button {
|
|
||||||
-webkit-app-region: no-drag;
|
|
||||||
}
|
|
||||||
|
|
||||||
.list-group-item ::ng-deep svg {
|
.list-group-item ::ng-deep svg {
|
||||||
width: 16px;
|
width: 16px;
|
||||||
height: 16px;
|
height: 16px;
|
||||||
|
@@ -1,7 +1,8 @@
|
|||||||
import { Component, Inject } from '@angular/core'
|
import { Component, Inject } from '@angular/core'
|
||||||
|
import { DomSanitizer } from '@angular/platform-browser'
|
||||||
import { ConfigService } from '../services/config.service'
|
import { ConfigService } from '../services/config.service'
|
||||||
import { HomeBaseService } from '../services/homeBase.service'
|
import { HomeBaseService } from '../services/homeBase.service'
|
||||||
import { IToolbarButton, ToolbarButtonProvider } from '../api'
|
import { ToolbarButton, ToolbarButtonProvider } from '../api'
|
||||||
|
|
||||||
/** @hidden */
|
/** @hidden */
|
||||||
@Component({
|
@Component({
|
||||||
@@ -14,15 +15,21 @@ export class StartPageComponent {
|
|||||||
|
|
||||||
constructor (
|
constructor (
|
||||||
private config: ConfigService,
|
private config: ConfigService,
|
||||||
|
private domSanitizer: DomSanitizer,
|
||||||
public homeBase: HomeBaseService,
|
public homeBase: HomeBaseService,
|
||||||
@Inject(ToolbarButtonProvider) private toolbarButtonProviders: ToolbarButtonProvider[],
|
@Inject(ToolbarButtonProvider) private toolbarButtonProviders: ToolbarButtonProvider[],
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
getButtons (): IToolbarButton[] {
|
getButtons (): ToolbarButton[] {
|
||||||
return this.config.enabledServices(this.toolbarButtonProviders)
|
return this.config.enabledServices(this.toolbarButtonProviders)
|
||||||
.map(provider => provider.provide())
|
.map(provider => provider.provide())
|
||||||
.reduce((a, b) => a.concat(b))
|
.reduce((a, b) => a.concat(b))
|
||||||
.sort((a: IToolbarButton, b: IToolbarButton) => (a.weight || 0) - (b.weight || 0))
|
.filter(x => !!x.click)
|
||||||
|
.sort((a: ToolbarButton, b: ToolbarButton) => (a.weight || 0) - (b.weight || 0))
|
||||||
|
}
|
||||||
|
|
||||||
|
sanitizeIcon (icon: string): any {
|
||||||
|
return this.domSanitizer.bypassSecurityTrustHtml(icon || '')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -9,6 +9,11 @@ import { ElectronService } from '../services/electron.service'
|
|||||||
import { AppService } from '../services/app.service'
|
import { AppService } from '../services/app.service'
|
||||||
import { HostAppService, Platform } from '../services/hostApp.service'
|
import { HostAppService, Platform } from '../services/hostApp.service'
|
||||||
|
|
||||||
|
/** @hidden */
|
||||||
|
export interface ISortableComponent {
|
||||||
|
setDragHandle (_: HTMLElement)
|
||||||
|
}
|
||||||
|
|
||||||
/** @hidden */
|
/** @hidden */
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'tab-header',
|
selector: 'tab-header',
|
||||||
@@ -23,13 +28,13 @@ export class TabHeaderComponent {
|
|||||||
@Input() progress: number
|
@Input() progress: number
|
||||||
@ViewChild('handle') handle: ElementRef
|
@ViewChild('handle') handle: ElementRef
|
||||||
|
|
||||||
constructor (
|
private constructor (
|
||||||
public app: AppService,
|
public app: AppService,
|
||||||
private electron: ElectronService,
|
private electron: ElectronService,
|
||||||
private hostApp: HostAppService,
|
private hostApp: HostAppService,
|
||||||
private ngbModal: NgbModal,
|
private ngbModal: NgbModal,
|
||||||
private hotkeys: HotkeysService,
|
private hotkeys: HotkeysService,
|
||||||
private parentDraggable: SortableComponent,
|
@Inject(SortableComponent) private parentDraggable: ISortableComponent,
|
||||||
@Optional() @Inject(TabContextMenuItemProvider) protected contextMenuProviders: TabContextMenuItemProvider[],
|
@Optional() @Inject(TabContextMenuItemProvider) protected contextMenuProviders: TabContextMenuItemProvider[],
|
||||||
) {
|
) {
|
||||||
this.hotkeys.matchedHotkey.subscribe((hotkey) => {
|
this.hotkeys.matchedHotkey.subscribe((hotkey) => {
|
||||||
@@ -52,7 +57,7 @@ export class TabHeaderComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
showRenameTabModal (): void {
|
showRenameTabModal (): void {
|
||||||
let modal = this.ngbModal.open(RenameTabModalComponent)
|
const modal = this.ngbModal.open(RenameTabModalComponent)
|
||||||
modal.componentInstance.value = this.tab.customTitle || this.tab.title
|
modal.componentInstance.value = this.tab.customTitle || this.tab.title
|
||||||
modal.result.then(result => {
|
modal.result.then(result => {
|
||||||
this.tab.setTitle(result)
|
this.tab.setTitle(result)
|
||||||
@@ -62,7 +67,7 @@ export class TabHeaderComponent {
|
|||||||
|
|
||||||
async buildContextMenu (): Promise<Electron.MenuItemConstructorOptions[]> {
|
async buildContextMenu (): Promise<Electron.MenuItemConstructorOptions[]> {
|
||||||
let items: Electron.MenuItemConstructorOptions[] = []
|
let items: Electron.MenuItemConstructorOptions[] = []
|
||||||
for (let section of await Promise.all(this.contextMenuProviders.map(x => x.getItems(this.tab, this)))) {
|
for (const section of await Promise.all(this.contextMenuProviders.map(x => x.getItems(this.tab, this)))) {
|
||||||
items.push({ type: 'separator' })
|
items.push({ type: 'separator' })
|
||||||
items = items.concat(section)
|
items = items.concat(section)
|
||||||
}
|
}
|
||||||
@@ -85,7 +90,6 @@ export class TabHeaderComponent {
|
|||||||
contextMenu.popup({
|
contextMenu.popup({
|
||||||
x: $event.pageX,
|
x: $event.pageX,
|
||||||
y: $event.pageY,
|
y: $event.pageY,
|
||||||
async: true,
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -6,4 +6,4 @@ import { Component } from '@angular/core'
|
|||||||
template: require('./titleBar.component.pug'),
|
template: require('./titleBar.component.pug'),
|
||||||
styles: [require('./titleBar.component.scss')],
|
styles: [require('./titleBar.component.scss')],
|
||||||
})
|
})
|
||||||
export class TitleBarComponent { }
|
export class TitleBarComponent { } // eslint-disable-line @typescript-eslint/no-extraneous-class
|
||||||
|
@@ -17,7 +17,7 @@ import { CheckboxComponent } from './checkbox.component'
|
|||||||
styles: [require('./toggle.component.scss')],
|
styles: [require('./toggle.component.scss')],
|
||||||
providers: [
|
providers: [
|
||||||
{ provide: NG_VALUE_ACCESSOR, useExisting: ToggleComponent, multi: true },
|
{ provide: NG_VALUE_ACCESSOR, useExisting: ToggleComponent, multi: true },
|
||||||
]
|
],
|
||||||
})
|
})
|
||||||
export class ToggleComponent extends CheckboxComponent {
|
export class ToggleComponent extends CheckboxComponent {
|
||||||
}
|
}
|
||||||
|
19
terminus-core/src/components/welcomeTab.component.pug
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
.mb-4
|
||||||
|
.terminus-logo
|
||||||
|
h1.terminus-title Terminus
|
||||||
|
sup α
|
||||||
|
|
||||||
|
.container
|
||||||
|
.text-center.mb-5 Thank you for downloading Terminus!
|
||||||
|
|
||||||
|
.form-line
|
||||||
|
.header
|
||||||
|
.title Enable analytics
|
||||||
|
.description Help us track the number of Terminus installs across the world!
|
||||||
|
toggle(
|
||||||
|
[(ngModel)]='config.store.enableAnalytics',
|
||||||
|
(ngModelChange)='config.save(); config.requestRestart()',
|
||||||
|
)
|
||||||
|
|
||||||
|
.text-center.mt-5
|
||||||
|
button.btn.btn-primary((click)='closeAndDisable()') Close and never show again
|
6
terminus-core/src/components/welcomeTab.component.scss
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
:host {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
margin: auto;
|
||||||
|
flex: 0 1 500px;
|
||||||
|
}
|
26
terminus-core/src/components/welcomeTab.component.ts
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
import { Component } from '@angular/core'
|
||||||
|
import { BaseTabComponent } from './baseTab.component'
|
||||||
|
import { ConfigService } from '../services/config.service'
|
||||||
|
import { AppService } from '../services/app.service'
|
||||||
|
|
||||||
|
/** @hidden */
|
||||||
|
@Component({
|
||||||
|
selector: 'welcome-page',
|
||||||
|
template: require('./welcomeTab.component.pug'),
|
||||||
|
styles: [require('./welcomeTab.component.scss')],
|
||||||
|
})
|
||||||
|
export class WelcomeTabComponent extends BaseTabComponent {
|
||||||
|
constructor (
|
||||||
|
private app: AppService,
|
||||||
|
public config: ConfigService,
|
||||||
|
) {
|
||||||
|
super()
|
||||||
|
this.setTitle('Welcome')
|
||||||
|
}
|
||||||
|
|
||||||
|
closeAndDisable () {
|
||||||
|
this.config.store.enableWelcomeTab = false
|
||||||
|
this.config.save()
|
||||||
|
this.app.closeTab(this)
|
||||||
|
}
|
||||||
|
}
|
@@ -11,10 +11,10 @@ hotkeys:
|
|||||||
rename-tab:
|
rename-tab:
|
||||||
- 'Ctrl-Shift-R'
|
- 'Ctrl-Shift-R'
|
||||||
next-tab:
|
next-tab:
|
||||||
- 'Ctrl-Shift-ArrowRight'
|
- 'Ctrl-Shift-Right'
|
||||||
- 'Ctrl-Tab'
|
- 'Ctrl-Tab'
|
||||||
previous-tab:
|
previous-tab:
|
||||||
- 'Ctrl-Shift-ArrowLeft'
|
- 'Ctrl-Shift-Left'
|
||||||
- 'Ctrl-Shift-Tab'
|
- 'Ctrl-Shift-Tab'
|
||||||
tab-1:
|
tab-1:
|
||||||
- 'Alt-1'
|
- 'Alt-1'
|
||||||
@@ -43,12 +43,12 @@ hotkeys:
|
|||||||
split-left: []
|
split-left: []
|
||||||
split-top: []
|
split-top: []
|
||||||
pane-nav-right:
|
pane-nav-right:
|
||||||
- 'Ctrl-Alt-ArrowRight'
|
- 'Ctrl-Alt-Right'
|
||||||
pane-nav-down:
|
pane-nav-down:
|
||||||
- 'Ctrl-Alt-ArrowDown'
|
- 'Ctrl-Alt-Down'
|
||||||
pane-nav-up:
|
pane-nav-up:
|
||||||
- 'Ctrl-Alt-ArrowUp'
|
- 'Ctrl-Alt-Up'
|
||||||
pane-nav-left:
|
pane-nav-left:
|
||||||
- 'Ctrl-Alt-ArrowLeft'
|
- 'Ctrl-Alt-Left'
|
||||||
close-pane: []
|
close-pane: []
|
||||||
pluginBlacklist: ['ssh']
|
pluginBlacklist: ['ssh']
|
||||||
|
@@ -41,13 +41,13 @@ hotkeys:
|
|||||||
split-left: []
|
split-left: []
|
||||||
split-top: []
|
split-top: []
|
||||||
pane-nav-right:
|
pane-nav-right:
|
||||||
- '⌘-⌥-ArrowRight'
|
- '⌘-⌥-Right'
|
||||||
pane-nav-down:
|
pane-nav-down:
|
||||||
- '⌘-⌥-ArrowDown'
|
- '⌘-⌥-Down'
|
||||||
pane-nav-up:
|
pane-nav-up:
|
||||||
- '⌘-⌥-ArrowUp'
|
- '⌘-⌥-Up'
|
||||||
pane-nav-left:
|
pane-nav-left:
|
||||||
- '⌘-⌥-ArrowLeft'
|
- '⌘-⌥-Left'
|
||||||
close-pane:
|
close-pane:
|
||||||
- '⌘-Shift-W'
|
- '⌘-Shift-W'
|
||||||
pluginBlacklist: ['ssh']
|
pluginBlacklist: ['ssh']
|
||||||
|
@@ -11,10 +11,10 @@ hotkeys:
|
|||||||
rename-tab:
|
rename-tab:
|
||||||
- 'Ctrl-Shift-R'
|
- 'Ctrl-Shift-R'
|
||||||
next-tab:
|
next-tab:
|
||||||
- 'Ctrl-Shift-ArrowRight'
|
- 'Ctrl-Shift-Right'
|
||||||
- 'Ctrl-Tab'
|
- 'Ctrl-Tab'
|
||||||
previous-tab:
|
previous-tab:
|
||||||
- 'Ctrl-Shift-ArrowLeft'
|
- 'Ctrl-Shift-Left'
|
||||||
- 'Ctrl-Shift-Tab'
|
- 'Ctrl-Shift-Tab'
|
||||||
tab-1:
|
tab-1:
|
||||||
- 'Alt-1'
|
- 'Alt-1'
|
||||||
@@ -43,12 +43,12 @@ hotkeys:
|
|||||||
split-left: []
|
split-left: []
|
||||||
split-top: []
|
split-top: []
|
||||||
pane-nav-right:
|
pane-nav-right:
|
||||||
- 'Ctrl-Alt-ArrowRight'
|
- 'Ctrl-Alt-Right'
|
||||||
pane-nav-down:
|
pane-nav-down:
|
||||||
- 'Ctrl-Alt-ArrowDown'
|
- 'Ctrl-Alt-Down'
|
||||||
pane-nav-up:
|
pane-nav-up:
|
||||||
- 'Ctrl-Alt-ArrowUp'
|
- 'Ctrl-Alt-Up'
|
||||||
pane-nav-left:
|
pane-nav-left:
|
||||||
- 'Ctrl-Alt-ArrowLeft'
|
- 'Ctrl-Alt-Left'
|
||||||
close-pane: []
|
close-pane: []
|
||||||
pluginBlacklist: []
|
pluginBlacklist: []
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
appearance:
|
appearance:
|
||||||
dock: off
|
dock: off
|
||||||
dockScreen: current
|
dockScreen: current
|
||||||
dockFill: 50
|
dockFill: 0.5
|
||||||
tabsLocation: top
|
tabsLocation: top
|
||||||
cycleTabs: true
|
cycleTabs: true
|
||||||
theme: Standard
|
theme: Standard
|
||||||
@@ -11,3 +11,6 @@ appearance:
|
|||||||
vibrancy: false
|
vibrancy: false
|
||||||
vibrancyType: 'blur'
|
vibrancyType: 'blur'
|
||||||
enableAnalytics: true
|
enableAnalytics: true
|
||||||
|
enableWelcomeTab: true
|
||||||
|
electronFlags:
|
||||||
|
- ['force_discrete_gpu', '0']
|
||||||
|
@@ -2,7 +2,7 @@ import { Directive, AfterViewInit, ElementRef } from '@angular/core'
|
|||||||
|
|
||||||
/** @hidden */
|
/** @hidden */
|
||||||
@Directive({
|
@Directive({
|
||||||
selector: '[autofocus]'
|
selector: '[autofocus]',
|
||||||
})
|
})
|
||||||
export class AutofocusDirective implements AfterViewInit {
|
export class AutofocusDirective implements AfterViewInit {
|
||||||
constructor (private el: ElementRef) { }
|
constructor (private el: ElementRef) { }
|
||||||
|
@@ -1,10 +1,10 @@
|
|||||||
import { Injectable } from '@angular/core'
|
import { Injectable } from '@angular/core'
|
||||||
import { IHotkeyDescription, HotkeyProvider } from './api/hotkeyProvider'
|
import { HotkeyDescription, HotkeyProvider } from './api/hotkeyProvider'
|
||||||
|
|
||||||
/** @hidden */
|
/** @hidden */
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class AppHotkeyProvider extends HotkeyProvider {
|
export class AppHotkeyProvider extends HotkeyProvider {
|
||||||
hotkeys: IHotkeyDescription[] = [
|
hotkeys: HotkeyDescription[] = [
|
||||||
{
|
{
|
||||||
id: 'new-window',
|
id: 'new-window',
|
||||||
name: 'New window',
|
name: 'New window',
|
||||||
@@ -115,7 +115,7 @@ export class AppHotkeyProvider extends HotkeyProvider {
|
|||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
async provide (): Promise<IHotkeyDescription[]> {
|
async provide (): Promise<HotkeyDescription[]> {
|
||||||
return this.hotkeys
|
return this.hotkeys
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -18,6 +18,7 @@ import { WindowControlsComponent } from './components/windowControls.component'
|
|||||||
import { RenameTabModalComponent } from './components/renameTabModal.component'
|
import { RenameTabModalComponent } from './components/renameTabModal.component'
|
||||||
import { SplitTabComponent, SplitTabRecoveryProvider } from './components/splitTab.component'
|
import { SplitTabComponent, SplitTabRecoveryProvider } from './components/splitTab.component'
|
||||||
import { SplitTabSpannerComponent } from './components/splitTabSpanner.component'
|
import { SplitTabSpannerComponent } from './components/splitTabSpanner.component'
|
||||||
|
import { WelcomeTabComponent } from './components/welcomeTab.component'
|
||||||
|
|
||||||
import { AutofocusDirective } from './directives/autofocus.directive'
|
import { AutofocusDirective } from './directives/autofocus.directive'
|
||||||
|
|
||||||
@@ -27,6 +28,9 @@ import { Theme } from './api/theme'
|
|||||||
import { TabContextMenuItemProvider } from './api/tabContextMenuProvider'
|
import { TabContextMenuItemProvider } from './api/tabContextMenuProvider'
|
||||||
import { TabRecoveryProvider } from './api/tabRecovery'
|
import { TabRecoveryProvider } from './api/tabRecovery'
|
||||||
|
|
||||||
|
import { AppService } from './services/app.service'
|
||||||
|
import { ConfigService } from './services/config.service'
|
||||||
|
|
||||||
import { StandardTheme, StandardCompactTheme, PaperTheme } from './theme'
|
import { StandardTheme, StandardCompactTheme, PaperTheme } from './theme'
|
||||||
import { CoreConfigProvider } from './config'
|
import { CoreConfigProvider } from './config'
|
||||||
import { AppHotkeyProvider } from './hotkeys'
|
import { AppHotkeyProvider } from './hotkeys'
|
||||||
@@ -35,6 +39,12 @@ import { TaskCompletionContextMenu, CommonOptionsContextMenu, CloseContextMenu }
|
|||||||
import 'perfect-scrollbar/css/perfect-scrollbar.css'
|
import 'perfect-scrollbar/css/perfect-scrollbar.css'
|
||||||
import 'ng2-dnd/bundles/style.css'
|
import 'ng2-dnd/bundles/style.css'
|
||||||
|
|
||||||
|
// PerfectScrollbar fix
|
||||||
|
import { fromEvent } from 'rxjs/internal/observable/fromEvent'
|
||||||
|
import { merge } from 'rxjs/internal/observable/merge'
|
||||||
|
require('rxjs').fromEvent = fromEvent
|
||||||
|
require('rxjs').merge = merge
|
||||||
|
|
||||||
const PROVIDERS = [
|
const PROVIDERS = [
|
||||||
{ provide: HotkeyProvider, useClass: AppHotkeyProvider, multi: true },
|
{ provide: HotkeyProvider, useClass: AppHotkeyProvider, multi: true },
|
||||||
{ provide: Theme, useClass: StandardTheme, multi: true },
|
{ provide: Theme, useClass: StandardTheme, multi: true },
|
||||||
@@ -45,7 +55,7 @@ const PROVIDERS = [
|
|||||||
{ provide: TabContextMenuItemProvider, useClass: CloseContextMenu, multi: true },
|
{ provide: TabContextMenuItemProvider, useClass: CloseContextMenu, multi: true },
|
||||||
{ provide: TabContextMenuItemProvider, useClass: TaskCompletionContextMenu, multi: true },
|
{ provide: TabContextMenuItemProvider, useClass: TaskCompletionContextMenu, multi: true },
|
||||||
{ provide: TabRecoveryProvider, useClass: SplitTabRecoveryProvider, multi: true },
|
{ provide: TabRecoveryProvider, useClass: SplitTabRecoveryProvider, multi: true },
|
||||||
{ provide: PERFECT_SCROLLBAR_CONFIG, useValue: { suppressScrollX: true } }
|
{ provide: PERFECT_SCROLLBAR_CONFIG, useValue: { suppressScrollX: true } },
|
||||||
]
|
]
|
||||||
|
|
||||||
/** @hidden */
|
/** @hidden */
|
||||||
@@ -59,7 +69,7 @@ const PROVIDERS = [
|
|||||||
DndModule.forRoot(),
|
DndModule.forRoot(),
|
||||||
],
|
],
|
||||||
declarations: [
|
declarations: [
|
||||||
AppRootComponent,
|
AppRootComponent as any,
|
||||||
CheckboxComponent,
|
CheckboxComponent,
|
||||||
StartPageComponent,
|
StartPageComponent,
|
||||||
TabBodyComponent,
|
TabBodyComponent,
|
||||||
@@ -72,19 +82,29 @@ const PROVIDERS = [
|
|||||||
AutofocusDirective,
|
AutofocusDirective,
|
||||||
SplitTabComponent,
|
SplitTabComponent,
|
||||||
SplitTabSpannerComponent,
|
SplitTabSpannerComponent,
|
||||||
|
WelcomeTabComponent,
|
||||||
],
|
],
|
||||||
entryComponents: [
|
entryComponents: [
|
||||||
RenameTabModalComponent,
|
RenameTabModalComponent,
|
||||||
SafeModeModalComponent,
|
SafeModeModalComponent,
|
||||||
SplitTabComponent,
|
SplitTabComponent,
|
||||||
|
WelcomeTabComponent,
|
||||||
],
|
],
|
||||||
exports: [
|
exports: [
|
||||||
CheckboxComponent,
|
CheckboxComponent,
|
||||||
ToggleComponent,
|
ToggleComponent,
|
||||||
AutofocusDirective,
|
AutofocusDirective,
|
||||||
]
|
],
|
||||||
})
|
})
|
||||||
export default class AppModule {
|
export default class AppModule { // eslint-disable-line @typescript-eslint/no-extraneous-class
|
||||||
|
constructor (app: AppService, config: ConfigService) {
|
||||||
|
app.ready$.subscribe(() => {
|
||||||
|
if (config.store.enableWelcomeTab) {
|
||||||
|
app.openNewTabRaw(WelcomeTabComponent)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
static forRoot (): ModuleWithProviders {
|
static forRoot (): ModuleWithProviders {
|
||||||
return {
|
return {
|
||||||
ngModule: AppModule,
|
ngModule: AppModule,
|
||||||
@@ -93,11 +113,9 @@ export default class AppModule {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// PerfectScrollbar fix
|
|
||||||
import { fromEvent } from 'rxjs/internal/observable/fromEvent'
|
|
||||||
import { merge } from 'rxjs/internal/observable/merge'
|
|
||||||
require('rxjs').fromEvent = fromEvent
|
|
||||||
require('rxjs').merge = merge
|
|
||||||
|
|
||||||
export { AppRootComponent as bootstrap }
|
export { AppRootComponent as bootstrap }
|
||||||
export * from './api'
|
export * from './api'
|
||||||
|
|
||||||
|
// Deprecations
|
||||||
|
export { ToolbarButton as IToolbarButton } from './api'
|
||||||
|
export { HotkeyDescription as IHotkeyDescription } from './api'
|
||||||
|
@@ -16,12 +16,12 @@ class CompletionObserver {
|
|||||||
private interval: number
|
private interval: number
|
||||||
|
|
||||||
constructor (private tab: BaseTabComponent) {
|
constructor (private tab: BaseTabComponent) {
|
||||||
this.interval = setInterval(() => this.tick(), 1000)
|
this.interval = setInterval(() => this.tick(), 1000) as any
|
||||||
this.tab.destroyed$.pipe(takeUntil(this.destroyed$)).subscribe(() => this.stop())
|
this.tab.destroyed$.pipe(takeUntil(this.destroyed$)).subscribe(() => this.stop())
|
||||||
}
|
}
|
||||||
|
|
||||||
async tick () {
|
async tick () {
|
||||||
if (!(await this.tab.getCurrentProcess())) {
|
if (!await this.tab.getCurrentProcess()) {
|
||||||
this.done.next(null)
|
this.done.next(null)
|
||||||
this.stop()
|
this.stop()
|
||||||
}
|
}
|
||||||
@@ -68,7 +68,7 @@ export class AppService {
|
|||||||
private tabsService: TabsService,
|
private tabsService: TabsService,
|
||||||
) {
|
) {
|
||||||
this.tabRecovery.recoverTabs().then(tabs => {
|
this.tabRecovery.recoverTabs().then(tabs => {
|
||||||
for (let tab of tabs) {
|
for (const tab of tabs) {
|
||||||
this.openNewTabRaw(tab.type, tab.options)
|
this.openNewTabRaw(tab.type, tab.options)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -81,7 +81,7 @@ export class AppService {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
private addTabRaw (tab: BaseTabComponent) {
|
addTabRaw (tab: BaseTabComponent) {
|
||||||
this.tabs.push(tab)
|
this.tabs.push(tab)
|
||||||
this.selectTab(tab)
|
this.selectTab(tab)
|
||||||
this.tabsChanged.next()
|
this.tabsChanged.next()
|
||||||
@@ -98,7 +98,7 @@ export class AppService {
|
|||||||
})
|
})
|
||||||
|
|
||||||
tab.destroyed$.subscribe(() => {
|
tab.destroyed$.subscribe(() => {
|
||||||
let newIndex = Math.max(0, this.tabs.indexOf(tab) - 1)
|
const newIndex = Math.max(0, this.tabs.indexOf(tab) - 1)
|
||||||
this.tabs = this.tabs.filter((x) => x !== tab)
|
this.tabs = this.tabs.filter((x) => x !== tab)
|
||||||
if (tab === this._activeTab) {
|
if (tab === this._activeTab) {
|
||||||
this.selectTab(this.tabs[newIndex])
|
this.selectTab(this.tabs[newIndex])
|
||||||
@@ -113,7 +113,7 @@ export class AppService {
|
|||||||
* @param inputs Properties to be assigned on the new tab component instance
|
* @param inputs Properties to be assigned on the new tab component instance
|
||||||
*/
|
*/
|
||||||
openNewTabRaw (type: TabComponentType, inputs?: any): BaseTabComponent {
|
openNewTabRaw (type: TabComponentType, inputs?: any): BaseTabComponent {
|
||||||
let tab = this.tabsService.create(type, inputs)
|
const tab = this.tabsService.create(type, inputs)
|
||||||
this.addTabRaw(tab)
|
this.addTabRaw(tab)
|
||||||
return tab
|
return tab
|
||||||
}
|
}
|
||||||
@@ -123,8 +123,8 @@ export class AppService {
|
|||||||
* @param inputs Properties to be assigned on the new tab component instance
|
* @param inputs Properties to be assigned on the new tab component instance
|
||||||
*/
|
*/
|
||||||
openNewTab (type: TabComponentType, inputs?: any): BaseTabComponent {
|
openNewTab (type: TabComponentType, inputs?: any): BaseTabComponent {
|
||||||
let splitTab = this.tabsService.create(SplitTabComponent) as SplitTabComponent
|
const splitTab = this.tabsService.create(SplitTabComponent) as SplitTabComponent
|
||||||
let tab = this.tabsService.create(type, inputs)
|
const tab = this.tabsService.create(type, inputs)
|
||||||
splitTab.addTab(tab, null, 'r')
|
splitTab.addTab(tab, null, 'r')
|
||||||
this.addTabRaw(splitTab)
|
this.addTabRaw(splitTab)
|
||||||
return tab
|
return tab
|
||||||
@@ -164,7 +164,7 @@ export class AppService {
|
|||||||
|
|
||||||
nextTab () {
|
nextTab () {
|
||||||
if (this.tabs.length > 1) {
|
if (this.tabs.length > 1) {
|
||||||
let tabIndex = this.tabs.indexOf(this._activeTab)
|
const tabIndex = this.tabs.indexOf(this._activeTab)
|
||||||
if (tabIndex < this.tabs.length - 1) {
|
if (tabIndex < this.tabs.length - 1) {
|
||||||
this.selectTab(this.tabs[tabIndex + 1])
|
this.selectTab(this.tabs[tabIndex + 1])
|
||||||
} else if (this.config.store.appearance.cycleTabs) {
|
} else if (this.config.store.appearance.cycleTabs) {
|
||||||
@@ -175,7 +175,7 @@ export class AppService {
|
|||||||
|
|
||||||
previousTab () {
|
previousTab () {
|
||||||
if (this.tabs.length > 1) {
|
if (this.tabs.length > 1) {
|
||||||
let tabIndex = this.tabs.indexOf(this._activeTab)
|
const tabIndex = this.tabs.indexOf(this._activeTab)
|
||||||
if (tabIndex > 0) {
|
if (tabIndex > 0) {
|
||||||
this.selectTab(this.tabs[tabIndex - 1])
|
this.selectTab(this.tabs[tabIndex - 1])
|
||||||
} else if (this.config.store.appearance.cycleTabs) {
|
} else if (this.config.store.appearance.cycleTabs) {
|
||||||
@@ -200,19 +200,19 @@ export class AppService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async duplicateTab (tab: BaseTabComponent) {
|
async duplicateTab (tab: BaseTabComponent) {
|
||||||
let dup = await this.tabsService.duplicate(tab)
|
const dup = await this.tabsService.duplicate(tab)
|
||||||
if (dup) {
|
if (dup) {
|
||||||
this.addTabRaw(dup)
|
this.addTabRaw(dup)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async closeAllTabs () {
|
async closeAllTabs () {
|
||||||
for (let tab of this.tabs) {
|
for (const tab of this.tabs) {
|
||||||
if (!await tab.canClose()) {
|
if (!await tab.canClose()) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (let tab of this.tabs) {
|
for (const tab of this.tabs) {
|
||||||
tab.destroy()
|
tab.destroy()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -230,7 +230,7 @@ export class AppService {
|
|||||||
*/
|
*/
|
||||||
observeTabCompletion (tab: BaseTabComponent): Observable<void> {
|
observeTabCompletion (tab: BaseTabComponent): Observable<void> {
|
||||||
if (!this.completionObservers.has(tab)) {
|
if (!this.completionObservers.has(tab)) {
|
||||||
let observer = new CompletionObserver(tab)
|
const observer = new CompletionObserver(tab)
|
||||||
observer.destroyed$.subscribe(() => {
|
observer.destroyed$.subscribe(() => {
|
||||||
this.stopObservingTabCompletion(tab)
|
this.stopObservingTabCompletion(tab)
|
||||||
})
|
})
|
||||||
|
@@ -14,19 +14,19 @@ function isStructuralMember (v) {
|
|||||||
Object.keys(v).length > 0 && !v.__nonStructural
|
Object.keys(v).length > 0 && !v.__nonStructural
|
||||||
}
|
}
|
||||||
|
|
||||||
function isNonStructuralObjectMember (v) {
|
function isNonStructuralObjectMember (v): boolean {
|
||||||
return v instanceof Object && !(v instanceof Array) && v.__nonStructural
|
return v instanceof Object && !(v instanceof Array) && v.__nonStructural
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @hidden */
|
/** @hidden */
|
||||||
export class ConfigProxy {
|
export class ConfigProxy {
|
||||||
constructor (real: any, defaults: any) {
|
constructor (real: any, defaults: any) {
|
||||||
for (let key in defaults) {
|
for (const key in defaults) {
|
||||||
if (isStructuralMember(defaults[key])) {
|
if (isStructuralMember(defaults[key])) {
|
||||||
if (!real[key]) {
|
if (!real[key]) {
|
||||||
real[key] = {}
|
real[key] = {}
|
||||||
}
|
}
|
||||||
let proxy = new ConfigProxy(real[key], defaults[key])
|
const proxy = new ConfigProxy(real[key], defaults[key])
|
||||||
Object.defineProperty(
|
Object.defineProperty(
|
||||||
this,
|
this,
|
||||||
key,
|
key,
|
||||||
@@ -46,13 +46,13 @@ export class ConfigProxy {
|
|||||||
get: () => this.getValue(key),
|
get: () => this.getValue(key),
|
||||||
set: (value) => {
|
set: (value) => {
|
||||||
this.setValue(key, value)
|
this.setValue(key, value)
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.getValue = (key: string) => {
|
this.getValue = (key: string) => { // eslint-disable-line @typescript-eslint/unbound-method
|
||||||
if (real[key] !== undefined) {
|
if (real[key] !== undefined) {
|
||||||
return real[key]
|
return real[key]
|
||||||
} else {
|
} else {
|
||||||
@@ -66,13 +66,13 @@ export class ConfigProxy {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.setValue = (key: string, value: any) => {
|
this.setValue = (key: string, value: any) => { // eslint-disable-line @typescript-eslint/unbound-method
|
||||||
real[key] = value
|
real[key] = value
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
getValue (key: string): any { } // tslint:disable-line
|
getValue (_key: string): any { }
|
||||||
setValue (key: string, value: any) { } // tslint:disable-line
|
setValue (_key: string, _value: any) { }
|
||||||
}
|
}
|
||||||
|
|
||||||
@Injectable({ providedIn: 'root' })
|
@Injectable({ providedIn: 'root' })
|
||||||
@@ -160,10 +160,6 @@ export class ConfigService {
|
|||||||
this.emitChange()
|
this.emitChange()
|
||||||
}
|
}
|
||||||
|
|
||||||
private emitChange (): void {
|
|
||||||
this.changed.next()
|
|
||||||
}
|
|
||||||
|
|
||||||
requestRestart (): void {
|
requestRestart (): void {
|
||||||
this.restartRequested = true
|
this.restartRequested = true
|
||||||
}
|
}
|
||||||
@@ -177,9 +173,9 @@ export class ConfigService {
|
|||||||
enabledServices<T> (services: T[]): T[] {
|
enabledServices<T> (services: T[]): T[] {
|
||||||
if (!this.servicesCache) {
|
if (!this.servicesCache) {
|
||||||
this.servicesCache = {}
|
this.servicesCache = {}
|
||||||
let ngModule = window['rootModule'].ngInjectorDef
|
const ngModule = window['rootModule'].ngInjectorDef
|
||||||
for (let imp of ngModule.imports) {
|
for (const imp of ngModule.imports) {
|
||||||
let module = (imp['ngModule'] || imp)
|
const module = imp['ngModule'] || imp
|
||||||
if (module.ngInjectorDef && module.ngInjectorDef.providers) {
|
if (module.ngInjectorDef && module.ngInjectorDef.providers) {
|
||||||
this.servicesCache[module['pluginName']] = module.ngInjectorDef.providers.map(provider => {
|
this.servicesCache[module['pluginName']] = module.ngInjectorDef.providers.map(provider => {
|
||||||
return provider['useClass'] || provider
|
return provider['useClass'] || provider
|
||||||
@@ -188,7 +184,7 @@ export class ConfigService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return services.filter(service => {
|
return services.filter(service => {
|
||||||
for (let pluginName in this.servicesCache) {
|
for (const pluginName in this.servicesCache) {
|
||||||
if (this.servicesCache[pluginName].includes(service.constructor)) {
|
if (this.servicesCache[pluginName].includes(service.constructor)) {
|
||||||
return !this.store.pluginBlacklist.includes(pluginName)
|
return !this.store.pluginBlacklist.includes(pluginName)
|
||||||
}
|
}
|
||||||
@@ -196,4 +192,8 @@ export class ConfigService {
|
|||||||
return true
|
return true
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private emitChange (): void {
|
||||||
|
this.changed.next()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -3,11 +3,6 @@ import { ConfigService } from '../services/config.service'
|
|||||||
import { ElectronService } from '../services/electron.service'
|
import { ElectronService } from '../services/electron.service'
|
||||||
import { HostAppService, Bounds } from '../services/hostApp.service'
|
import { HostAppService, Bounds } from '../services/hostApp.service'
|
||||||
|
|
||||||
export interface IScreen {
|
|
||||||
id: string
|
|
||||||
name: string
|
|
||||||
}
|
|
||||||
|
|
||||||
@Injectable({ providedIn: 'root' })
|
@Injectable({ providedIn: 'root' })
|
||||||
export class DockingService {
|
export class DockingService {
|
||||||
/** @hidden */
|
/** @hidden */
|
||||||
@@ -21,7 +16,7 @@ export class DockingService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dock () {
|
dock () {
|
||||||
let dockSide = this.config.store.appearance.dock
|
const dockSide = this.config.store.appearance.dock
|
||||||
|
|
||||||
if (dockSide === 'off') {
|
if (dockSide === 'off') {
|
||||||
this.hostApp.setAlwaysOnTop(false)
|
this.hostApp.setAlwaysOnTop(false)
|
||||||
@@ -29,14 +24,15 @@ export class DockingService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let display = this.electron.screen.getAllDisplays()
|
let display = this.electron.screen.getAllDisplays()
|
||||||
.filter((x) => x.id === this.config.store.appearance.dockScreen)[0]
|
.filter(x => x.id === this.config.store.appearance.dockScreen)[0]
|
||||||
if (!display) {
|
if (!display) {
|
||||||
display = this.getCurrentScreen()
|
display = this.getCurrentScreen()
|
||||||
}
|
}
|
||||||
|
|
||||||
let newBounds: Bounds = { x: 0, y: 0, width: 0, height: 0 }
|
const newBounds: Bounds = { x: 0, y: 0, width: 0, height: 0 }
|
||||||
let fill = this.config.store.appearance.dockFill
|
|
||||||
let [minWidth, minHeight] = this.hostApp.getWindow().getMinimumSize()
|
const fill = this.config.store.appearance.dockFill <= 1 ? this.config.store.appearance.dockFill : 1;
|
||||||
|
const [minWidth, minHeight] = this.hostApp.getWindow().getMinimumSize()
|
||||||
|
|
||||||
if (dockSide === 'left' || dockSide === 'right') {
|
if (dockSide === 'left' || dockSide === 'right') {
|
||||||
newBounds.width = Math.max(minWidth, Math.round(fill * display.bounds.width))
|
newBounds.width = Math.max(minWidth, Math.round(fill * display.bounds.width))
|
||||||
@@ -68,26 +64,26 @@ export class DockingService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getScreens () {
|
getScreens () {
|
||||||
return this.electron.screen.getAllDisplays().map((display, index) => {
|
const primaryDisplayID = this.electron.screen.getPrimaryDisplay().id;
|
||||||
|
return this.electron.screen.getAllDisplays().sort((a,b) => (
|
||||||
|
a.bounds.x === b.bounds.x ? a.bounds.y - b.bounds.y : a.bounds.x - b.bounds.x
|
||||||
|
)).map((display,index) => {
|
||||||
return {
|
return {
|
||||||
id: display.id,
|
id: display.id,
|
||||||
name: {
|
name: display.id === primaryDisplayID ? 'Primary Display' : `Display ${index +1}`,
|
||||||
0: 'Primary display',
|
|
||||||
1: 'Secondary display',
|
|
||||||
}[index] || `Display ${index + 1}`
|
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private repositionWindow () {
|
private repositionWindow () {
|
||||||
let [x, y] = this.hostApp.getWindow().getPosition()
|
const [x, y] = this.hostApp.getWindow().getPosition()
|
||||||
for (let screen of this.electron.screen.getAllDisplays()) {
|
for (const screen of this.electron.screen.getAllDisplays()) {
|
||||||
let bounds = screen.bounds
|
const bounds = screen.bounds
|
||||||
if (x >= bounds.x && x <= bounds.x + bounds.width && y >= bounds.y && y <= bounds.y + bounds.height) {
|
if (x >= bounds.x && x <= bounds.x + bounds.width && y >= bounds.y && y <= bounds.y + bounds.height) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let screen = this.electron.screen.getPrimaryDisplay()
|
const screen = this.electron.screen.getPrimaryDisplay()
|
||||||
this.hostApp.getWindow().setPosition(screen.bounds.x, screen.bounds.y)
|
this.hostApp.getWindow().setPosition(screen.bounds.x, screen.bounds.y)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
import { Injectable } from '@angular/core'
|
import { Injectable } from '@angular/core'
|
||||||
import { TouchBar, BrowserWindow, Menu, MenuItem } from 'electron'
|
import { TouchBar, BrowserWindow, Menu, MenuItem, NativeImage } from 'electron'
|
||||||
|
|
||||||
export interface MessageBoxResponse {
|
export interface MessageBoxResponse {
|
||||||
response: number
|
response: number
|
||||||
@@ -8,16 +8,16 @@ export interface MessageBoxResponse {
|
|||||||
|
|
||||||
@Injectable({ providedIn: 'root' })
|
@Injectable({ providedIn: 'root' })
|
||||||
export class ElectronService {
|
export class ElectronService {
|
||||||
app: any
|
app: Electron.App
|
||||||
ipcRenderer: any
|
ipcRenderer: Electron.IpcRenderer
|
||||||
shell: any
|
shell: Electron.Shell
|
||||||
dialog: any
|
dialog: Electron.Dialog
|
||||||
clipboard: any
|
clipboard: Electron.Clipboard
|
||||||
globalShortcut: any
|
globalShortcut: Electron.GlobalShortcut
|
||||||
nativeImage: any
|
nativeImage: typeof NativeImage
|
||||||
screen: any
|
screen: Electron.Screen
|
||||||
remote: any
|
remote: Electron.Remote
|
||||||
autoUpdater: any
|
autoUpdater: Electron.AutoUpdater
|
||||||
TouchBar: typeof TouchBar
|
TouchBar: typeof TouchBar
|
||||||
BrowserWindow: typeof BrowserWindow
|
BrowserWindow: typeof BrowserWindow
|
||||||
Menu: typeof Menu
|
Menu: typeof Menu
|
||||||
@@ -52,7 +52,7 @@ export class ElectronService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
showMessageBox (
|
async showMessageBox (
|
||||||
browserWindow: Electron.BrowserWindow,
|
browserWindow: Electron.BrowserWindow,
|
||||||
options: Electron.MessageBoxOptions
|
options: Electron.MessageBoxOptions
|
||||||
): Promise<MessageBoxResponse> {
|
): Promise<MessageBoxResponse> {
|
||||||
|
@@ -2,12 +2,13 @@ import * as os from 'os'
|
|||||||
import { Injectable } from '@angular/core'
|
import { Injectable } from '@angular/core'
|
||||||
import { ElectronService } from './electron.service'
|
import { ElectronService } from './electron.service'
|
||||||
import { ConfigService } from './config.service'
|
import { ConfigService } from './config.service'
|
||||||
import ua = require('universal-analytics')
|
import * as mixpanel from 'mixpanel'
|
||||||
import uuidv4 = require('uuid/v4')
|
import * as uuidv4 from 'uuid/v4'
|
||||||
|
|
||||||
@Injectable({ providedIn: 'root' })
|
@Injectable({ providedIn: 'root' })
|
||||||
export class HomeBaseService {
|
export class HomeBaseService {
|
||||||
appVersion: string
|
appVersion: string
|
||||||
|
mixpanel: any
|
||||||
|
|
||||||
/** @hidden */
|
/** @hidden */
|
||||||
constructor (
|
constructor (
|
||||||
@@ -16,7 +17,7 @@ export class HomeBaseService {
|
|||||||
) {
|
) {
|
||||||
this.appVersion = electron.app.getVersion()
|
this.appVersion = electron.app.getVersion()
|
||||||
|
|
||||||
if (this.config.store.enableAnalytics) {
|
if (this.config.store.enableAnalytics && !this.config.store.enableWelcomeTab) {
|
||||||
this.enableAnalytics()
|
this.enableAnalytics()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -28,12 +29,12 @@ export class HomeBaseService {
|
|||||||
reportBug () {
|
reportBug () {
|
||||||
let body = `Version: ${this.appVersion}\n`
|
let body = `Version: ${this.appVersion}\n`
|
||||||
body += `Platform: ${os.platform()} ${os.release()}\n`
|
body += `Platform: ${os.platform()} ${os.release()}\n`
|
||||||
let label = {
|
const label = {
|
||||||
darwin: 'OS: macOS',
|
darwin: 'OS: macOS',
|
||||||
windows: 'OS: Windows',
|
windows: 'OS: Windows',
|
||||||
linux: 'OS: Linux',
|
linux: 'OS: Linux',
|
||||||
}[os.platform()]
|
}[os.platform()]
|
||||||
let plugins = (window as any).installedPlugins.filter(x => !x.isBuiltin).map(x => x.name)
|
const plugins = (window as any).installedPlugins.filter(x => !x.isBuiltin).map(x => x.name)
|
||||||
body += `Plugins: ${plugins.join(', ') || 'none'}\n\n`
|
body += `Plugins: ${plugins.join(', ') || 'none'}\n\n`
|
||||||
this.electron.shell.openExternal(`https://github.com/eugeny/terminus/issues/new?body=${encodeURIComponent(body)}&labels=${label}`)
|
this.electron.shell.openExternal(`https://github.com/eugeny/terminus/issues/new?body=${encodeURIComponent(body)}&labels=${label}`)
|
||||||
}
|
}
|
||||||
@@ -42,9 +43,20 @@ export class HomeBaseService {
|
|||||||
if (!window.localStorage.analyticsUserID) {
|
if (!window.localStorage.analyticsUserID) {
|
||||||
window.localStorage.analyticsUserID = uuidv4()
|
window.localStorage.analyticsUserID = uuidv4()
|
||||||
}
|
}
|
||||||
const session = ua('UA-3278102-20', window.localStorage.analyticsUserID)
|
this.mixpanel = mixpanel.init('bb4638b0860eef14c04d4fbc5eb365fa')
|
||||||
session.set('cd1', this.appVersion)
|
if (!window.localStorage.installEventSent) {
|
||||||
session.set('cd2', process.platform)
|
this.mixpanel.track('freshInstall', this.getAnalyticsProperties())
|
||||||
session.pageview('/').send()
|
window.localStorage.installEventSent = true
|
||||||
|
}
|
||||||
|
this.mixpanel.track('launch', this.getAnalyticsProperties())
|
||||||
|
}
|
||||||
|
|
||||||
|
getAnalyticsProperties () {
|
||||||
|
return {
|
||||||
|
distinct_id: window.localStorage.analyticsUserID, // eslint-disable-line @typescript-eslint/camelcase
|
||||||
|
platform: process.platform,
|
||||||
|
os: os.release(),
|
||||||
|
version: this.appVersion,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
import * as path from 'path'
|
import * as path from 'path'
|
||||||
import shellEscape = require('shell-escape')
|
import shellEscape from 'shell-escape'
|
||||||
import { Observable, Subject } from 'rxjs'
|
import { Observable, Subject } from 'rxjs'
|
||||||
import { Injectable, NgZone, EventEmitter } from '@angular/core'
|
import { Injectable, NgZone, EventEmitter } from '@angular/core'
|
||||||
import { ElectronService } from './electron.service'
|
import { ElectronService } from './electron.service'
|
||||||
@@ -28,6 +28,7 @@ export class HostAppService {
|
|||||||
*/
|
*/
|
||||||
shown = new EventEmitter<any>()
|
shown = new EventEmitter<any>()
|
||||||
isFullScreen = false
|
isFullScreen = false
|
||||||
|
isPortable = !!process.env.PORTABLE_EXECUTABLE_FILE
|
||||||
|
|
||||||
private preferencesMenu = new Subject<void>()
|
private preferencesMenu = new Subject<void>()
|
||||||
private secondInstance = new Subject<void>()
|
private secondInstance = new Subject<void>()
|
||||||
@@ -86,8 +87,7 @@ export class HostAppService {
|
|||||||
|
|
||||||
get displayMetricsChanged$ (): Observable<void> { return this.displayMetricsChanged }
|
get displayMetricsChanged$ (): Observable<void> { return this.displayMetricsChanged }
|
||||||
|
|
||||||
/** @hidden */
|
private constructor (
|
||||||
constructor (
|
|
||||||
private zone: NgZone,
|
private zone: NgZone,
|
||||||
private electron: ElectronService,
|
private electron: ElectronService,
|
||||||
log: LogService,
|
log: LogService,
|
||||||
@@ -96,7 +96,7 @@ export class HostAppService {
|
|||||||
this.platform = {
|
this.platform = {
|
||||||
win32: Platform.Windows,
|
win32: Platform.Windows,
|
||||||
darwin: Platform.macOS,
|
darwin: Platform.macOS,
|
||||||
linux: Platform.Linux
|
linux: Platform.Linux,
|
||||||
}[process.platform]
|
}[process.platform]
|
||||||
|
|
||||||
this.windowId = parseInt(location.search.substring(1))
|
this.windowId = parseInt(location.search.substring(1))
|
||||||
@@ -169,7 +169,7 @@ export class HostAppService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
toggleFullscreen () {
|
toggleFullscreen () {
|
||||||
let window = this.getWindow()
|
const window = this.getWindow()
|
||||||
window.setFullScreen(!this.isFullScreen)
|
window.setFullScreen(!this.isFullScreen)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -251,6 +251,15 @@ export class HostAppService {
|
|||||||
this.electron.ipcRenderer.send('window-close')
|
this.electron.ipcRenderer.send('window-close')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
relaunch () {
|
||||||
|
if (this.isPortable) {
|
||||||
|
this.electron.app.relaunch({ execPath: process.env.PORTABLE_EXECUTABLE_FILE })
|
||||||
|
} else {
|
||||||
|
this.electron.app.relaunch()
|
||||||
|
}
|
||||||
|
this.electron.app.exit()
|
||||||
|
}
|
||||||
|
|
||||||
quit () {
|
quit () {
|
||||||
this.logger.info('Quitting')
|
this.logger.info('Quitting')
|
||||||
this.electron.app.quit()
|
this.electron.app.quit()
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
import { Injectable, Inject, NgZone, EventEmitter } from '@angular/core'
|
import { Injectable, Inject, NgZone, EventEmitter } from '@angular/core'
|
||||||
import { IHotkeyDescription, HotkeyProvider } from '../api/hotkeyProvider'
|
import { HotkeyDescription, HotkeyProvider } from '../api/hotkeyProvider'
|
||||||
import { NativeKeyEvent, stringifyKeySequence } from './hotkeys.util'
|
import { stringifyKeySequence } from './hotkeys.util'
|
||||||
import { ConfigService } from '../services/config.service'
|
import { ConfigService } from '../services/config.service'
|
||||||
import { ElectronService } from '../services/electron.service'
|
import { ElectronService } from '../services/electron.service'
|
||||||
|
|
||||||
@@ -13,29 +13,28 @@ export interface PartialHotkeyMatch {
|
|||||||
const KEY_TIMEOUT = 2000
|
const KEY_TIMEOUT = 2000
|
||||||
|
|
||||||
interface EventBufferEntry {
|
interface EventBufferEntry {
|
||||||
event: NativeKeyEvent
|
event: KeyboardEvent
|
||||||
time: number
|
time: number
|
||||||
}
|
}
|
||||||
|
|
||||||
@Injectable({ providedIn: 'root' })
|
@Injectable({ providedIn: 'root' })
|
||||||
export class HotkeysService {
|
export class HotkeysService {
|
||||||
key = new EventEmitter<NativeKeyEvent>()
|
key = new EventEmitter<KeyboardEvent>()
|
||||||
matchedHotkey = new EventEmitter<string>()
|
matchedHotkey = new EventEmitter<string>()
|
||||||
globalHotkey = new EventEmitter()
|
globalHotkey = new EventEmitter<void>()
|
||||||
private currentKeystrokes: EventBufferEntry[] = []
|
private currentKeystrokes: EventBufferEntry[] = []
|
||||||
private disabledLevel = 0
|
private disabledLevel = 0
|
||||||
private hotkeyDescriptions: IHotkeyDescription[] = []
|
private hotkeyDescriptions: HotkeyDescription[] = []
|
||||||
|
|
||||||
/** @hidden */
|
private constructor (
|
||||||
constructor (
|
|
||||||
private zone: NgZone,
|
private zone: NgZone,
|
||||||
private electron: ElectronService,
|
private electron: ElectronService,
|
||||||
private config: ConfigService,
|
private config: ConfigService,
|
||||||
@Inject(HotkeyProvider) private hotkeyProviders: HotkeyProvider[],
|
@Inject(HotkeyProvider) private hotkeyProviders: HotkeyProvider[],
|
||||||
) {
|
) {
|
||||||
let events = ['keydown', 'keyup']
|
const events = ['keydown', 'keyup']
|
||||||
events.forEach((event) => {
|
events.forEach(event => {
|
||||||
document.addEventListener(event, (nativeEvent) => {
|
document.addEventListener(event, (nativeEvent: KeyboardEvent) => {
|
||||||
if (document.querySelectorAll('input:focus').length === 0) {
|
if (document.querySelectorAll('input:focus').length === 0) {
|
||||||
this.pushKeystroke(event, nativeEvent)
|
this.pushKeystroke(event, nativeEvent)
|
||||||
this.processKeystrokes()
|
this.processKeystrokes()
|
||||||
@@ -58,8 +57,8 @@ export class HotkeysService {
|
|||||||
* @param name DOM event name
|
* @param name DOM event name
|
||||||
* @param nativeEvent event object
|
* @param nativeEvent event object
|
||||||
*/
|
*/
|
||||||
pushKeystroke (name, nativeEvent) {
|
pushKeystroke (name: string, nativeEvent: KeyboardEvent) {
|
||||||
nativeEvent.event = name
|
(nativeEvent as any).event = name
|
||||||
this.currentKeystrokes.push({ event: nativeEvent, time: performance.now() })
|
this.currentKeystrokes.push({ event: nativeEvent, time: performance.now() })
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -69,7 +68,7 @@ export class HotkeysService {
|
|||||||
processKeystrokes () {
|
processKeystrokes () {
|
||||||
if (this.isEnabled()) {
|
if (this.isEnabled()) {
|
||||||
this.zone.run(() => {
|
this.zone.run(() => {
|
||||||
let matched = this.getCurrentFullyMatchedHotkey()
|
const matched = this.getCurrentFullyMatchedHotkey()
|
||||||
if (matched) {
|
if (matched) {
|
||||||
console.log('Matched hotkey', matched)
|
console.log('Matched hotkey', matched)
|
||||||
this.matchedHotkey.emit(matched)
|
this.matchedHotkey.emit(matched)
|
||||||
@@ -79,7 +78,7 @@ export class HotkeysService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
emitKeyEvent (nativeEvent) {
|
emitKeyEvent (nativeEvent: KeyboardEvent) {
|
||||||
this.zone.run(() => {
|
this.zone.run(() => {
|
||||||
this.key.emit(nativeEvent)
|
this.key.emit(nativeEvent)
|
||||||
})
|
})
|
||||||
@@ -94,61 +93,16 @@ export class HotkeysService {
|
|||||||
return stringifyKeySequence(this.currentKeystrokes.map(x => x.event))
|
return stringifyKeySequence(this.currentKeystrokes.map(x => x.event))
|
||||||
}
|
}
|
||||||
|
|
||||||
private registerGlobalHotkey () {
|
getCurrentFullyMatchedHotkey (): string {
|
||||||
this.electron.globalShortcut.unregisterAll()
|
const currentStrokes = this.getCurrentKeystrokes()
|
||||||
let value = this.config.store.hotkeys['toggle-window'] || []
|
const config = this.getHotkeysConfig()
|
||||||
if (typeof value === 'string') {
|
for (const id in config) {
|
||||||
value = [value]
|
for (const sequence of config[id]) {
|
||||||
}
|
|
||||||
value.forEach(item => {
|
|
||||||
item = (typeof item === 'string') ? [item] : item
|
|
||||||
|
|
||||||
try {
|
|
||||||
this.electron.globalShortcut.register(item[0].replace(/-/g, '+'), () => {
|
|
||||||
this.globalHotkey.emit()
|
|
||||||
})
|
|
||||||
} catch (err) {
|
|
||||||
console.error('Could not register the global hotkey:', err)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
private getHotkeysConfig () {
|
|
||||||
return this.getHotkeysConfigRecursive(this.config.store.hotkeys)
|
|
||||||
}
|
|
||||||
|
|
||||||
private getHotkeysConfigRecursive (branch) {
|
|
||||||
let keys = {}
|
|
||||||
for (let key in branch) {
|
|
||||||
let value = branch[key]
|
|
||||||
if (value instanceof Object && !(value instanceof Array)) {
|
|
||||||
let subkeys = this.getHotkeysConfigRecursive(value)
|
|
||||||
for (let subkey in subkeys) {
|
|
||||||
keys[key + '.' + subkey] = subkeys[subkey]
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (typeof value === 'string') {
|
|
||||||
value = [value]
|
|
||||||
}
|
|
||||||
if (value) {
|
|
||||||
value = value.map((item) => (typeof item === 'string') ? [item] : item)
|
|
||||||
keys[key] = value
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return keys
|
|
||||||
}
|
|
||||||
|
|
||||||
private getCurrentFullyMatchedHotkey (): string {
|
|
||||||
let currentStrokes = this.getCurrentKeystrokes()
|
|
||||||
let config = this.getHotkeysConfig()
|
|
||||||
for (let id in config) {
|
|
||||||
for (let sequence of config[id]) {
|
|
||||||
if (currentStrokes.length < sequence.length) {
|
if (currentStrokes.length < sequence.length) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if (sequence.every(
|
if (sequence.every(
|
||||||
(x, index) =>
|
(x: string, index: number) =>
|
||||||
x.toLowerCase() ===
|
x.toLowerCase() ===
|
||||||
currentStrokes[currentStrokes.length - sequence.length + index].toLowerCase()
|
currentStrokes[currentStrokes.length - sequence.length + index].toLowerCase()
|
||||||
)) {
|
)) {
|
||||||
@@ -160,21 +114,21 @@ export class HotkeysService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getCurrentPartiallyMatchedHotkeys (): PartialHotkeyMatch[] {
|
getCurrentPartiallyMatchedHotkeys (): PartialHotkeyMatch[] {
|
||||||
let currentStrokes = this.getCurrentKeystrokes()
|
const currentStrokes = this.getCurrentKeystrokes()
|
||||||
let config = this.getHotkeysConfig()
|
const config = this.getHotkeysConfig()
|
||||||
let result = []
|
const result = []
|
||||||
for (let id in config) {
|
for (const id in config) {
|
||||||
for (let sequence of config[id]) {
|
for (const sequence of config[id]) {
|
||||||
for (let matchLength = Math.min(currentStrokes.length, sequence.length); matchLength > 0; matchLength--) {
|
for (let matchLength = Math.min(currentStrokes.length, sequence.length); matchLength > 0; matchLength--) {
|
||||||
if (sequence.slice(0, matchLength).every(
|
if (sequence.slice(0, matchLength).every(
|
||||||
(x, index) =>
|
(x: string, index: number) =>
|
||||||
x.toLowerCase() ===
|
x.toLowerCase() ===
|
||||||
currentStrokes[currentStrokes.length - matchLength + index].toLowerCase()
|
currentStrokes[currentStrokes.length - matchLength + index].toLowerCase()
|
||||||
)) {
|
)) {
|
||||||
result.push({
|
result.push({
|
||||||
matchedLength: matchLength,
|
matchedLength: matchLength,
|
||||||
id,
|
id,
|
||||||
strokes: sequence
|
strokes: sequence,
|
||||||
})
|
})
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
@@ -184,7 +138,7 @@ export class HotkeysService {
|
|||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
getHotkeyDescription (id: string): IHotkeyDescription {
|
getHotkeyDescription (id: string): HotkeyDescription {
|
||||||
return this.hotkeyDescriptions.filter((x) => x.id === id)[0]
|
return this.hotkeyDescriptions.filter((x) => x.id === id)[0]
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -200,7 +154,7 @@ export class HotkeysService {
|
|||||||
return this.disabledLevel === 0
|
return this.disabledLevel === 0
|
||||||
}
|
}
|
||||||
|
|
||||||
async getHotkeyDescriptions (): Promise<IHotkeyDescription[]> {
|
async getHotkeyDescriptions (): Promise<HotkeyDescription[]> {
|
||||||
return (
|
return (
|
||||||
await Promise.all(
|
await Promise.all(
|
||||||
this.config.enabledServices(this.hotkeyProviders)
|
this.config.enabledServices(this.hotkeyProviders)
|
||||||
@@ -208,4 +162,53 @@ export class HotkeysService {
|
|||||||
)
|
)
|
||||||
).reduce((a, b) => a.concat(b))
|
).reduce((a, b) => a.concat(b))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private registerGlobalHotkey () {
|
||||||
|
this.electron.globalShortcut.unregisterAll()
|
||||||
|
let value = this.config.store.hotkeys['toggle-window'] || []
|
||||||
|
if (typeof value === 'string') {
|
||||||
|
value = [value]
|
||||||
|
}
|
||||||
|
value.forEach((item: string | string[]) => {
|
||||||
|
item = typeof item === 'string' ? [item] : item
|
||||||
|
|
||||||
|
try {
|
||||||
|
let electronKeySpec = item[0]
|
||||||
|
electronKeySpec = electronKeySpec.replace('⌘', 'Command')
|
||||||
|
electronKeySpec = electronKeySpec.replace('⌥', 'Alt')
|
||||||
|
electronKeySpec = electronKeySpec.replace(/-/g, '+')
|
||||||
|
this.electron.globalShortcut.register(electronKeySpec, () => {
|
||||||
|
this.globalHotkey.emit()
|
||||||
|
})
|
||||||
|
} catch (err) {
|
||||||
|
console.error('Could not register the global hotkey:', err)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
private getHotkeysConfig () {
|
||||||
|
return this.getHotkeysConfigRecursive(this.config.store.hotkeys)
|
||||||
|
}
|
||||||
|
|
||||||
|
private getHotkeysConfigRecursive (branch: any) {
|
||||||
|
const keys = {}
|
||||||
|
for (const key in branch) {
|
||||||
|
let value = branch[key]
|
||||||
|
if (value instanceof Object && !(value instanceof Array)) {
|
||||||
|
const subkeys = this.getHotkeysConfigRecursive(value)
|
||||||
|
for (const subkey in subkeys) {
|
||||||
|
keys[key + '.' + subkey] = subkeys[subkey]
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (typeof value === 'string') {
|
||||||
|
value = [value]
|
||||||
|
}
|
||||||
|
if (value) {
|
||||||
|
value = value.map((item: string | string[]) => typeof item === 'string' ? [item] : item)
|
||||||
|
keys[key] = value
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return keys
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -10,24 +10,14 @@ export const altKeyName = {
|
|||||||
linux: 'Alt',
|
linux: 'Alt',
|
||||||
}[process.platform]
|
}[process.platform]
|
||||||
|
|
||||||
export interface NativeKeyEvent {
|
export function stringifyKeySequence (events: KeyboardEvent[]): string[] {
|
||||||
event?: string
|
const items: string[] = []
|
||||||
altKey: boolean
|
|
||||||
ctrlKey: boolean
|
|
||||||
metaKey: boolean
|
|
||||||
shiftKey: boolean
|
|
||||||
key: string
|
|
||||||
keyCode: string
|
|
||||||
}
|
|
||||||
|
|
||||||
export function stringifyKeySequence (events: NativeKeyEvent[]): string[] {
|
|
||||||
let items: string[] = []
|
|
||||||
events = events.slice()
|
events = events.slice()
|
||||||
|
|
||||||
while (events.length > 0) {
|
while (events.length > 0) {
|
||||||
let event = events.shift()
|
const event = events.shift()
|
||||||
if (event.event === 'keydown') {
|
if ((event as any).event === 'keydown') {
|
||||||
let itemKeys: string[] = []
|
const itemKeys: string[] = []
|
||||||
if (event.ctrlKey) {
|
if (event.ctrlKey) {
|
||||||
itemKeys.push('Ctrl')
|
itemKeys.push('Ctrl')
|
||||||
}
|
}
|
||||||
@@ -45,13 +35,26 @@ export function stringifyKeySequence (events: NativeKeyEvent[]): string[] {
|
|||||||
// TODO make this optional?
|
// TODO make this optional?
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if (event.key === ' ') {
|
|
||||||
itemKeys.push('Space')
|
let key = event.code
|
||||||
} else if (event.key.length === 1) {
|
key = key.replace('Key', '')
|
||||||
itemKeys.push(event.key.toUpperCase())
|
key = key.replace('Arrow', '')
|
||||||
} else {
|
key = key.replace('Digit', '')
|
||||||
itemKeys.push(event.key)
|
key = {
|
||||||
}
|
Comma: ',',
|
||||||
|
Period: '.',
|
||||||
|
Slash: '/',
|
||||||
|
Backslash: '\\',
|
||||||
|
IntlBackslash: '\\',
|
||||||
|
Backquote: '`',
|
||||||
|
Minus: '-',
|
||||||
|
Equal: '=',
|
||||||
|
Semicolon: ';',
|
||||||
|
Quote: '\'',
|
||||||
|
BracketLeft: '[',
|
||||||
|
BracketRight: ']',
|
||||||
|
}[key] || key
|
||||||
|
itemKeys.push(key)
|
||||||
items.push(itemKeys.join('-'))
|
items.push(itemKeys.join('-'))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -11,25 +11,18 @@ const initializeWinston = (electron: ElectronService) => {
|
|||||||
fs.mkdirSync(logDirectory)
|
fs.mkdirSync(logDirectory)
|
||||||
}
|
}
|
||||||
|
|
||||||
return new winston.Logger({
|
return winston.createLogger({
|
||||||
transports: [
|
transports: [
|
||||||
new winston.transports.File({
|
new winston.transports.File({
|
||||||
level: 'debug',
|
level: 'debug',
|
||||||
filename: path.join(logDirectory, 'log.txt'),
|
filename: path.join(logDirectory, 'log.txt'),
|
||||||
|
format: winston.format.simple(),
|
||||||
handleExceptions: false,
|
handleExceptions: false,
|
||||||
json: false,
|
|
||||||
maxsize: 5242880,
|
maxsize: 5242880,
|
||||||
maxFiles: 5,
|
maxFiles: 5,
|
||||||
colorize: false
|
|
||||||
}),
|
}),
|
||||||
new winston.transports.Console({
|
|
||||||
level: 'debug',
|
|
||||||
handleExceptions: false,
|
|
||||||
json: false,
|
|
||||||
colorize: true
|
|
||||||
})
|
|
||||||
],
|
],
|
||||||
exitOnError: false
|
exitOnError: false,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -39,18 +32,32 @@ export class Logger {
|
|||||||
private name: string,
|
private name: string,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
|
debug (...args: any[]) {
|
||||||
|
this.doLog('debug', ...args)
|
||||||
|
}
|
||||||
|
|
||||||
|
info (...args: any[]) {
|
||||||
|
this.doLog('info', ...args)
|
||||||
|
}
|
||||||
|
|
||||||
|
warn (...args: any[]) {
|
||||||
|
this.doLog('warn', ...args)
|
||||||
|
}
|
||||||
|
|
||||||
|
error (...args: any[]) {
|
||||||
|
this.doLog('error', ...args)
|
||||||
|
}
|
||||||
|
|
||||||
|
log (...args: any[]) {
|
||||||
|
this.doLog('log', ...args)
|
||||||
|
}
|
||||||
|
|
||||||
private doLog (level: string, ...args: any[]) {
|
private doLog (level: string, ...args: any[]) {
|
||||||
console[level](`%c[${this.name}]`, 'color: #aaa', ...args)
|
console[level](`%c[${this.name}]`, 'color: #aaa', ...args)
|
||||||
if (this.winstonLogger) {
|
if (this.winstonLogger) {
|
||||||
this.winstonLogger[level](...args)
|
this.winstonLogger[level](...args)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
debug (...args: any[]) { this.doLog('debug', ...args) }
|
|
||||||
info (...args: any[]) { this.doLog('info', ...args) }
|
|
||||||
warn (...args: any[]) { this.doLog('warn', ...args) }
|
|
||||||
error (...args: any[]) { this.doLog('error', ...args) }
|
|
||||||
log (...args: any[]) { this.doLog('log', ...args) }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Injectable({ providedIn: 'root' })
|
@Injectable({ providedIn: 'root' })
|
||||||
|
@@ -1,11 +1,16 @@
|
|||||||
import * as path from 'path'
|
import * as path from 'path'
|
||||||
import * as fs from 'mz/fs'
|
import * as fs from 'mz/fs'
|
||||||
import { Registry } from 'rage-edit'
|
|
||||||
import { exec } from 'mz/child_process'
|
import { exec } from 'mz/child_process'
|
||||||
import { Injectable } from '@angular/core'
|
import { Injectable } from '@angular/core'
|
||||||
import { ElectronService } from './electron.service'
|
import { ElectronService } from './electron.service'
|
||||||
import { HostAppService, Platform } from './hostApp.service'
|
import { HostAppService, Platform } from './hostApp.service'
|
||||||
|
|
||||||
|
/* eslint-disable block-scoped-var */
|
||||||
|
|
||||||
|
try {
|
||||||
|
var wnr = require('windows-native-registry') // eslint-disable-line @typescript-eslint/no-var-requires
|
||||||
|
} catch (_) { }
|
||||||
|
|
||||||
@Injectable({ providedIn: 'root' })
|
@Injectable({ providedIn: 'root' })
|
||||||
export class ShellIntegrationService {
|
export class ShellIntegrationService {
|
||||||
private automatorWorkflows = ['Open Terminus here.workflow', 'Paste path into Terminus.workflow']
|
private automatorWorkflows = ['Open Terminus here.workflow', 'Paste path into Terminus.workflow']
|
||||||
@@ -13,12 +18,12 @@ export class ShellIntegrationService {
|
|||||||
private automatorWorkflowsDestination: string
|
private automatorWorkflowsDestination: string
|
||||||
private registryKeys = [
|
private registryKeys = [
|
||||||
{
|
{
|
||||||
path: 'HKCU\\Software\\Classes\\Directory\\Background\\shell\\Open Terminus here',
|
path: 'Software\\Classes\\Directory\\Background\\shell\\Open Terminus here',
|
||||||
command: 'open "%V"'
|
command: 'open "%V"',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'HKCU\\Software\\Classes\\*\\shell\\Paste path into Terminus',
|
path: 'Software\\Classes\\*\\shell\\Paste path into Terminus',
|
||||||
command: 'paste "%V"'
|
command: 'paste "%V"',
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
constructor (
|
constructor (
|
||||||
@@ -37,6 +42,43 @@ export class ShellIntegrationService {
|
|||||||
this.updatePaths()
|
this.updatePaths()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async isInstalled (): Promise<boolean> {
|
||||||
|
if (this.hostApp.platform === Platform.macOS) {
|
||||||
|
return fs.exists(path.join(this.automatorWorkflowsDestination, this.automatorWorkflows[0]))
|
||||||
|
} else if (this.hostApp.platform === Platform.Windows) {
|
||||||
|
return !!wnr.getRegistryKey(wnr.HK.CU, this.registryKeys[0].path)
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
async install () {
|
||||||
|
const exe: string = process.env.PORTABLE_EXECUTABLE_FILE || this.electron.app.getPath('exe')
|
||||||
|
if (this.hostApp.platform === Platform.macOS) {
|
||||||
|
for (const wf of this.automatorWorkflows) {
|
||||||
|
await exec(`cp -r "${this.automatorWorkflowsLocation}/${wf}" "${this.automatorWorkflowsDestination}"`)
|
||||||
|
}
|
||||||
|
} else if (this.hostApp.platform === Platform.Windows) {
|
||||||
|
for (const registryKey of this.registryKeys) {
|
||||||
|
wnr.createRegistryKey(wnr.HK.CU, registryKey.path)
|
||||||
|
wnr.createRegistryKey(wnr.HK.CU, registryKey.path + '\\command')
|
||||||
|
wnr.setRegistryValue(wnr.HK.CU, registryKey.path, 'Icon', wnr.REG.SZ, exe)
|
||||||
|
wnr.setRegistryValue(wnr.HK.CU, registryKey.path + '\\command', '', wnr.REG.SZ, exe + ' ' + registryKey.command)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async remove () {
|
||||||
|
if (this.hostApp.platform === Platform.macOS) {
|
||||||
|
for (const wf of this.automatorWorkflows) {
|
||||||
|
await exec(`rm -rf "${this.automatorWorkflowsDestination}/${wf}"`)
|
||||||
|
}
|
||||||
|
} else if (this.hostApp.platform === Platform.Windows) {
|
||||||
|
for (const registryKey of this.registryKeys) {
|
||||||
|
wnr.deleteRegistryKey(wnr.HK.CU, registryKey.path)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private async updatePaths (): Promise<void> {
|
private async updatePaths (): Promise<void> {
|
||||||
// Update paths in case of an update
|
// Update paths in case of an update
|
||||||
if (this.hostApp.platform === Platform.Windows) {
|
if (this.hostApp.platform === Platform.Windows) {
|
||||||
@@ -45,26 +87,4 @@ export class ShellIntegrationService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async isInstalled (): Promise<boolean> {
|
|
||||||
if (this.hostApp.platform === Platform.macOS) {
|
|
||||||
return fs.exists(path.join(this.automatorWorkflowsDestination, this.automatorWorkflows[0]))
|
|
||||||
} else if (this.hostApp.platform === Platform.Windows) {
|
|
||||||
return Registry.has(this.registryKeys[0].path)
|
|
||||||
}
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
async install () {
|
|
||||||
if (this.hostApp.platform === Platform.macOS) {
|
|
||||||
for (let wf of this.automatorWorkflows) {
|
|
||||||
await exec(`cp -r "${this.automatorWorkflowsLocation}/${wf}" "${this.automatorWorkflowsDestination}"`)
|
|
||||||
}
|
|
||||||
} else if (this.hostApp.platform === Platform.Windows) {
|
|
||||||
for (let registryKey of this.registryKeys) {
|
|
||||||
await Registry.set(registryKey.path, 'Icon', this.electron.app.getPath('exe'))
|
|
||||||
await Registry.set(registryKey.path + '\\command', '', this.electron.app.getPath('exe') + ' ' + registryKey.command)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@@ -28,9 +28,9 @@ export class TabRecoveryService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async recoverTab (token: any): Promise<RecoveredTab> {
|
async recoverTab (token: any): Promise<RecoveredTab> {
|
||||||
for (let provider of this.config.enabledServices(this.tabRecoveryProviders)) {
|
for (const provider of this.config.enabledServices(this.tabRecoveryProviders)) {
|
||||||
try {
|
try {
|
||||||
let tab = await provider.recover(token)
|
const tab = await provider.recover(token)
|
||||||
if (tab) {
|
if (tab) {
|
||||||
return tab
|
return tab
|
||||||
}
|
}
|
||||||
@@ -43,9 +43,9 @@ export class TabRecoveryService {
|
|||||||
|
|
||||||
async recoverTabs (): Promise<RecoveredTab[]> {
|
async recoverTabs (): Promise<RecoveredTab[]> {
|
||||||
if (window.localStorage.tabsRecovery) {
|
if (window.localStorage.tabsRecovery) {
|
||||||
let tabs: RecoveredTab[] = []
|
const tabs: RecoveredTab[] = []
|
||||||
for (let token of JSON.parse(window.localStorage.tabsRecovery)) {
|
for (const token of JSON.parse(window.localStorage.tabsRecovery)) {
|
||||||
let tab = await this.recoverTab(token)
|
const tab = await this.recoverTab(token)
|
||||||
if (tab) {
|
if (tab) {
|
||||||
tabs.push(tab)
|
tabs.push(tab)
|
||||||
}
|
}
|
||||||
@@ -54,5 +54,4 @@ export class TabRecoveryService {
|
|||||||
}
|
}
|
||||||
return []
|
return []
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -2,7 +2,8 @@ import { Injectable, ComponentFactoryResolver, Injector } from '@angular/core'
|
|||||||
import { BaseTabComponent } from '../components/baseTab.component'
|
import { BaseTabComponent } from '../components/baseTab.component'
|
||||||
import { TabRecoveryService } from './tabRecovery.service'
|
import { TabRecoveryService } from './tabRecovery.service'
|
||||||
|
|
||||||
export declare type TabComponentType = new (...args: any[]) => BaseTabComponent
|
// eslint-disable-next-line @typescript-eslint/no-type-alias
|
||||||
|
export type TabComponentType = new (...args: any[]) => BaseTabComponent
|
||||||
|
|
||||||
@Injectable({ providedIn: 'root' })
|
@Injectable({ providedIn: 'root' })
|
||||||
export class TabsService {
|
export class TabsService {
|
||||||
@@ -17,9 +18,9 @@ export class TabsService {
|
|||||||
* Instantiates a tab component and assigns given inputs
|
* Instantiates a tab component and assigns given inputs
|
||||||
*/
|
*/
|
||||||
create (type: TabComponentType, inputs?: any): BaseTabComponent {
|
create (type: TabComponentType, inputs?: any): BaseTabComponent {
|
||||||
let componentFactory = this.componentFactoryResolver.resolveComponentFactory(type)
|
const componentFactory = this.componentFactoryResolver.resolveComponentFactory(type)
|
||||||
let componentRef = componentFactory.create(this.injector)
|
const componentRef = componentFactory.create(this.injector)
|
||||||
let tab = componentRef.instance
|
const tab = componentRef.instance
|
||||||
tab.hostView = componentRef.hostView
|
tab.hostView = componentRef.hostView
|
||||||
Object.assign(tab, inputs || {})
|
Object.assign(tab, inputs || {})
|
||||||
return tab
|
return tab
|
||||||
@@ -29,11 +30,11 @@ export class TabsService {
|
|||||||
* Duplicates an existing tab instance (using the tab recovery system)
|
* Duplicates an existing tab instance (using the tab recovery system)
|
||||||
*/
|
*/
|
||||||
async duplicate (tab: BaseTabComponent): Promise<BaseTabComponent> {
|
async duplicate (tab: BaseTabComponent): Promise<BaseTabComponent> {
|
||||||
let token = await tab.getRecoveryToken()
|
const token = await tab.getRecoveryToken()
|
||||||
if (!token) {
|
if (!token) {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
let dup = await this.tabRecovery.recoverTab(token)
|
const dup = await this.tabRecovery.recoverTab(token)
|
||||||
if (dup) {
|
if (dup) {
|
||||||
return this.create(dup.type, dup.options)
|
return this.create(dup.type, dup.options)
|
||||||
}
|
}
|
||||||
|
@@ -4,12 +4,13 @@ import { AppService } from './app.service'
|
|||||||
import { ConfigService } from './config.service'
|
import { ConfigService } from './config.service'
|
||||||
import { ElectronService } from './electron.service'
|
import { ElectronService } from './electron.service'
|
||||||
import { HostAppService, Platform } from './hostApp.service'
|
import { HostAppService, Platform } from './hostApp.service'
|
||||||
import { IToolbarButton, ToolbarButtonProvider } from '../api'
|
import { ToolbarButton, ToolbarButtonProvider } from '../api'
|
||||||
|
|
||||||
/** @hidden */
|
/** @hidden */
|
||||||
@Injectable({ providedIn: 'root' })
|
@Injectable({ providedIn: 'root' })
|
||||||
export class TouchbarService {
|
export class TouchbarService {
|
||||||
private tabsSegmentedControl: TouchBarSegmentedControl
|
private tabsSegmentedControl: TouchBarSegmentedControl
|
||||||
|
private buttonsSegmentedControl: TouchBarSegmentedControl
|
||||||
private tabSegments: SegmentedControlSegment[] = []
|
private tabSegments: SegmentedControlSegment[] = []
|
||||||
private nsImageCache: {[id: string]: Electron.NativeImage} = {}
|
private nsImageCache: {[id: string]: Electron.NativeImage} = {}
|
||||||
|
|
||||||
@@ -24,53 +25,85 @@ export class TouchbarService {
|
|||||||
if (this.hostApp.platform !== Platform.macOS) {
|
if (this.hostApp.platform !== Platform.macOS) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
app.tabsChanged$.subscribe(() => this.update())
|
app.tabsChanged$.subscribe(() => this.updateTabs())
|
||||||
app.activeTabChange$.subscribe(() => this.update())
|
app.activeTabChange$.subscribe(() => this.updateTabs())
|
||||||
|
|
||||||
|
const activityIconPath = `${electron.app.getAppPath()}/assets/activity.png`
|
||||||
|
const activityIcon = this.electron.nativeImage.createFromPath(activityIconPath)
|
||||||
app.tabOpened$.subscribe(tab => {
|
app.tabOpened$.subscribe(tab => {
|
||||||
tab.titleChange$.subscribe(title => {
|
tab.titleChange$.subscribe(title => {
|
||||||
this.tabSegments[app.tabs.indexOf(tab)].label = this.shortenTitle(title)
|
const segment = this.tabSegments[app.tabs.indexOf(tab)]
|
||||||
this.tabsSegmentedControl.segments = this.tabSegments
|
if (segment) {
|
||||||
|
segment.label = this.shortenTitle(title)
|
||||||
|
this.tabsSegmentedControl.segments = this.tabSegments
|
||||||
|
}
|
||||||
|
})
|
||||||
|
tab.activity$.subscribe(hasActivity => {
|
||||||
|
const showIcon = this.app.activeTab !== tab && hasActivity
|
||||||
|
const segment = this.tabSegments[app.tabs.indexOf(tab)]
|
||||||
|
if (segment) {
|
||||||
|
segment.icon = showIcon ? activityIcon : null
|
||||||
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
updateTabs () {
|
||||||
|
this.tabSegments = this.app.tabs.map(tab => ({
|
||||||
|
label: this.shortenTitle(tab.title),
|
||||||
|
}))
|
||||||
|
this.tabsSegmentedControl.segments = this.tabSegments
|
||||||
|
this.tabsSegmentedControl.selectedIndex = this.app.tabs.indexOf(this.app.activeTab)
|
||||||
|
}
|
||||||
|
|
||||||
update () {
|
update () {
|
||||||
if (this.hostApp.platform !== Platform.macOS) {
|
if (this.hostApp.platform !== Platform.macOS) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
let buttons: IToolbarButton[] = []
|
let buttons: ToolbarButton[] = []
|
||||||
this.config.enabledServices(this.toolbarButtonProviders).forEach(provider => {
|
this.config.enabledServices(this.toolbarButtonProviders).forEach(provider => {
|
||||||
buttons = buttons.concat(provider.provide())
|
buttons = buttons.concat(provider.provide())
|
||||||
})
|
})
|
||||||
|
buttons = buttons.filter(x => !!x.touchBarNSImage)
|
||||||
buttons.sort((a, b) => (a.weight || 0) - (b.weight || 0))
|
buttons.sort((a, b) => (a.weight || 0) - (b.weight || 0))
|
||||||
this.tabSegments = this.app.tabs.map(tab => ({
|
this.tabSegments = this.app.tabs.map(tab => ({
|
||||||
label: this.shortenTitle(tab.title),
|
label: this.shortenTitle(tab.title),
|
||||||
}))
|
}))
|
||||||
|
|
||||||
this.tabsSegmentedControl = new this.electron.TouchBar.TouchBarSegmentedControl({
|
this.tabsSegmentedControl = new this.electron.TouchBar.TouchBarSegmentedControl({
|
||||||
segments: this.tabSegments,
|
segments: this.tabSegments,
|
||||||
selectedIndex: this.app.tabs.indexOf(this.app.activeTab),
|
selectedIndex: this.app.tabs.indexOf(this.app.activeTab),
|
||||||
change: (selectedIndex) => this.zone.run(() => {
|
change: (selectedIndex) => this.zone.run(() => {
|
||||||
this.app.selectTab(this.app.tabs[selectedIndex])
|
this.app.selectTab(this.app.tabs[selectedIndex])
|
||||||
})
|
}),
|
||||||
})
|
})
|
||||||
let touchBar = new this.electron.TouchBar({
|
|
||||||
|
this.buttonsSegmentedControl = new this.electron.TouchBar.TouchBarSegmentedControl({
|
||||||
|
segments: buttons.map(button => this.getButton(button)),
|
||||||
|
mode: 'buttons',
|
||||||
|
change: (selectedIndex) => this.zone.run(() => {
|
||||||
|
buttons[selectedIndex].click()
|
||||||
|
}),
|
||||||
|
})
|
||||||
|
|
||||||
|
const touchBar = new this.electron.TouchBar({
|
||||||
items: [
|
items: [
|
||||||
this.tabsSegmentedControl,
|
this.tabsSegmentedControl,
|
||||||
new this.electron.TouchBar.TouchBarSpacer({ size: 'flexible' }),
|
new this.electron.TouchBar.TouchBarSpacer({ size: 'flexible' }),
|
||||||
new this.electron.TouchBar.TouchBarSpacer({ size: 'small' }),
|
new this.electron.TouchBar.TouchBarSpacer({ size: 'small' }),
|
||||||
...buttons.map(button => this.getButton(button))
|
this.buttonsSegmentedControl,
|
||||||
]
|
],
|
||||||
})
|
})
|
||||||
this.hostApp.setTouchBar(touchBar)
|
this.hostApp.setTouchBar(touchBar)
|
||||||
}
|
}
|
||||||
|
|
||||||
private getButton (button: IToolbarButton): Electron.TouchBarButton {
|
private getButton (button: ToolbarButton): Electron.SegmentedControlSegment {
|
||||||
return new this.electron.TouchBar.TouchBarButton({
|
return {
|
||||||
label: button.touchBarNSImage ? null : this.shortenTitle(button.touchBarTitle || button.title),
|
label: button.touchBarNSImage ? null : this.shortenTitle(button.touchBarTitle || button.title),
|
||||||
icon: button.touchBarNSImage ? this.getCachedNSImage(button.touchBarNSImage) : null,
|
icon: button.touchBarNSImage ? this.getCachedNSImage(button.touchBarNSImage) : null,
|
||||||
click: () => this.zone.run(() => button.click()),
|
// click: () => this.zone.run(() => button.click()),
|
||||||
})
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private getCachedNSImage (name: string) {
|
private getCachedNSImage (name: string) {
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import * as os from 'os'
|
|
||||||
import { Injectable } from '@angular/core'
|
import { Injectable } from '@angular/core'
|
||||||
import { Logger, LogService } from './log.service'
|
import { Logger, LogService } from './log.service'
|
||||||
import { ElectronService } from './electron.service'
|
import { ElectronService } from './electron.service'
|
||||||
@@ -11,8 +11,9 @@ const UPDATES_URL = 'https://api.github.com/repos/eugeny/terminus/releases/lates
|
|||||||
export class UpdaterService {
|
export class UpdaterService {
|
||||||
private logger: Logger
|
private logger: Logger
|
||||||
private downloaded: Promise<boolean>
|
private downloaded: Promise<boolean>
|
||||||
private isSquirrel = true
|
private electronUpdaterAvailable = true
|
||||||
private updateURL: string
|
private updateURL: string
|
||||||
|
private autoUpdater
|
||||||
|
|
||||||
constructor (
|
constructor (
|
||||||
log: LogService,
|
log: LogService,
|
||||||
@@ -20,42 +21,37 @@ export class UpdaterService {
|
|||||||
) {
|
) {
|
||||||
this.logger = log.create('updater')
|
this.logger = log.create('updater')
|
||||||
|
|
||||||
try {
|
this.autoUpdater = electron.remote.require('electron-updater').autoUpdater
|
||||||
electron.autoUpdater.setFeedURL(`https://terminus-updates.herokuapp.com/update/${os.platform()}/${electron.app.getVersion()}`)
|
|
||||||
} catch (e) {
|
|
||||||
this.isSquirrel = false
|
|
||||||
this.logger.info('Squirrel updater unavailable, falling back')
|
|
||||||
}
|
|
||||||
|
|
||||||
this.electron.autoUpdater.on('update-available', () => {
|
this.autoUpdater.on('update-available', () => {
|
||||||
this.logger.info('Update available')
|
this.logger.info('Update available')
|
||||||
})
|
})
|
||||||
this.electron.autoUpdater.once('update-not-available', () => {
|
this.autoUpdater.once('update-not-available', () => {
|
||||||
this.logger.info('No updates')
|
this.logger.info('No updates')
|
||||||
})
|
})
|
||||||
|
|
||||||
this.downloaded = new Promise<boolean>(resolve => {
|
this.downloaded = new Promise<boolean>(resolve => {
|
||||||
this.electron.autoUpdater.once('update-downloaded', () => resolve(true))
|
this.autoUpdater.once('update-downloaded', () => resolve(true))
|
||||||
})
|
})
|
||||||
|
|
||||||
this.logger.debug('Checking for updates')
|
this.logger.debug('Checking for updates')
|
||||||
|
|
||||||
if (this.isSquirrel) {
|
if (this.electronUpdaterAvailable && !process.env.TERMINUS_DEV) {
|
||||||
try {
|
try {
|
||||||
this.electron.autoUpdater.checkForUpdates()
|
this.autoUpdater.checkForUpdates()
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
this.isSquirrel = false
|
this.electronUpdaterAvailable = false
|
||||||
this.logger.info('Squirrel updater unavailable, falling back')
|
this.logger.info('Electron updater unavailable, falling back', e)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async check (): Promise<boolean> {
|
async check (): Promise<boolean> {
|
||||||
if (!this.isSquirrel) {
|
if (!this.electronUpdaterAvailable) {
|
||||||
this.logger.debug('Checking for updates')
|
this.logger.debug('Checking for updates')
|
||||||
let response = await axios.get(UPDATES_URL)
|
const response = await axios.get(UPDATES_URL)
|
||||||
let data = response.data
|
const data = response.data
|
||||||
let version = data.tag_name.substring(1)
|
const version = data.tag_name.substring(1)
|
||||||
if (this.electron.app.getVersion() !== version) {
|
if (this.electron.app.getVersion() !== version) {
|
||||||
this.logger.info('Update available')
|
this.logger.info('Update available')
|
||||||
this.updateURL = data.html_url
|
this.updateURL = data.html_url
|
||||||
@@ -68,11 +64,11 @@ export class UpdaterService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async update () {
|
async update () {
|
||||||
if (!this.isSquirrel) {
|
if (!this.electronUpdaterAvailable) {
|
||||||
this.electron.shell.openExternal(this.updateURL)
|
this.electron.shell.openExternal(this.updateURL)
|
||||||
} else {
|
} else {
|
||||||
await this.downloaded
|
await this.downloaded
|
||||||
this.electron.autoUpdater.quitAndInstall()
|
this.autoUpdater.quitAndInstall()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -22,31 +22,31 @@ export class CloseContextMenu extends TabContextMenuItemProvider {
|
|||||||
label: 'Close',
|
label: 'Close',
|
||||||
click: () => this.zone.run(() => {
|
click: () => this.zone.run(() => {
|
||||||
this.app.closeTab(tab, true)
|
this.app.closeTab(tab, true)
|
||||||
})
|
}),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Close other tabs',
|
label: 'Close other tabs',
|
||||||
click: () => this.zone.run(() => {
|
click: () => this.zone.run(() => {
|
||||||
for (let t of this.app.tabs.filter(x => x !== tab)) {
|
for (const t of this.app.tabs.filter(x => x !== tab)) {
|
||||||
this.app.closeTab(t, true)
|
this.app.closeTab(t, true)
|
||||||
}
|
}
|
||||||
})
|
}),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Close tabs to the right',
|
label: 'Close tabs to the right',
|
||||||
click: () => this.zone.run(() => {
|
click: () => this.zone.run(() => {
|
||||||
for (let t of this.app.tabs.slice(this.app.tabs.indexOf(tab) + 1)) {
|
for (const t of this.app.tabs.slice(this.app.tabs.indexOf(tab) + 1)) {
|
||||||
this.app.closeTab(t, true)
|
this.app.closeTab(t, true)
|
||||||
}
|
}
|
||||||
})
|
}),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Close tabs to the left',
|
label: 'Close tabs to the left',
|
||||||
click: () => this.zone.run(() => {
|
click: () => this.zone.run(() => {
|
||||||
for (let t of this.app.tabs.slice(0, this.app.tabs.indexOf(tab))) {
|
for (const t of this.app.tabs.slice(0, this.app.tabs.indexOf(tab))) {
|
||||||
this.app.closeTab(t, true)
|
this.app.closeTab(t, true)
|
||||||
}
|
}
|
||||||
})
|
}),
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -78,11 +78,11 @@ export class CommonOptionsContextMenu extends TabContextMenuItemProvider {
|
|||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
label: 'Rename',
|
label: 'Rename',
|
||||||
click: () => this.zone.run(() => tabHeader.showRenameTabModal())
|
click: () => this.zone.run(() => tabHeader.showRenameTabModal()),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Duplicate',
|
label: 'Duplicate',
|
||||||
click: () => this.zone.run(() => this.app.duplicateTab(tab))
|
click: () => this.zone.run(() => this.app.duplicateTab(tab)),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Color',
|
label: 'Color',
|
||||||
@@ -95,7 +95,7 @@ export class CommonOptionsContextMenu extends TabContextMenuItemProvider {
|
|||||||
tab.color = color.value
|
tab.color = color.value
|
||||||
}),
|
}),
|
||||||
})) as Electron.MenuItemConstructorOptions[],
|
})) as Electron.MenuItemConstructorOptions[],
|
||||||
}
|
},
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -111,7 +111,7 @@ export class TaskCompletionContextMenu extends TabContextMenuItemProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getItems (tab: BaseTabComponent): Promise<Electron.MenuItemConstructorOptions[]> {
|
async getItems (tab: BaseTabComponent): Promise<Electron.MenuItemConstructorOptions[]> {
|
||||||
let process = await tab.getCurrentProcess()
|
const process = await tab.getCurrentProcess()
|
||||||
if (process) {
|
if (process) {
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
@@ -138,7 +138,7 @@ export class TaskCompletionContextMenu extends TabContextMenuItemProvider {
|
|||||||
} else {
|
} else {
|
||||||
this.app.stopObservingTabCompletion(tab)
|
this.app.stopObservingTabCompletion(tab)
|
||||||
}
|
}
|
||||||
})
|
}),
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@@ -51,13 +51,13 @@ $input-disabled-bg: #333;
|
|||||||
$input-color: $body-color;
|
$input-color: $body-color;
|
||||||
$input-color-placeholder: #333;
|
$input-color-placeholder: #333;
|
||||||
$input-border-color: #344;
|
$input-border-color: #344;
|
||||||
$input-border-width: 0;
|
$input-border-width: 1px;
|
||||||
//$input-box-shadow: inset 0 1px 1px rgba($black,.075);
|
//$input-box-shadow: inset 0 1px 1px rgba($black,.075);
|
||||||
$input-border-radius: 0;
|
$input-border-radius: 0;
|
||||||
$custom-select-border-radius: 0;
|
$custom-select-border-radius: 0;
|
||||||
$input-bg-focus: $input-bg;
|
$input-bg-focus: $input-bg;
|
||||||
//$input-border-focus: lighten($brand-primary, 25%);
|
$input-border-focus: lighten($blue, 25%);
|
||||||
//$input-box-shadow-focus: $input-box-shadow, rgba($input-border-focus, .6);
|
$input-focus-box-shadow: none;
|
||||||
$input-color-focus: $input-color;
|
$input-color-focus: $input-color;
|
||||||
$input-group-addon-bg: $body-bg;
|
$input-group-addon-bg: $body-bg;
|
||||||
$input-group-addon-border-color: $input-border-color;
|
$input-group-addon-border-color: $input-border-color;
|
||||||
@@ -136,6 +136,10 @@ app-root {
|
|||||||
background: transparent;
|
background: transparent;
|
||||||
&:hover { background: rgba(0, 0, 0, .25) !important; }
|
&:hover { background: rgba(0, 0, 0, .25) !important; }
|
||||||
&:active { background: rgba(0, 0, 0, .5) !important; }
|
&:active { background: rgba(0, 0, 0, .5) !important; }
|
||||||
|
|
||||||
|
&::after {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&>.tabs {
|
&>.tabs {
|
||||||
|
@@ -2,7 +2,6 @@
|
|||||||
"extends": "../tsconfig.json",
|
"extends": "../tsconfig.json",
|
||||||
"exclude": ["node_modules", "dist"],
|
"exclude": ["node_modules", "dist"],
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"baseUrl": "src",
|
"baseUrl": "src"
|
||||||
"declarationDir": "dist"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
14
terminus-core/tsconfig.typings.json
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"extends": "../tsconfig.json",
|
||||||
|
"exclude": ["node_modules", "dist", "typings"],
|
||||||
|
"compilerOptions": {
|
||||||
|
"baseUrl": "src",
|
||||||
|
"emitDeclarationOnly": true,
|
||||||
|
"declaration": true,
|
||||||
|
"declarationDir": "./typings",
|
||||||
|
"paths": {
|
||||||
|
"terminus-*": ["../../terminus-*"],
|
||||||
|
"*": ["../../app/node_modules/*"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -2,64 +2,64 @@ const path = require('path')
|
|||||||
const webpack = require('webpack')
|
const webpack = require('webpack')
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
target: 'node',
|
target: 'node',
|
||||||
entry: 'src/index.ts',
|
entry: 'src/index.ts',
|
||||||
devtool: 'source-map',
|
devtool: 'source-map',
|
||||||
context: __dirname,
|
context: __dirname,
|
||||||
mode: 'development',
|
mode: 'development',
|
||||||
output: {
|
output: {
|
||||||
path: path.resolve(__dirname, 'dist'),
|
path: path.resolve(__dirname, 'dist'),
|
||||||
filename: 'index.js',
|
filename: 'index.js',
|
||||||
pathinfo: true,
|
pathinfo: true,
|
||||||
libraryTarget: 'umd',
|
libraryTarget: 'umd',
|
||||||
devtoolModuleFilenameTemplate: 'webpack-terminus-core:///[resource-path]',
|
devtoolModuleFilenameTemplate: 'webpack-terminus-core:///[resource-path]',
|
||||||
},
|
},
|
||||||
mode: process.env.TERMINUS_DEV ? 'development' : 'production',
|
mode: process.env.TERMINUS_DEV ? 'development' : 'production',
|
||||||
optimization:{
|
optimization:{
|
||||||
minimize: false,
|
minimize: false,
|
||||||
},
|
},
|
||||||
resolve: {
|
resolve: {
|
||||||
modules: ['.', 'src', 'node_modules', '../app/node_modules'].map(x => path.join(__dirname, x)),
|
modules: ['.', 'src', 'node_modules', '../app/node_modules'].map(x => path.join(__dirname, x)),
|
||||||
extensions: ['.ts', '.js'],
|
extensions: ['.ts', '.js'],
|
||||||
},
|
},
|
||||||
module: {
|
module: {
|
||||||
rules: [
|
rules: [
|
||||||
{
|
{
|
||||||
test: /\.ts$/,
|
test: /\.ts$/,
|
||||||
use: {
|
use: {
|
||||||
loader: 'awesome-typescript-loader',
|
loader: 'awesome-typescript-loader',
|
||||||
options: {
|
options: {
|
||||||
configFileName: path.resolve(__dirname, 'tsconfig.json'),
|
configFileName: path.resolve(__dirname, 'tsconfig.json'),
|
||||||
typeRoots: [path.resolve(__dirname, 'node_modules/@types')],
|
typeRoots: [
|
||||||
paths: {
|
path.resolve(__dirname, 'node_modules/@types'),
|
||||||
"terminus-*": [path.resolve(__dirname, '../terminus-*')],
|
path.resolve(__dirname, '../node_modules/@types'),
|
||||||
"*": [path.resolve(__dirname, '../app/node_modules/*')],
|
],
|
||||||
}
|
paths: {
|
||||||
}
|
"terminus-*": [path.resolve(__dirname, '../terminus-*')],
|
||||||
}
|
"*": [path.resolve(__dirname, '../app/node_modules/*')],
|
||||||
},
|
},
|
||||||
{ test: /\.pug$/, use: ['apply-loader', 'pug-loader'] },
|
},
|
||||||
{ test: /\.scss$/, use: ['to-string-loader', 'css-loader', 'sass-loader'] },
|
},
|
||||||
{ test: /\.css$/, use: ['to-string-loader', 'css-loader'], include: /component\.css/ },
|
},
|
||||||
{ test: /\.css$/, use: ['style-loader', 'css-loader'], exclude: /component\.css/ },
|
{ test: /\.pug$/, use: ['apply-loader', 'pug-loader'] },
|
||||||
{ test: /\.yaml$/, use: ['json-loader', 'yaml-loader'] },
|
{ test: /\.scss$/, use: ['to-string-loader', 'css-loader', 'sass-loader'] },
|
||||||
{ test: /\.svg/, use: ['svg-inline-loader'] },
|
{ test: /\.css$/, use: ['to-string-loader', 'css-loader'], include: /component\.css/ },
|
||||||
]
|
{ test: /\.css$/, use: ['style-loader', 'css-loader'], exclude: /component\.css/ },
|
||||||
},
|
{ test: /\.yaml$/, use: ['json-loader', 'yaml-loader'] },
|
||||||
externals: [
|
{ test: /\.svg/, use: ['svg-inline-loader'] },
|
||||||
'electron',
|
],
|
||||||
'fs',
|
},
|
||||||
'os',
|
externals: [
|
||||||
'path',
|
'electron',
|
||||||
'deepmerge',
|
'fs',
|
||||||
'untildify',
|
'os',
|
||||||
'winston',
|
'path',
|
||||||
'js-yaml',
|
'windows-native-registry',
|
||||||
/^rxjs/,
|
/^rxjs/,
|
||||||
/^@angular/,
|
/^@angular/,
|
||||||
/^@ng-bootstrap/,
|
/^@ng-bootstrap/,
|
||||||
],
|
],
|
||||||
plugins: [
|
plugins: [
|
||||||
new webpack.optimize.ModuleConcatenationPlugin(),
|
new webpack.optimize.ModuleConcatenationPlugin(),
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "terminus-plugin-manager",
|
"name": "terminus-plugin-manager",
|
||||||
"version": "1.0.73-c4-ga7d62b0",
|
"version": "1.0.83-nightly.0",
|
||||||
"description": "Terminus' plugin manager",
|
"description": "Terminus' plugin manager",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"terminus-builtin-plugin"
|
"terminus-builtin-plugin"
|
||||||
],
|
],
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"typings": "dist/index.d.ts",
|
"typings": "typings/index.d.ts",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "webpack --progress --color --display-modules",
|
"build": "webpack --progress --color --display-modules",
|
||||||
"watch": "webpack --progress --color --watch"
|
"watch": "webpack --progress --color --watch"
|
||||||
@@ -17,28 +17,21 @@
|
|||||||
"author": "Eugene Pankov",
|
"author": "Eugene Pankov",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/mz": "0.0.31",
|
"@types/mz": "0.0.32",
|
||||||
"@types/node": "7.0.12",
|
"@types/semver": "^6.0.0",
|
||||||
"@types/semver": "^5.3.32",
|
"axios": "^0.19.0",
|
||||||
"@types/webpack-env": "1.13.0",
|
"mz": "^2.6.0",
|
||||||
"css-loader": "^0.28.0",
|
|
||||||
"ngx-pipes": "^1.6.1",
|
"ngx-pipes": "^1.6.1",
|
||||||
"semver": "^5.3.0"
|
"semver": "^6.1.0"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@angular/common": "4.0.1",
|
"@angular/common": "^7",
|
||||||
"@angular/core": "4.0.1",
|
"@angular/core": "^7",
|
||||||
"@angular/forms": "4.0.1",
|
"@angular/forms": "^7",
|
||||||
"@angular/platform-browser": "4.0.1",
|
"@angular/platform-browser": "^7",
|
||||||
"@ng-bootstrap/ng-bootstrap": "1.0.0-alpha.22",
|
"@ng-bootstrap/ng-bootstrap": "^1",
|
||||||
"rxjs": "5.3.0",
|
"rxjs": "^5",
|
||||||
"terminus-core": "*",
|
"terminus-core": "*",
|
||||||
"terminus-settings": "*"
|
"terminus-settings": "*"
|
||||||
},
|
}
|
||||||
"dependencies": {
|
|
||||||
"axios": "^0.16.2",
|
|
||||||
"mz": "^2.6.0",
|
|
||||||
"npm": "^6.7.0"
|
|
||||||
},
|
|
||||||
"false": {}
|
|
||||||
}
|
}
|
||||||
|
@@ -4,7 +4,7 @@ import * as semver from 'semver'
|
|||||||
|
|
||||||
import { Component, Input } from '@angular/core'
|
import { Component, Input } from '@angular/core'
|
||||||
import { ConfigService, ElectronService } from 'terminus-core'
|
import { ConfigService, ElectronService } from 'terminus-core'
|
||||||
import { IPluginInfo, PluginManagerService } from '../services/pluginManager.service'
|
import { PluginInfo, PluginManagerService } from '../services/pluginManager.service'
|
||||||
|
|
||||||
enum BusyState { Installing, Uninstalling }
|
enum BusyState { Installing, Uninstalling }
|
||||||
|
|
||||||
@@ -15,10 +15,10 @@ enum BusyState { Installing, Uninstalling }
|
|||||||
})
|
})
|
||||||
export class PluginsSettingsTabComponent {
|
export class PluginsSettingsTabComponent {
|
||||||
BusyState = BusyState
|
BusyState = BusyState
|
||||||
@Input() availablePlugins$: Observable<IPluginInfo[]>
|
@Input() availablePlugins$: Observable<PluginInfo[]>
|
||||||
@Input() availablePluginsQuery$ = new BehaviorSubject<string>('')
|
@Input() availablePluginsQuery$ = new BehaviorSubject<string>('')
|
||||||
@Input() availablePluginsReady = false
|
@Input() availablePluginsReady = false
|
||||||
@Input() knownUpgrades: {[id: string]: IPluginInfo} = {}
|
@Input() knownUpgrades: {[id: string]: PluginInfo} = {}
|
||||||
@Input() busy: {[id: string]: BusyState} = {}
|
@Input() busy: {[id: string]: BusyState} = {}
|
||||||
@Input() erroredPlugin: string
|
@Input() erroredPlugin: string
|
||||||
@Input() errorMessage: string
|
@Input() errorMessage: string
|
||||||
@@ -44,7 +44,7 @@ export class PluginsSettingsTabComponent {
|
|||||||
})
|
})
|
||||||
)
|
)
|
||||||
this.availablePlugins$.pipe(first()).subscribe(available => {
|
this.availablePlugins$.pipe(first()).subscribe(available => {
|
||||||
for (let plugin of this.pluginManager.installedPlugins) {
|
for (const plugin of this.pluginManager.installedPlugins) {
|
||||||
this.knownUpgrades[plugin.name] = available.find(x => x.name === plugin.name && semver.gt(x.version, plugin.version))
|
this.knownUpgrades[plugin.name] = available.find(x => x.name === plugin.name && semver.gt(x.version, plugin.version))
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -58,11 +58,11 @@ export class PluginsSettingsTabComponent {
|
|||||||
this.availablePluginsQuery$.next(query)
|
this.availablePluginsQuery$.next(query)
|
||||||
}
|
}
|
||||||
|
|
||||||
isAlreadyInstalled (plugin: IPluginInfo): boolean {
|
isAlreadyInstalled (plugin: PluginInfo): boolean {
|
||||||
return this.pluginManager.installedPlugins.some(x => x.name === plugin.name)
|
return this.pluginManager.installedPlugins.some(x => x.name === plugin.name)
|
||||||
}
|
}
|
||||||
|
|
||||||
async installPlugin (plugin: IPluginInfo): Promise<void> {
|
async installPlugin (plugin: PluginInfo): Promise<void> {
|
||||||
this.busy[plugin.name] = BusyState.Installing
|
this.busy[plugin.name] = BusyState.Installing
|
||||||
try {
|
try {
|
||||||
await this.pluginManager.installPlugin(plugin)
|
await this.pluginManager.installPlugin(plugin)
|
||||||
@@ -76,7 +76,7 @@ export class PluginsSettingsTabComponent {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async uninstallPlugin (plugin: IPluginInfo): Promise<void> {
|
async uninstallPlugin (plugin: PluginInfo): Promise<void> {
|
||||||
this.busy[plugin.name] = BusyState.Uninstalling
|
this.busy[plugin.name] = BusyState.Uninstalling
|
||||||
try {
|
try {
|
||||||
await this.pluginManager.uninstallPlugin(plugin)
|
await this.pluginManager.uninstallPlugin(plugin)
|
||||||
@@ -90,21 +90,21 @@ export class PluginsSettingsTabComponent {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async upgradePlugin (plugin: IPluginInfo): Promise<void> {
|
async upgradePlugin (plugin: PluginInfo): Promise<void> {
|
||||||
return this.installPlugin(this.knownUpgrades[plugin.name])
|
return this.installPlugin(this.knownUpgrades[plugin.name])
|
||||||
}
|
}
|
||||||
|
|
||||||
showPluginInfo (plugin: IPluginInfo) {
|
showPluginInfo (plugin: PluginInfo) {
|
||||||
this.electron.shell.openExternal('https://www.npmjs.com/package/' + plugin.packageName)
|
this.electron.shell.openExternal('https://www.npmjs.com/package/' + plugin.packageName)
|
||||||
}
|
}
|
||||||
|
|
||||||
enablePlugin (plugin: IPluginInfo) {
|
enablePlugin (plugin: PluginInfo) {
|
||||||
this.config.store.pluginBlacklist = this.config.store.pluginBlacklist.filter(x => x !== plugin.name)
|
this.config.store.pluginBlacklist = this.config.store.pluginBlacklist.filter(x => x !== plugin.name)
|
||||||
this.config.save()
|
this.config.save()
|
||||||
this.config.requestRestart()
|
this.config.requestRestart()
|
||||||
}
|
}
|
||||||
|
|
||||||
disablePlugin (plugin: IPluginInfo) {
|
disablePlugin (plugin: PluginInfo) {
|
||||||
this.config.store.pluginBlacklist = [...this.config.store.pluginBlacklist, plugin.name]
|
this.config.store.pluginBlacklist = [...this.config.store.pluginBlacklist, plugin.name]
|
||||||
this.config.save()
|
this.config.save()
|
||||||
this.config.requestRestart()
|
this.config.requestRestart()
|
||||||
|
@@ -27,6 +27,6 @@ import { PluginsSettingsTabProvider } from './settings'
|
|||||||
PluginsSettingsTabComponent,
|
PluginsSettingsTabComponent,
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
export default class PluginManagerModule { }
|
export default class PluginManagerModule { } // eslint-disable-line @typescript-eslint/no-extraneous-class
|
||||||
|
|
||||||
export { PluginManagerService }
|
export { PluginManagerService }
|
||||||
|
@@ -8,7 +8,7 @@ const NAME_PREFIX = 'terminus-'
|
|||||||
const KEYWORD = 'terminus-plugin'
|
const KEYWORD = 'terminus-plugin'
|
||||||
const OFFICIAL_NPM_ACCOUNT = 'eugenepankov'
|
const OFFICIAL_NPM_ACCOUNT = 'eugenepankov'
|
||||||
|
|
||||||
export interface IPluginInfo {
|
export interface PluginInfo {
|
||||||
name: string
|
name: string
|
||||||
description: string
|
description: string
|
||||||
packageName: string
|
packageName: string
|
||||||
@@ -25,7 +25,7 @@ export class PluginManagerService {
|
|||||||
logger: Logger
|
logger: Logger
|
||||||
builtinPluginsPath: string = (window as any).builtinPluginsPath
|
builtinPluginsPath: string = (window as any).builtinPluginsPath
|
||||||
userPluginsPath: string = (window as any).userPluginsPath
|
userPluginsPath: string = (window as any).userPluginsPath
|
||||||
installedPlugins: IPluginInfo[] = (window as any).installedPlugins
|
installedPlugins: PluginInfo[] = (window as any).installedPlugins
|
||||||
|
|
||||||
private npmReady: Promise<void>
|
private npmReady: Promise<void>
|
||||||
private npm: any
|
private npm: any
|
||||||
@@ -40,7 +40,7 @@ export class PluginManagerService {
|
|||||||
if (!this.npm) {
|
if (!this.npm) {
|
||||||
if (!this.npmReady) {
|
if (!this.npmReady) {
|
||||||
this.npmReady = new Promise(resolve => {
|
this.npmReady = new Promise(resolve => {
|
||||||
const npm = require('npm')
|
const npm = (global as any).require('npm')
|
||||||
npm.load({
|
npm.load({
|
||||||
prefix: this.userPluginsPath,
|
prefix: this.userPluginsPath,
|
||||||
}, err => {
|
}, err => {
|
||||||
@@ -57,12 +57,12 @@ export class PluginManagerService {
|
|||||||
return this.npm
|
return this.npm
|
||||||
}
|
}
|
||||||
|
|
||||||
listAvailable (query?: string): Observable<IPluginInfo[]> {
|
listAvailable (query?: string): Observable<PluginInfo[]> {
|
||||||
return from(
|
return from(
|
||||||
axios.get(`https://www.npmjs.com/search?q=keywords%3A${KEYWORD}+${encodeURIComponent(query || '')}&from=0&size=1000`, {
|
axios.get(`https://www.npmjs.com/search?q=keywords%3A${KEYWORD}+${encodeURIComponent(query || '')}&from=0&size=1000`, {
|
||||||
headers: {
|
headers: {
|
||||||
'x-spiferack': '1',
|
'x-spiferack': '1',
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
).pipe(
|
).pipe(
|
||||||
map(response => response.data.objects.map(item => ({
|
map(response => response.data.objects.map(item => ({
|
||||||
@@ -78,7 +78,7 @@ export class PluginManagerService {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
async installPlugin (plugin: IPluginInfo) {
|
async installPlugin (plugin: PluginInfo) {
|
||||||
(await this.getNPM()).commands.install([`${plugin.packageName}@${plugin.version}`], err => {
|
(await this.getNPM()).commands.install([`${plugin.packageName}@${plugin.version}`], err => {
|
||||||
if (err) {
|
if (err) {
|
||||||
this.logger.error(err)
|
this.logger.error(err)
|
||||||
@@ -88,7 +88,7 @@ export class PluginManagerService {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
async uninstallPlugin (plugin: IPluginInfo) {
|
async uninstallPlugin (plugin: PluginInfo) {
|
||||||
(await this.getNPM()).commands.remove([plugin.packageName], err => {
|
(await this.getNPM()).commands.remove([plugin.packageName], err => {
|
||||||
if (err) {
|
if (err) {
|
||||||
this.logger.error(err)
|
this.logger.error(err)
|
||||||
|
@@ -3,6 +3,5 @@
|
|||||||
"exclude": ["node_modules", "dist"],
|
"exclude": ["node_modules", "dist"],
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"baseUrl": "src",
|
"baseUrl": "src",
|
||||||
"declarationDir": "dist"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|