Compare commits
1091 Commits
Author | SHA1 | Date | |
---|---|---|---|
75764f2a2d | |||
b31d772d09 | |||
1216c0e821 | |||
5b3fe9882d | |||
efcbeb36e6 | |||
c5f13e095e | |||
09efcc6aba | |||
095de7cca8 | |||
|
ea73c0c19c | ||
73c0dc11c6 | |||
55dc3c548a | |||
070476a3e3 | |||
5d97cfa7eb | |||
d49de554a8 | |||
de0ca89236 | |||
924f846fdf | |||
|
f14378ba17 | ||
8db0175378 | |||
fe4198d884 | |||
bf8fc48e0f | |||
394a36886f | |||
559a023743 | |||
578212882d | |||
b3e712cab7 | |||
86321e56d1 | |||
65cab457ff | |||
003fad7cd0 | |||
494a16ff52 | |||
9df90066f9 | |||
0cbcb93e6e | |||
ed2515a26c | |||
889f069012 | |||
fd6c7016cc | |||
44ad9f186d | |||
4286569466 | |||
d2ecec6961 | |||
03a6cf86ff | |||
cddfe8d386 | |||
c955228a91 | |||
2e6276a354 | |||
5b4dd2c5a5 | |||
fe1096f308 | |||
80379b54d0 | |||
300577706a | |||
ccdc97191a | |||
8cb6d63606 | |||
471dc7dd6a | |||
2aa6e87266 | |||
e95d6453f1 | |||
f16d25d289 | |||
94044c33e0 | |||
2834f76230 | |||
f95d6f8bec | |||
8e8e7b314b | |||
2de912fa5e | |||
44750cb506 | |||
7e74e7c1cc | |||
75156dc201 | |||
8d25e7c151 | |||
acd0dae11c | |||
754068006b | |||
4d98408cfb | |||
|
6ed3caad77 | ||
f77523ac76 | |||
3ceeb55423 | |||
76669518d9 | |||
5771a150a4 | |||
ca95cbab96 | |||
4a855f550e | |||
bee29b9137 | |||
ccdc217278 | |||
5e3a36bc98 | |||
0b70162a11 | |||
523b320888 | |||
6f75139e29 | |||
8232f8caa5 | |||
2524afe8d0 | |||
f3b73ede84 | |||
84933e7553 | |||
8f5e5423ee | |||
990fc1e487 | |||
be6a2253fd | |||
125c7f0bb1 | |||
26c261f3e7 | |||
d47df34ed1 | |||
c42607eee6 | |||
f3239a6629 | |||
50d920644d | |||
f390e5858b | |||
2f31ee7e17 | |||
6c18614599 | |||
ab8eaa0dbe | |||
6a56873886 | |||
6b567134d1 | |||
5172e21e06 | |||
8dd9d8f16e | |||
ee631595d7 | |||
59432a29a9 | |||
76858e2c94 | |||
595d1b0624 | |||
80bde65a43 | |||
c512c97521 | |||
b8a4916f8a | |||
a7abc3df22 | |||
d79671a5e6 | |||
805c613ae0 | |||
af82d729ca | |||
1e5da1d6d7 | |||
d16e7b5ba6 | |||
e7fab7e013 | |||
5f6109d89f | |||
4c62089bb6 | |||
1e00adce20 | |||
29d02f56ee | |||
11972ee2e7 | |||
07071e85ea | |||
0e4ad49ce0 | |||
1666d651d1 | |||
b9212833e5 | |||
7bea146a6a | |||
b6624bf645 | |||
c8b9dee2fd | |||
ab107f1b25 | |||
82bb346a54 | |||
810b4af15b | |||
3798753d3c | |||
e1a0ea5a96 | |||
fc946a0db4 | |||
55059c7259 | |||
b05f5276ee | |||
15433f1fb7 | |||
756517145f | |||
fced4cdc04 | |||
ef9383c734 | |||
df3d76ac8b | |||
b9f3be87dd | |||
8bf2c3b332 | |||
3034776593 | |||
b109aa1c8a | |||
d2a0fd8dcd | |||
a237e47870 | |||
215c5a43b3 | |||
ad5628dffc | |||
87f9bca555 | |||
091af0c917 | |||
ac5bcbdde4 | |||
bb4bba8caa | |||
e3edad8a40 | |||
258d2cfff6 | |||
90a14018b7 | |||
13b251e4ba | |||
36cbaef9a6 | |||
a28d1433e3 | |||
30d2c26f34 | |||
4388e93caa | |||
7363f8b45d | |||
045985be47 | |||
33cfe28917 | |||
05b7592150 | |||
019b630d9b | |||
bec9f8cd2c | |||
7053614ba6 | |||
c573041c25 | |||
3ab50d93cf | |||
b70f71e316 | |||
fda663d835 | |||
d17d3da6be | |||
e08f08d22c | |||
f44fc40b7a | |||
f0b50e5fc1 | |||
5a314bb3a7 | |||
7d4149cb2c | |||
fa2ba1390e | |||
ba14f0247b | |||
0d06de438f | |||
d57aca1e85 | |||
2a28091b29 | |||
c76a21c5b1 | |||
c5d1211e6c | |||
e82a2571b1 | |||
889beef18f | |||
47f194127a | |||
a1b0974053 | |||
925c838f15 | |||
ea3c286569 | |||
3a76da6cc3 | |||
39a3355812 | |||
fcded2db92 | |||
6388a99f1b | |||
9741c8f99f | |||
fa1ea01eb4 | |||
f2a66c7dd6 | |||
90ae4412fe | |||
84823be99e | |||
9579bd1fff | |||
069ccdf421 | |||
4f77b3c839 | |||
8fc0a07e1b | |||
886bc85e9b | |||
539eb59974 | |||
24e389a7cc | |||
f26ecfe51c | |||
18c48c7535 | |||
0a0dc46363 | |||
396b2b3633 | |||
3d7a187b08 | |||
855f75cf4d | |||
677e9ffce2 | |||
79a7a4c638 | |||
203848a20d | |||
cee3b68825 | |||
57d629762d | |||
0019cd1cd9 | |||
5fbe866c8b | |||
5650c720d1 | |||
80fc244117 | |||
45edd121cf | |||
3498915234 | |||
fa22d4596e | |||
e781efc5ae | |||
b88dcddf56 | |||
1e6a076b34 | |||
7c015f04af | |||
6baeeb794f | |||
6524520436 | |||
ce07ba04f5 | |||
bdd4c57bd7 | |||
0d55c5ddf7 | |||
400274bb4e | |||
9744c172ea | |||
4a8f80c75c | |||
efe9035fc0 | |||
0dd8182c05 | |||
bab6ae0a99 | |||
5a8226b149 | |||
ed7932e9c3 | |||
7e2765cf97 | |||
383c8af40e | |||
a2943b3dbe | |||
9c20aa82f9 | |||
bdb6c10597 | |||
ec5836d5a4 | |||
ee2c8952e8 | |||
fd69c27bd5 | |||
e61937622f | |||
abd6f24135 | |||
d013cf104b | |||
21690676e1 | |||
f1b9a36885 | |||
a59d9a4671 | |||
1e67cb7c80 | |||
9be707f843 | |||
83afd0b0e6 | |||
f07e0060ea | |||
df7a661d4d | |||
4fec089f72 | |||
6320f76f3b | |||
cd0f121c65 | |||
7c041aa68f | |||
36af24d555 | |||
c6030368bf | |||
562ec6561a | |||
98929af2de | |||
9edfa9a12b | |||
1a751c7c30 | |||
160b2312ba | |||
95d2154e07 | |||
0088b2f371 | |||
|
7fb3997d66 | ||
83af4ca70a | |||
494ded2069 | |||
2ef7259767 | |||
630e64b4d7 | |||
ef881800a4 | |||
79cb7aa2a9 | |||
aa6a24dce6 | |||
511e0a9444 | |||
71c37a1e5c | |||
0a55547e3e | |||
d1d5cc15ae | |||
6050aab515 | |||
1c6a777e58 | |||
c1e38700c6 | |||
a9467902dd | |||
1d96dab892 | |||
0386efefd1 | |||
aea5601acd | |||
f1cd2b2ced | |||
9a7dde3f7e | |||
7f7aa51912 | |||
db309eff08 | |||
3b07c8f25a | |||
|
c6953bdc6a | ||
d95898dfa3 | |||
79f22acd62 | |||
7afb980e77 | |||
6711a2c2c9 | |||
5b8ca313fe | |||
6b10e4f778 | |||
decf416dd9 | |||
4439b6693c | |||
6b26762faa | |||
d89c2a1c7a | |||
01339a175f | |||
4913dedb30 | |||
adeb82629e | |||
ff5f156ed0 | |||
4a2c852547 | |||
97e959f9d7 | |||
12938553d7 | |||
b29f51332c | |||
eb1f349cb4 | |||
5ad8dbed87 | |||
7cf549d65f | |||
7ce1677b30 | |||
54867d7eb1 | |||
6234cae12c | |||
07d99cd68d | |||
a7f47ea059 | |||
45d646e609 | |||
c3d8b47c61 | |||
927be26ece | |||
429a12cbf4 | |||
f3d1029502 | |||
c78141a622 | |||
ff6ba48f8a | |||
3a6a7b3fcc | |||
aaf5454b3a | |||
44db4fc2c7 | |||
d14af06f09 | |||
1c6e460d25 | |||
71491750d2 | |||
fc751a101d | |||
f11f30a7dc | |||
83dc6bb2f0 | |||
4d4b9b3050 | |||
1d42463c85 | |||
49e43a37d2 | |||
48bfa5da4d | |||
b9381982d2 | |||
861e2485d9 | |||
c030bafb8a | |||
7224f3dec7 | |||
aeffda6ea1 | |||
27333be7ac | |||
e39225b338 | |||
80aae3b17b | |||
90b126db68 | |||
d2e3c6008f | |||
f25a5a9541 | |||
54242ada92 | |||
aee251c692 | |||
7b311834ab | |||
b67e3a6db0 | |||
f43a20548e | |||
0726833e9b | |||
be8bc6f633 | |||
0ff3ac3016 | |||
f50d3aeb24 | |||
ef5ef4c90f | |||
1c534a3946 | |||
c8155ad435 | |||
f1c2c38700 | |||
7b655a9a65 | |||
adbb5fca95 | |||
94228561b1 | |||
eb75941d52 | |||
3d034e9ccf | |||
54f8cbfb53 | |||
a1a1a460a6 | |||
da6c1837cf | |||
e1ca4f5b31 | |||
7f144e8053 | |||
eab2c8d91f | |||
480d5eefd6 | |||
89a5f9ffae | |||
2000562659 | |||
75e35b234d | |||
aa9211e75c | |||
9290fc0a5d | |||
dfcf086d6c | |||
2cb806fde9 | |||
f44b07b8e6 | |||
503c1f0772 | |||
0ece8d3cab | |||
6d99264686 | |||
|
16c418f2b1 | ||
a09b79aaea | |||
8d42494f10 | |||
9f8f66391a | |||
4e57d40bcb | |||
3336107811 | |||
bba2e31a6b | |||
f441a9a02c | |||
bd8285762a | |||
8c67d78d45 | |||
2ed179e918 | |||
14b302c598 | |||
8425a7b906 | |||
6bdf9161b5 | |||
9b356584eb | |||
424b6bcc1f | |||
6bf6b8f9a4 | |||
c598869675 | |||
d1d4479838 | |||
6f6b7a39e3 | |||
59b6a205af | |||
6607f182ff | |||
59523637f3 | |||
bbf7d32ad0 | |||
1b9e005b6d | |||
d4812d44cc | |||
9fd287bc48 | |||
9451d8a12f | |||
8f1155a6d0 | |||
0307e866c4 | |||
f67f7152c0 | |||
ba35218f3c | |||
85477efb8d | |||
b3bc39daef | |||
752703a664 | |||
445f6552bc | |||
76a038e395 | |||
49999e8acb | |||
a0f641957f | |||
bef9d7552f | |||
eec2f03ccb | |||
ec7de4b52f | |||
fd9687bef0 | |||
bee41497ae | |||
35f7098a14 | |||
7def0add0c | |||
fd5b6b675d | |||
98ecda8751 | |||
1b085aabd6 | |||
|
666b6b2817 | ||
a938016cea | |||
657b557880 | |||
8107926b4a | |||
4f3194141e | |||
98fee074d0 | |||
23ac71c95e | |||
7b7b5650be | |||
573c515860 | |||
e13193f39c | |||
171235bdb9 | |||
c705f11b7e | |||
9e8bb06921 | |||
0b836b2bc9 | |||
fb99301a3c | |||
fbba723c2c | |||
ecb43e1a4c | |||
b09b82a627 | |||
9b3fd166b9 | |||
2aa5c70de6 | |||
089f0826a8 | |||
f06ab1d598 | |||
e060be2fb9 | |||
1a3235013c | |||
d59cae979a | |||
a85c157003 | |||
9171b9fa03 | |||
094770b782 | |||
00dea75988 | |||
a3006708c4 | |||
f94720c34b | |||
e426d7a90b | |||
c12cb48a48 | |||
b7f560e867 | |||
dbd483e768 | |||
4ca1d27138 | |||
ac7419ece3 | |||
78c69e6711 | |||
8a6335762d | |||
f04b4994d6 | |||
31733fcd72 | |||
de775f07a8 | |||
2b66a44d28 | |||
394e327430 | |||
c3ec2845f1 | |||
ceb4bb9406 | |||
4359a1b1b3 | |||
d47f07fe8b | |||
b4b2094253 | |||
85a0d206bb | |||
3bc42bff3c | |||
e1f68623dc | |||
d69c18e02e | |||
d590906bb0 | |||
eb9b2f4277 | |||
b8436056c8 | |||
14937817a4 | |||
0c2ecb5def | |||
8b7d4b7443 | |||
8ef36e0d40 | |||
7068ac021b | |||
18b9fea6b8 | |||
8a032790cd | |||
3a229d2874 | |||
a3995eb988 | |||
74168bab9d | |||
48fa9dc010 | |||
17596ea54a | |||
54c5472d86 | |||
27c2a26f27 | |||
6341247ee5 | |||
81fb5c9d9c | |||
2af42b80e7 | |||
f46b3a4bf7 | |||
021e08a163 | |||
ce8bdc8510 | |||
1b10769cee | |||
3a1811f5ac | |||
8039280ba5 | |||
6017b91a95 | |||
68631f27bf | |||
a366565d7c | |||
3aeebbcead | |||
06fe19f684 | |||
7b7e0445ea | |||
64076a21da | |||
4686fb6bfe | |||
131a2d3d6b | |||
3d8c25c7cc | |||
6ca00bf474 | |||
d5a8e1b71a | |||
0fa964414b | |||
9f3a538492 | |||
6c1699447f | |||
751a1ffa01 | |||
c305661c89 | |||
97d55ff324 | |||
87625f99a6 | |||
5227b947a4 | |||
c16586e701 | |||
c3dd462113 | |||
dbcb39357c | |||
c460f95775 | |||
8cbd891993 | |||
bd844f7be8 | |||
f0de3fa1cf | |||
7dbeeba2a7 | |||
48dc8a2493 | |||
40b78237fe | |||
dc740d7a8f | |||
954d231da4 | |||
5ba73d13eb | |||
79feaa0608 | |||
de78da3f47 | |||
af0fcf52d8 | |||
663029066b | |||
f7a9635c72 | |||
77f5f61461 | |||
22065de20f | |||
5f6a1738e3 | |||
ee120f0cd0 | |||
b8c1680418 | |||
de725f42b0 | |||
ee5daf47ce | |||
e3ea0bf1ef | |||
2963298f63 | |||
5a02fe4ad2 | |||
b173f81678 | |||
be63bbad3d | |||
a0dcff4922 | |||
54bcad1790 | |||
aea40be34e | |||
8353de34a2 | |||
2b262f3e47 | |||
ae5760f800 | |||
fa56bf33eb | |||
f59b6748ed | |||
1b8aab1bf9 | |||
20c5adec71 | |||
36262132f3 | |||
ade7db35dc | |||
1562ac7555 | |||
|
cfbbafac7d | ||
|
e970a892f2 | ||
63613e58f2 | |||
78a7ac018d | |||
8590a364d2 | |||
aa84b5d006 | |||
4f19250d07 | |||
3aaf668903 | |||
5e9678aa3b | |||
321131d529 | |||
|
b48450e92f | ||
eb17c036a2 | |||
4f1098af9e | |||
b020f4018b | |||
c9c13e895c | |||
30d0b8044d | |||
611558abbb | |||
27f6480be4 | |||
7d98769806 | |||
0e402fad56 | |||
a13a0a50cf | |||
956dcec7f3 | |||
54c08e99a1 | |||
30aadbd5d6 | |||
f398358afc | |||
dfcd9829e8 | |||
26d7e1bc03 | |||
00ab91453b | |||
2478ee31ea | |||
14d6ac9954 | |||
1be4ed3c61 | |||
2664548fac | |||
bba10b30e3 | |||
db2c511e64 | |||
fc6bf55f86 | |||
52a7eca414 | |||
130097f5df | |||
672b778ae4 | |||
6f939105d2 | |||
da689b31dd | |||
be1ae1c5bd | |||
c5f3713d28 | |||
|
f2c75d1e2a | ||
7de4f21222 | |||
992f0ac259 | |||
16c97b51ab | |||
0b3997c3cc | |||
9def7a31b0 | |||
5e23aa1642 | |||
4e56b2af76 | |||
1f2831e47a | |||
7106b43e30 | |||
704500f50a | |||
f42a05c3c6 | |||
56b8d8b44a | |||
12c2dd3e49 | |||
c4d8d34b00 | |||
94400bbd53 | |||
e94d8bd351 | |||
4bf49f4050 | |||
b9638f0c2c | |||
61bcdff5fb | |||
5ae5c73b23 | |||
3bfd9b2117 | |||
e5a0ce109d | |||
a54304ec54 | |||
0293a5cd6f | |||
b579890c0c | |||
10a316c64d | |||
e09c050a53 | |||
db726c2c61 | |||
5971e5bb2c | |||
b5396530fd | |||
b16b7a9fa4 | |||
bcaf757894 | |||
eb5911b32c | |||
8694d65b2e | |||
0a3eb7eba0 | |||
12f2b9be67 | |||
7f75d988c2 | |||
15751617e7 | |||
c11505bacf | |||
7c39556ae1 | |||
52062b1897 | |||
eff643a445 | |||
cb562d1c65 | |||
7691702c10 | |||
fa0768c803 | |||
908201519e | |||
6ca59b24b3 | |||
c5dd2b3525 | |||
|
dcc3eb2151 | ||
c49283243b | |||
0c0b47527c | |||
223b8d36f4 | |||
b976a595df | |||
ec249b70db | |||
fd31478636 | |||
a099cff27a | |||
f6bbeb5c66 | |||
046dd43831 | |||
b02bf6877c | |||
9175befcfc | |||
c5a020a899 | |||
21bbb5c9df | |||
ff50b5d4f3 | |||
c33003b3c6 | |||
ac6e8c9129 | |||
735b4dbbb4 | |||
d3169737b1 | |||
c4de104b0a | |||
3acc8cca8b | |||
618f951aa2 | |||
5cb5f85b45 | |||
2f717a179e | |||
86d2bce01f | |||
182040d37a | |||
a86918d3b9 | |||
27972f3f5f | |||
ff34d2900b | |||
bb2cd23c4b | |||
0ae6cbc0d9 | |||
1a0a53445e | |||
bbd0c1d5bb | |||
10eb64692f | |||
d295ddda53 | |||
39ecbf3ee3 | |||
f149060dff | |||
9b44010bc3 | |||
06f38164b3 | |||
d154c36062 | |||
fa2e40c75d | |||
f00a15548b | |||
df151c5a0a | |||
65a5ecc3b6 | |||
50f6ca2c14 | |||
|
b7837284a9 | ||
7eb67cc124 | |||
9e4721579a | |||
0105d79977 | |||
08928cdae9 | |||
07e01c7471 | |||
88101b767e | |||
efaabf8cf2 | |||
|
aac047423e | ||
b7739080ab | |||
80cc6e0721 | |||
2674438c4e | |||
db5a0bfcac | |||
d498a03505 | |||
3190fba4b7 | |||
cdb752dd1b | |||
85667624b3 | |||
b7864e7a39 | |||
2a9f086f14 | |||
402f0d4557 | |||
f9acfa8de9 | |||
f3f02e8095 | |||
dddee4009b | |||
302fbe301b | |||
7c49505551 | |||
c08fc6cf8e | |||
03ce741235 | |||
cac10348f6 | |||
c80e3b9763 | |||
58148d6c3e | |||
171ac2596a | |||
ea34632669 | |||
a47c7c4593 | |||
3fc8720d81 | |||
eefac29eba | |||
d0b16d2abb | |||
34d18dd464 | |||
eb97bbbaf9 | |||
2745104b7c | |||
e41cf70b51 | |||
76ab58d388 | |||
74ab0045e5 | |||
6d14778682 | |||
aa48ae1a78 | |||
14c036862d | |||
79231d2c6a | |||
fbb1f9a62b | |||
925e5ee673 | |||
c4c3defc4a | |||
c94a4a47e2 | |||
36d28e7b06 | |||
b48c48a0c4 | |||
8b165ae8d3 | |||
3586ba9d8b | |||
3e52ff1699 | |||
5f1b11569a | |||
76c9e905b9 | |||
d7cca6ce27 | |||
4379c6e0da | |||
ebc0909c15 | |||
9fc04da329 | |||
703e133054 | |||
88bd3269fa | |||
b3c3e7e1d8 | |||
15186e4f1a | |||
10a471343c | |||
423e305072 | |||
c69584dc15 | |||
cfce86db1f | |||
68023b1915 | |||
bbbc0ea86a | |||
a75200a751 | |||
|
928552454d | ||
6411a79e6f | |||
a3b5558749 | |||
9ba5039e93 | |||
f5826fdb9d | |||
819fdb070f | |||
9aceb9bc8a | |||
c0ada28b7a | |||
1dc446d5d1 | |||
0115e34c5d | |||
19df441d1c | |||
28c655882c | |||
61452bfb7d | |||
d77145e1e3 | |||
fea6a88a1d | |||
5ef619b68b | |||
f045c38cb4 | |||
0b3619e901 | |||
00b125f575 | |||
446813f51e | |||
1fbaef76a9 | |||
cde9caa24b | |||
81167c455e | |||
4da1a0b506 | |||
b34b2f9b90 | |||
64edf048e2 | |||
c2a2e2ff25 | |||
771989b7c9 | |||
2f01fe7291 | |||
dc0983010e | |||
72c377032b | |||
009ccda2c6 | |||
dd4e38175f | |||
3f259e5531 | |||
16a7e8454b | |||
9d99ad4002 | |||
0634e24b8c | |||
dd7524385e | |||
751cb23683 | |||
67ce4a9f61 | |||
779e9c763a | |||
e85500a00f | |||
6c3f918109 | |||
3a122674ae | |||
3cf8758ef4 | |||
5a753e6be7 | |||
fa9604abdb | |||
e3e5444d9c | |||
6a3e0658e5 | |||
b52dd47375 | |||
bbf51f1f7d | |||
5a83e2c11c | |||
85f24c973b | |||
53e5c8302e | |||
c8b1263a6f | |||
f8701a22c9 | |||
0ac5a3f3e8 | |||
b1b1a7fc38 | |||
9a6a0d937e | |||
a6d7fd6d54 | |||
501983f615 | |||
af86376e79 | |||
5646e847da | |||
4083a618af | |||
6f87790979 | |||
7c93bf4ca2 | |||
12ddf3b3ae | |||
fe25d6d54f | |||
154cc51274 | |||
cf16e3343e | |||
44eb21a777 | |||
c90b924a00 | |||
a46902bb1e | |||
dd17cbe0ff | |||
b4ee145e33 | |||
587e5b2f32 | |||
c1ced9e4c1 | |||
4c225c6014 | |||
083b42340e | |||
e3d06b7823 | |||
5467192ef2 | |||
a2f825fe10 | |||
238ea51427 | |||
ba94adfa18 | |||
67577485b0 | |||
7207cf5388 | |||
775b3ea2e9 | |||
6f50106fd3 | |||
cbc791db35 | |||
a7f01730eb | |||
9becc55879 | |||
d7c4ee039e | |||
a8653211b4 | |||
5be9229456 | |||
1fa3e720e7 | |||
3b5c67937f | |||
270ae41104 | |||
1e49c9bd84 | |||
815d591b83 | |||
dc96cf271b | |||
44eceb487b | |||
08fbde4f7f | |||
e08da3942b | |||
89943a6446 | |||
|
326c63b457 | ||
|
f975406092 | ||
|
ac3d2e67cc | ||
|
3ec1ac1997 | ||
|
028448cc32 | ||
|
239e7eca68 | ||
|
9941d9ea95 | ||
|
b5c9ce90a4 | ||
|
bbcc181ee4 | ||
|
0980990d0e | ||
|
3a5af895a3 | ||
|
a39a70e4cb | ||
|
362284690b | ||
|
3c10943ba6 | ||
|
e78154ea09 | ||
|
d7362ce479 | ||
|
413487a154 | ||
|
773b6343f0 | ||
|
89348aa1db | ||
|
9dcb2e4419 | ||
|
daa0f31c24 | ||
|
a036fe4239 | ||
|
cd6ea940ed | ||
|
f8c6b8a6ab | ||
|
d4b9bca4b0 | ||
|
cad1e93ec8 | ||
|
2ceea7d154 | ||
|
95b1405b95 | ||
|
fb72ee89fd | ||
|
5cf9760540 | ||
|
8ce213f863 | ||
|
72859c2fbd | ||
|
dc1e364b25 | ||
|
281757a187 | ||
|
8aa8fd405e | ||
|
96d2a3ae8b | ||
|
94fa7f2ce6 | ||
|
82d2809ccb | ||
|
d50aeb14fc | ||
|
89ebf3e4e8 | ||
|
a801bab8a1 | ||
|
4b6916cad2 | ||
|
1c3899c97d | ||
|
5b788f0e51 | ||
|
417522367e | ||
|
035246c248 | ||
|
96ac872a30 | ||
|
5023e8dee6 | ||
|
05b39ad532 | ||
|
efceb8fd85 | ||
|
5452ed4930 | ||
|
e17a8d9b82 | ||
|
f20804f7bd | ||
|
0e7c94db0c | ||
|
3bb5646713 | ||
|
f7c48a6228 | ||
|
d8fb515afd | ||
|
eb833b6412 | ||
|
57aedb84d4 | ||
|
7f28f854b1 | ||
|
1b557a49af | ||
|
7f43427cb8 | ||
|
94015e7f1e | ||
|
736f933ce5 | ||
|
878143c515 | ||
|
b3c48b9fdd | ||
|
636eaaaf83 | ||
|
03709378f3 | ||
|
01bbafcd4a | ||
|
7957e6bea4 | ||
|
f41f565e93 | ||
|
6fda7a5ef3 | ||
|
340b673080 | ||
|
1c90adcd3f | ||
|
0fbba17316 | ||
|
6eb8db9f20 | ||
|
ca9a56c330 | ||
|
ebba5828e8 | ||
|
0c9c5007c8 | ||
|
c15e92e386 | ||
|
bef884fe2d | ||
|
04a591d278 | ||
|
ac69e2fec7 | ||
|
d328d612b2 | ||
|
82d426697a | ||
|
9ea418b99d | ||
|
5564e8e323 | ||
|
6af0d092d9 | ||
|
79ecb69f16 | ||
|
273bd10b8d | ||
|
21c120c95f | ||
|
9cf915dfaa | ||
|
ca1bbf0dd2 | ||
|
f7535ae7c0 | ||
|
c1b764be06 | ||
|
20faeea409 | ||
|
030027b2a1 | ||
|
a12a1372ff | ||
|
bdc19546fe | ||
|
cc184378af | ||
|
d9315c6d93 | ||
|
d43d23fbc1 | ||
|
f601a01672 | ||
|
6f1e3d001f | ||
|
8150528ced | ||
|
fb03a2cef1 | ||
|
18262638fc | ||
|
674d270fa6 | ||
|
052d3b58c7 | ||
|
aa424fb420 | ||
|
06455f6412 | ||
|
b39b0cea56 | ||
|
cc9396b5b6 | ||
|
b6295785af | ||
|
7b1962d778 | ||
|
63bb85cf5c | ||
|
a7a9b887e1 | ||
|
f327225db2 | ||
|
c06ffe5e0d | ||
|
1c1acb9a2b | ||
|
45e4d2cd96 | ||
|
2aa02a5009 | ||
|
7b0bcf7bf6 | ||
|
a2993d4eab | ||
|
572eb5f5bc | ||
|
4e76cb0db6 | ||
|
bb5daa7c84 | ||
|
ecbd3d50c9 | ||
|
d484cefa92 | ||
|
6f4a5943a8 | ||
|
4720ed240a | ||
|
c8d7809106 | ||
|
c646d18c1a | ||
|
1838682c2a | ||
|
c9aa8ad4f8 | ||
|
eb53751f4f | ||
|
f9d83647cb | ||
|
d3576e23b9 | ||
|
bbfe6f31cf | ||
|
8badcbaa2e | ||
|
d094673bde | ||
|
e5a5243dbe | ||
|
dbb752651b | ||
|
821d183ef4 | ||
|
dfdbe2fc73 | ||
|
bd2b1fdbb4 | ||
|
82404cc32a | ||
|
dae830a7ce | ||
|
90ddeca69b | ||
|
789c03cecf | ||
|
f5722f044d | ||
|
91e7a162af | ||
|
5841296cd7 | ||
|
5c6836245b | ||
|
b59aef5d12 | ||
|
c141c3d689 | ||
|
d954b78f79 | ||
|
22a888d51f | ||
|
477fe6608b | ||
|
ca669bf042 | ||
|
5e372157a4 | ||
|
10d2138027 | ||
|
ad5e38ead1 | ||
|
95a74eb3a2 | ||
|
b500171b01 | ||
|
005b6a41c9 | ||
|
0cae935aab | ||
|
296f12c67e | ||
|
d27d7e70a4 | ||
|
b58128519d | ||
|
95a8010042 | ||
|
2e6db0c645 | ||
|
b7f6223ded | ||
|
4ce2564a50 | ||
|
5012174297 | ||
|
794e11c9eb | ||
|
dfeb56c8ea | ||
|
69df0eb9d6 | ||
|
d34614d178 | ||
|
a918c5821e | ||
|
a8fe322432 | ||
|
0d2e9eb907 | ||
|
b94eda6b7e | ||
|
5f6dee7988 | ||
|
69bf50712d | ||
|
007ebcc0ed | ||
|
a403a7008c | ||
|
06cedf9887 | ||
|
f493c830b5 | ||
|
0c864e6246 | ||
|
f5898f6f92 | ||
|
f349519678 | ||
|
e350d16b81 | ||
|
2f84bedfd3 | ||
|
991511f58d | ||
|
95b80bd35c | ||
|
e2b89ce113 | ||
|
268e1b75bc | ||
|
956d36edaa | ||
|
d229001944 | ||
|
471deba2d6 | ||
|
9b066ad9ee |
@ -1,16 +0,0 @@
|
||||
# http://editorconfig.org
|
||||
root = true
|
||||
|
||||
[*]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
|
||||
[*.md]
|
||||
trim_trailing_whitespace = false
|
||||
|
||||
[Makefile]
|
||||
indent_style = tab
|
11
.github/ISSUE_TEMPLATE/01-bug.md
vendored
Executable file
@ -0,0 +1,11 @@
|
||||
---
|
||||
name: Bug Report
|
||||
about: Issues caused by bugs
|
||||
---
|
||||
**Describe the bug:**
|
||||
|
||||
**Screenshots or/and Reproductions(if applicable):**
|
||||
|
||||
**App/Core/Dependency version info:**
|
||||
|
||||
**Logs or logDump(if applicable):**
|
10
.github/ISSUE_TEMPLATE/02-feature.md
vendored
Executable file
@ -0,0 +1,10 @@
|
||||
---
|
||||
name: Feature Request
|
||||
about: Request an feature
|
||||
---
|
||||
**Describe the Idea/Feature:**
|
||||
|
||||
**Any concept or sketch?:**
|
||||
|
||||
**How it could be applied or in what way?:**
|
||||
|
13
.github/workflows/changelog.yml
vendored
Executable file
@ -0,0 +1,13 @@
|
||||
|
||||
name: Create Changelogs
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
jobs:
|
||||
create_changelog:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Create Changelogs
|
||||
uses: heineiuo/create-changelogs@v0.2.8
|
68
.github/workflows/codeql-analysis.yml
vendored
Executable file
@ -0,0 +1,68 @@
|
||||
# For most projects, this workflow file will not need changing; you simply need
|
||||
# to commit it to your repository.
|
||||
#
|
||||
# You may wish to alter this file to override the set of languages analyzed,
|
||||
# or to provide custom queries or build logic.
|
||||
name: "CodeQL"
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [master]
|
||||
schedule:
|
||||
- cron: '0 0 * * *'
|
||||
|
||||
jobs:
|
||||
analyze:
|
||||
name: Analyze
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
# Override automatic language detection by changing the below list
|
||||
# Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python']
|
||||
language: ['javascript']
|
||||
# Learn more...
|
||||
# https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
# We must fetch at least the immediate parents so that if this is
|
||||
# a pull request then we can checkout the head.
|
||||
fetch-depth: 2
|
||||
|
||||
# If this run was triggered by a pull request event, then checkout
|
||||
# the head of the pull request instead of the merge commit.
|
||||
- run: git checkout HEAD^2
|
||||
if: ${{ github.event_name == 'pull_request' }}
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v1
|
||||
with:
|
||||
languages: ${{ matrix.language }}
|
||||
# If you wish to specify custom queries, you can do so here or in a config file.
|
||||
# By default, queries listed here will override any specified in a config file.
|
||||
# Prefix the list here with "+" to use these queries and those in the config file.
|
||||
# queries: ./path/to/local/query, your-org/your-repo/queries@main
|
||||
|
||||
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
||||
# If this step fails, then you should remove it and run the build manually (see below)
|
||||
- name: Autobuild
|
||||
uses: github/codeql-action/autobuild@v1
|
||||
|
||||
# ℹ️ Command-line programs to run using the OS shell.
|
||||
# 📚 https://git.io/JvXDl
|
||||
|
||||
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
|
||||
# and modify them (or add more) to build your code if your project
|
||||
# uses a compiled language
|
||||
|
||||
#- run: |
|
||||
# make bootstrap
|
||||
# make release
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v1
|
18
.github/workflows/trello_issue.yml
vendored
Executable file
@ -0,0 +1,18 @@
|
||||
name: Trello Issue List
|
||||
on:
|
||||
issues:
|
||||
types: [opened]
|
||||
env:
|
||||
TRELLO_KEY: ${{ secrets.TRELLO_KEY }}
|
||||
TRELLO_TOKEN: ${{ secrets.TRELLO_TOKEN }}
|
||||
|
||||
jobs:
|
||||
issue_send:
|
||||
name: Send Issue to Trello
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Runs trello manage
|
||||
uses: sisodiya2421/trello-manage@master
|
||||
with:
|
||||
repo-name: Comty Development
|
||||
trello-username: ${{ secrets.TRELLO_USERNAME }}
|
17
.github/workflows/validate.yml
vendored
Executable file
@ -0,0 +1,17 @@
|
||||
name: Validate code
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- '**'
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 12
|
||||
- run: npm ci
|
||||
- run: npm test
|
47
.gitignore
vendored
@ -1,17 +1,36 @@
|
||||
# dependencies
|
||||
/node_modules
|
||||
/npm-debug.log*
|
||||
/yarn-error.log
|
||||
/yarn.lock
|
||||
/package-lock.json
|
||||
# Secrets
|
||||
/**/**/.env
|
||||
/**/**/origin.server
|
||||
/**/**/server.manifest
|
||||
/**/**/server.registry
|
||||
|
||||
# production
|
||||
/dist
|
||||
/out
|
||||
# Trash
|
||||
/**/**/*.log
|
||||
/**/**/dumps.log
|
||||
/**/**/.crash.log
|
||||
/**/**/.tmp
|
||||
/**/**/.cache
|
||||
/**/**/cache
|
||||
/**/**/out
|
||||
/**/**/.out
|
||||
/**/**/dist
|
||||
/**/**/node_modules
|
||||
/**/**/corenode_modules
|
||||
/**/**/.DS_Store
|
||||
/**/**/package-lock.json
|
||||
/**/**/yarn.lock
|
||||
/**/**/.evite
|
||||
/**/**/uploads
|
||||
/**/**/d_data
|
||||
/**/**/*.tar
|
||||
/**/**/*.7z
|
||||
/**/**/*.zip
|
||||
|
||||
# umi
|
||||
/src/.umi
|
||||
/src/.umi-production
|
||||
/src/.umi-test
|
||||
/.env.local
|
||||
# Logs
|
||||
/**/**/npm-debug.log*
|
||||
/**/**/yarn-error.log
|
||||
/**/**/dumps.log
|
||||
/**/**/corenode.log
|
||||
|
||||
# Temporal configurations
|
||||
/**/**/.aliaser
|
@ -1,8 +0,0 @@
|
||||
**/*.md
|
||||
**/*.svg
|
||||
**/*.ejs
|
||||
**/*.html
|
||||
package.json
|
||||
.umi
|
||||
.umi-production
|
||||
.umi-test
|
11
.prettierrc
@ -1,11 +0,0 @@
|
||||
{
|
||||
"singleQuote": true,
|
||||
"trailingComma": "all",
|
||||
"printWidth": 80,
|
||||
"overrides": [
|
||||
{
|
||||
"files": ".prettierrc",
|
||||
"options": { "parser": "json" }
|
||||
}
|
||||
]
|
||||
}
|
113
.umirc.js
@ -1,113 +0,0 @@
|
||||
import { defineConfig } from 'umi';
|
||||
const { resolve, join } = require('path');
|
||||
|
||||
export default defineConfig({
|
||||
hash: false,
|
||||
dynamicImport: {
|
||||
loading: 'components/Loader/Loader.js',
|
||||
},
|
||||
// dynamicImport: false,
|
||||
// history: { type: "hash" },
|
||||
|
||||
targets: { ie: 9 },
|
||||
dva: { immer: true },
|
||||
ignoreMomentLocale: true,
|
||||
mountElementId: "root",
|
||||
nodeModulesTransform: {
|
||||
type: 'none',
|
||||
},
|
||||
// ssr: {
|
||||
// devServerRender: true,
|
||||
// },
|
||||
alias: {
|
||||
antd: resolve(__dirname, './node_modules/antd'),
|
||||
api: resolve(__dirname, './node_modules/@ragestudio/ycorejs-lib'), // ./api
|
||||
plugins: resolve(__dirname, './plugins'),
|
||||
globals: resolve(__dirname, './globals'),
|
||||
core: resolve(__dirname, './src/core'),
|
||||
theme: resolve(__dirname, './src/theme'),
|
||||
config: resolve(__dirname, './config'),
|
||||
components: resolve(__dirname, './src/components'),
|
||||
models: resolve(__dirname, './src/models'),
|
||||
node_modules: resolve(__dirname, './node_modules')
|
||||
},
|
||||
extraBabelPlugins: [
|
||||
[
|
||||
'import',
|
||||
{
|
||||
libraryName: 'lodash',
|
||||
libraryDirectory: '',
|
||||
camel2DashComponentName: false,
|
||||
},
|
||||
'lodash',
|
||||
],
|
||||
],
|
||||
// externals(context, request, callback) {
|
||||
// const isDev = process.env.NODE_ENV === 'development';
|
||||
// let isExternal = false;
|
||||
// const load = [
|
||||
// 'electron',
|
||||
// 'fs',
|
||||
// 'path',
|
||||
// 'os',
|
||||
// 'child_process'
|
||||
// ];
|
||||
// if (load.includes(request)) {
|
||||
// isExternal = `require("${request}")`;
|
||||
// }
|
||||
// const appDeps = Object.keys(require('./package.json').dependencies);
|
||||
// if (appDeps.includes(request)) {
|
||||
// const orininalPath = slash(join(__dirname, 'node_modules', request));
|
||||
// const requireAbsolute = `require('${orininalPath}')`;
|
||||
// console.log(isDev)
|
||||
// isExternal = isDev ? requireAbsolute : `require('${request}')`;
|
||||
// }
|
||||
// callback(null, isExternal);
|
||||
// },
|
||||
// plugins: [themePlugin],
|
||||
// chainWebpack: function(config, { webpack }) {
|
||||
// config.module
|
||||
// .rule('js-in-node_modules')
|
||||
// .exclude.add(/node_modules/)
|
||||
// .end()
|
||||
|
||||
// config.module
|
||||
// .rule('ts-in-node_modules')
|
||||
// .exclude.add(/node_modules/)
|
||||
// .end()
|
||||
|
||||
// config.merge({
|
||||
// optimization: {
|
||||
// minimize: true,
|
||||
// splitChunks: {
|
||||
// chunks: 'all',
|
||||
// minSize: 30000,
|
||||
// minChunks: 3,
|
||||
// automaticNameDelimiter: '.',
|
||||
// cacheGroups: {
|
||||
// react: {
|
||||
// name: 'react',
|
||||
// priority: 20,
|
||||
// test: /[\\/]node_modules[\\/](react|react-dom|react-dom-router)[\\/]/,
|
||||
// },
|
||||
// antd: {
|
||||
// name: 'antd',
|
||||
// priority: 20,
|
||||
// test: /[\\/]node_modules[\\/](antd|@ant-design\/icons)[\\/]/,
|
||||
// },
|
||||
// async: {
|
||||
// chunks: 'async',
|
||||
// minChunks: 2,
|
||||
// name: 'async',
|
||||
// maxInitialRequests: 1,
|
||||
// minSize: 0,
|
||||
// priority: 5,
|
||||
// reuseExistingChunk: true,
|
||||
// },
|
||||
// },
|
||||
// },
|
||||
// },
|
||||
// })
|
||||
// },
|
||||
|
||||
});
|
23
.vscode/components_schemas.code-snippets
vendored
Executable file
@ -0,0 +1,23 @@
|
||||
{
|
||||
"[schema-31] New Connected Component with decorators": {
|
||||
"scope": "javascript",
|
||||
"prefix": "newConnectedComponent",
|
||||
"description": "Create a new react component with default schema for ycore-schema31",
|
||||
"body": [
|
||||
"import React from 'react'",
|
||||
"import * as antd from 'antd'",
|
||||
"import { connect } from 'umi'",
|
||||
"",
|
||||
"@connect(({ app }) => ({ app }))",
|
||||
"export default class ${1:NewComponent} extends React.Component{",
|
||||
"\trender(){",
|
||||
"\t\treturn(",
|
||||
"\t\t\t<div>",
|
||||
"\t\t\t\t",
|
||||
"\t\t\t</div>",
|
||||
"\t\t)",
|
||||
"\t}",
|
||||
"}",
|
||||
]
|
||||
}
|
||||
}
|
30
.vscode/functions_schemas.code-snippets
vendored
Executable file
@ -0,0 +1,30 @@
|
||||
{
|
||||
"[schema-21] New api v3 based functions": {
|
||||
"scope": "javascript",
|
||||
"prefix": "newApiFunctional21",
|
||||
"description": "Create a new functional core module with default schema for ycore-schema21",
|
||||
"body": [
|
||||
"import verbosity from 'core/libs/verbosity'",
|
||||
"import handle from 'core/libs/errorhandler'",
|
||||
"import { notify } from 'core/libs/ui'",
|
||||
"import settings from 'core/libs/settings'",
|
||||
"import endpoints from 'config/endpoints'",
|
||||
"import { v3_model } from 'core/libs'",
|
||||
"",
|
||||
"export function ${1:NewFunction}(payload, callback){",
|
||||
"\tif (!payload) return false",
|
||||
"\tconst { data } = payload",
|
||||
"\t\t",
|
||||
"\treturn callback(false, null)",
|
||||
"}",
|
||||
"",
|
||||
"export const ${2:ObjectFunction} = {",
|
||||
"\tsomething: (payload, callback) => {",
|
||||
"\t\treturn callback(false, null)",
|
||||
"\t}",
|
||||
"}",
|
||||
"",
|
||||
"export default ${1:NewFunction}",
|
||||
]
|
||||
}
|
||||
}
|
33
.vscode/launch.json
vendored
Normal file → Executable file
@ -1,5 +1,22 @@
|
||||
{
|
||||
"configurations": [
|
||||
{
|
||||
"name": "[Node] Run file",
|
||||
"internalConsoleOptions": "openOnSessionStart",
|
||||
"program": "${file}",
|
||||
"request": "launch",
|
||||
"skipFiles": [
|
||||
"<node_internals>/**"
|
||||
],
|
||||
"type": "pwa-node"
|
||||
},
|
||||
{
|
||||
"name": "Attach to Chrome",
|
||||
"port": 8000,
|
||||
"request": "attach",
|
||||
"type": "pwa-chrome",
|
||||
"webRoot": "${workspaceFolder}"
|
||||
},
|
||||
{
|
||||
"name": "Attach by Process ID",
|
||||
"processId": "${command:PickProcess}",
|
||||
@ -22,10 +39,22 @@
|
||||
{
|
||||
"name": "Launch via NPM",
|
||||
"request": "launch",
|
||||
"runtimeArgs": ["run-script", "debug"],
|
||||
"runtimeArgs": [
|
||||
"run-script",
|
||||
"debug"
|
||||
],
|
||||
"runtimeExecutable": "npm",
|
||||
"skipFiles": ["<node_internals>/**"],
|
||||
"skipFiles": [
|
||||
"<node_internals>/**"
|
||||
],
|
||||
"type": "pwa-node"
|
||||
},
|
||||
{
|
||||
"name": "Launch WEB APP",
|
||||
"type": "pwa-chrome",
|
||||
"name": "http://192.168.0.2:8000",
|
||||
"request": "launch",
|
||||
"url": "http://192.168.0.2:8000"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
3
.vscode/settings.json
vendored
Executable file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"discord.enabled": false
|
||||
}
|
45
README.md
Normal file → Executable file
@ -1,5 +1,44 @@
|
||||
# Comty-Development
|
||||
[](https://www.codefactor.io/repository/github/srgooglo/comty-development)
|
||||
|
||||
# Comty - An prototype of an social network
|
||||

|
||||
[](https://www.codefactor.io/repository/github/ragestudio/comty)[](https://codeclimate.com/github/srgooglo/comty/maintainability)
|
||||
[](https://lgtm.com/projects/g/srgooglo/comty/alerts/)
|
||||
[](https://lgtm.com/projects/g/srgooglo/comty/context:javascript)
|
||||
[](https://discord.gg/NmnJexe)
|
||||
|
||||
[Join our Trello](https://trello.com/invite/b/UbwvlG1I/2bc02725b9b210d2e9e9a82c5040b895/comty-development)
|
||||
A prototype of a platform inside of application focused on microservices, extensible and modular, in which the application adapts to your needs, where you will find tools and services allowing you to facilitate communication with other people in a social way.
|
||||
|
||||
## Getting Started
|
||||
>Its needed to have installed NodeJS ( v13^ ), Git, and a dependency manager (npm, yarn...)
|
||||
|
||||
- Getting the repository
|
||||
```shell
|
||||
git clone https://github.com/ragestudio/comty && cd comty
|
||||
yarn
|
||||
```
|
||||
|
||||
- Starting web development server
|
||||
```shell
|
||||
cd packages/app
|
||||
yarn start
|
||||
```
|
||||
- Starting api development server
|
||||
```shell
|
||||
cd packages/server
|
||||
yarn start
|
||||
```
|
||||
|
||||
## Status
|
||||
This project is in a **early** design phase, there are still many phases to go through.
|
||||
|
||||
At the moment the ***development is slow but without pause***, because being a very complicated and important phase, we are **prioritizing quality** so that the project base can be preserved for a **long time**.
|
||||
|
||||
Now **we are looking** for a team too.
|
||||
Anyway, anyone interested, we are **looking for you**.
|
||||
|
||||
***Soon*** new updates adding much more information about this project.
|
||||
|
||||
***Any contribution is very grateful, we need you more than ever!***
|
||||
|
||||
## Tech
|
||||

|
||||
|
@ -1,9 +0,0 @@
|
||||
module.exports = {
|
||||
unsplash_key: 'slrHmuo9FEJajV4xvWl38TUhbib6BhhGI4VIZ1-cqnw',
|
||||
unsplash_secret: 'dh3UlgLTdunO7a_l_iKjotXbz0xB7w5EuDIBU8Pa8pA',
|
||||
g_recaptcha_key: '6Lc55uUUAAAAAEIACMVf3BUzAJSNCmI3RrjEirZ6',
|
||||
g_recaptcha_secret: '6Lc55uUUAAAAAOP4OgUa5DpqJC-70t53AmW0lyYf',
|
||||
// Global Server Key (Requiered for RS-YIBTP), Not autogenerated, must be included on. (Recommended not modify this constant)
|
||||
server_key:
|
||||
'f706b0a535b6c2d36545c4137a0a3a26853ea8b5-1223c9ba7923152cae28e5a2e7501b2b-50600768',
|
||||
};
|
@ -1,10 +0,0 @@
|
||||
export default {
|
||||
auth_server: 'POST /auth_server',
|
||||
auth: 'POST /auth',
|
||||
sessions: 'POST /sessions',
|
||||
posts: 'POST /posts',
|
||||
post_actions: 'POST /post-actions',
|
||||
|
||||
get_data: 'POST /get-user-data',
|
||||
profileData: 'POST /early_user'
|
||||
};
|
@ -1,78 +0,0 @@
|
||||
module.exports = {
|
||||
app_config: {
|
||||
id: "comty",
|
||||
siteName: 'Comty',
|
||||
copyright: 'RageStudio©',
|
||||
MainPath: '/',
|
||||
|
||||
LogoPath: '/logo.svg',
|
||||
FullLogoPath: '/full_logo.svg',
|
||||
DarkFullLogoPath: '/dark_full_logo.svg',
|
||||
DarkLogoPath: '/dark_logo.svg',
|
||||
|
||||
api_interface: 'https://api.ragestudio.net',
|
||||
api_prefix: 'ycorejs_apiv3',
|
||||
|
||||
app_settings_storage: 'app_settings',
|
||||
endpoint_global: 'https://comty.pw',
|
||||
proxy_local: 'http://localhost:8000',
|
||||
|
||||
session_token_storage: 'cid',
|
||||
session_data_storage: 'data',
|
||||
|
||||
appTheme_container: 'app_theme',
|
||||
appTheme_desiredContrast: 7,
|
||||
// Contrast level AA = 4.5, Level AAA = 7
|
||||
// Reference: https://www.w3.org/WAI/WCAG21/quickref/?versions=2.0&showtechniques=143#qr-visual-audio-contrast-contrast
|
||||
|
||||
},
|
||||
|
||||
i18n: {
|
||||
languages: [
|
||||
{
|
||||
key: 'en',
|
||||
title: 'English',
|
||||
},
|
||||
],
|
||||
defaultLanguage: 'en',
|
||||
},
|
||||
|
||||
layouts: [
|
||||
{
|
||||
name: 'primary',
|
||||
include: [/\/main/, /\/settings/, /\/saves/, /\/pro/, /\/chats/, /\//],
|
||||
exclude: [/\/publics/, /\/login/ ],
|
||||
},
|
||||
{
|
||||
name: 'public',
|
||||
include: [/.*/]
|
||||
}
|
||||
],
|
||||
|
||||
// Default Behaviors
|
||||
defaults: {
|
||||
app_model: "app",
|
||||
verbosity: false,
|
||||
session_noexpire: false,
|
||||
search_ontype: false,
|
||||
overlay_loosefocus: true,
|
||||
render_pagetransition_preset: 'moveToRightScaleUp',
|
||||
post_catchlimit: '20',
|
||||
post_hidebar: true,
|
||||
|
||||
feed_autorefresh: false,
|
||||
keybinds: {
|
||||
nextElement: "J",
|
||||
prevElement: "U",
|
||||
createNew: "N"
|
||||
}
|
||||
},
|
||||
|
||||
stricts: {
|
||||
post_maxlenght: '512',
|
||||
// In KB
|
||||
api_maxpayload: '101376',
|
||||
api_maxovertick: 10,
|
||||
}
|
||||
|
||||
};
|
15
docker-compose.yml
Executable file
@ -0,0 +1,15 @@
|
||||
version: "3"
|
||||
|
||||
services:
|
||||
app:
|
||||
build: packages/wrapper
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "9000:9000"
|
||||
api:
|
||||
build: packages/server
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "3010:3000"
|
||||
env_file:
|
||||
- .env
|
1
example.env
Executable file
@ -0,0 +1 @@
|
||||
GITHUB_TOKEN=""
|
@ -1,10 +0,0 @@
|
||||
[
|
||||
{"id": "alpha_test","title": "Alpha Tester","color": "green","icon": "Bug","tip": "Oh yeah!"},
|
||||
{"id": "nsfw_flag","title": "NSFW","color": "volcano","require": "nsfw_flag","tip": "NSFW"},
|
||||
{"id":"pro","title":"CPRO™","color":"purple","require":"pro","icon":"RocketOutlined","tip":"CPRO™"},
|
||||
{"id":"dev","title":"DEVELOPER","color":"default","require":"dev","icon":"GitBranch","tip":"DEVELOPER"},
|
||||
{"id":"professional_retarder","title":"Professional Retarder","color":"gold","require":"","icon":"SmileOutlined","tip":"hump...."},
|
||||
{"id":"el_walter_pro","title":"Pro Chikito","color":"#a0d911","require":"","icon":"🐱🐉🧜♀️","tip":"Chikito"},
|
||||
{"id":"patreon","title":"Patreon Member","color":"","require":"","icon":"Patreon","tip":"GoodBoy!"}
|
||||
]
|
||||
|
@ -1,14 +0,0 @@
|
||||
import * as Icons from 'components/Icons'
|
||||
|
||||
export default [
|
||||
{
|
||||
key: "inspect_element",
|
||||
title: "Inspect",
|
||||
icon: <Icons.Command />,
|
||||
params: {
|
||||
onClick: (e) => {
|
||||
window.inspectElement(e)
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
@ -1,6 +0,0 @@
|
||||
module.exports = {
|
||||
gitlab: "https://gitlab.com/rstudio-development/comty-development",
|
||||
github:"https://github.com/srgooglo/Comty-Development",
|
||||
trellojoin: "https://trello.com/invite/b/UbwvlG1I/2bc02725b9b210d2e9e9a82c5040b895/comty-development",
|
||||
patreon: "https://www.patreon.com/rstudio",
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
{
|
||||
"gitlab": "https://gitlab.com/rstudio-development/comty-development",
|
||||
"github":"https://github.com/srgooglo/Comty-Development",
|
||||
"trellojoin": "https://trello.com/invite/b/UbwvlG1I/2bc02725b9b210d2e9e9a82c5040b895/comty-development",
|
||||
"patreon": "https://www.patreon.com/rstudio"
|
||||
}
|
@ -1,4 +0,0 @@
|
||||
[
|
||||
{"key":"pro_boost","icon":"RocketOutlined","type":"switch","title":"CPRO™ Boost","description":"","require":"pro","value":false},
|
||||
{"key":"allow_comments","icon":"CommentOutlined","type":"switch","title":"Allow Comments","description":"","require":"","value":true}
|
||||
]
|
@ -1,32 +0,0 @@
|
||||
import * as Icons from 'components/Icons'
|
||||
|
||||
export default [
|
||||
{
|
||||
id: 'session_noexpire',
|
||||
icon: <Icons.Watch />,
|
||||
type: 'switch',
|
||||
title: 'No expire session',
|
||||
description: 'Force the app to not expire any session... [Developer]',
|
||||
},
|
||||
{
|
||||
id: 'search_ontype',
|
||||
icon: <Icons.CornerDownRight />,
|
||||
type: 'switch',
|
||||
title: 'Detect input on search bar',
|
||||
description: 'Force the app to automaticly search when a type input is detected... [Developer]',
|
||||
},
|
||||
{
|
||||
id: 'post_hidebar',
|
||||
icon: <Icons.Menu />,
|
||||
type: 'switch',
|
||||
title: 'Auto hide postbar',
|
||||
description: 'Force the app to hide the post actions (likes, comments ...etc) automaticly... [Developer]',
|
||||
},
|
||||
{
|
||||
id: 'verbosity',
|
||||
icon: <Icons.Terminal />,
|
||||
type: 'switch',
|
||||
title: 'Enable core verbosity',
|
||||
description: 'Show all console logs... [Developer]',
|
||||
}
|
||||
]
|
@ -1,13 +0,0 @@
|
||||
[
|
||||
{"id":"session_noexpire","icon":"Watch","type":"switch","title":"No expire session","description":"Force the app to not expire any session... [Developer]"},
|
||||
{"id":"search_ontype","icon":"CornerDownRight","type":"switch","title":"Detect input on search bar","description":"Force the app to automaticly search when a type input is detected... [Developer]"},
|
||||
{"id":"post_hidebar","icon":"Menu","type":"switch","title":"Auto hide postbar","description":"Force the app to hide the post actions (likes, comments ...etc) automaticly... [Developer]"},
|
||||
{"id":"verbosity","icon":"Terminal","type":"switch","title":"Enable core verbosity","description":"Show all console logs... [Developer]"},
|
||||
{
|
||||
"id":"seponetriste",
|
||||
"icon":"Terminal",
|
||||
"type":"switch",
|
||||
"title":"Mayonesa",
|
||||
"description":"liquiedA?"
|
||||
}
|
||||
]
|
@ -1,110 +0,0 @@
|
||||
import * as Icons from 'components/Icons'
|
||||
|
||||
/**
|
||||
* Sidebar Menu scheme
|
||||
*
|
||||
* @param id {string} Used for ( key_filter ) & ( router.push(id) ) [required]
|
||||
* @param icon {any} Render an "icon" component on the list | Default => null
|
||||
* @param title {string} Render an string on the list | Default => null
|
||||
* @param attributes.path {string} Override path for router.push(id)
|
||||
* @param attributes.position {string} Sets render position (Only for desktop mode) | Default => "top"
|
||||
* @param attributes.require {string} Sets an render condition | Default => null
|
||||
* @param attributes.desktop {boolean} Activate render for desktop clients | Default => true
|
||||
* @param attributes.mobile {boolean} Activate render for mobile clients | Default => true
|
||||
*/
|
||||
|
||||
export default [
|
||||
{
|
||||
id: 'main',
|
||||
icon: <Icons.Home />,
|
||||
title: 'Main',
|
||||
attributes: {
|
||||
require: 'login',
|
||||
desktop: false,
|
||||
}
|
||||
},
|
||||
{
|
||||
id: 'explore',
|
||||
title: 'Explore',
|
||||
icon: <Icons.Compass />,
|
||||
},
|
||||
{
|
||||
id: 'saves',
|
||||
title: 'Saves',
|
||||
icon: <Icons.Bookmark />,
|
||||
attributes: {
|
||||
require: 'login',
|
||||
mobile: false
|
||||
}
|
||||
},
|
||||
{
|
||||
id: 'messages',
|
||||
title: 'Messages',
|
||||
icon: <Icons.MessageSquare />,
|
||||
attributes: {
|
||||
require: 'login'
|
||||
}
|
||||
},
|
||||
{
|
||||
id: 'rooms',
|
||||
title: 'Rooms',
|
||||
icon: <Icons.Box />,
|
||||
attributes: {
|
||||
require: 'login'
|
||||
}
|
||||
},
|
||||
{
|
||||
id: 'workshop',
|
||||
title: 'Workshop',
|
||||
icon: <Icons.Package />,
|
||||
attributes: {
|
||||
require: 'login'
|
||||
}
|
||||
},
|
||||
{
|
||||
id: 'streams',
|
||||
title: 'Streams',
|
||||
icon: <Icons.Tv />,
|
||||
attributes: {
|
||||
require: 'login'
|
||||
}
|
||||
},
|
||||
{
|
||||
id: 'debug',
|
||||
title: 'Debug',
|
||||
icon: <Icons.Tool />,
|
||||
attributes: {
|
||||
position: "bottom",
|
||||
require: "dev"
|
||||
}
|
||||
},
|
||||
{
|
||||
id: 'settings',
|
||||
title: 'Settings',
|
||||
icon: <Icons.Settings />,
|
||||
attributes: {
|
||||
position: "bottom"
|
||||
}
|
||||
},
|
||||
{
|
||||
id: 'logout',
|
||||
title: 'Logout',
|
||||
icon: <Icons.LogOut style={{ color: '#ef233c', marginRight: '10px' }} />,
|
||||
attributes: {
|
||||
position: "bottom",
|
||||
require: 'login'
|
||||
}
|
||||
},
|
||||
{
|
||||
id: 'login',
|
||||
title: 'Signin',
|
||||
icon: <Icons.LogIn style={{ color: '#3a86ff', marginRight: '10px' }} />,
|
||||
attributes: {
|
||||
position: "bottom",
|
||||
require: "guest"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
|
||||
|
@ -1,100 +0,0 @@
|
||||
[
|
||||
{
|
||||
"id":"main",
|
||||
"icon":"Home",
|
||||
"title":"Main",
|
||||
"attributes": {
|
||||
"require":"login",
|
||||
"desktop":false
|
||||
}
|
||||
},
|
||||
{
|
||||
"id":"explore",
|
||||
"title":"Explore",
|
||||
"icon":"Compass"
|
||||
},
|
||||
{
|
||||
"id":"saves",
|
||||
"title":"Saves",
|
||||
"icon":"Bookmark",
|
||||
"attributes": {
|
||||
"require":"login",
|
||||
"mobile":false
|
||||
}
|
||||
},
|
||||
{
|
||||
"id":"messages",
|
||||
"title":"Messages",
|
||||
"icon":"MessageSquare",
|
||||
"attributes": {
|
||||
"require":"login"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id":"rooms",
|
||||
"title":"Rooms",
|
||||
"icon":"Box",
|
||||
"attributes": {
|
||||
"require":"login"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id":"workshop",
|
||||
"title":"Workshop",
|
||||
"icon":"Package",
|
||||
"attributes": {
|
||||
"require":"login"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id":"streams",
|
||||
"title":"Streams",
|
||||
"icon":"Tv",
|
||||
"attributes": {
|
||||
"require":"login"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id":"debug",
|
||||
"title":"Debug",
|
||||
"icon":"Tool",
|
||||
"attributes": {
|
||||
"position":"bottom",
|
||||
"require":"dev"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id":"settings",
|
||||
"title":"Settings",
|
||||
"icon":"Settings",
|
||||
"attributes": {
|
||||
"position":"bottom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id":"logout",
|
||||
"title":"Logout",
|
||||
"icon":"LogOut",
|
||||
"iconStyle": {
|
||||
"color": 'red',
|
||||
"marginRight": '10px'
|
||||
},
|
||||
"attributes": {
|
||||
"position":"bottom",
|
||||
"require":"login"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id":"login",
|
||||
"title":"Signin",
|
||||
"icon":"Login",
|
||||
"iconStyle": {
|
||||
"color": "blue",
|
||||
"marginRight": "10px"
|
||||
},
|
||||
"attributes": {
|
||||
"position":"bottom",
|
||||
"require":"guest"
|
||||
}
|
||||
}
|
||||
]
|
@ -1,40 +0,0 @@
|
||||
import * as Icons from 'components/Icons'
|
||||
|
||||
export default [
|
||||
{
|
||||
id: 'backgroundImage',
|
||||
icon: <Icons.Image />,
|
||||
title: 'Background',
|
||||
description: 'Change the background of the app',
|
||||
},
|
||||
{
|
||||
id: 'overlay',
|
||||
icon: <Icons.Sidebar />,
|
||||
title: 'Overlay',
|
||||
description: 'Description blah blah',
|
||||
},
|
||||
{
|
||||
id: 'color',
|
||||
icon: <Icons.Droplet />,
|
||||
title: 'Colors',
|
||||
description: 'Texts, Buttons, Sliders ...etc',
|
||||
},
|
||||
{
|
||||
id: 'text',
|
||||
icon: <Icons.FontColorsOutlined style={{ marginRight: '10px' }} />,
|
||||
title: 'Text',
|
||||
description: 'Sizes, Fonts',
|
||||
},
|
||||
{
|
||||
id: 'sounds',
|
||||
icon: <Icons.Volume2 />,
|
||||
title: 'Sounds',
|
||||
description: 'BlipBlopBLup',
|
||||
},
|
||||
{
|
||||
id: 'darkmode',
|
||||
icon: <Icons.Moon />,
|
||||
title: 'Dark Mode',
|
||||
description: 'Yeaah, no more daying',
|
||||
}
|
||||
]
|
@ -1,8 +0,0 @@
|
||||
[
|
||||
{"id":"backgroundImage","icon":"Image","title":"Background","description":"Change the background of the app"},
|
||||
{"id":"overlay","icon":"Sidebar","title":"Overlay","description":"Description blah blah"},
|
||||
{"id":"color","icon":"Droplet","title":"Colors","description":"Texts, Buttons, Sliders ...etc"},
|
||||
{"id":"text","icon":"FontColorsOutlined","title":"Text","description":"Sizes, Fonts"},
|
||||
{"id":"sounds","icon":"Volume2","title":"Sounds","description":"BlipBlopBLup"},
|
||||
{"id":"darkmode","icon":"Moon","title":"Dark Mode","description":"Yeaah, no more daying"}
|
||||
]
|
288
main/index.js
@ -1,288 +0,0 @@
|
||||
const {
|
||||
app,
|
||||
BrowserWindow,
|
||||
ipcMain,
|
||||
Tray,
|
||||
Menu,
|
||||
MenuItem,
|
||||
dialog,
|
||||
shell,
|
||||
screen,
|
||||
BrowserView,
|
||||
systemPreferences,
|
||||
Notification,
|
||||
globalShortcut
|
||||
} = require('electron')
|
||||
const path = require('path')
|
||||
// const { spawn, exec } = require('child_process')
|
||||
// const { autoUpdater } = require('electron-updater')
|
||||
const log = require('electron-log');
|
||||
const packagejson = require('../package.json')
|
||||
const is = require('electron-is')
|
||||
const waitOn = require('wait-on');
|
||||
const { getDoNotDisturb } = require('electron-notification-state');
|
||||
const { app_config } = require("../config");
|
||||
|
||||
let app_path = is.dev()? app_config.proxy_local : `file://${path.join(__dirname, '..', 'renderer')}/index.html`;
|
||||
let mainWindow;
|
||||
let tray;
|
||||
let watcher;
|
||||
|
||||
// This gets rid of this: https://github.com/electron/electron/issues/13186
|
||||
process.env.ELECTRON_DISABLE_SECURITY_WARNINGS = true
|
||||
// app.commandLine.appendSwitch("disable-web-security")
|
||||
//app.commandLine.appendSwitch('disable-gpu-vsync=gpu')
|
||||
app.commandLine.appendSwitch('disable-features', 'OutOfBlinkCors')
|
||||
|
||||
const gotTheLock = app.requestSingleInstanceLock()
|
||||
const notifySupport = Notification.isSupported()
|
||||
const isNotDisturb = getDoNotDisturb()
|
||||
|
||||
// Prevent multiple instances
|
||||
if (!gotTheLock) {
|
||||
app.quit()
|
||||
}
|
||||
|
||||
function relaunchApp(){
|
||||
mainWindow.close()
|
||||
app.relaunch()
|
||||
}
|
||||
|
||||
function resumeApp(){
|
||||
if (mainWindow) {
|
||||
mainWindow.show()
|
||||
mainWindow.focus()
|
||||
}else{
|
||||
createWindow()
|
||||
}
|
||||
}
|
||||
|
||||
function contextualMenu(payload){
|
||||
if (!payload) {
|
||||
return false
|
||||
}
|
||||
|
||||
const menu = new Menu()
|
||||
const menuItem = new MenuItem({
|
||||
label: 'Inspect Element',
|
||||
click: () => {
|
||||
mainWindow.inspectElement(payload.x, payload.y)
|
||||
}
|
||||
})
|
||||
menu.append(menuItem)
|
||||
menu.popup(mainWindow)
|
||||
}
|
||||
|
||||
function notify(params) {
|
||||
if(!notifySupport || !params) return false
|
||||
let options = {
|
||||
title: "",
|
||||
body: "",
|
||||
icon: null,
|
||||
timeoutType: "default"
|
||||
}
|
||||
|
||||
const keys = Object.keys(params)
|
||||
const values = Object.values(params)
|
||||
|
||||
for (let i = 0; i < keys.length; i++) {
|
||||
options[keys[i]] = values[i]
|
||||
}
|
||||
|
||||
new Notification(options).show()
|
||||
}
|
||||
|
||||
async function __init() {
|
||||
createWindow()
|
||||
}
|
||||
|
||||
function createWindow() {
|
||||
mainWindow = new BrowserWindow({
|
||||
title: packagejson.title,
|
||||
icon: path.join(__dirname, './icon.png'),
|
||||
width: 1100,
|
||||
height: 700,
|
||||
minWidth: 1256,
|
||||
minHeight: 755,
|
||||
show: true,
|
||||
frame: false,
|
||||
transparent: false,
|
||||
hasShadow: true,
|
||||
//webgl: true,
|
||||
visualEffectState: "followWindow",
|
||||
backgroundColor: '#00ffffff',
|
||||
webPreferences: {
|
||||
//enableRemoteModule: true,
|
||||
enableBlinkFeatures: true,
|
||||
experimentalFeatures: true,
|
||||
nodeIntegration: true,
|
||||
// Disable in dev since I think hot reload is messing with it
|
||||
webSecurity: !is.dev()
|
||||
}
|
||||
})
|
||||
|
||||
if (is.dev()) {
|
||||
app.commandLine.appendSwitch('remote-debugging-port', '9222')
|
||||
globalShortcut.register('CommandOrControl+R', () => {
|
||||
mainWindow.reload()
|
||||
})
|
||||
|
||||
globalShortcut.register('F5', () => {
|
||||
mainWindow.reload()
|
||||
})
|
||||
}
|
||||
|
||||
mainWindow.webContents.session.webRequest.onHeadersReceived(
|
||||
{
|
||||
urls: ['http://*/*', 'https://*/*']
|
||||
},
|
||||
(details, callback) => {
|
||||
delete details.responseHeaders['Access-Control-Allow-Origin']
|
||||
delete details.responseHeaders['access-control-allow-origin']
|
||||
if (details.url.includes('www.google-analytics.com')) {
|
||||
details.responseHeaders['Access-Control-Allow-Origin'] = [ app_path ]
|
||||
} else {
|
||||
details.responseHeaders['Access-Control-Allow-Origin'] = ['*']
|
||||
}
|
||||
callback({
|
||||
cancel: false,
|
||||
responseHeaders: details.responseHeaders
|
||||
})
|
||||
}
|
||||
)
|
||||
|
||||
tray = new Tray(
|
||||
is.dev()
|
||||
? path.join(__dirname, './icon.png')
|
||||
: path.join(__dirname, '../build/icon.png')
|
||||
);
|
||||
|
||||
const trayMenuTemplate = [
|
||||
{
|
||||
label: '🧰 Open DevTools',
|
||||
click: () => mainWindow.webContents.openDevTools()
|
||||
},
|
||||
{
|
||||
label: '🔄 Relaunch',
|
||||
click: () => {
|
||||
relaunchApp()
|
||||
}
|
||||
},
|
||||
{
|
||||
label: '🛑 Quit',
|
||||
click: () => app.quit()
|
||||
}
|
||||
];
|
||||
|
||||
tray.setContextMenu(Menu.buildFromTemplate(trayMenuTemplate))
|
||||
tray.setToolTip(packagejson.title)
|
||||
tray.on('double-click', () => resumeApp())
|
||||
|
||||
mainWindow.loadURL(app_path)
|
||||
mainWindow.focus()
|
||||
|
||||
if (is.dev()) {
|
||||
mainWindow.webContents.openDevTools()
|
||||
}
|
||||
|
||||
// const handleRedirect = (e, url) => {
|
||||
// if (url !== mainWindow.webContents.getURL()) {
|
||||
// e.preventDefault()
|
||||
// shell.openExternal(url)
|
||||
// }
|
||||
// };
|
||||
|
||||
// mainWindow.webContents.on('will-navigate', handleRedirect)
|
||||
// mainWindow.webContents.on('new-window', handleRedirect)
|
||||
}
|
||||
|
||||
app.on('ready', () => {
|
||||
if (is.dev()) {
|
||||
loadWindow = new BrowserWindow({
|
||||
width: 700,
|
||||
height: 500,
|
||||
frame: false,
|
||||
resizable: false,
|
||||
center: true,
|
||||
transparent: true,
|
||||
backgroundColor: "#00000000",
|
||||
});
|
||||
loadWindow.loadURL(`file://${__dirname}/statics/loading_dev.html`)
|
||||
notify({title: "Starting development server..."})
|
||||
waitOn({ resources: [app_path] }, function (err) {
|
||||
if (err) {
|
||||
return log.log(err)
|
||||
}
|
||||
__init()
|
||||
loadWindow.close()
|
||||
})
|
||||
}else{
|
||||
__init()
|
||||
}
|
||||
})
|
||||
|
||||
app.on('window-all-closed', () => {
|
||||
mainWindow = null;
|
||||
})
|
||||
|
||||
app.on('before-quit', async () => {
|
||||
mainWindow.removeAllListeners('close');
|
||||
mainWindow = null;
|
||||
})
|
||||
|
||||
ipcMain.handle('update-progress-bar', (event, p) => {
|
||||
mainWindow.setProgressBar(p);
|
||||
})
|
||||
|
||||
ipcMain.handle('hide-window', () => {
|
||||
if (mainWindow) {
|
||||
mainWindow.hide();
|
||||
}
|
||||
})
|
||||
|
||||
ipcMain.handle('show-window', () => {
|
||||
if (mainWindow) {
|
||||
mainWindow.show();
|
||||
mainWindow.focus();
|
||||
}
|
||||
})
|
||||
|
||||
ipcMain.handle('min-max-window', () => {
|
||||
if (mainWindow.isMaximized()) {
|
||||
mainWindow.unmaximize();
|
||||
} else if (mainWindow.maximizable) {
|
||||
mainWindow.maximize();
|
||||
}
|
||||
})
|
||||
|
||||
ipcMain.handle('getSystemPreferences', () => {
|
||||
return systemPreferences
|
||||
})
|
||||
|
||||
ipcMain.handle('minimize-window', () => {
|
||||
mainWindow.minimize();
|
||||
})
|
||||
|
||||
ipcMain.handle('quit-app', () => {
|
||||
app.quit();
|
||||
})
|
||||
|
||||
ipcMain.handle('open-devtools', () => {
|
||||
mainWindow.webContents.openDevTools({ mode: 'undocked' });
|
||||
})
|
||||
|
||||
ipcMain.handle('appRelaunch', () => {
|
||||
relaunchApp()
|
||||
})
|
||||
|
||||
ipcMain.handle('app_notify', (event, payload) => {
|
||||
notify(payload)
|
||||
})
|
||||
|
||||
ipcMain.handle('contextualMenu', (event, payload) => {
|
||||
contextualMenu(payload)
|
||||
})
|
||||
|
||||
ipcMain.handle('inspectElement', (event, payload) => {
|
||||
mainWindow.inspectElement(payload.x, payload.y)
|
||||
})
|
126
package.json
@ -1,122 +1,20 @@
|
||||
{
|
||||
"name": "comty-development",
|
||||
"UUID": "C8mVSr-4nmPp2-pr5Vrz-CU4kg4",
|
||||
"title": "Comty™",
|
||||
"DevBuild": true,
|
||||
"version": "0.10.6",
|
||||
"stage": "dev",
|
||||
"description": "",
|
||||
"author": "RageStudio",
|
||||
"license": "ISC",
|
||||
"license": "LGPL-2.1",
|
||||
"types": "index.d.ts",
|
||||
"private": true,
|
||||
"main": "main/index.js",
|
||||
"build": {
|
||||
"files": [
|
||||
"./dist/**/*",
|
||||
"./pages/**/*",
|
||||
"./node_modules/**/*"
|
||||
],
|
||||
"appId": "com.rstudio.comty",
|
||||
"asar": false
|
||||
},
|
||||
"scripts": {
|
||||
"start": "umi dev",
|
||||
"debug": "node --inspect-brk ./node_modules/.bin/umi dev",
|
||||
"postinstall": "electron-builder install-app-deps",
|
||||
"electronDev": "concurrently \"electron .\" \"npm start\"",
|
||||
"build": "npm run build:main && npm run build:renderer",
|
||||
"build:main": "ESLINT=none roadhog build",
|
||||
"build:renderer": "ESLINT=none umi build",
|
||||
"pack": "npm run build && npm run rebuild && build",
|
||||
"pack:dir": "npm run build && npm run rebuild && build --dir",
|
||||
"pack:dirOnly": "build --dir"
|
||||
"release": "node ./scripts/release.js"
|
||||
},
|
||||
"workspaces": [
|
||||
"packages"
|
||||
],
|
||||
"dependencies": {
|
||||
"@icons-pack/react-simple-icons": "^3.8.0",
|
||||
"@lingui/react": "^2.9.2",
|
||||
"@material-ui/core": "^4.9.9",
|
||||
"@material-ui/icons": "^4.9.1",
|
||||
"@ragestudio/ycorejs-lib": "^0.1.22",
|
||||
"antd": "^4.6.6",
|
||||
"axios": "^0.19.2",
|
||||
"babel-core": "^6.26.3",
|
||||
"classnames": "^2.2.6",
|
||||
"concat-stream": "^2.0.0",
|
||||
"cookie_js": "^1.4.0",
|
||||
"dotenv": "^8.2.0",
|
||||
"electron-config": "^2.0.0",
|
||||
"electron-context-menu": "^2.3.0",
|
||||
"electron-is": "^3.0.0",
|
||||
"electron-log": "^4.2.4",
|
||||
"electron-notification-state": "^1.0.4",
|
||||
"electron-remote": "^1.3.0",
|
||||
"electron-updater": "^4.3.4",
|
||||
"enquire-js": "^0.2.1",
|
||||
"feather-reactjs": "^2.0.13",
|
||||
"html2canvas": "^1.0.0-rc.7",
|
||||
"jquery": "^3.5.1",
|
||||
"jsonwebtoken": "^8.5.1",
|
||||
"less-vars-to-js": "^1.3.0",
|
||||
"localforage": "^1.7.4",
|
||||
"lodash": "^4.17.19",
|
||||
"moment": "^2.28.0",
|
||||
"node-sass": "^4.13.1",
|
||||
"nprogress": "^0.2.0",
|
||||
"path-to-regexp": "^6.1.0",
|
||||
"platform": "^1.3.6",
|
||||
"radium": "^0.26.0",
|
||||
"react": "^16.13.1",
|
||||
"react-animations": "^1.0.0",
|
||||
"react-color": "^2.18.1",
|
||||
"react-dazzle": "^1.4.0",
|
||||
"react-dom": "^16.12.0",
|
||||
"react-emoji": "^0.5.0",
|
||||
"react-google-recaptcha": "^2.0.1",
|
||||
"react-helmet": "^5.2.1",
|
||||
"react-linkify": "^1.0.0-alpha",
|
||||
"react-perfect-scrollbar": "^1.5.8",
|
||||
"react-redux": "^7.2.1",
|
||||
"react-reveal": "^1.2.2",
|
||||
"react-scripts": "^3.4.1",
|
||||
"react-virtualized": "^9.21.2",
|
||||
"redux-socket.io": "^1.4.0",
|
||||
"redux-thunk": "^2.3.0",
|
||||
"request": "^2.88.2",
|
||||
"requirejs": "^2.3.6",
|
||||
"simple-icons": "^3.8.0",
|
||||
"socket.io-client": "^2.3.0",
|
||||
"stack-trace": "0.0.10",
|
||||
"store": "^2.0.12",
|
||||
"styled-components": "^5.2.0",
|
||||
"timeago.js": "^4.0.2",
|
||||
"vm": "^0.1.0",
|
||||
"wait-on": "^5.2.0"
|
||||
"corenode": "^0.28.26",
|
||||
"@octokit/rest": "19.0.4",
|
||||
"dotenv": "16.0.3",
|
||||
"7zip-min": "1.4.3",
|
||||
"axios": "0.21.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
|
||||
"@lingui/babel-preset-react": "^2.9.2",
|
||||
"@lingui/cli": "^2.9.2",
|
||||
"@lingui/loader": "^2.9.2",
|
||||
"@types/electron-devtools-installer": "^2.2.0",
|
||||
"@types/node": "^12.12.59",
|
||||
"@umijs/preset-react": "^1.6.5",
|
||||
"babel-eslint": "^10.0.1",
|
||||
"babel-plugin-dev-expression": "^0.2.1",
|
||||
"babel-plugin-module-resolver": "^4.0.0",
|
||||
"concurrently": "^3.5.1",
|
||||
"cross-env": "^6.0.0",
|
||||
"dva-model-extend": "^0.1.2",
|
||||
"electron": "^10.1.2",
|
||||
"electron-builder": "^22.8.0",
|
||||
"electron-debug": "^2.0.0",
|
||||
"electron-devtools-installer": "^3.1.1",
|
||||
"electron-rebuild": "^1.7.3",
|
||||
"electron-reloader": "^1.0.1",
|
||||
"jsdoc": "^3.6.5",
|
||||
"less": "^3.12.2",
|
||||
"less-loader": "^7.0.1",
|
||||
"style-loader": "^1.2.1",
|
||||
"typescript": "^3.8.3",
|
||||
"umi": "^3.2.22"
|
||||
}
|
||||
"version": "0.25.1"
|
||||
}
|
||||
|
BIN
packages/.DS_Store
vendored
Executable file
504
packages/LICENSE
Executable file
@ -0,0 +1,504 @@
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 2.1, February 1999
|
||||
|
||||
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
(This is the first released version of the Lesser GPL. It also counts
|
||||
as the successor of the GNU Library Public License, version 2, hence
|
||||
the version number 2.1.)
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
Licenses are intended to guarantee your freedom to share and change
|
||||
free software--to make sure the software is free for all its users.
|
||||
|
||||
This license, the Lesser General Public License, applies to some
|
||||
specially designated software packages--typically libraries--of the
|
||||
Free Software Foundation and other authors who decide to use it. You
|
||||
can use it too, but we suggest you first think carefully about whether
|
||||
this license or the ordinary General Public License is the better
|
||||
strategy to use in any particular case, based on the explanations below.
|
||||
|
||||
When we speak of free software, we are referring to freedom of use,
|
||||
not price. Our General Public Licenses are designed to make sure that
|
||||
you have the freedom to distribute copies of free software (and charge
|
||||
for this service if you wish); that you receive source code or can get
|
||||
it if you want it; that you can change the software and use pieces of
|
||||
it in new free programs; and that you are informed that you can do
|
||||
these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
distributors to deny you these rights or to ask you to surrender these
|
||||
rights. These restrictions translate to certain responsibilities for
|
||||
you if you distribute copies of the library or if you modify it.
|
||||
|
||||
For example, if you distribute copies of the library, whether gratis
|
||||
or for a fee, you must give the recipients all the rights that we gave
|
||||
you. You must make sure that they, too, receive or can get the source
|
||||
code. If you link other code with the library, you must provide
|
||||
complete object files to the recipients, so that they can relink them
|
||||
with the library after making changes to the library and recompiling
|
||||
it. And you must show them these terms so they know their rights.
|
||||
|
||||
We protect your rights with a two-step method: (1) we copyright the
|
||||
library, and (2) we offer you this license, which gives you legal
|
||||
permission to copy, distribute and/or modify the library.
|
||||
|
||||
To protect each distributor, we want to make it very clear that
|
||||
there is no warranty for the free library. Also, if the library is
|
||||
modified by someone else and passed on, the recipients should know
|
||||
that what they have is not the original version, so that the original
|
||||
author's reputation will not be affected by problems that might be
|
||||
introduced by others.
|
||||
|
||||
Finally, software patents pose a constant threat to the existence of
|
||||
any free program. We wish to make sure that a company cannot
|
||||
effectively restrict the users of a free program by obtaining a
|
||||
restrictive license from a patent holder. Therefore, we insist that
|
||||
any patent license obtained for a version of the library must be
|
||||
consistent with the full freedom of use specified in this license.
|
||||
|
||||
Most GNU software, including some libraries, is covered by the
|
||||
ordinary GNU General Public License. This license, the GNU Lesser
|
||||
General Public License, applies to certain designated libraries, and
|
||||
is quite different from the ordinary General Public License. We use
|
||||
this license for certain libraries in order to permit linking those
|
||||
libraries into non-free programs.
|
||||
|
||||
When a program is linked with a library, whether statically or using
|
||||
a shared library, the combination of the two is legally speaking a
|
||||
combined work, a derivative of the original library. The ordinary
|
||||
General Public License therefore permits such linking only if the
|
||||
entire combination fits its criteria of freedom. The Lesser General
|
||||
Public License permits more lax criteria for linking other code with
|
||||
the library.
|
||||
|
||||
We call this license the "Lesser" General Public License because it
|
||||
does Less to protect the user's freedom than the ordinary General
|
||||
Public License. It also provides other free software developers Less
|
||||
of an advantage over competing non-free programs. These disadvantages
|
||||
are the reason we use the ordinary General Public License for many
|
||||
libraries. However, the Lesser license provides advantages in certain
|
||||
special circumstances.
|
||||
|
||||
For example, on rare occasions, there may be a special need to
|
||||
encourage the widest possible use of a certain library, so that it becomes
|
||||
a de-facto standard. To achieve this, non-free programs must be
|
||||
allowed to use the library. A more frequent case is that a free
|
||||
library does the same job as widely used non-free libraries. In this
|
||||
case, there is little to gain by limiting the free library to free
|
||||
software only, so we use the Lesser General Public License.
|
||||
|
||||
In other cases, permission to use a particular library in non-free
|
||||
programs enables a greater number of people to use a large body of
|
||||
free software. For example, permission to use the GNU C Library in
|
||||
non-free programs enables many more people to use the whole GNU
|
||||
operating system, as well as its variant, the GNU/Linux operating
|
||||
system.
|
||||
|
||||
Although the Lesser General Public License is Less protective of the
|
||||
users' freedom, it does ensure that the user of a program that is
|
||||
linked with the Library has the freedom and the wherewithal to run
|
||||
that program using a modified version of the Library.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow. Pay close attention to the difference between a
|
||||
"work based on the library" and a "work that uses the library". The
|
||||
former contains code derived from the library, whereas the latter must
|
||||
be combined with the library in order to run.
|
||||
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License Agreement applies to any software library or other
|
||||
program which contains a notice placed by the copyright holder or
|
||||
other authorized party saying it may be distributed under the terms of
|
||||
this Lesser General Public License (also called "this License").
|
||||
Each licensee is addressed as "you".
|
||||
|
||||
A "library" means a collection of software functions and/or data
|
||||
prepared so as to be conveniently linked with application programs
|
||||
(which use some of those functions and data) to form executables.
|
||||
|
||||
The "Library", below, refers to any such software library or work
|
||||
which has been distributed under these terms. A "work based on the
|
||||
Library" means either the Library or any derivative work under
|
||||
copyright law: that is to say, a work containing the Library or a
|
||||
portion of it, either verbatim or with modifications and/or translated
|
||||
straightforwardly into another language. (Hereinafter, translation is
|
||||
included without limitation in the term "modification".)
|
||||
|
||||
"Source code" for a work means the preferred form of the work for
|
||||
making modifications to it. For a library, complete source code means
|
||||
all the source code for all modules it contains, plus any associated
|
||||
interface definition files, plus the scripts used to control compilation
|
||||
and installation of the library.
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running a program using the Library is not restricted, and output from
|
||||
such a program is covered only if its contents constitute a work based
|
||||
on the Library (independent of the use of the Library in a tool for
|
||||
writing it). Whether that is true depends on what the Library does
|
||||
and what the program that uses the Library does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Library's
|
||||
complete source code as you receive it, in any medium, provided that
|
||||
you conspicuously and appropriately publish on each copy an
|
||||
appropriate copyright notice and disclaimer of warranty; keep intact
|
||||
all the notices that refer to this License and to the absence of any
|
||||
warranty; and distribute a copy of this License along with the
|
||||
Library.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy,
|
||||
and you may at your option offer warranty protection in exchange for a
|
||||
fee.
|
||||
|
||||
2. You may modify your copy or copies of the Library or any portion
|
||||
of it, thus forming a work based on the Library, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) The modified work must itself be a software library.
|
||||
|
||||
b) You must cause the files modified to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
c) You must cause the whole of the work to be licensed at no
|
||||
charge to all third parties under the terms of this License.
|
||||
|
||||
d) If a facility in the modified Library refers to a function or a
|
||||
table of data to be supplied by an application program that uses
|
||||
the facility, other than as an argument passed when the facility
|
||||
is invoked, then you must make a good faith effort to ensure that,
|
||||
in the event an application does not supply such function or
|
||||
table, the facility still operates, and performs whatever part of
|
||||
its purpose remains meaningful.
|
||||
|
||||
(For example, a function in a library to compute square roots has
|
||||
a purpose that is entirely well-defined independent of the
|
||||
application. Therefore, Subsection 2d requires that any
|
||||
application-supplied function or table used by this function must
|
||||
be optional: if the application does not supply it, the square
|
||||
root function must still compute square roots.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Library,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Library, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote
|
||||
it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Library.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Library
|
||||
with the Library (or with a work based on the Library) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may opt to apply the terms of the ordinary GNU General Public
|
||||
License instead of this License to a given copy of the Library. To do
|
||||
this, you must alter all the notices that refer to this License, so
|
||||
that they refer to the ordinary GNU General Public License, version 2,
|
||||
instead of to this License. (If a newer version than version 2 of the
|
||||
ordinary GNU General Public License has appeared, then you can specify
|
||||
that version instead if you wish.) Do not make any other change in
|
||||
these notices.
|
||||
|
||||
Once this change is made in a given copy, it is irreversible for
|
||||
that copy, so the ordinary GNU General Public License applies to all
|
||||
subsequent copies and derivative works made from that copy.
|
||||
|
||||
This option is useful when you wish to copy part of the code of
|
||||
the Library into a program that is not a library.
|
||||
|
||||
4. You may copy and distribute the Library (or a portion or
|
||||
derivative of it, under Section 2) in object code or executable form
|
||||
under the terms of Sections 1 and 2 above provided that you accompany
|
||||
it with the complete corresponding machine-readable source code, which
|
||||
must be distributed under the terms of Sections 1 and 2 above on a
|
||||
medium customarily used for software interchange.
|
||||
|
||||
If distribution of object code is made by offering access to copy
|
||||
from a designated place, then offering equivalent access to copy the
|
||||
source code from the same place satisfies the requirement to
|
||||
distribute the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
5. A program that contains no derivative of any portion of the
|
||||
Library, but is designed to work with the Library by being compiled or
|
||||
linked with it, is called a "work that uses the Library". Such a
|
||||
work, in isolation, is not a derivative work of the Library, and
|
||||
therefore falls outside the scope of this License.
|
||||
|
||||
However, linking a "work that uses the Library" with the Library
|
||||
creates an executable that is a derivative of the Library (because it
|
||||
contains portions of the Library), rather than a "work that uses the
|
||||
library". The executable is therefore covered by this License.
|
||||
Section 6 states terms for distribution of such executables.
|
||||
|
||||
When a "work that uses the Library" uses material from a header file
|
||||
that is part of the Library, the object code for the work may be a
|
||||
derivative work of the Library even though the source code is not.
|
||||
Whether this is true is especially significant if the work can be
|
||||
linked without the Library, or if the work is itself a library. The
|
||||
threshold for this to be true is not precisely defined by law.
|
||||
|
||||
If such an object file uses only numerical parameters, data
|
||||
structure layouts and accessors, and small macros and small inline
|
||||
functions (ten lines or less in length), then the use of the object
|
||||
file is unrestricted, regardless of whether it is legally a derivative
|
||||
work. (Executables containing this object code plus portions of the
|
||||
Library will still fall under Section 6.)
|
||||
|
||||
Otherwise, if the work is a derivative of the Library, you may
|
||||
distribute the object code for the work under the terms of Section 6.
|
||||
Any executables containing that work also fall under Section 6,
|
||||
whether or not they are linked directly with the Library itself.
|
||||
|
||||
6. As an exception to the Sections above, you may also combine or
|
||||
link a "work that uses the Library" with the Library to produce a
|
||||
work containing portions of the Library, and distribute that work
|
||||
under terms of your choice, provided that the terms permit
|
||||
modification of the work for the customer's own use and reverse
|
||||
engineering for debugging such modifications.
|
||||
|
||||
You must give prominent notice with each copy of the work that the
|
||||
Library is used in it and that the Library and its use are covered by
|
||||
this License. You must supply a copy of this License. If the work
|
||||
during execution displays copyright notices, you must include the
|
||||
copyright notice for the Library among them, as well as a reference
|
||||
directing the user to the copy of this License. Also, you must do one
|
||||
of these things:
|
||||
|
||||
a) Accompany the work with the complete corresponding
|
||||
machine-readable source code for the Library including whatever
|
||||
changes were used in the work (which must be distributed under
|
||||
Sections 1 and 2 above); and, if the work is an executable linked
|
||||
with the Library, with the complete machine-readable "work that
|
||||
uses the Library", as object code and/or source code, so that the
|
||||
user can modify the Library and then relink to produce a modified
|
||||
executable containing the modified Library. (It is understood
|
||||
that the user who changes the contents of definitions files in the
|
||||
Library will not necessarily be able to recompile the application
|
||||
to use the modified definitions.)
|
||||
|
||||
b) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (1) uses at run time a
|
||||
copy of the library already present on the user's computer system,
|
||||
rather than copying library functions into the executable, and (2)
|
||||
will operate properly with a modified version of the library, if
|
||||
the user installs one, as long as the modified version is
|
||||
interface-compatible with the version that the work was made with.
|
||||
|
||||
c) Accompany the work with a written offer, valid for at
|
||||
least three years, to give the same user the materials
|
||||
specified in Subsection 6a, above, for a charge no more
|
||||
than the cost of performing this distribution.
|
||||
|
||||
d) If distribution of the work is made by offering access to copy
|
||||
from a designated place, offer equivalent access to copy the above
|
||||
specified materials from the same place.
|
||||
|
||||
e) Verify that the user has already received a copy of these
|
||||
materials or that you have already sent this user a copy.
|
||||
|
||||
For an executable, the required form of the "work that uses the
|
||||
Library" must include any data and utility programs needed for
|
||||
reproducing the executable from it. However, as a special exception,
|
||||
the materials to be distributed need not include anything that is
|
||||
normally distributed (in either source or binary form) with the major
|
||||
components (compiler, kernel, and so on) of the operating system on
|
||||
which the executable runs, unless that component itself accompanies
|
||||
the executable.
|
||||
|
||||
It may happen that this requirement contradicts the license
|
||||
restrictions of other proprietary libraries that do not normally
|
||||
accompany the operating system. Such a contradiction means you cannot
|
||||
use both them and the Library together in an executable that you
|
||||
distribute.
|
||||
|
||||
7. You may place library facilities that are a work based on the
|
||||
Library side-by-side in a single library together with other library
|
||||
facilities not covered by this License, and distribute such a combined
|
||||
library, provided that the separate distribution of the work based on
|
||||
the Library and of the other library facilities is otherwise
|
||||
permitted, and provided that you do these two things:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work
|
||||
based on the Library, uncombined with any other library
|
||||
facilities. This must be distributed under the terms of the
|
||||
Sections above.
|
||||
|
||||
b) Give prominent notice with the combined library of the fact
|
||||
that part of it is a work based on the Library, and explaining
|
||||
where to find the accompanying uncombined form of the same work.
|
||||
|
||||
8. You may not copy, modify, sublicense, link with, or distribute
|
||||
the Library except as expressly provided under this License. Any
|
||||
attempt otherwise to copy, modify, sublicense, link with, or
|
||||
distribute the Library is void, and will automatically terminate your
|
||||
rights under this License. However, parties who have received copies,
|
||||
or rights, from you under this License will not have their licenses
|
||||
terminated so long as such parties remain in full compliance.
|
||||
|
||||
9. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Library or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Library (or any work based on the
|
||||
Library), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Library or works based on it.
|
||||
|
||||
10. Each time you redistribute the Library (or any work based on the
|
||||
Library), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute, link with or modify the Library
|
||||
subject to these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties with
|
||||
this License.
|
||||
|
||||
11. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Library at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Library by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Library.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under any
|
||||
particular circumstance, the balance of the section is intended to apply,
|
||||
and the section as a whole is intended to apply in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
12. If the distribution and/or use of the Library is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Library under this License may add
|
||||
an explicit geographical distribution limitation excluding those countries,
|
||||
so that distribution is permitted only in or among countries not thus
|
||||
excluded. In such case, this License incorporates the limitation as if
|
||||
written in the body of this License.
|
||||
|
||||
13. The Free Software Foundation may publish revised and/or new
|
||||
versions of the Lesser General Public License from time to time.
|
||||
Such new versions will be similar in spirit to the present version,
|
||||
but may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Library
|
||||
specifies a version number of this License which applies to it and
|
||||
"any later version", you have the option of following the terms and
|
||||
conditions either of that version or of any later version published by
|
||||
the Free Software Foundation. If the Library does not specify a
|
||||
license version number, you may choose any version ever published by
|
||||
the Free Software Foundation.
|
||||
|
||||
14. If you wish to incorporate parts of the Library into other free
|
||||
programs whose distribution conditions are incompatible with these,
|
||||
write to the author to ask for permission. For software which is
|
||||
copyrighted by the Free Software Foundation, write to the Free
|
||||
Software Foundation; we sometimes make exceptions for this. Our
|
||||
decision will be guided by the two goals of preserving the free status
|
||||
of all derivatives of our free software and of promoting the sharing
|
||||
and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
||||
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
||||
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
|
||||
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
|
||||
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
|
||||
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
|
||||
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
||||
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
|
||||
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
|
||||
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
|
||||
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
|
||||
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
|
||||
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
|
||||
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
||||
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Libraries
|
||||
|
||||
If you develop a new library, and you want it to be of the greatest
|
||||
possible use to the public, we recommend making it free software that
|
||||
everyone can redistribute and change. You can do so by permitting
|
||||
redistribution under these terms (or, alternatively, under the terms of the
|
||||
ordinary General Public License).
|
||||
|
||||
To apply these terms, attach the following notices to the library. It is
|
||||
safest to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least the
|
||||
"copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
Comty-Development
|
||||
Copyright (C) 2020 srgooglo
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
|
||||
USA
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the library, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the
|
||||
library `Frob' (a library for tweaking knobs) written by James Random
|
||||
Hacker.
|
||||
|
||||
{signature of Ty Coon}, 1 April 1990
|
||||
Ty Coon, President of Vice
|
||||
|
||||
That's all there is to it!
|
66
packages/app/.config.js
Executable file
@ -0,0 +1,66 @@
|
||||
const path = require("path")
|
||||
const { builtinModules } = require("module")
|
||||
|
||||
const aliases = {
|
||||
"~": __dirname,
|
||||
"~/": `${path.resolve(__dirname, "src")}/`,
|
||||
"@src": path.join(__dirname, "src"),
|
||||
cores: path.join(__dirname, "src/cores"),
|
||||
schemas: path.join(__dirname, "constants"),
|
||||
config: path.join(__dirname, "config"),
|
||||
extensions: path.resolve(__dirname, "src/extensions"),
|
||||
pages: path.join(__dirname, "src/pages"),
|
||||
theme: path.join(__dirname, "src/theme"),
|
||||
components: path.join(__dirname, "src/components"),
|
||||
models: path.join(__dirname, "src/models"),
|
||||
utils: path.join(__dirname, "src/utils"),
|
||||
layouts: path.join(__dirname, "src/layouts"),
|
||||
}
|
||||
|
||||
module.exports = (config = {}) => {
|
||||
if (!config.resolve) {
|
||||
config.resolve = {}
|
||||
}
|
||||
if (!config.server) {
|
||||
config.server = {}
|
||||
}
|
||||
|
||||
config.resolve.alias = aliases
|
||||
config.server.port = process.env.listenPort ?? 8000
|
||||
config.server.host = "0.0.0.0"
|
||||
config.server.fs = {
|
||||
allow: [".."]
|
||||
}
|
||||
|
||||
config.envDir = path.join(__dirname, "environments")
|
||||
|
||||
config.css = {
|
||||
preprocessorOptions: {
|
||||
less: {
|
||||
javascriptEnabled: true,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// config.build = {
|
||||
// sourcemap: "inline",
|
||||
// target: `node16`,
|
||||
// outDir: "dist",
|
||||
// assetsDir: ".",
|
||||
// minify: process.env.MODE !== "development",
|
||||
// rollupOptions: {
|
||||
// external: [
|
||||
// "electron",
|
||||
// "electron-devtools-installer",
|
||||
// ...builtinModules.flatMap(p => [p, `node:16`]),
|
||||
// ],
|
||||
// output: {
|
||||
// entryFileNames: "[name].js",
|
||||
// },
|
||||
// },
|
||||
// emptyOutDir: true,
|
||||
// brotliSize: false,
|
||||
// }
|
||||
|
||||
return config
|
||||
}
|
2
packages/app/.dockerignore
Executable file
@ -0,0 +1,2 @@
|
||||
node_modules
|
||||
yarn.lock
|
9
packages/app/.gitignore
vendored
Executable file
@ -0,0 +1,9 @@
|
||||
node_modules
|
||||
.DS_Store
|
||||
dist
|
||||
dist-ssr
|
||||
*.local
|
||||
.vscode
|
||||
yarn-error.log
|
||||
ios/**/**
|
||||
out/
|
25
packages/app/Dockerfile
Executable file
@ -0,0 +1,25 @@
|
||||
FROM node:16-alpine
|
||||
|
||||
RUN apk add git
|
||||
RUN mkdir -p /home/node/app/node_modules && chown -R node:node /home/node/app
|
||||
|
||||
WORKDIR /home/node/app
|
||||
USER node
|
||||
|
||||
EXPOSE 9000
|
||||
|
||||
COPY --chown=node:node ./src ./src
|
||||
COPY --chown=node:node ./constants ./constants
|
||||
COPY --chown=node:node ./config ./config
|
||||
COPY --chown=node:node ./public ./public
|
||||
COPY --chown=node:node ./index.html .
|
||||
COPY --chown=node:node ./.config.js .
|
||||
COPY --chown=node:node ./vite.config.js .
|
||||
COPY --chown=node:node ./server.js .
|
||||
COPY --chown=node:node ./package.json .
|
||||
|
||||
RUN chmod -R 777 /home/node/app
|
||||
RUN npm install -D --force
|
||||
RUN npm run build
|
||||
|
||||
CMD ["node", "/home/node/app/server.js"]
|
7
packages/app/capacitor.config.json
Executable file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"appId": "com.ragestudio.comty",
|
||||
"appName": "Comty",
|
||||
"bundledWebRuntime": true,
|
||||
"overrideUserAgent": "capacitor",
|
||||
"webDir": "dist"
|
||||
}
|
99
packages/app/config/index.js
Executable file
@ -0,0 +1,99 @@
|
||||
import packagejson from "../package.json"
|
||||
import defaultTheme from "../constants/defaultTheme.json"
|
||||
import defaultSoundPack from "../constants/defaultSoundPack.json"
|
||||
import defaultRemotesOrigins from "../constants/defaultRemotesOrigins.json"
|
||||
|
||||
const envOrigins = {
|
||||
"development": {
|
||||
mainApi: `http://${window.location.hostname}:3000`,
|
||||
authApi: `http://${window.location.hostname}:4000`,
|
||||
contentApi: `http://${window.location.hostname}:3050`,
|
||||
streamingApi: `http://${window.location.hostname}:3002`,
|
||||
},
|
||||
"production": {
|
||||
mainApi: "http://api.comty.pw",
|
||||
authApi: "http://auth.comty.pw",
|
||||
contentApi: "http://content.comty.pw",
|
||||
streamingApi: "http://streaming.comty.pw",
|
||||
},
|
||||
"indev": {
|
||||
mainApi: "https://indev_api.comty.pw",
|
||||
authApi: `http://indev_auth.comty.pw`,
|
||||
contentApi: `http://indev_content.comty.pw`,
|
||||
streamingApi: "https://indev_live.comty.pw",
|
||||
},
|
||||
"nightly": {
|
||||
mainApi: "https://nightly_api.comty.pw",
|
||||
authApi: `https://nightly_auth.comty.pw`,
|
||||
contentApi: `https://nightly_content.comty.pw`,
|
||||
streamingApi: "https://nightly_live.comty.pw"
|
||||
}
|
||||
}
|
||||
|
||||
console.log(`Config loaded with mode: [${process.env.NODE_ENV}]`)
|
||||
|
||||
export default {
|
||||
package: packagejson,
|
||||
defaultTheme: defaultTheme,
|
||||
defaultSoundPack: defaultSoundPack,
|
||||
author: "RageStudio©",
|
||||
footerLinks: [
|
||||
{
|
||||
label: "Terms of Service",
|
||||
location: "/terms"
|
||||
},
|
||||
{
|
||||
label: "Privacy Policy",
|
||||
location: "/privacy"
|
||||
},
|
||||
{
|
||||
label: "Contact",
|
||||
location: "/contact"
|
||||
},
|
||||
{
|
||||
label: "Github",
|
||||
url: "https://github.com/ragestudio/comty"
|
||||
},
|
||||
{
|
||||
label: "Support this project",
|
||||
url: "https://www.paypal.com/donate/?hosted_button_id=S4TWMAN79KC76"
|
||||
}
|
||||
],
|
||||
logo: {
|
||||
alt: "/logo_alt.svg",
|
||||
full: "/logo_full.svg",
|
||||
},
|
||||
remotes: {
|
||||
mainApi: process.env.NODE_ENV !== "production" ? envOrigins[process.env.NODE_ENV].mainApi : defaultRemotesOrigins.main_api,
|
||||
authApi: process.env.NODE_ENV !== "production" ? envOrigins[process.env.NODE_ENV].authApi : defaultRemotesOrigins.auth_api,
|
||||
streamingApi: process.env.NODE_ENV !== "production" ? envOrigins[process.env.NODE_ENV].streamingApi : defaultRemotesOrigins.streaming_api,
|
||||
},
|
||||
app: {
|
||||
title: packagejson.name,
|
||||
siteName: "Comty",
|
||||
siteDescription: "Comty, a prototype of social network.",
|
||||
mainPath: "/home",
|
||||
authPath: "/login",
|
||||
copyright: "Comty - RageStudio© 2022",
|
||||
storage: {
|
||||
basics: "user",
|
||||
token: "token",
|
||||
session_frame: "session",
|
||||
signkey: "certified",
|
||||
settings: "app_settings"
|
||||
},
|
||||
},
|
||||
i18n: {
|
||||
languages: [
|
||||
{
|
||||
locale: "en",
|
||||
name: "English"
|
||||
},
|
||||
{
|
||||
locale: "es",
|
||||
name: "Español"
|
||||
}
|
||||
],
|
||||
defaultLocale: "en",
|
||||
}
|
||||
}
|
5
packages/app/constants/defaultRemotesOrigins.json
Executable file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"main_api": "https://api.comty.pw",
|
||||
"auth_api": "https://auth.ragestudio.net",
|
||||
"streaming_api": "https://live.comty.pw"
|
||||
}
|
24
packages/app/constants/defaultSettings.json
Executable file
@ -0,0 +1,24 @@
|
||||
{
|
||||
"themeVariant": "light",
|
||||
"forceMobileMode": false,
|
||||
"notifications_sound": true,
|
||||
"notifications_vibrate": true,
|
||||
"notifications_sound_volume": 50,
|
||||
"selection_longPress_timeout": 600,
|
||||
"autoCollapseDelay": 500,
|
||||
"autoCollapseDelayEnabled": true,
|
||||
"haptic_feedback": false,
|
||||
"collapseOnLooseFocus": true,
|
||||
"auto_darkMode": false,
|
||||
"compactWidth": false,
|
||||
"postCard_carrusel_auto": true,
|
||||
"postCard_expansible_actions": true,
|
||||
"feed_max_fetch": 20,
|
||||
"style.compactMode": false,
|
||||
"language": "en",
|
||||
"sidebarKeys": [
|
||||
"home",
|
||||
"marketplace",
|
||||
"groups"
|
||||
]
|
||||
}
|
5
packages/app/constants/defaultSoundPack.json
Executable file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"crash": "/sounds/crash.wav",
|
||||
"error": "/sounds/error.wav",
|
||||
"notification": "/sounds/notification.wav"
|
||||
}
|
45
packages/app/constants/defaultTheme.json
Executable file
@ -0,0 +1,45 @@
|
||||
{
|
||||
"staticVars": {
|
||||
"backgroundBlur": "10px",
|
||||
"primaryColor": "#ff6064",
|
||||
"backgroundColorTransparency": "0.8",
|
||||
"backgroundImage": "none",
|
||||
"fontFamily": "'Varela Round', sans-serif",
|
||||
"layoutMargin": "unset",
|
||||
"layoutPadding": "10px"
|
||||
},
|
||||
"defaultVariant": "light",
|
||||
"variants": {
|
||||
"light": {
|
||||
"appColor": "#ff6064",
|
||||
"text-color": "#000000",
|
||||
"layoutBackgroundColor": "255, 255, 255",
|
||||
"background-color-primary": "#ffffff",
|
||||
"background-color-primary2": "#f0f0f0",
|
||||
"shadow-color": "#4b4b4b7c",
|
||||
"background-color-accent": "#f0f2f5",
|
||||
"background-color-contrast": "#4b4b4b",
|
||||
"border-color": "#4b4b4b2a",
|
||||
"sidebar-background-color": "var(--background-color-accent)",
|
||||
"sidedrawer-background-color": "var(--background-color-accent)"
|
||||
},
|
||||
"dark": {
|
||||
"appColor": "#ff6064",
|
||||
"text-color": "#d2d2d2",
|
||||
"svg-color": "var(--text-color)",
|
||||
"shadow-color": "#3535357c",
|
||||
"layoutBackgroundColor": "38, 38, 38",
|
||||
"background-color-primary": "#262626",
|
||||
"background-color-primary2": "#2c2c2c",
|
||||
"background-color-accent": "#353535",
|
||||
"background_disabled": "#0A0A0A",
|
||||
"background-color-contrast": "#ffffff",
|
||||
"border-color": "#4b4b4b2a",
|
||||
"header-text-color": "#d2d2d2",
|
||||
"button-background-color": "var(--primaryColor)",
|
||||
"button-text-color": "var(--background-color-contrast)",
|
||||
"sidebar-background-color": "var(--background-color-accent)",
|
||||
"sidedrawer-background-color": "var(--background-color-accent)"
|
||||
}
|
||||
}
|
||||
}
|
115
packages/app/constants/menu-contexts.js
Executable file
@ -0,0 +1,115 @@
|
||||
import download from "utils/download"
|
||||
|
||||
function copyToClipboard(text) {
|
||||
if (!navigator.clipboard?.writeText) {
|
||||
control.close()
|
||||
return app.message.error("Clipboard API not supported")
|
||||
}
|
||||
|
||||
navigator.clipboard.writeText(text)
|
||||
app.message.success("Copied to clipboard")
|
||||
}
|
||||
|
||||
export default {
|
||||
"postCard-context": (parent, element, control) => {
|
||||
const items = [
|
||||
{
|
||||
label: "Copy ID",
|
||||
icon: "Copy",
|
||||
action: () => {
|
||||
copyToClipboard(parent.id)
|
||||
control.close()
|
||||
}
|
||||
},
|
||||
{
|
||||
label: "Copy Link",
|
||||
icon: "Link",
|
||||
action: () => {
|
||||
copyToClipboard(`${window.location.origin}/post/${parent.id}`)
|
||||
control.close()
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
let media = null
|
||||
|
||||
// if element div has `addition` class, search inside it for video or image
|
||||
if (element.classList.contains("addition")) {
|
||||
media = element.querySelector("video, img")
|
||||
}
|
||||
|
||||
// if element div has `plyr__poster` class, search outside it for video or image
|
||||
if (element.classList.contains("plyr__poster")) {
|
||||
console.log(element.parentElement)
|
||||
media = element.parentElement.querySelector("video")
|
||||
}
|
||||
|
||||
// if media is found, and is a video, search for the source
|
||||
if (media && media.tagName === "VIDEO") {
|
||||
media = media.querySelector("source")
|
||||
}
|
||||
|
||||
if (media) {
|
||||
items.push({
|
||||
type: "separator"
|
||||
})
|
||||
|
||||
items.push({
|
||||
label: "Copy media URL",
|
||||
icon: "Copy",
|
||||
action: () => {
|
||||
copyToClipboard(media.src)
|
||||
control.close()
|
||||
}
|
||||
})
|
||||
|
||||
items.push({
|
||||
label: "Open media in new tab",
|
||||
icon: "ExternalLink",
|
||||
action: () => {
|
||||
window.open(media.src, "_blank")
|
||||
control.close()
|
||||
}
|
||||
})
|
||||
|
||||
items.push({
|
||||
label: "Download media",
|
||||
icon: "Download",
|
||||
action: () => {
|
||||
app.message.info("Downloading media...")
|
||||
download(media.src)
|
||||
control.close()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// check if parent has `self-post` attribute
|
||||
const isSelf = parent.getAttribute("self-post").toBoolean()
|
||||
|
||||
if (isSelf) {
|
||||
items.push({
|
||||
type: "separator"
|
||||
})
|
||||
|
||||
items.push({
|
||||
label: "Delete",
|
||||
icon: "Trash",
|
||||
action: () => {
|
||||
app.eventBus.emit(`post.${parent.id}.delete`)
|
||||
control.close()
|
||||
}
|
||||
})
|
||||
|
||||
items.push({
|
||||
label: "Edit",
|
||||
icon: "Edit2",
|
||||
action: () => {
|
||||
app.eventBus.emit(`post.${parent.id}.edit`)
|
||||
control.close()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
return items
|
||||
}
|
||||
}
|
4
packages/app/constants/publicRoutes.json
Executable file
@ -0,0 +1,4 @@
|
||||
[
|
||||
"/post/*",
|
||||
"/live/*"
|
||||
]
|
50
packages/app/constants/routes.json
Executable file
@ -0,0 +1,50 @@
|
||||
[
|
||||
{
|
||||
"id": "login",
|
||||
"path": "/login",
|
||||
"title": "Login",
|
||||
"icon": "Login",
|
||||
"useLayout": "login"
|
||||
},
|
||||
{
|
||||
"id": "home",
|
||||
"path": "/home",
|
||||
"title": "Home",
|
||||
"icon": "Home",
|
||||
"reachable": true
|
||||
},
|
||||
{
|
||||
"id": "saved",
|
||||
"path": "/saved",
|
||||
"title": "Saved",
|
||||
"icon": "Archive",
|
||||
"reachable": true
|
||||
},
|
||||
{
|
||||
"id": "marketplace",
|
||||
"path": "/marketplace",
|
||||
"title": "Marketplace",
|
||||
"icon": "Package",
|
||||
"reachable": true
|
||||
},
|
||||
{
|
||||
"id": "streams",
|
||||
"path": "/streams",
|
||||
"title": "Streams",
|
||||
"icon": "Tv",
|
||||
"reachable": true
|
||||
},
|
||||
{
|
||||
"id": "streaming_control",
|
||||
"path": "/streaming_control",
|
||||
"title": "Streaming Control",
|
||||
"icon": "Video"
|
||||
},
|
||||
{
|
||||
"id": "groups",
|
||||
"path": "/groups",
|
||||
"title": "Groups",
|
||||
"icon": "Users",
|
||||
"reachable": true
|
||||
}
|
||||
]
|
189
packages/app/constants/settings/account/index.jsx
Executable file
@ -0,0 +1,189 @@
|
||||
import React from "react"
|
||||
import { User } from "models"
|
||||
|
||||
export default [
|
||||
{
|
||||
"id": "username",
|
||||
"group": "account.basicInfo",
|
||||
"component": "Button",
|
||||
"icon": "AtSign",
|
||||
"title": "Username",
|
||||
"description": "Your username is the name you use to log in to your account.",
|
||||
"props": {
|
||||
"disabled": true,
|
||||
"children": "Change username",
|
||||
},
|
||||
},
|
||||
{
|
||||
"id": "fullName",
|
||||
"group": "account.basicInfo",
|
||||
"component": "Input",
|
||||
"icon": "Edit3",
|
||||
"title": "Name",
|
||||
"description": "Change your public name",
|
||||
"props": {
|
||||
// set max length
|
||||
"maxLength": 120,
|
||||
"showCount": true,
|
||||
"allowClear": true,
|
||||
"placeholder": "Enter your name. e.g. John Doe",
|
||||
},
|
||||
"defaultValue": async () => {
|
||||
const userData = await User.data()
|
||||
return userData.fullName
|
||||
},
|
||||
"onUpdate": async (value) => {
|
||||
const selfId = await User.selfUserId()
|
||||
|
||||
const result = window.app.api.withEndpoints("main").post.updateUser({
|
||||
_id: selfId,
|
||||
update: {
|
||||
fullName: value
|
||||
}
|
||||
})
|
||||
|
||||
if (result) {
|
||||
return result
|
||||
}
|
||||
},
|
||||
"extraActions": [
|
||||
{
|
||||
"id": "unset",
|
||||
"icon": "Delete",
|
||||
"title": "Unset",
|
||||
"onClick": async () => {
|
||||
window.app.api.withEndpoints("main").post.unsetPublicName()
|
||||
}
|
||||
}
|
||||
],
|
||||
"debounced": true,
|
||||
},
|
||||
{
|
||||
"id": "email",
|
||||
"group": "account.basicInfo",
|
||||
"component": "Input",
|
||||
"icon": "Mail",
|
||||
"title": "Email",
|
||||
"description": "Change your email address",
|
||||
"props": {
|
||||
"placeholder": "Enter your email address",
|
||||
"allowClear": true,
|
||||
"showCount": true,
|
||||
"maxLength": 320,
|
||||
},
|
||||
"defaultValue": async () => {
|
||||
const userData = await User.data()
|
||||
return userData.email
|
||||
},
|
||||
"onUpdate": async (value) => {
|
||||
const selfId = await User.selfUserId()
|
||||
|
||||
const result = window.app.api.withEndpoints("main").post.updateUser({
|
||||
_id: selfId,
|
||||
update: {
|
||||
email: value
|
||||
}
|
||||
})
|
||||
|
||||
if (result) {
|
||||
return result
|
||||
}
|
||||
},
|
||||
"debounced": true,
|
||||
},
|
||||
{
|
||||
"id": "avatar",
|
||||
"group": "account.profile",
|
||||
"component": "Input",
|
||||
"icon": "Image",
|
||||
"title": "Avatar",
|
||||
"description": "Change your avatar (Upload an image or use an URL)",
|
||||
"defaultValue": async () => {
|
||||
const userData = await User.data()
|
||||
return userData.avatar
|
||||
},
|
||||
"onUpdate": async (value) => {
|
||||
const selfId = await User.selfUserId()
|
||||
|
||||
const result = window.app.api.withEndpoints("main").post.updateUser({
|
||||
_id: selfId,
|
||||
update: {
|
||||
avatar: value
|
||||
}
|
||||
})
|
||||
|
||||
if (result) {
|
||||
return result
|
||||
}
|
||||
},
|
||||
"debounced": true,
|
||||
},
|
||||
{
|
||||
"id": "cover",
|
||||
"group": "account.profile",
|
||||
"component": "Input",
|
||||
"icon": "Image",
|
||||
"title": "Cover",
|
||||
"description": "Change your profile cover (Upload an image or use an URL)",
|
||||
"defaultValue": async () => {
|
||||
const userData = await User.data()
|
||||
return userData.cover
|
||||
},
|
||||
"onUpdate": async (value) => {
|
||||
const selfId = await User.selfUserId()
|
||||
|
||||
const result = window.app.api.withEndpoints("main").post.updateUser({
|
||||
_id: selfId,
|
||||
update: {
|
||||
cover: value
|
||||
}
|
||||
})
|
||||
|
||||
if (result) {
|
||||
return result
|
||||
}
|
||||
},
|
||||
"debounced": true,
|
||||
},
|
||||
{
|
||||
"id": "cover",
|
||||
"group": "account.profile",
|
||||
"component": "ImageUpload",
|
||||
"icon": "Image",
|
||||
"title": "Cover",
|
||||
"description": "Change your cover",
|
||||
},
|
||||
{
|
||||
"id": "description",
|
||||
"group": "account.profile",
|
||||
"component": "TextArea",
|
||||
"icon": "Edit3",
|
||||
"title": "Description",
|
||||
"description": "Change your description for your profile",
|
||||
"props": {
|
||||
"placeholder": "Enter here a description for your profile",
|
||||
"maxLength": 1000,
|
||||
"showCount": true,
|
||||
"allowClear": true
|
||||
},
|
||||
"defaultValue": async () => {
|
||||
const userData = await User.data()
|
||||
return userData.description
|
||||
},
|
||||
"onUpdate": async (value) => {
|
||||
const selfId = await User.selfUserId()
|
||||
|
||||
const result = window.app.api.withEndpoints("main").post.updateUser({
|
||||
_id: selfId,
|
||||
update: {
|
||||
description: value
|
||||
}
|
||||
})
|
||||
|
||||
if (result) {
|
||||
return result
|
||||
}
|
||||
},
|
||||
"debounced": true,
|
||||
},
|
||||
]
|
172
packages/app/constants/settings/app/index.jsx
Executable file
@ -0,0 +1,172 @@
|
||||
import React from "react"
|
||||
import config from "config"
|
||||
import { Select } from "antd"
|
||||
|
||||
export default [
|
||||
{
|
||||
"id": "language",
|
||||
"storaged": true,
|
||||
"group": "general",
|
||||
"component": "Select",
|
||||
"icon": "MdTranslate",
|
||||
"title": "Language",
|
||||
"description": "Choose a language for the application",
|
||||
"props": {
|
||||
children: config.i18n.languages.map((language) => {
|
||||
return <Select.Option value={language.locale}>{language.name}</Select.Option>
|
||||
})
|
||||
},
|
||||
"emitEvent": "changeLanguage"
|
||||
},
|
||||
{
|
||||
"id": "forceMobileMode",
|
||||
"storaged": true,
|
||||
"group": "general",
|
||||
"component": "Switch",
|
||||
"icon": "MdSmartphone",
|
||||
"title": "Force Mobile Mode",
|
||||
"description": "Force the application to run in mobile mode.",
|
||||
"emitEvent": "forceMobileMode"
|
||||
},
|
||||
{
|
||||
"id": "haptic_feedback",
|
||||
"storaged": true,
|
||||
"group": "general",
|
||||
"component": "Switch",
|
||||
"icon": "MdVibration",
|
||||
"title": "Haptic Feedback",
|
||||
"description": "Enable haptic feedback on touch events.",
|
||||
},
|
||||
{
|
||||
"id": "selection_longPress_timeout",
|
||||
"storaged": true,
|
||||
"group": "general",
|
||||
"component": "Slider",
|
||||
"icon": "MdTimer",
|
||||
"title": "Selection press delay",
|
||||
"description": "Set the delay before the selection trigger is activated.",
|
||||
"props": {
|
||||
min: 300,
|
||||
max: 2000,
|
||||
step: 100,
|
||||
marks: {
|
||||
300: "0.3s",
|
||||
600: "0.6s",
|
||||
1000: "1s",
|
||||
1500: "1.5s",
|
||||
2000: "2s",
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "notifications_sound",
|
||||
"storaged": true,
|
||||
"group": "notifications",
|
||||
"component": "Switch",
|
||||
"icon": "MdVolumeUp",
|
||||
"title": "Notifications Sound",
|
||||
"description": "Play a sound when a notification is received.",
|
||||
},
|
||||
{
|
||||
"id": "notifications_vibrate",
|
||||
"storaged": true,
|
||||
"group": "notifications",
|
||||
"component": "Switch",
|
||||
"icon": "MdVibration",
|
||||
"title": "Vibration",
|
||||
"description": "Vibrate the device when a notification is received.",
|
||||
"emitEvent": "changeNotificationsVibrate"
|
||||
},
|
||||
{
|
||||
"id": "notifications_sound_volume",
|
||||
"storaged": true,
|
||||
"group": "notifications",
|
||||
"component": "Slider",
|
||||
"icon": "MdVolumeUp",
|
||||
"title": "Sound Volume",
|
||||
"description": "Set the volume of the sound when a notification is received.",
|
||||
"props": {
|
||||
tipFormatter: (value) => {
|
||||
return `${value}%`
|
||||
}
|
||||
},
|
||||
"emitEvent": "changeNotificationsSoundVolume"
|
||||
},
|
||||
{
|
||||
"id": "edit_sidebar",
|
||||
"storaged": true,
|
||||
"group": "sidebar",
|
||||
"component": "Button",
|
||||
"icon": "Edit",
|
||||
"title": "Edit Sidebar",
|
||||
"emitEvent": "edit_sidebar",
|
||||
"noStorage": true
|
||||
},
|
||||
{
|
||||
"id": "collapseOnLooseFocus",
|
||||
"storaged": true,
|
||||
"group": "sidebar",
|
||||
"component": "Switch",
|
||||
"icon": "Columns",
|
||||
"title": "Auto Collapse",
|
||||
"description": "Collapse the sidebar when loose focus",
|
||||
"emitEvent": "settingChanged.sidebar_collapse",
|
||||
},
|
||||
{
|
||||
"id": "autoCollapseDelay",
|
||||
"storaged": true,
|
||||
"group": "sidebar",
|
||||
"component": "Slider",
|
||||
"icon": "MdTimer",
|
||||
"dependsOn": {
|
||||
"collapseOnLooseFocus": true
|
||||
},
|
||||
"title": "Auto Collapse timeout",
|
||||
"description": "Set the delay before the sidebar is collapsed",
|
||||
"props": {
|
||||
min: 0,
|
||||
max: 2000,
|
||||
step: 100,
|
||||
marks: {
|
||||
0: "No delay",
|
||||
600: "0.6s",
|
||||
1000: "1s",
|
||||
1500: "1.5s",
|
||||
2000: "2s",
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "feed_max_fetch",
|
||||
"title": "Fetch max items",
|
||||
"description": "Set the maximum number of items to load per fetch in the feed list",
|
||||
"component": "Slider",
|
||||
"icon": "MdFormatListNumbered",
|
||||
"group": "posts",
|
||||
"props": {
|
||||
min: 5,
|
||||
max: 50,
|
||||
},
|
||||
"storaged": true,
|
||||
},
|
||||
{
|
||||
"id": "postCard_carrusel_auto",
|
||||
"title": "Auto show post media",
|
||||
"description": "Automatically show the post medias when the post has multiple medias",
|
||||
"component": "Switch",
|
||||
"icon": "MdPhotoCameraBack",
|
||||
"group": "posts",
|
||||
"storaged": true,
|
||||
"emitEvent": "router.forceUpdate"
|
||||
},
|
||||
{
|
||||
"id": "postCard_expansible_actions",
|
||||
"title": "Expansible actions",
|
||||
"description": "Automatically show or hide the actions bar",
|
||||
"component": "Switch",
|
||||
"icon": "MdCallToAction",
|
||||
"group": "posts",
|
||||
"storaged": true,
|
||||
"emitEvent": "router.forceUpdate"
|
||||
},
|
||||
]
|
1
packages/app/constants/settings/apparence/components/index.js
Executable file
@ -0,0 +1 @@
|
||||
export { default as UnsplashBrowser } from "./unsplashBrowser"
|
@ -0,0 +1,14 @@
|
||||
import React from "react"
|
||||
|
||||
export default (props) => {
|
||||
const [searchValue, setSearchValue] = React.useState("")
|
||||
const [results, setResults] = React.useState([])
|
||||
|
||||
|
||||
return <div className="unsplashBrowser">
|
||||
<h1>Search in Unsplash™</h1>
|
||||
<div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
}
|
170
packages/app/constants/settings/apparence/index.jsx
Executable file
@ -0,0 +1,170 @@
|
||||
import React from "react"
|
||||
import * as antd from "antd"
|
||||
|
||||
import { UnsplashBrowser } from "./components"
|
||||
|
||||
import "./index.less"
|
||||
|
||||
export default [
|
||||
{
|
||||
"id": "compactWidth",
|
||||
"title": "Compact Width",
|
||||
"description": "Sets the width of the app to a compact width to facilitate the vision of components.",
|
||||
"component": "Switch",
|
||||
"icon": "MdCompress",
|
||||
"group": "layout",
|
||||
"experimental": true,
|
||||
"storaged": true
|
||||
},
|
||||
{
|
||||
"id": "reduceAnimations",
|
||||
"storaged": true,
|
||||
"group": "aspect",
|
||||
"component": "Switch",
|
||||
"icon": "MdOutlineAnimation",
|
||||
"title": "Reduce animation",
|
||||
"experimental": true
|
||||
},
|
||||
{
|
||||
"id": "auto_darkMode",
|
||||
"experimental": true,
|
||||
"storaged": true,
|
||||
"group": "aspect",
|
||||
"component": "Switch",
|
||||
"icon": "Moon",
|
||||
"title": "Auto dark mode",
|
||||
"emitEvent": "style.autoDarkModeToogle",
|
||||
},
|
||||
{
|
||||
"experimental": true,
|
||||
"dependsOn": {
|
||||
"auto_darkMode": false
|
||||
},
|
||||
"id": "darkMode",
|
||||
"storaged": true,
|
||||
"group": "aspect",
|
||||
"component": "Switch",
|
||||
"icon": "Moon",
|
||||
"title": "Dark mode",
|
||||
"emitEvent": "theme.applyVariant",
|
||||
"emissionValueUpdate": (value) => {
|
||||
return value ? "dark" : "light"
|
||||
},
|
||||
},
|
||||
{
|
||||
"id": "primaryColor",
|
||||
"storaged": true,
|
||||
"group": "aspect",
|
||||
"component": "SliderColorPicker",
|
||||
"title": "Primary color",
|
||||
"description": "Change primary color of the application.",
|
||||
"emitEvent": "modifyTheme",
|
||||
"reloadValueOnUpdateEvent": "resetTheme",
|
||||
"emissionValueUpdate": (value) => {
|
||||
return {
|
||||
primaryColor: value
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "backgroundImage",
|
||||
"storaged": true,
|
||||
"group": "aspect",
|
||||
"title": "Background image",
|
||||
"description": "Change background image of the application. You can use a local image or a remote image (URL).",
|
||||
"component": (props) => {
|
||||
const [validUrl, setValidUrl] = React.useState(true)
|
||||
|
||||
const submitUrl = (e) => {
|
||||
const url = e.target.value
|
||||
|
||||
// validate if value recived is url
|
||||
if (!url.match(/^(http(s)?:\/\/)?(www\.)?[a-zA-Z0-9]+\.[a-zA-Z]+(\.[a-zA-Z]+)?(\/.*)?$/)) {
|
||||
setValidUrl(false)
|
||||
antd.message.error("Invalid URL")
|
||||
return
|
||||
}
|
||||
|
||||
props.ctx.dispatchUpdate(url)
|
||||
}
|
||||
|
||||
const onClickSearchUnsplash = () => {
|
||||
antd.message.warn("This feature is not implemented yet.")
|
||||
return false
|
||||
window.app.SidedrawerController.open("unsplashBrowser", UnsplashBrowser)
|
||||
}
|
||||
|
||||
return <div className="backgroundImageSetting">
|
||||
<antd.Input
|
||||
placeholder="https://example.com/image.png"
|
||||
onPressEnter={submitUrl}
|
||||
status={validUrl ? "default" : "error"}
|
||||
/>
|
||||
or
|
||||
<antd.Button
|
||||
onClick={onClickSearchUnsplash}
|
||||
>
|
||||
Search on Unsplash
|
||||
</antd.Button>
|
||||
</div>
|
||||
},
|
||||
"emitEvent": "modifyTheme",
|
||||
"emissionValueUpdate": (value) => {
|
||||
return {
|
||||
backgroundImage: `url(${value})`
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
"id": "backgroundBlur",
|
||||
"storaged": true,
|
||||
"group": "aspect",
|
||||
"component": "Slider",
|
||||
"icon": "Eye",
|
||||
"title": "Background blur",
|
||||
"description": "Create a blur effect on the background.",
|
||||
"props": {
|
||||
min: 0,
|
||||
max: 50,
|
||||
step: 5
|
||||
},
|
||||
"emitEvent": "modifyTheme",
|
||||
"emissionValueUpdate": (value) => {
|
||||
return {
|
||||
backgroundBlur: `${value}px`,
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
"id": "backgroundColorTransparency",
|
||||
"storaged": true,
|
||||
"group": "aspect",
|
||||
"component": "Slider",
|
||||
"icon": "Eye",
|
||||
"title": "Background color transparency",
|
||||
"description": "Adjust the transparency of the background color.",
|
||||
"props": {
|
||||
min: 0,
|
||||
max: 1,
|
||||
step: 0.1
|
||||
},
|
||||
"emitEvent": "modifyTheme",
|
||||
"emissionValueUpdate": (value) => {
|
||||
return {
|
||||
backgroundColorTransparency: value,
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
"id": "resetTheme",
|
||||
"storaged": true,
|
||||
"group": "aspect",
|
||||
"component": "Button",
|
||||
"title": "Reset theme",
|
||||
"props": {
|
||||
"children": "Default Theme"
|
||||
},
|
||||
"emitEvent": "resetTheme",
|
||||
"noUpdate": true,
|
||||
}
|
||||
]
|
6
packages/app/constants/settings/apparence/index.less
Executable file
@ -0,0 +1,6 @@
|
||||
.backgroundImageSetting {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
5
packages/app/constants/settings/extensions/index.jsx
Executable file
@ -0,0 +1,5 @@
|
||||
import React from "react"
|
||||
|
||||
export default [
|
||||
|
||||
]
|
34
packages/app/constants/settings/index.js
Executable file
@ -0,0 +1,34 @@
|
||||
import AppSettings from "./app"
|
||||
import AccountSettings from "./account"
|
||||
import SecuritySettings from "./security"
|
||||
import NotificationsSettings from "./notifications"
|
||||
import ApparenceSettings from "./apparence"
|
||||
//import ExtensionsSettings from "./extensions"
|
||||
|
||||
export default {
|
||||
app: {
|
||||
icon: "Command",
|
||||
label: "App",
|
||||
settings: AppSettings
|
||||
},
|
||||
account: {
|
||||
icon: "User",
|
||||
label: "Profile",
|
||||
settings: AccountSettings
|
||||
},
|
||||
apparence: {
|
||||
icon: "Eye",
|
||||
label: "Apparence",
|
||||
settings: ApparenceSettings
|
||||
},
|
||||
security: {
|
||||
icon: "Shield",
|
||||
label: "Security",
|
||||
settings: SecuritySettings
|
||||
},
|
||||
notifications: {
|
||||
icon: "Bell",
|
||||
label: "Notifications",
|
||||
settings: NotificationsSettings
|
||||
},
|
||||
}
|
5
packages/app/constants/settings/notifications/index.jsx
Executable file
@ -0,0 +1,5 @@
|
||||
import React from "react"
|
||||
|
||||
export default [
|
||||
|
||||
]
|
10
packages/app/constants/settings/security/components/changePassword/index.jsx
Executable file
@ -0,0 +1,10 @@
|
||||
import React from "react"
|
||||
import * as antd from "antd"
|
||||
|
||||
export default (props) => {
|
||||
return <div>
|
||||
<antd.Button>
|
||||
Change password
|
||||
</antd.Button>
|
||||
</div>
|
||||
}
|
10
packages/app/constants/settings/security/components/sessions/index.jsx
Executable file
@ -0,0 +1,10 @@
|
||||
import React from "react"
|
||||
import * as antd from "antd"
|
||||
|
||||
export default (props) => {
|
||||
return <div>
|
||||
<antd.Button>
|
||||
Check activity
|
||||
</antd.Button>
|
||||
</div>
|
||||
}
|
40
packages/app/constants/settings/security/index.jsx
Executable file
@ -0,0 +1,40 @@
|
||||
import React from "react"
|
||||
import loadable from "@loadable/component"
|
||||
|
||||
// TODO: Make logout button require a valid session to be not disabled
|
||||
|
||||
export default [
|
||||
{
|
||||
"id": "change-password",
|
||||
"group": "security.account",
|
||||
"title": "Change Password",
|
||||
"description": "Change your password",
|
||||
"icon": "Lock",
|
||||
"component": loadable(() => import("./components/changePassword")),
|
||||
},
|
||||
{
|
||||
"id": "two-factor-authentication",
|
||||
"group": "security.account",
|
||||
"title": "Two-Factor Authentication",
|
||||
"description": "Add an extra layer of security to your account",
|
||||
"icon": "MdOutlineSecurity",
|
||||
"component": "Switch",
|
||||
},
|
||||
{
|
||||
"id": "sessions",
|
||||
"group": "security.account",
|
||||
"title": "Sessions",
|
||||
"description": "Manage your active sessions",
|
||||
"icon": "Monitor",
|
||||
"component": loadable(() => import("./components/sessions")),
|
||||
},
|
||||
{
|
||||
"id": "logout",
|
||||
"group": "security.other",
|
||||
"component": "Button",
|
||||
"icon": "LogOut",
|
||||
"title": "Logout",
|
||||
"description": "Logout from your account",
|
||||
"emitEvent": "session.logout",
|
||||
}
|
||||
]
|
42
packages/app/constants/settingsGroupsDecorator.json
Executable file
@ -0,0 +1,42 @@
|
||||
{
|
||||
"general": {
|
||||
"title": "General",
|
||||
"icon": "Settings"
|
||||
},
|
||||
"notifications": {
|
||||
"title": "Notifications",
|
||||
"icon": "Bell"
|
||||
},
|
||||
"sidebar": {
|
||||
"title": "Sidebar",
|
||||
"icon": "Layout"
|
||||
},
|
||||
"aspect": {
|
||||
"title": "Aspect",
|
||||
"icon": "Eye"
|
||||
},
|
||||
"security.account": {
|
||||
"title": "Account Security",
|
||||
"icon": "Lock"
|
||||
},
|
||||
"security.other":{
|
||||
"title": "Others",
|
||||
"icon": "MoreHorizontal"
|
||||
},
|
||||
"account.basicInfo": {
|
||||
"title": "Basic Information",
|
||||
"icon": "Info"
|
||||
},
|
||||
"account.profile": {
|
||||
"title": "Profile",
|
||||
"icon": "Book"
|
||||
},
|
||||
"layout": {
|
||||
"title": "Layout",
|
||||
"icon": "Layers"
|
||||
},
|
||||
"posts": {
|
||||
"title": "Posts",
|
||||
"icon": "MdOutlineFeed"
|
||||
}
|
||||
}
|
7
electron-builder.yml → packages/app/electron-builder.yml
Normal file → Executable file
@ -1,6 +1,6 @@
|
||||
appId: com.example.bruh
|
||||
productName: Bruh
|
||||
copyright: Copyright © Bruh
|
||||
appId: com.ragestudio.comty
|
||||
productName: Comty
|
||||
copyright: Copyright © RageStudio
|
||||
directories:
|
||||
output: dist
|
||||
buildResources: resources
|
||||
@ -8,5 +8,4 @@ files:
|
||||
- from: .
|
||||
filter:
|
||||
- package.json
|
||||
- app
|
||||
publish: null
|
0
main/configs/config.js → packages/app/electron/main/configs/config.js
Normal file → Executable file
0
main/icon.png → packages/app/electron/main/icon.png
Normal file → Executable file
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 44 KiB |
254
packages/app/electron/main/index.js
Executable file
@ -0,0 +1,254 @@
|
||||
const path = require("path")
|
||||
const {
|
||||
app,
|
||||
BrowserWindow,
|
||||
ipcMain,
|
||||
Tray,
|
||||
Menu,
|
||||
MenuItem,
|
||||
dialog,
|
||||
shell,
|
||||
screen,
|
||||
BrowserView,
|
||||
systemPreferences,
|
||||
Notification,
|
||||
globalShortcut
|
||||
} = require("electron")
|
||||
|
||||
const log = require("electron-log")
|
||||
const is = require("electron-is")
|
||||
const waitOn = require("wait-on")
|
||||
|
||||
const srcPath = path.join(process.cwd())
|
||||
const distPath = path.join(process.cwd(), "dist")
|
||||
const devMode = is.dev()
|
||||
|
||||
const packagejson = require(path.join(srcPath, "package.json"))
|
||||
|
||||
let app_path = devMode ? "http://localhost:8000" : `file://${path.join(distPath, "index.html")}`
|
||||
|
||||
let mainWindow = null
|
||||
let devtools = null
|
||||
let tray = null
|
||||
let watcher = null
|
||||
|
||||
// This gets rid of this: https://github.com/electron/electron/issues/13186
|
||||
process.env.ELECTRON_DISABLE_SECURITY_WARNINGS = true
|
||||
// app.commandLine.appendSwitch("disable-web-security")
|
||||
//app.commandLine.appendSwitch("disable-gpu-vsync=gpu")
|
||||
app.commandLine.appendSwitch("disable-features", "OutOfBlinkCors")
|
||||
|
||||
const gotTheLock = app.requestSingleInstanceLock()
|
||||
const notifySupport = Notification.isSupported()
|
||||
|
||||
// Prevent multiple instances
|
||||
if (!gotTheLock) {
|
||||
app.quit()
|
||||
}
|
||||
|
||||
function relaunchApp() {
|
||||
mainWindow.close()
|
||||
app.relaunch()
|
||||
}
|
||||
|
||||
function resumeApp() {
|
||||
if (mainWindow) {
|
||||
mainWindow.show()
|
||||
mainWindow.focus()
|
||||
} else {
|
||||
createWindow()
|
||||
}
|
||||
}
|
||||
|
||||
function notify(params) {
|
||||
if (!notifySupport || !params) return false
|
||||
let options = {
|
||||
title: "",
|
||||
body: "",
|
||||
icon: null,
|
||||
timeoutType: "default"
|
||||
}
|
||||
|
||||
const keys = Object.keys(params)
|
||||
const values = Object.values(params)
|
||||
|
||||
for (let i = 0; i < keys.length; i++) {
|
||||
options[keys[i]] = values[i]
|
||||
}
|
||||
|
||||
new Notification(options).show()
|
||||
}
|
||||
|
||||
function createWindow() {
|
||||
mainWindow = new BrowserWindow({
|
||||
title: packagejson.title,
|
||||
icon: path.join(__dirname, "./icon.png"),
|
||||
width: 1100,
|
||||
height: 700,
|
||||
minWidth: 1256,
|
||||
minHeight: 755,
|
||||
show: true,
|
||||
frame: false,
|
||||
transparent: false,
|
||||
hasShadow: true,
|
||||
//webgl: true,
|
||||
visualEffectState: "followWindow",
|
||||
backgroundColor: "#00ffffff",
|
||||
webPreferences: {
|
||||
preload: path.join(__dirname, "../preload"),
|
||||
//enableRemoteModule: true,
|
||||
enableBlinkFeatures: true,
|
||||
experimentalFeatures: true,
|
||||
nodeIntegration: true,
|
||||
// Disable in dev since I think hot reload is messing with it
|
||||
webSecurity: !is.dev()
|
||||
}
|
||||
})
|
||||
|
||||
if (devMode) {
|
||||
app.commandLine.appendSwitch("remote-debugging-port", "9222")
|
||||
|
||||
globalShortcut.register("CommandOrControl+R", () => {
|
||||
mainWindow.reload()
|
||||
})
|
||||
|
||||
globalShortcut.register("F5", () => {
|
||||
mainWindow.reload()
|
||||
})
|
||||
|
||||
globalShortcut.register("CommandOrControl+Shift+I", () => {
|
||||
mainWindow.webContents.toggleDevTools()
|
||||
})
|
||||
|
||||
devtools = new BrowserWindow()
|
||||
|
||||
mainWindow.webContents.setDevToolsWebContents(devtools.webContents)
|
||||
|
||||
mainWindow.webContents.openDevTools({
|
||||
mode: "detach"
|
||||
})
|
||||
}
|
||||
|
||||
mainWindow.webContents.session.webRequest.onHeadersReceived(
|
||||
{
|
||||
urls: ["http://*/*", "https://*/*"]
|
||||
},
|
||||
(details, callback) => {
|
||||
delete details.responseHeaders["Access-Control-Allow-Origin"]
|
||||
delete details.responseHeaders["access-control-allow-origin"]
|
||||
if (details.url.includes("www.google-analytics.com")) {
|
||||
details.responseHeaders["Access-Control-Allow-Origin"] = [app_path]
|
||||
} else {
|
||||
details.responseHeaders["Access-Control-Allow-Origin"] = ["*"]
|
||||
}
|
||||
callback({
|
||||
cancel: false,
|
||||
responseHeaders: details.responseHeaders
|
||||
})
|
||||
}
|
||||
)
|
||||
|
||||
// load the app
|
||||
mainWindow.loadURL(app_path)
|
||||
mainWindow.focus()
|
||||
|
||||
// const handleRedirect = (e, url) => {
|
||||
// if (url !== mainWindow.webContents.getURL()) {
|
||||
// e.preventDefault()
|
||||
// shell.openExternal(url)
|
||||
// }
|
||||
// }
|
||||
|
||||
// mainWindow.webContents.on("will-navigate", handleRedirect)
|
||||
// mainWindow.webContents.on("new-window", handleRedirect)
|
||||
}
|
||||
|
||||
app.on("ready", async () => {
|
||||
if (!devMode) {
|
||||
return createWindow()
|
||||
}
|
||||
|
||||
loadWindow = new BrowserWindow({
|
||||
width: 700,
|
||||
height: 500,
|
||||
frame: false,
|
||||
resizable: false,
|
||||
center: true,
|
||||
transparent: true,
|
||||
backgroundColor: "#00000000",
|
||||
})
|
||||
|
||||
console.log("Starting on dev mode....")
|
||||
notify({ title: "Starting development server..." })
|
||||
|
||||
loadWindow.loadURL(`file://${__dirname}/statics/loading_dev.html`)
|
||||
loadWindow.focus()
|
||||
|
||||
await waitOn({ resources: [app_path] }, (err) => {
|
||||
if (err) {
|
||||
return console.error(err)
|
||||
}
|
||||
})
|
||||
|
||||
loadWindow.close()
|
||||
|
||||
createWindow()
|
||||
})
|
||||
|
||||
app.on("window-all-closed", () => {
|
||||
mainWindow = null
|
||||
})
|
||||
|
||||
app.on("before-quit", async () => {
|
||||
mainWindow.removeAllListeners("close")
|
||||
mainWindow = null
|
||||
})
|
||||
|
||||
ipcMain.handle("update-progress-bar", (event, p) => {
|
||||
mainWindow.setProgressBar(p)
|
||||
})
|
||||
|
||||
ipcMain.handle("hide-window", () => {
|
||||
if (mainWindow) {
|
||||
mainWindow.hide()
|
||||
}
|
||||
})
|
||||
|
||||
ipcMain.handle("show-window", () => {
|
||||
if (mainWindow) {
|
||||
mainWindow.show()
|
||||
mainWindow.focus()
|
||||
}
|
||||
})
|
||||
|
||||
ipcMain.handle("min-max-window", () => {
|
||||
if (mainWindow.isMaximized()) {
|
||||
mainWindow.unmaximize()
|
||||
} else if (mainWindow.maximizable) {
|
||||
mainWindow.maximize()
|
||||
}
|
||||
})
|
||||
|
||||
ipcMain.handle("getSystemPreferences", () => {
|
||||
return systemPreferences
|
||||
})
|
||||
|
||||
ipcMain.handle("app.minimize", () => {
|
||||
mainWindow.minimize()
|
||||
})
|
||||
|
||||
ipcMain.handle("app.close", () => {
|
||||
app.quit()
|
||||
})
|
||||
|
||||
ipcMain.handle("open-devtools", () => {
|
||||
mainWindow.webContents.openDevTools({ mode: "undocked" })
|
||||
})
|
||||
|
||||
ipcMain.handle("appRelaunch", () => {
|
||||
relaunchApp()
|
||||
})
|
||||
|
||||
ipcMain.handle("inspectElement", (event, payload) => {
|
||||
mainWindow.inspectElement(payload.x, payload.y)
|
||||
})
|
0
main/statics/loading.css → packages/app/electron/main/statics/loading.css
Normal file → Executable file
0
main/statics/loading.html → packages/app/electron/main/statics/loading.html
Normal file → Executable file
0
main/statics/loading_dev.html → packages/app/electron/main/statics/loading_dev.html
Normal file → Executable file
8
packages/app/electron/preload/index.js
Executable file
@ -0,0 +1,8 @@
|
||||
const { contextBridge, ipcRenderer } = require("electron")
|
||||
|
||||
contextBridge.exposeInMainWorld("electron", {
|
||||
ipcRenderer,
|
||||
isDev: () => {
|
||||
return process.env.NODE_ENV === "development"
|
||||
}
|
||||
})
|
20
packages/app/index.html
Executable file
@ -0,0 +1,20 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" type="image/svg+xml" href="/favicon.ico" />
|
||||
<meta name="viewport"
|
||||
content="viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
|
||||
<meta name="description" content="Comty, a prototype of social network." />
|
||||
<meta property="og:title" content="Comty" />
|
||||
<meta property="og:description" content="Comty, a prototype of social network." />
|
||||
<meta property="og:image" content="https://dl.ragestudio.net/branding/comty/alt/SVG/t3t3.svg" />
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
<script type="module" src="/src/App.jsx"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
139
packages/app/package.json
Executable file
@ -0,0 +1,139 @@
|
||||
{
|
||||
"name": "comty",
|
||||
"version": "0.25.1",
|
||||
"license": "LGPL-2.1",
|
||||
"main": "electron/main",
|
||||
"author": "RageStudio",
|
||||
"description": "A prototype of a social network.",
|
||||
"scripts": {
|
||||
"start": "electron-forge start",
|
||||
"build": "vite build",
|
||||
"dev": "vite",
|
||||
"dev:electron": "concurrently -k \"yarn dev\" \"yarn electron:dev\"",
|
||||
"electron:dev": "cross-env IS_DEV=true electron-forge start",
|
||||
"electron:build": "electron-forge make",
|
||||
"electron:package": "electron-forge package",
|
||||
"docker-compose:update_run": "docker-compose down && git pull && yarn build && docker-compose up -d --build",
|
||||
"preview": "vite preview",
|
||||
"package": "electron-forge package",
|
||||
"make": "electron-forge make"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "^16.8.6"
|
||||
},
|
||||
"dependencies": {
|
||||
"@ant-design/icons": "4.7.0",
|
||||
"@capacitor/android": "3.5.1",
|
||||
"@capacitor/core": "3.5.1",
|
||||
"@capacitor/haptics": "1.1.4",
|
||||
"@capacitor/push-notifications": "1.0.9",
|
||||
"@capacitor/status-bar": "1.0.7",
|
||||
"@capacitor/storage": "1.2.4",
|
||||
"@corenode/utils": "0.28.26",
|
||||
"@emotion/css": "11.0.0",
|
||||
"@loadable/component": "5.15.2",
|
||||
"@tsmx/human-readable": "^1.0.7",
|
||||
"antd": "4.23.2",
|
||||
"antd-mobile": "^5.0.0-rc.17",
|
||||
"axios": "1.1.3",
|
||||
"chart.js": "3.7.0",
|
||||
"classnames": "2.3.1",
|
||||
"electron-is": "^3.0.0",
|
||||
"electron-log": "^4.4.8",
|
||||
"electron-squirrel-startup": "^1.0.0",
|
||||
"evite": "0.13.7",
|
||||
"faye": "1.4.0",
|
||||
"feather-reactjs": "2.0.13",
|
||||
"fuse.js": "6.5.3",
|
||||
"global": "4.4.0",
|
||||
"history": "5.2.0",
|
||||
"hls.js": "^1.1.5",
|
||||
"howler": "2.2.3",
|
||||
"i18next": "21.6.6",
|
||||
"js-cookie": "3.0.1",
|
||||
"jwt-decode": "3.1.2",
|
||||
"less": "4.1.2",
|
||||
"linebridge": "0.13.0",
|
||||
"luxon": "^3.0.4",
|
||||
"moment": "2.29.4",
|
||||
"moment-timezone": "^0.5.37",
|
||||
"mpegts.js": "^1.6.10",
|
||||
"nprogress": "^0.2.0",
|
||||
"plyr": "^3.6.12",
|
||||
"plyr-react": "^3.2.1",
|
||||
"prop-types": "^15.8.1",
|
||||
"qrcode": "1.5.0",
|
||||
"rc-animate": "^3.1.1",
|
||||
"rc-util": "^5.19.3",
|
||||
"rc-virtual-list": "^3.4.4",
|
||||
"react-beautiful-dnd": "13.1.0",
|
||||
"react-chartjs-2": "4.0.1",
|
||||
"react-color": "2.19.3",
|
||||
"react-contexify": "5.0.0",
|
||||
"react-draggable": "4.4.4",
|
||||
"react-helmet": "6.1.0",
|
||||
"react-i18next": "11.15.3",
|
||||
"react-icons": "4.3.1",
|
||||
"react-intersection-observer": "8.33.1",
|
||||
"react-json-view": "1.21.3",
|
||||
"react-lazy-load-image-component": "^1.5.4",
|
||||
"react-loadable": "^5.5.0",
|
||||
"react-motion": "0.5.2",
|
||||
"react-responsive-carousel": "^3.2.23",
|
||||
"react-reveal": "1.2.2",
|
||||
"react-rnd": "10.3.5",
|
||||
"rxjs": "^7.5.5",
|
||||
"store": "^2.0.12",
|
||||
"uuid": "^9.0.0",
|
||||
"wait-on": "^6.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@electron-forge/cli": "^6.0.0-beta.66",
|
||||
"@electron-forge/maker-deb": "^6.0.0-beta.66",
|
||||
"@electron-forge/maker-rpm": "^6.0.0-beta.66",
|
||||
"@electron-forge/maker-squirrel": "^6.0.0-beta.66",
|
||||
"@electron-forge/maker-zip": "^6.0.0-beta.66",
|
||||
"@types/jest": "^26.0.24",
|
||||
"@types/node": "^16.4.10",
|
||||
"@types/react": "^17.0.15",
|
||||
"@types/react-dom": "^17.0.9",
|
||||
"@types/react-router-config": "^5.0.3",
|
||||
"@types/react-router-dom": "^5.1.8",
|
||||
"@typescript-eslint/eslint-plugin": "^4.29.0",
|
||||
"concurrently": "^7.4.0",
|
||||
"corenode": "0.28.26",
|
||||
"cors": "2.8.5",
|
||||
"cross-env": "^7.0.3",
|
||||
"electron": "^21.0.1",
|
||||
"express": "^4.17.1",
|
||||
"typescript": "^4.3.5",
|
||||
"vite": "3.1.4"
|
||||
},
|
||||
"config": {
|
||||
"forge": {
|
||||
"packagerConfig": {},
|
||||
"makers": [
|
||||
{
|
||||
"name": "@electron-forge/maker-squirrel",
|
||||
"config": {
|
||||
"name": "comty"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "@electron-forge/maker-zip",
|
||||
"platforms": [
|
||||
"darwin"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "@electron-forge/maker-deb",
|
||||
"config": {}
|
||||
},
|
||||
{
|
||||
"name": "@electron-forge/maker-rpm",
|
||||
"config": {}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
BIN
packages/app/public/assets/new_file.png
Executable file
After Width: | Height: | Size: 6.2 KiB |
BIN
packages/app/public/assets/no_song.png
Executable file
After Width: | Height: | Size: 6.2 KiB |
8
packages/app/public/broken-image.svg
Executable file
@ -0,0 +1,8 @@
|
||||
<svg
|
||||
style="width: 1em; height: 1em;vertical-align: middle;fill: var(--background-color-contrast);overflow: hidden;"
|
||||
viewBox="0 0 1024 1024"
|
||||
version="1.1"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
><path
|
||||
d="M896 213.333333v281.6l-128-128-170.666667 170.666667-170.666666-170.666667-170.666667 170.666667-128-128V213.333333c0-46.933333 38.4-85.333333 85.333333-85.333333h597.333334c46.933333 0 85.333333 38.4 85.333333 85.333333z m-128 273.066667l128 128V810.666667c0 46.933333-38.4 85.333333-85.333333 85.333333H213.333333c-46.933333 0-85.333333-38.4-85.333333-85.333333V529.066667l128 128 170.666667-170.666667 170.666666 170.666667 170.666667-170.666667z"
|
||||
/></svg>
|
After Width: | Height: | Size: 667 B |
BIN
packages/app/public/favicon.ico
Executable file
After Width: | Height: | Size: 1.6 MiB |
22
packages/app/public/logo_alt.svg
Executable file
@ -0,0 +1,22 @@
|
||||
<svg id="a5b341d4-efcc-46ea-a271-f2bea59c6abd" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 73.95833 75.98684">
|
||||
<defs>
|
||||
<clipPath id="ff5fefc3-adb2-4abb-b227-248fe5798176" transform="translate(-59.54167 -41.51316)">
|
||||
<path d="M65.66466,94.80263h11.627V77.03947h7.12138A17.46634,17.46634,0,0,1,89.91264,67.661a16.65479,16.65479,0,0,1,5.129-3.01224v-5.3724h17.75V44.65313a38.859,38.859,0,0,0-13.03991-2.15171H66.44444A3.9459,3.9459,0,0,0,62.5,46.44878V80a37.22971,37.22971,0,0,0,3.16466,14.80263Z" style="fill:none"/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
<g id="ff89d78c-8832-4326-ac52-0a37a191ec6c" data-name="ISO">
|
||||
<path
|
||||
d="M117.10747,71.60975l15.661-8.2106a1.393,1.393,0,0,0,.56628-1.88339l-.0039-.0088a38.47206,38.47206,0,0,0-52.29612-13.895q-.61987.361-1.22711.74651A37.19166,37.19166,0,0,0,63.90489,89.91631a37.89348,37.89348,0,0,0,8.33249,15.0407,38.40645,38.40645,0,0,0,43.51431,9.43652,37.34524,37.34524,0,0,0,9.28377-5.794,1.3857,1.3857,0,0,0,.11794-1.94992l-.01852-.01957L113.45926,94.14684a1.39344,1.39344,0,0,0-1.85383-.16143,16.599,16.599,0,0,1-3.53612,2.23757,17.26606,17.26606,0,0,1-9.12587,1.33158c-8.05763-1.042-12.19512-7.694-12.49045-8.18028a17.37349,17.37349,0,0,1-2.348-10.45305,17.5888,17.5888,0,0,1,6.47768-11.82574,17.23688,17.23688,0,0,1,23.98672,2.9782c.27583.35319.5351.71813.78169,1.09286a1.3741,1.3741,0,0,0,1.75637.4432"
|
||||
transform="translate(-59.54167 -41.51316)"
|
||||
style="fill:#ff6064"
|
||||
/>
|
||||
<g style="clip-path:url(#ff5fefc3-adb2-4abb-b227-248fe5798176)">
|
||||
<rect class="A1" width="17.75" height="17.76316" style="fill:#ff7c8c"/>
|
||||
<rect class="A2" x="17.75" width="17.75" height="17.76316" style="fill:#ff4971"/>
|
||||
<rect class="A3" x="35.5" width="17.75" height="17.76316" style="fill:#ff4457"/>
|
||||
<rect class="B1" y="17.76316" width="17.75" height="17.76316" style="fill:#ff4971"/>
|
||||
<rect class="B2" x="17.75" y="17.76316" width="17.75" height="17.76316" style="fill:#ff4457"/>
|
||||
<rect class="C1" y="35.52632" width="17.75" height="17.76316" style="fill:#ff4457"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 2.1 KiB |
48
packages/app/public/logo_full.svg
Executable file
@ -0,0 +1,48 @@
|
||||
<svg fill="#fff" id="b619fe7a-ff90-4eba-8fab-fc8da13c4d01" data-name="Capa 1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 345 126.78261">
|
||||
<defs>
|
||||
<linearGradient id="f098983f-0e25-42ef-8a37-90969e9b2c72" x1="1.19966" y1="94.58815" x2="101.19961" y2="94.58815" gradientTransform="translate(0.23514 -0.02293)" gradientUnits="userSpaceOnUse">
|
||||
<stop offset="0" stop-color="#ed6f56" />
|
||||
<stop offset="1" stop-color="#ff6064" />
|
||||
</linearGradient>
|
||||
<clipPath id="f19b29d4-1e8d-4178-855a-243e0912bbca">
|
||||
<path d="M25.09943,65.36785h11.627V47.60469h7.12138a17.46641,17.46641,0,0,1,5.49959-9.37851,16.65459,16.65459,0,0,1,5.129-3.01224V29.84153h17.75V15.21835a38.85939,38.85939,0,0,0-13.03991-2.15172H25.87922A3.94591,3.94591,0,0,0,21.93477,17.014V50.56522a37.22971,37.22971,0,0,0,3.16466,14.80263Z" style="fill:none" />
|
||||
</clipPath>
|
||||
<clipPath id="a709f1c7-d8a7-4e50-b69c-38e7e1bf269b">
|
||||
<path d="M107.4542,59.23431a13.32324,13.32324,0,1,1,13.37961,13.48405A13.32259,13.32259,0,0,1,107.4542,59.23431m-13.90215,0a27.27746,27.27746,0,1,0,27.28176-27.48574A27.25288,27.25288,0,0,0,93.552,59.23431" style="fill:#ff6064" />
|
||||
</clipPath>
|
||||
<clipPath id="b9696296-277b-4b6c-8f78-1a1a4f0442c4">
|
||||
<path d="M198.98242,40.2153c-4.59926-6.47573-11.60267-8.46673-17.45618-8.46673-6.58021,0-11.17947,2.30458-14.31517,6.16712V32.27121H153.41829v53.304h13.79278V62.26561c0-11.493,3.44938-16.92349,11.39335-16.92349,7.62559,0,11.28413,5.11687,11.28413,16.92349V85.57523H203.686V62.26561c0-11.493,3.44953-16.92349,11.3935-16.92349,7.63061,0,11.289,5.11687,11.289,16.92349V85.57523h13.79263V58.29854c0-21.21907-12.64775-26.55-22.1598-26.55-7.93911,0-14.52433,3.03129-19.01894,8.46673" style="fill:none" />
|
||||
</clipPath>
|
||||
<clipPath id="bb055267-959c-42d8-b7c8-a796232b4837">
|
||||
<polygon points="254.413 15.343 254.413 32.271 244.384 32.271 244.384 44.815 254.413 44.815 254.413 85.575 268.315 85.575 268.315 44.815 279.495 44.815 279.495 32.271 268.315 32.271 268.315 15.343 254.413 15.343" style="fill:none" />
|
||||
</clipPath>
|
||||
<clipPath id="f8754a63-63bf-4125-8805-22d5c19b3f68">
|
||||
<polygon points="329.145 32.271 314.825 68.333 300.097 32.271 285.672 32.271 307.717 86.411 302.705 99.159 289.325 99.159 289.325 111.697 312.112 111.697 343.565 32.271 329.145 32.271" style="fill:none" />
|
||||
</clipPath>
|
||||
</defs>
|
||||
<g id="ac09f01a-134c-4431-8c16-92ddf77ea314" data-name="ISO">
|
||||
<path d="M12.08564,71.33466,3.02945,75.57422A2.76967,2.76967,0,0,0,1.62592,79.0925a61.16433,61.16433,0,0,0,73.67317,36.66026,59.91038,59.91038,0,0,0,11.99952-4.92518,61.40873,61.40873,0,0,0,7.34947-4.65668,63.36948,63.36948,0,0,0,5.92619-4.95293,2.77329,2.77329,0,0,0,.20741-3.79571l-6.15333-7.33184c-.02765-.03467-.05728-.06836-.08691-.10105a2.73018,2.73018,0,0,0-3.86387-.19619,46.69194,46.69194,0,0,1-39.736,11.394A48.16334,48.16334,0,0,1,30.921,92.4979,47.91286,47.91286,0,0,1,15.79049,72.75149c-.01679-.04161-.03655-.08322-.05531-.12484a2.72948,2.72948,0,0,0-3.64954-1.292" style="fill:url(#f098983f-0e25-42ef-8a37-90969e9b2c72)" />
|
||||
<path d="M76.54224,42.175l15.661-8.2106a1.393,1.393,0,0,0,.56628-1.88339l-.00389-.00881a38.47207,38.47207,0,0,0-52.29613-13.895q-.61987.361-1.22711.74651A37.19168,37.19168,0,0,0,23.33966,60.48153a37.89348,37.89348,0,0,0,8.33249,15.0407,38.40649,38.40649,0,0,0,43.51431,9.43652,37.3448,37.3448,0,0,0,9.28377-5.794,1.38568,1.38568,0,0,0,.11794-1.94991l-.01852-.01958L72.894,64.71206a1.39343,1.39343,0,0,0-1.85383-.16143,16.59877,16.59877,0,0,1-3.53611,2.23756,17.266,17.266,0,0,1-9.12588,1.33159c-8.05762-1.042-12.19512-7.694-12.49044-8.18028a17.37344,17.37344,0,0,1-2.348-10.45306A17.58886,17.58886,0,0,1,50.01746,37.6607a17.2369,17.2369,0,0,1,23.98672,2.9782c.27583.3532.5351.71814.7817,1.09286a1.37408,1.37408,0,0,0,1.75636.44321" style="fill:#ff6064" />
|
||||
<g style="clip-path:url(#f19b29d4-1e8d-4178-855a-243e0912bbca)">
|
||||
<rect x="18.97644" y="12.07838" width="17.75" height="17.76316" style="fill:#ff7c8c" />
|
||||
<rect x="36.72644" y="12.07838" width="17.75" height="17.76316" style="fill:#ff4971" />
|
||||
<rect x="54.47644" y="12.07838" width="17.75" height="17.76316" style="fill:#ff4457" />
|
||||
<rect x="18.97644" y="29.84153" width="17.75" height="17.76316" style="fill:#ff4971" />
|
||||
<rect x="18.97644" y="47.60469" width="17.75" height="17.76316" style="fill:#ff4457" />
|
||||
<rect x="36.72644" y="29.84153" width="17.75" height="17.76316" style="fill:#ff4457" />
|
||||
</g>
|
||||
</g>
|
||||
<path d="M107.4542,59.23431a13.32324,13.32324,0,1,1,13.37961,13.48405A13.32259,13.32259,0,0,1,107.4542,59.23431m-13.90215,0a27.27746,27.27746,0,1,0,27.28176-27.48574A27.25288,27.25288,0,0,0,93.552,59.23431" style="fill:#ff6064" />
|
||||
<g style="clip-path:url(#a709f1c7-d8a7-4e50-b69c-38e7e1bf269b)">
|
||||
<rect x="93.55205" y="31.74857" width="54.55318" height="54.86696" style="fill:#ff6064" />
|
||||
</g>
|
||||
<g style="clip-path:url(#b9696296-277b-4b6c-8f78-1a1a4f0442c4)">
|
||||
<rect x="153.41814" y="31.74857" width="86.74302" height="53.82666" style="fill:#ff6064" />
|
||||
</g>
|
||||
<g style="clip-path:url(#bb055267-959c-42d8-b7c8-a796232b4837)">
|
||||
<rect x="244.38346" y="15.34274" width="35.1112" height="70.23249" style="fill:#ff6064" />
|
||||
</g>
|
||||
<g style="clip-path:url(#f8754a63-63bf-4125-8805-22d5c19b3f68)">
|
||||
<rect x="285.67172" y="32.27121" width="57.89334" height="79.42594" style="fill:#ff6064" />
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 5.5 KiB |
BIN
packages/app/public/sounds/crash.wav
Executable file
BIN
packages/app/public/sounds/error.wav
Executable file
BIN
packages/app/public/sounds/notification.wav
Executable file
25
packages/app/server.js
Executable file
@ -0,0 +1,25 @@
|
||||
const express = require("express")
|
||||
const path = require("path")
|
||||
const cors = require("cors")
|
||||
|
||||
const app = express()
|
||||
|
||||
const portFromArgs = process.argv[2]
|
||||
let portListen = portFromArgs ? portFromArgs : 9000
|
||||
|
||||
app.use(cors({
|
||||
origin: "*",
|
||||
methods: "GET,HEAD,PUT,PATCH,POST,DELETE",
|
||||
preflightContinue: true,
|
||||
optionsSuccessStatus: 204
|
||||
}))
|
||||
|
||||
app.use(express.static(path.join(__dirname, "dist")))
|
||||
|
||||
app.get("*", function (req, res) {
|
||||
res.sendFile(path.join(__dirname, "dist", "index.html"))
|
||||
})
|
||||
|
||||
app.listen(portListen)
|
||||
|
||||
console.log(`🌐 Listening app in port [${portListen}]`)
|
525
packages/app/src/App.jsx
Executable file
@ -0,0 +1,525 @@
|
||||
// Patch global prototypes
|
||||
Array.prototype.findAndUpdateObject = function (discriminator, obj) {
|
||||
let index = this.findIndex(item => item[discriminator] === obj[discriminator])
|
||||
if (index !== -1) {
|
||||
this[index] = obj
|
||||
}
|
||||
|
||||
return index
|
||||
}
|
||||
|
||||
Array.prototype.move = function (from, to) {
|
||||
this.splice(to, 0, this.splice(from, 1)[0])
|
||||
return this
|
||||
}
|
||||
|
||||
String.prototype.toTitleCase = function () {
|
||||
return this.replace(/\w\S*/g, function (txt) {
|
||||
return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase()
|
||||
})
|
||||
}
|
||||
|
||||
String.prototype.toBoolean = function () {
|
||||
return this === "true"
|
||||
}
|
||||
|
||||
Promise.tasked = function (promises) {
|
||||
return new Promise(async (resolve, reject) => {
|
||||
let rejected = false
|
||||
|
||||
for await (let promise of promises) {
|
||||
if (rejected) {
|
||||
return
|
||||
}
|
||||
|
||||
try {
|
||||
await promise()
|
||||
} catch (error) {
|
||||
rejected = true
|
||||
return reject(error)
|
||||
}
|
||||
}
|
||||
|
||||
if (!rejected) {
|
||||
return resolve()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
import React from "react"
|
||||
import ReactDOM from "react-dom"
|
||||
|
||||
import { EviteRuntime } from "evite"
|
||||
import { Helmet } from "react-helmet"
|
||||
import * as antd from "antd"
|
||||
import { Toast } from "antd-mobile"
|
||||
import { StatusBar, Style } from "@capacitor/status-bar"
|
||||
import { Translation } from "react-i18next"
|
||||
|
||||
import { Session, User } from "models"
|
||||
import config from "config"
|
||||
|
||||
import { NotFound, RenderError, Crash, Settings, Navigation, Login, UserRegister, Creator, Searcher } from "components"
|
||||
import { DOMWindow } from "components/RenderWindow"
|
||||
import loadable from "@loadable/component"
|
||||
|
||||
import { Icons } from "components/Icons"
|
||||
|
||||
import Layout from "./layout"
|
||||
import * as Router from "./router"
|
||||
|
||||
import "theme/index.less"
|
||||
|
||||
class App extends React.Component {
|
||||
sessionController = new Session()
|
||||
|
||||
userController = new User()
|
||||
|
||||
state = {
|
||||
session: null,
|
||||
user: null,
|
||||
}
|
||||
|
||||
static async initialize() {
|
||||
window.app.version = config.package.version
|
||||
|
||||
window.app.message = antd.message
|
||||
|
||||
// check if electron library is available
|
||||
if (typeof window.electron !== "undefined") {
|
||||
window.isElectron = true
|
||||
}
|
||||
|
||||
// if is electron app, append frame to body as first child
|
||||
if (window.isElectron) {
|
||||
const frame = document.createElement("div")
|
||||
const systemBarComponent = await import("components/Layout/systemBar")
|
||||
|
||||
frame.id = "systemBar"
|
||||
|
||||
ReactDOM.render(<systemBarComponent.default />, frame)
|
||||
|
||||
document.body.insertBefore(frame, document.body.firstChild)
|
||||
|
||||
// append var to #root
|
||||
document.getElementById("root").classList.add("electron")
|
||||
}
|
||||
}
|
||||
|
||||
static publicEvents = {
|
||||
"clearAllOverlays": function () {
|
||||
window.app.DrawerController.closeAll()
|
||||
},
|
||||
}
|
||||
|
||||
eventsHandlers = {
|
||||
"app.close": () => {
|
||||
if (window.isElectron) {
|
||||
window.electron.ipcRenderer.invoke("app.close")
|
||||
}
|
||||
},
|
||||
"app.minimize": () => {
|
||||
if (window.isElectron) {
|
||||
window.electron.ipcRenderer.invoke("app.minimize")
|
||||
}
|
||||
},
|
||||
"app.openSearcher": () => {
|
||||
return App.publicMethods.openSearcher()
|
||||
},
|
||||
"app.openCreator": (...args) => {
|
||||
return App.publicMethods.openCreator(...args)
|
||||
},
|
||||
"app.createLogin": async () => {
|
||||
app.DrawerController.open("login", Login, {
|
||||
componentProps: {
|
||||
sessionController: this.sessionController
|
||||
}
|
||||
})
|
||||
},
|
||||
"app.createRegister": async () => {
|
||||
app.DrawerController.open("Register", UserRegister, {
|
||||
allowMultiples: false,
|
||||
panel: true,
|
||||
})
|
||||
},
|
||||
"app.no_session": async () => {
|
||||
const location = window.location.pathname
|
||||
|
||||
if (location !== "/login" && location !== "/register") {
|
||||
antd.notification.info({
|
||||
message: "You are not logged in, to use some features you will need to log in.",
|
||||
btn: <antd.Button type="primary" onClick={() => app.goAuth()}>Login</antd.Button>,
|
||||
duration: 15,
|
||||
})
|
||||
}
|
||||
},
|
||||
"session.logout": async () => {
|
||||
await this.sessionController.logout()
|
||||
},
|
||||
"session.created": async () => {
|
||||
app.eventBus.emit("layout.animations.fadeOut")
|
||||
app.eventBus.emit("layout.render.lock")
|
||||
|
||||
await this.flushState()
|
||||
await this.initialization()
|
||||
|
||||
// if is `/login` move to `/`
|
||||
if (window.location.pathname === "/login") {
|
||||
app.setLocation("/")
|
||||
}
|
||||
|
||||
app.eventBus.emit("layout.render.unlock")
|
||||
app.eventBus.emit("layout.animations.fadeIn")
|
||||
},
|
||||
"session.destroyed": async () => {
|
||||
await this.flushState()
|
||||
app.eventBus.emit("app.forceToLogin")
|
||||
},
|
||||
"session.regenerated": async () => {
|
||||
//await this.flushState()
|
||||
//await this.initialization()
|
||||
},
|
||||
"session.invalid": async (error) => {
|
||||
const token = await Session.token
|
||||
|
||||
if (!this.state.session && !token) {
|
||||
return false
|
||||
}
|
||||
|
||||
await this.sessionController.forgetLocalSession()
|
||||
await this.flushState()
|
||||
|
||||
app.eventBus.emit("app.forceToLogin")
|
||||
|
||||
antd.notification.open({
|
||||
message: <Translation>
|
||||
{(t) => t("Invalid Session")}
|
||||
</Translation>,
|
||||
description: <Translation>
|
||||
{(t) => t(error)}
|
||||
</Translation>,
|
||||
icon: <Icons.MdOutlineAccessTimeFilled />,
|
||||
})
|
||||
},
|
||||
"app.forceToLogin": () => {
|
||||
window.app.setLocation("/login")
|
||||
},
|
||||
"api.ws.main.connect": () => {
|
||||
if (this.wsReconnecting) {
|
||||
this.wsReconnectingTry = 0
|
||||
this.wsReconnecting = false
|
||||
|
||||
setTimeout(() => {
|
||||
Toast.show({
|
||||
icon: "success",
|
||||
content: "Connected",
|
||||
})
|
||||
}, 500)
|
||||
}
|
||||
},
|
||||
"api.ws.main.connect_error": () => {
|
||||
if (!this.wsReconnecting) {
|
||||
this.wsReconnectingTry = 0
|
||||
this.wsReconnecting = true
|
||||
|
||||
Toast.show({
|
||||
icon: "loading",
|
||||
content: "Connecting...",
|
||||
duration: 0,
|
||||
})
|
||||
}
|
||||
|
||||
this.wsReconnectingTry = this.wsReconnectingTry + 1
|
||||
|
||||
if (this.wsReconnectingTry > 3 && app.settings.get("app.reloadOnWSConnectionError")) {
|
||||
window.location.reload()
|
||||
}
|
||||
},
|
||||
"api.ws.main.disconnect": () => {
|
||||
antd.notification.open({
|
||||
message: <Translation>
|
||||
{(t) => t("Disconnected")}
|
||||
</Translation>,
|
||||
description: <Translation>
|
||||
{(t) => t("You have been disconnected from the server, trying to reconnect.")}
|
||||
</Translation>
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
static staticRenders = {
|
||||
PageLoad: () => {
|
||||
return <antd.Skeleton active />
|
||||
},
|
||||
NotFound: (props) => {
|
||||
return <NotFound />
|
||||
},
|
||||
RenderError: (props) => {
|
||||
return <RenderError {...props} />
|
||||
},
|
||||
Crash: Crash.CrashWrapper,
|
||||
Initialization: () => {
|
||||
return <div className="app_splash_wrapper">
|
||||
<div className="splash_logo">
|
||||
<img src={config.logo.alt} />
|
||||
</div>
|
||||
<div className="splash_label">
|
||||
<Icons.LoadingOutlined />
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
|
||||
static publicMethods = {
|
||||
openSearcher: (options) => {
|
||||
window.app.ModalController.open((props) => <Searcher {...props} />)
|
||||
},
|
||||
openCreator: () => {
|
||||
window.app.ModalController.open((props) => <Creator {...props} />)
|
||||
},
|
||||
openSettings: (goTo) => {
|
||||
window.app.SidedrawerController.open("Settings", Settings, {
|
||||
props: {
|
||||
width: "fit-content",
|
||||
goTo,
|
||||
},
|
||||
allowMultiples: false,
|
||||
escClosable: true,
|
||||
})
|
||||
},
|
||||
openNavigationMenu: () => window.app.DrawerController.open("navigation", Navigation),
|
||||
goAuth: () => {
|
||||
return window.app.setLocation(config.app.authPath ?? "/auth")
|
||||
},
|
||||
goMain: () => {
|
||||
return window.app.setLocation(config.app.mainPath ?? "/home")
|
||||
},
|
||||
goToAccount: (username) => {
|
||||
return window.app.setLocation(`/@${username}`)
|
||||
},
|
||||
goToPost: (id) => {
|
||||
return window.app.setLocation(`/post/${id}`)
|
||||
},
|
||||
isAppCapacitor: () => window.navigator.userAgent === "capacitor",
|
||||
setStatusBarStyleDark: async () => {
|
||||
if (!window.app.isAppCapacitor()) {
|
||||
console.warn("[App] setStatusBarStyleDark is only available on capacitor")
|
||||
return false
|
||||
}
|
||||
return await StatusBar.setStyle({ style: Style.Dark })
|
||||
},
|
||||
setStatusBarStyleLight: async () => {
|
||||
if (!window.app.isAppCapacitor()) {
|
||||
console.warn("[App] setStatusBarStyleLight is not supported on this platform")
|
||||
return false
|
||||
}
|
||||
return await StatusBar.setStyle({ style: Style.Light })
|
||||
},
|
||||
hideStatusBar: async () => {
|
||||
if (!window.app.isAppCapacitor()) {
|
||||
console.warn("[App] hideStatusBar is not supported on this platform")
|
||||
return false
|
||||
}
|
||||
return await StatusBar.hide()
|
||||
},
|
||||
showStatusBar: async () => {
|
||||
if (!window.app.isAppCapacitor()) {
|
||||
console.warn("[App] showStatusBar is not supported on this platform")
|
||||
return false
|
||||
}
|
||||
return await StatusBar.show()
|
||||
},
|
||||
openDebugger: () => {
|
||||
// create a new dom window
|
||||
const win = new DOMWindow({
|
||||
id: "debug",
|
||||
title: "Debug",
|
||||
})
|
||||
|
||||
win.createDefaultWindow(loadable(() => import("./debug")))
|
||||
}
|
||||
}
|
||||
|
||||
constructor(props) {
|
||||
super(props)
|
||||
|
||||
Object.keys(this.eventsHandlers).forEach((event) => {
|
||||
app.eventBus.on(event, this.eventsHandlers[event])
|
||||
})
|
||||
}
|
||||
|
||||
flushState = async () => {
|
||||
await this.setState({ session: null, user: null })
|
||||
}
|
||||
|
||||
componentDidMount = async () => {
|
||||
if (window.app.isAppCapacitor()) {
|
||||
window.addEventListener("statusTap", () => {
|
||||
app.eventBus.emit("statusTap")
|
||||
})
|
||||
|
||||
StatusBar.setOverlaysWebView({ overlay: true })
|
||||
window.app.hideStatusBar()
|
||||
}
|
||||
|
||||
const userAgentPlatform = window.navigator.userAgent.toLowerCase()
|
||||
const isMac = userAgentPlatform.indexOf("mac") !== -1
|
||||
|
||||
this.props.cores.ShortcutsCore.register({
|
||||
id: "app.openSearcher",
|
||||
key: ",",
|
||||
meta: isMac,
|
||||
ctrl: !isMac,
|
||||
preventDefault: true,
|
||||
}, (...args) => {
|
||||
App.publicMethods.openSettings(...args)
|
||||
})
|
||||
|
||||
this.props.cores.ShortcutsCore.register({
|
||||
id: "app.openCreator",
|
||||
key: "k",
|
||||
meta: isMac,
|
||||
ctrl: !isMac,
|
||||
preventDefault: true,
|
||||
}, () => {
|
||||
App.publicMethods.openCreator()
|
||||
})
|
||||
|
||||
app.eventBus.emit("app.initialization.start")
|
||||
|
||||
await this.initialization()
|
||||
|
||||
app.eventBus.emit("app.initialization.finish")
|
||||
}
|
||||
|
||||
initialization = async () => {
|
||||
console.debug(`[App] Initializing app`)
|
||||
|
||||
const initializationTasks = [
|
||||
async () => {
|
||||
try {
|
||||
// get remotes origins from config
|
||||
const defaultRemotes = config.remotes
|
||||
|
||||
// get storaged remotes origins
|
||||
const storedRemotes = await app.settings.get("remotes") ?? {}
|
||||
|
||||
// mount main api bridge
|
||||
await this.props.cores.ApiCore.connectBridge("main", {
|
||||
origin: storedRemotes.mainApi ?? defaultRemotes.mainApi,
|
||||
locked: true,
|
||||
})
|
||||
|
||||
await this.props.cores.ApiCore.namespaces["main"].initialize()
|
||||
|
||||
app.eventBus.emit("app.initialization.api_success")
|
||||
} catch (error) {
|
||||
app.eventBus.emit("app.initialization.api_error", error)
|
||||
console.error(`[App] Error while initializing api`, error)
|
||||
|
||||
throw {
|
||||
cause: "Cannot connect to API",
|
||||
details: `Sorry but we cannot connect to the API. Please try again later. [${config.remotes.mainApi}]`,
|
||||
}
|
||||
}
|
||||
},
|
||||
async () => {
|
||||
try {
|
||||
await this.__SessionInit()
|
||||
|
||||
app.eventBus.emit("app.initialization.session_success")
|
||||
} catch (error) {
|
||||
app.eventBus.emit("app.initialization.session_error", error)
|
||||
|
||||
throw {
|
||||
cause: "Cannot initialize session",
|
||||
details: error.message,
|
||||
}
|
||||
}
|
||||
},
|
||||
async () => {
|
||||
try {
|
||||
await this.__UserInit()
|
||||
|
||||
app.eventBus.emit("app.initialization.user_success")
|
||||
} catch (error) {
|
||||
app.eventBus.emit("app.initialization.user_error", error)
|
||||
|
||||
throw {
|
||||
cause: "Cannot initialize user data",
|
||||
details: error.message,
|
||||
}
|
||||
}
|
||||
},
|
||||
]
|
||||
|
||||
await Promise.tasked(initializationTasks).catch((reason) => {
|
||||
console.error(`[App] Initialization failed: ${reason.cause}`)
|
||||
app.eventBus.emit("runtime.crash", {
|
||||
message: `App initialization failed (${reason.cause})`,
|
||||
details: reason.details,
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
__SessionInit = async () => {
|
||||
const token = await Session.token
|
||||
|
||||
if (!token || token == null) {
|
||||
app.eventBus.emit("app.no_session")
|
||||
return false
|
||||
}
|
||||
|
||||
const session = await this.sessionController.getCurrentSession().catch((error) => {
|
||||
console.error(`[App] Cannot get current session: ${error.message}`)
|
||||
return false
|
||||
})
|
||||
|
||||
await this.setState({ session })
|
||||
}
|
||||
|
||||
__UserInit = async () => {
|
||||
if (!this.state.session) {
|
||||
return false
|
||||
}
|
||||
|
||||
const user = await User.data()
|
||||
|
||||
await this.setState({ user })
|
||||
|
||||
const publicData = await User.publicData()
|
||||
|
||||
app.userData = {
|
||||
...publicData,
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
return <React.Fragment>
|
||||
<Helmet>
|
||||
<title>{config.app.siteName}</title>
|
||||
<meta name="og:description" content={config.app.siteDescription} />
|
||||
<meta property="og:title" content={config.app.siteName} />
|
||||
</Helmet>
|
||||
<antd.ConfigProvider>
|
||||
<Router.InternalRouter>
|
||||
<Layout
|
||||
user={this.state.user}
|
||||
staticRenders={App.staticRenders}
|
||||
bindProps={{
|
||||
staticRenders: App.staticRenders,
|
||||
user: this.state.user,
|
||||
session: this.state.session,
|
||||
sessionController: this.sessionController,
|
||||
userController: this.userController,
|
||||
}}
|
||||
>
|
||||
<Router.PageRender />
|
||||
</Layout>
|
||||
</Router.InternalRouter>
|
||||
</antd.ConfigProvider>
|
||||
</React.Fragment>
|
||||
}
|
||||
}
|
||||
|
||||
export default new EviteRuntime(App)
|
99
packages/app/src/components/AboutApp/index.jsx
Executable file
@ -0,0 +1,99 @@
|
||||
import React from "react"
|
||||
import ReactDOM from "react-dom"
|
||||
import * as antd from "antd"
|
||||
import { Card as ACard, Mask as AMask } from "antd-mobile"
|
||||
|
||||
import { Icons } from "components/Icons"
|
||||
|
||||
import config from "config"
|
||||
|
||||
import "./index.less"
|
||||
|
||||
export const Card = (props) => {
|
||||
const isProduction = import.meta.env.PROD
|
||||
|
||||
const [serverManifest, setServerManifest] = React.useState(null)
|
||||
|
||||
const checkServerVersion = async () => {
|
||||
const serverManifest = await app.api.customRequest("main")
|
||||
|
||||
setServerManifest(serverManifest.data)
|
||||
}
|
||||
|
||||
React.useEffect(() => {
|
||||
checkServerVersion()
|
||||
}, [])
|
||||
|
||||
return <ACard
|
||||
bodyClassName="aboutApp_card"
|
||||
headerClassName="aboutApp_card_header"
|
||||
title={
|
||||
<div className="content">
|
||||
<div className="branding">
|
||||
<h2>{config.app.siteName}</h2>
|
||||
<span>{config.author}</span>
|
||||
<span> Licensed with {config.package?.license ?? "unlicensed"} </span>
|
||||
</div>
|
||||
<div>
|
||||
<antd.Tag><Icons.Tag />v{window.app.version ?? "experimental"}</antd.Tag>
|
||||
<antd.Tag color={isProduction ? "green" : "magenta"}>
|
||||
{isProduction ? <Icons.CheckCircle /> : <Icons.Triangle />}
|
||||
{String(import.meta.env.MODE)}
|
||||
</antd.Tag>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
>
|
||||
<div className="group">
|
||||
<h3><Icons.GitMerge />Versions</h3>
|
||||
<div>
|
||||
<antd.Tag>Linebridge {serverManifest?.LINEBRIDGE_SERVER_VERSION ?? "Unknown"}</antd.Tag>
|
||||
<antd.Tag color="blue">React {React.version}</antd.Tag>
|
||||
<antd.Tag color="#ffec3d">eVite v{window.app.__eviteVersion ?? "experimental"}</antd.Tag>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="group">
|
||||
<h3><Icons.GitMerge />Server info</h3>
|
||||
<div>
|
||||
Server Time: {serverManifest?.requestTime ?? "Unknown"}
|
||||
</div>
|
||||
<div>
|
||||
Origin: {app.api.namespaces.main.origin ?? "Unknown"}
|
||||
</div>
|
||||
</div>
|
||||
</ACard>
|
||||
}
|
||||
|
||||
export const ModalCard = (props) => {
|
||||
const [visible, setVisible] = React.useState(false)
|
||||
|
||||
React.useEffect(() => {
|
||||
setVisible(true)
|
||||
}, [])
|
||||
|
||||
const close = () => {
|
||||
setVisible(false)
|
||||
setTimeout(() => {
|
||||
props.onClose()
|
||||
}, 150)
|
||||
}
|
||||
|
||||
return <AMask visible={visible} onMaskClick={() => close()}>
|
||||
<div className="aboutApp_wrapper">
|
||||
<Card />
|
||||
</div>
|
||||
</AMask >
|
||||
}
|
||||
|
||||
export function openModal() {
|
||||
const component = document.createElement("div")
|
||||
document.body.appendChild(component)
|
||||
|
||||
const onClose = () => {
|
||||
ReactDOM.unmountComponentAtNode(component)
|
||||
document.body.removeChild(component)
|
||||
}
|
||||
|
||||
ReactDOM.render(<ModalCard onClose={onClose} />, component)
|
||||
}
|
118
packages/app/src/components/AboutApp/index.less
Executable file
@ -0,0 +1,118 @@
|
||||
.adm-card {
|
||||
background-color: var(--background-color-accent);
|
||||
color: var(--text-color);
|
||||
|
||||
h1,
|
||||
h2,
|
||||
h3,
|
||||
h4,
|
||||
h5,
|
||||
h6,
|
||||
span,
|
||||
p {
|
||||
color: var(--text-color);
|
||||
}
|
||||
|
||||
.ant-tag {
|
||||
color: #1f1f1f;
|
||||
|
||||
svg {
|
||||
color: #1f1f1f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.adm-card-header:not(:last-child) {
|
||||
border-bottom: 1px solid var(--border-color);
|
||||
}
|
||||
|
||||
.aboutApp_wrapper {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
|
||||
background-color: var(--background-color-primary);
|
||||
color: var(--text-color);
|
||||
}
|
||||
|
||||
.aboutApp_card {
|
||||
height: fit-content;
|
||||
width: 80vw;
|
||||
|
||||
h1,
|
||||
h2,
|
||||
h3,
|
||||
h4,
|
||||
h5,
|
||||
h6,
|
||||
span,
|
||||
p {
|
||||
color: var(--text-color);
|
||||
}
|
||||
|
||||
svg {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.ant-tag {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.group {
|
||||
width: 100%;
|
||||
display: inline-flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
|
||||
>div {
|
||||
display: inline-flex;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.aboutApp_card_header {
|
||||
.adm-card-header-title {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.content {
|
||||
width: 100%;
|
||||
|
||||
display: inline-flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
|
||||
h1,
|
||||
h2,
|
||||
h3 {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.branding {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
h1,
|
||||
h2,
|
||||
h3 {
|
||||
height: fit-content;
|
||||
line-height: 24px;
|
||||
}
|
||||
|
||||
span {
|
||||
height: fit-content;
|
||||
color: var(--background-color-contrast);
|
||||
font-size: 10px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
27
packages/app/src/components/ActionsBar/index.jsx
Executable file
@ -0,0 +1,27 @@
|
||||
import React from "react"
|
||||
import classnames from "classnames"
|
||||
import "./index.less"
|
||||
|
||||
export default (props) => {
|
||||
const { children } = props
|
||||
|
||||
return <div
|
||||
style={{
|
||||
...props.style,
|
||||
padding: props.padding,
|
||||
}}
|
||||
className={classnames(
|
||||
"actionsBar",
|
||||
[props.mode],
|
||||
{["transparent"]: props.type === "transparent"},
|
||||
{["spaced"]: props.spaced},
|
||||
)}
|
||||
>
|
||||
<div
|
||||
style={props.wrapperStyle}
|
||||
className="wrapper"
|
||||
>
|
||||
{children}
|
||||
</div>
|
||||
</div>
|
||||
}
|
100
packages/app/src/components/ActionsBar/index.less
Executable file
@ -0,0 +1,100 @@
|
||||
@actionsBar_height: fit-content;
|
||||
|
||||
.actionsBar {
|
||||
--ignore-dragger: true;
|
||||
display: inline-block;
|
||||
white-space: nowrap;
|
||||
|
||||
overflow-x: overlay;
|
||||
|
||||
padding: 15px;
|
||||
|
||||
width: 100%;
|
||||
height: @actionsBar_height;
|
||||
|
||||
border: 1px solid #e0e0e0;
|
||||
border-radius: 8px;
|
||||
|
||||
background-color: #0c0c0c15;
|
||||
|
||||
backdrop-filter: blur(10px);
|
||||
--webkit-backdrop-filter: blur(10px);
|
||||
|
||||
transition: all 200ms ease-in-out;
|
||||
|
||||
::-webkit-scrollbar {
|
||||
position: absolute;
|
||||
display: none;
|
||||
|
||||
width: 0;
|
||||
height: 0;
|
||||
z-index: 0;
|
||||
}
|
||||
|
||||
.wrapper {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
|
||||
height: 100%;
|
||||
transition: all 200ms ease-in-out;
|
||||
|
||||
> div {
|
||||
margin: 0 5px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
justify-content: center;
|
||||
--ignore-dragger: true;
|
||||
|
||||
span {
|
||||
height: fit-content;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&.float {
|
||||
z-index: 1000;
|
||||
position: sticky;
|
||||
bottom: 0;
|
||||
top: 0;
|
||||
right: 0;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
&.fixedBottom {
|
||||
z-index: 1000;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
&.fixedTop {
|
||||
z-index: 1000;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
right: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
&.transparent {
|
||||
background-color: transparent;
|
||||
border: none;
|
||||
backdrop-filter: none;
|
||||
--webkit-backdrop-filter: none;
|
||||
}
|
||||
|
||||
&.spaced {
|
||||
.wrapper {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
}
|
204
packages/app/src/components/AdminTools/UserDataManager/index.jsx
Executable file
@ -0,0 +1,204 @@
|
||||
import React from "react"
|
||||
import * as antd from "antd"
|
||||
import debounce from "lodash/debounce"
|
||||
import { Translation } from "react-i18next"
|
||||
|
||||
import { ActionsBar } from "components"
|
||||
import { Icons } from "components/Icons"
|
||||
|
||||
import "./index.less"
|
||||
|
||||
export const EditAccountField = ({ id, component, props, header, handleChange, delay, defaultValue, allowEmpty }) => {
|
||||
const [currentValue, setCurrentValue] = React.useState(defaultValue)
|
||||
const [emittedValue, setEmittedValue] = React.useState(null)
|
||||
|
||||
const debouncedHandleChange = React.useCallback(
|
||||
debounce((value) => handleChange({ id, value }), delay ?? 300),
|
||||
[],
|
||||
)
|
||||
|
||||
const handleDiscard = (event) => {
|
||||
if (typeof event !== "undefined") {
|
||||
event.target.blur()
|
||||
}
|
||||
|
||||
setCurrentValue(defaultValue)
|
||||
handleChange({ id, value: defaultValue })
|
||||
}
|
||||
|
||||
React.useEffect(() => {
|
||||
debouncedHandleChange(currentValue)
|
||||
}, [emittedValue])
|
||||
|
||||
const onChange = (event) => {
|
||||
event.persist()
|
||||
let { value } = event.target
|
||||
|
||||
if (typeof value === "string") {
|
||||
if (value.length === 0) {
|
||||
// if is not allowed to be empty, discard modifications
|
||||
if (!allowEmpty) {
|
||||
return handleDiscard(event)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
setCurrentValue(value)
|
||||
setEmittedValue(value)
|
||||
}
|
||||
|
||||
const handleKeyDown = (event) => {
|
||||
if (event.keyCode === 27) {
|
||||
// "escape" pressed, reset to default value
|
||||
handleDiscard(event)
|
||||
}
|
||||
}
|
||||
|
||||
const RenderComponent = component
|
||||
|
||||
return (
|
||||
<div key={id} className="edit_account_field">
|
||||
{header ? header : null}
|
||||
<RenderComponent {...props} value={currentValue} id={id} onChange={onChange} onKeyDown={handleKeyDown} />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default class UserDataManager extends React.Component {
|
||||
state = {
|
||||
data: this.props.user,
|
||||
changes: [],
|
||||
loading: false,
|
||||
}
|
||||
|
||||
api = window.app.api.withEndpoints("main")
|
||||
|
||||
componentDidMount = async () => {
|
||||
if (!this.props.user && this.props.userId) {
|
||||
// TODO: Fetch from API
|
||||
}
|
||||
}
|
||||
|
||||
handleSave = async () => {
|
||||
if (!Array.isArray(this.state.changes)) {
|
||||
antd.message.error("Something went wrong")
|
||||
console.error("Changes should be an array")
|
||||
return false
|
||||
}
|
||||
|
||||
await this.setState({ loading: true })
|
||||
const update = {}
|
||||
|
||||
this.state.changes.forEach((change) => {
|
||||
update[change.id] = change.value
|
||||
})
|
||||
|
||||
const result = await this.api.post.updateUser({ _id: this.state.data._id, update }).catch((err) => {
|
||||
antd.message.error(err.message)
|
||||
console.error(err)
|
||||
return false
|
||||
})
|
||||
|
||||
await this.setState({ changes: [], loading: false })
|
||||
|
||||
if (typeof this.props.onSave === "function") {
|
||||
await this.props.onSave(this.state.changes)
|
||||
}
|
||||
|
||||
if (result) {
|
||||
if (typeof this.props.handleDone === "function") {
|
||||
this.props.handleDone(result)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
handleChange = (event) => {
|
||||
const { id, value } = event
|
||||
let changes = [...this.state.changes]
|
||||
|
||||
changes = changes.filter((change) => change.id !== id)
|
||||
|
||||
if (this.state.data[id] !== value) {
|
||||
changes.push({ id, value })
|
||||
}
|
||||
|
||||
this.setState({ changes })
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div className="edit_account">
|
||||
<div className="edit_account_wrapper">
|
||||
<div className="edit_account_category">
|
||||
<h2>
|
||||
<Icons.User /> Account information
|
||||
</h2>
|
||||
<EditAccountField
|
||||
id="username"
|
||||
defaultValue={this.state.data.username}
|
||||
header={
|
||||
<div>
|
||||
<Icons.Tag /> Username
|
||||
</div>
|
||||
}
|
||||
component={antd.Input}
|
||||
props={{
|
||||
placeholder: "Username",
|
||||
disabled: true,
|
||||
}}
|
||||
handleChange={this.handleChange}
|
||||
/>
|
||||
<EditAccountField
|
||||
id="fullName"
|
||||
defaultValue={this.state.data.fullName}
|
||||
header={
|
||||
<div>
|
||||
<Icons.User /> Name
|
||||
</div>
|
||||
}
|
||||
component={antd.Input}
|
||||
props={{
|
||||
placeholder: "Your full name",
|
||||
}}
|
||||
handleChange={this.handleChange}
|
||||
/>
|
||||
<EditAccountField
|
||||
id="email"
|
||||
defaultValue={this.state.data.email}
|
||||
header={
|
||||
<div>
|
||||
<Icons.Mail /> Email
|
||||
</div>
|
||||
}
|
||||
component={antd.Input}
|
||||
props={{
|
||||
placeholder: "Your email address",
|
||||
type: "email",
|
||||
}}
|
||||
handleChange={this.handleChange}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<ActionsBar spaced>
|
||||
<div>
|
||||
{this.state.changes.length} <Translation>
|
||||
{(t) => t("Changes")}
|
||||
</Translation>
|
||||
</div>
|
||||
<div>
|
||||
<antd.Button
|
||||
type="primary"
|
||||
loading={this.state.loading}
|
||||
disabled={this.state.loading}
|
||||
onClick={this.handleSave}
|
||||
>
|
||||
<Translation>
|
||||
{(t) => t("Save")}
|
||||
</Translation>
|
||||
</antd.Button>
|
||||
</div>
|
||||
</ActionsBar>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
61
packages/app/src/components/AdminTools/UserDataManager/index.less
Executable file
@ -0,0 +1,61 @@
|
||||
.edit_account{
|
||||
overflow: hidden!important;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.edit_account_wrapper{
|
||||
overflow: scroll;
|
||||
> div {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
.edit_account_actions {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
width: 100%;
|
||||
padding: 20px 0 20px 0;
|
||||
background-color: rgba(221, 221, 221, 0.5);
|
||||
backdrop-filter: blur(2px);
|
||||
--webkit-backdrop-filter: blur(2px);
|
||||
border-radius: 18px 18px 0 0;
|
||||
|
||||
transition: all 0.3s ease-in-out;
|
||||
|
||||
display: none;
|
||||
opacity: 0;
|
||||
|
||||
&.show {
|
||||
display: flex;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
> div {
|
||||
margin-left: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
.edit_account_actions_indicator{
|
||||
position: fixed;
|
||||
left: 0;
|
||||
margin-left: 30px;
|
||||
}
|
||||
|
||||
.edit_account_category{
|
||||
> div {
|
||||
margin-bottom: 20px;
|
||||
margin-left: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
.edit_account_field {
|
||||
input:not(:focus){
|
||||
color:rgba(105, 105, 105, 0.5)
|
||||
}
|
||||
}
|
140
packages/app/src/components/AdminTools/UserRolesManager/index.jsx
Executable file
@ -0,0 +1,140 @@
|
||||
import React from "react"
|
||||
import * as antd from "antd"
|
||||
|
||||
import { ActionsBar, UserSelector, Skeleton } from "components"
|
||||
import { Icons } from "components/Icons"
|
||||
|
||||
import "./index.less"
|
||||
|
||||
export default class UserRolesManager extends React.Component {
|
||||
state = {
|
||||
users: null,
|
||||
roles: null,
|
||||
}
|
||||
|
||||
api = window.app.api.withEndpoints("main")
|
||||
|
||||
componentDidMount = async () => {
|
||||
await this.fetchRoles()
|
||||
|
||||
if (typeof this.props.id !== "undefined") {
|
||||
const ids = Array.isArray(this.props.id) ? this.props.id : [this.props.id]
|
||||
await this.fetchUsersData(ids)
|
||||
}
|
||||
}
|
||||
|
||||
fetchRoles = async () => {
|
||||
const result = await this.api.get.roles().catch((err) => {
|
||||
antd.message.error(err)
|
||||
console.error(err)
|
||||
return false
|
||||
})
|
||||
|
||||
if (result) {
|
||||
this.setState({ roles: result })
|
||||
}
|
||||
}
|
||||
|
||||
fetchUsersData = async (users) => {
|
||||
const result = await this.api.get.users(undefined, { _id: users }).catch((err) => {
|
||||
antd.message.error(err)
|
||||
console.error(err)
|
||||
return false
|
||||
})
|
||||
|
||||
if (result) {
|
||||
this.setState({
|
||||
users: result.map((data) => {
|
||||
return {
|
||||
_id: data._id,
|
||||
username: data.username,
|
||||
roles: data.roles,
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
handleSelectUser = async (users) => {
|
||||
this.fetchUsersData(users)
|
||||
}
|
||||
|
||||
handleRoleChange = (userId, role, to) => {
|
||||
let updatedUsers = this.state.users.map((user) => {
|
||||
if (user._id === userId) {
|
||||
if (to == true) {
|
||||
user.roles.push(role)
|
||||
} else {
|
||||
user.roles = user.roles.filter((r) => r !== role)
|
||||
}
|
||||
}
|
||||
|
||||
return user
|
||||
})
|
||||
|
||||
this.setState({ users: updatedUsers })
|
||||
}
|
||||
|
||||
handleSubmit = async () => {
|
||||
const update = this.state.users.map((data) => {
|
||||
return {
|
||||
_id: data._id,
|
||||
roles: data.roles,
|
||||
}
|
||||
})
|
||||
|
||||
const result = await this.api.post.updateUserRoles({ update }).catch((err) => {
|
||||
antd.message.error(err)
|
||||
console.error(err)
|
||||
return false
|
||||
})
|
||||
|
||||
if (result) {
|
||||
this.props.handleDone(result)
|
||||
if (typeof this.props.close === "function") {
|
||||
this.props.close()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
renderItem = (item) => {
|
||||
return <div className="grantRoles_user">
|
||||
<h2>
|
||||
<Icons.User /> {item.username}
|
||||
</h2>
|
||||
<div className="roles">
|
||||
{this.state.roles.map((role) => {
|
||||
return <antd.Checkbox
|
||||
key={role.name}
|
||||
checked={item.roles.includes(role.name)}
|
||||
onChange={(to) => this.handleRoleChange(item._id, role.name, to.target.checked)}
|
||||
>
|
||||
{role.name}
|
||||
</antd.Checkbox>
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
render() {
|
||||
const { users } = this.state
|
||||
|
||||
if (!users) {
|
||||
return <UserSelector handleDone={this.handleSelectUser} />
|
||||
}
|
||||
|
||||
return <div>
|
||||
{users.map((data) => {
|
||||
return this.renderItem(data)
|
||||
})}
|
||||
|
||||
<ActionsBar>
|
||||
<div>
|
||||
<antd.Button icon={<Icons.Save />} onClick={() => this.handleSubmit()}>
|
||||
Submit
|
||||
</antd.Button>
|
||||
</div>
|
||||
</ActionsBar>
|
||||
</div>
|
||||
}
|
||||
}
|
19
packages/app/src/components/AdminTools/UserRolesManager/index.less
Executable file
@ -0,0 +1,19 @@
|
||||
.grantRoles_user {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.roles {
|
||||
display: inline-flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
|
||||
padding: 10px;
|
||||
border-radius: 8px;
|
||||
|
||||
background-color: var(--background-color-accent);
|
||||
}
|
||||
|
||||
> div {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
}
|
41
packages/app/src/components/AdminTools/index.js
Executable file
@ -0,0 +1,41 @@
|
||||
import UserDataManager from "./UserDataManager"
|
||||
import UserRolesManager from "./UserRolesManager"
|
||||
|
||||
export { UserDataManager, UserRolesManager }
|
||||
|
||||
export const open = {
|
||||
dataManager: (user) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
window.app.DrawerController.open("UserDataManager", UserDataManager, {
|
||||
componentProps: {
|
||||
user: user,
|
||||
},
|
||||
onDone: (ctx, value) => {
|
||||
resolve(value)
|
||||
ctx.close()
|
||||
},
|
||||
onFail: (ctx, value) => {
|
||||
reject(value)
|
||||
ctx.close()
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
rolesManager: (id) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
window.app.DrawerController.open("UserRolesManager", UserRolesManager, {
|
||||
componentProps: {
|
||||
id: id,
|
||||
},
|
||||
onDone: (ctx, value) => {
|
||||
resolve(value)
|
||||
ctx.close()
|
||||
},
|
||||
onFail: (ctx, value) => {
|
||||
reject(value)
|
||||
ctx.close()
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
61
packages/app/src/components/AppSearcher/index.jsx
Executable file
@ -0,0 +1,61 @@
|
||||
import React from "react"
|
||||
import * as antd from "antd"
|
||||
import "./index.less"
|
||||
|
||||
class Results extends React.Component {
|
||||
state = {
|
||||
results: this.props.results ?? []
|
||||
}
|
||||
|
||||
renderResults = () => {
|
||||
return this.state.results.map(result => {
|
||||
return <div id={result.id}>
|
||||
{result.title}
|
||||
</div>
|
||||
})
|
||||
}
|
||||
|
||||
render() {
|
||||
return <div>
|
||||
{this.renderResults()}
|
||||
</div>
|
||||
}
|
||||
}
|
||||
|
||||
export default class AppSearcher extends React.Component {
|
||||
state = {
|
||||
loading: false,
|
||||
searchResult: null,
|
||||
}
|
||||
|
||||
handleSearch = (value) => {
|
||||
let results = []
|
||||
|
||||
// get results
|
||||
results.push({ id: value, title: value })
|
||||
|
||||
// storage results
|
||||
this.setState({ searchResult: results })
|
||||
|
||||
// open results onlayout drawer
|
||||
this.openResults()
|
||||
}
|
||||
|
||||
openResults = () => {
|
||||
window.app.SidedrawerController.render(() => <Results results={this.state.searchResult} />)
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div>
|
||||
<antd.Input.Search
|
||||
style={{ width: this.props.width }}
|
||||
className="search_bar"
|
||||
placeholder="Search on app..."
|
||||
loading={this.state.loading}
|
||||
onSearch={this.handleSearch}
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
34
packages/app/src/components/AppSearcher/index.less
Executable file
@ -0,0 +1,34 @@
|
||||
@import "theme/index.less";
|
||||
|
||||
.search_bar {
|
||||
user-select: none;
|
||||
--webkit-user-select: none;
|
||||
|
||||
height: fit-content;
|
||||
border: 0;
|
||||
border-radius: 7px !important;
|
||||
vertical-align: middle !important;
|
||||
|
||||
.ant-input {
|
||||
background-color: var(--background-color-accent) !important;
|
||||
border-color: var(--background-color-accent) !important;
|
||||
color: var(--background-color-contrast) !important;
|
||||
}
|
||||
|
||||
.ant-input-group {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: fit-content;
|
||||
}
|
||||
|
||||
.ant-input-group-addon {
|
||||
width: fit-content;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.ant-btn {
|
||||
background-color: var(--background-color-primary) !important;
|
||||
border: 0 !important;
|
||||
}
|
||||
}
|
17
packages/app/src/components/Clock/index.jsx
Executable file
@ -0,0 +1,17 @@
|
||||
import React from "react"
|
||||
|
||||
import "./index.less"
|
||||
|
||||
export default () => {
|
||||
const [time, setTime] = React.useState(new Date())
|
||||
|
||||
React.useEffect(() => {
|
||||
const interval = setInterval(() => {
|
||||
setTime(new Date())
|
||||
}, 1000)
|
||||
|
||||
return () => clearInterval(interval)
|
||||
}, [])
|
||||
|
||||
return <div className="clock">{time.toLocaleTimeString()}</div>
|
||||
}
|
0
.vscode-janus-debug → packages/app/src/components/Clock/index.less
Normal file → Executable file
82
packages/app/src/components/CommentCreator/index.jsx
Executable file
@ -0,0 +1,82 @@
|
||||
import React from "react"
|
||||
import * as antd from "antd"
|
||||
import { Icons } from "components/Icons"
|
||||
|
||||
import "./index.less"
|
||||
|
||||
export default (props) => {
|
||||
const [value, setValue] = React.useState(null)
|
||||
const [loading, setLoading] = React.useState(false)
|
||||
|
||||
const submit = async () => {
|
||||
if (!canSubmit()) return
|
||||
|
||||
if (typeof props.onSubmit !== "function") {
|
||||
console.warn("No `onSubmit` handler provided")
|
||||
return
|
||||
}
|
||||
|
||||
setLoading(true)
|
||||
|
||||
try {
|
||||
await props.onSubmit(value)
|
||||
} catch (error) {
|
||||
|
||||
}
|
||||
|
||||
setLoading(false)
|
||||
setValue(null)
|
||||
}
|
||||
|
||||
const handleChange = (e) => {
|
||||
if (e.target.value === "") {
|
||||
return setValue(null)
|
||||
}
|
||||
|
||||
// if post only have whitespaces, dont allow to submit
|
||||
if (e.target.value.trim() === "") {
|
||||
return setValue("")
|
||||
}
|
||||
|
||||
return setValue(String(e.target.value))
|
||||
}
|
||||
|
||||
const handleKeyDown = (e) => {
|
||||
// detect if the user pressed `enter` key and submit the form, but only if the `shift` key is not pressed
|
||||
if (e.keyCode === 13 && !e.shiftKey) {
|
||||
e.preventDefault()
|
||||
e.stopPropagation()
|
||||
|
||||
submit()
|
||||
}
|
||||
}
|
||||
|
||||
const canSubmit = () => {
|
||||
if (loading) return false
|
||||
|
||||
if (value === null) return false
|
||||
|
||||
if (value === "") return false
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
return <div className="commentCreator">
|
||||
<antd.Input.TextArea
|
||||
placeholder="Write a comment..."
|
||||
autoSize={{ minRows: 2, maxRows: 6 }}
|
||||
onChange={handleChange}
|
||||
onKeyDown={handleKeyDown}
|
||||
maxLength={props.maxLength}
|
||||
draggable={false}
|
||||
disabled={loading}
|
||||
value={value}
|
||||
/>
|
||||
<antd.Button
|
||||
type="primary"
|
||||
disabled={loading || !canSubmit()}
|
||||
icon={loading ? <Icons.LoadingOutlined spin /> : <Icons.Send />}
|
||||
onClick={submit}
|
||||
/>
|
||||
</div>
|
||||
}
|