underpost 2.6.3 → 2.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (216) hide show
  1. package/.dockerignore +13 -13
  2. package/.env.development +7 -7
  3. package/.env.production +7 -7
  4. package/.env.test +7 -7
  5. package/.github/workflows/publish.yml +26 -0
  6. package/.nycrc +9 -9
  7. package/.prettierignore +12 -12
  8. package/.prettierrc +9 -9
  9. package/.vscode/extensions.json +72 -72
  10. package/.vscode/settings.json +100 -99
  11. package/AUTHORS.md +10 -0
  12. package/CHANGELOG.md +91 -0
  13. package/Dockerfile +89 -89
  14. package/LICENSE +21 -21
  15. package/README.md +96 -96
  16. package/bin/db.js +172 -119
  17. package/bin/deploy.js +582 -626
  18. package/bin/dns.js +1 -1
  19. package/bin/file.js +92 -92
  20. package/bin/index.js +53 -34
  21. package/bin/install.js +398 -357
  22. package/bin/shortcut.js +44 -44
  23. package/bin/ssl.js +65 -61
  24. package/bin/util.js +182 -182
  25. package/bin/vs.js +35 -35
  26. package/conf.js +251 -249
  27. package/docker-compose.yml +67 -67
  28. package/jsconfig.json +7 -7
  29. package/jsdoc.json +32 -32
  30. package/nodemon.json +6 -6
  31. package/package.json +137 -128
  32. package/prometheus.yml +36 -36
  33. package/setup.sh +24 -24
  34. package/src/api/core/core.controller.js +69 -69
  35. package/src/api/core/core.model.js +11 -11
  36. package/src/api/core/core.router.js +23 -23
  37. package/src/api/core/core.service.js +29 -29
  38. package/src/api/crypto/crypto.controller.js +51 -51
  39. package/src/api/crypto/crypto.model.js +23 -23
  40. package/src/api/crypto/crypto.router.js +20 -20
  41. package/src/api/crypto/crypto.service.js +64 -64
  42. package/src/api/default/default.controller.js +69 -69
  43. package/src/api/default/default.model.js +20 -20
  44. package/src/api/default/default.router.js +23 -23
  45. package/src/api/default/default.service.js +31 -31
  46. package/src/api/file/file.controller.js +53 -51
  47. package/src/api/file/file.model.js +19 -19
  48. package/src/api/file/file.router.js +21 -20
  49. package/src/api/file/file.service.js +76 -70
  50. package/src/api/instance/instance.controller.js +69 -69
  51. package/src/api/instance/instance.model.js +36 -36
  52. package/src/api/instance/instance.router.js +33 -33
  53. package/src/api/instance/instance.service.js +48 -48
  54. package/src/api/test/test.controller.js +59 -59
  55. package/src/api/test/test.model.js +14 -14
  56. package/src/api/test/test.router.js +21 -21
  57. package/src/api/test/test.service.js +35 -35
  58. package/src/api/user/user.build.js +16 -0
  59. package/src/api/user/user.controller.js +70 -70
  60. package/src/api/user/user.model.js +65 -65
  61. package/src/api/user/user.router.js +345 -345
  62. package/src/api/user/user.service.js +479 -479
  63. package/src/api.js +23 -23
  64. package/src/client/Default.index.js +40 -40
  65. package/src/client/components/core/Account.js +290 -290
  66. package/src/client/components/core/AgGrid.js +160 -160
  67. package/src/client/components/core/Auth.js +19 -19
  68. package/src/client/components/core/Badge.js +32 -32
  69. package/src/client/components/core/BlockChain.js +41 -41
  70. package/src/client/components/core/Blog.js +9 -9
  71. package/src/client/components/core/BtnIcon.js +101 -94
  72. package/src/client/components/core/CalendarCore.js +458 -319
  73. package/src/client/components/core/Chat.js +64 -64
  74. package/src/client/components/core/ColorPalette.js +5267 -5267
  75. package/src/client/components/core/CommonJs.js +735 -732
  76. package/src/client/components/core/Content.js +193 -49
  77. package/src/client/components/core/Css.js +1064 -1027
  78. package/src/client/components/core/CssCore.js +817 -796
  79. package/src/client/components/core/D3Chart.js +44 -44
  80. package/src/client/components/core/Docs.js +229 -229
  81. package/src/client/components/core/DropDown.js +164 -164
  82. package/src/client/components/core/EventsUI.js +46 -54
  83. package/src/client/components/core/FileExplorer.js +699 -624
  84. package/src/client/components/core/FullScreen.js +45 -45
  85. package/src/client/components/core/Input.js +346 -259
  86. package/src/client/components/core/JoyStick.js +77 -77
  87. package/src/client/components/core/Keyboard.js +73 -73
  88. package/src/client/components/core/LoadingAnimation.js +179 -157
  89. package/src/client/components/core/LogIn.js +187 -181
  90. package/src/client/components/core/LogOut.js +58 -52
  91. package/src/client/components/core/Logger.js +26 -26
  92. package/src/client/components/core/Modal.js +1612 -1596
  93. package/src/client/components/core/NotificationManager.js +84 -84
  94. package/src/client/components/core/Panel.js +613 -413
  95. package/src/client/components/core/PanelForm.js +468 -0
  96. package/src/client/components/core/Polyhedron.js +162 -162
  97. package/src/client/components/core/Recover.js +204 -204
  98. package/src/client/components/core/Responsive.js +53 -53
  99. package/src/client/components/core/RichText.js +51 -27
  100. package/src/client/components/core/Router.js +76 -77
  101. package/src/client/components/core/Scroll.js +34 -0
  102. package/src/client/components/core/SignUp.js +125 -125
  103. package/src/client/components/core/SocketIo.js +72 -72
  104. package/src/client/components/core/Stream.js +113 -113
  105. package/src/client/components/core/ToggleSwitch.js +87 -87
  106. package/src/client/components/core/ToolTip.js +26 -26
  107. package/src/client/components/core/Translate.js +437 -408
  108. package/src/client/components/core/Validator.js +100 -100
  109. package/src/client/components/core/VanillaJs.js +460 -457
  110. package/src/client/components/core/Wallet.js +106 -106
  111. package/src/client/components/core/Webhook.js +25 -25
  112. package/src/client/components/core/Worker.js +272 -272
  113. package/src/client/components/default/CommonDefault.js +29 -29
  114. package/src/client/components/default/CssDefault.js +13 -13
  115. package/src/client/components/default/ElementsDefault.js +38 -38
  116. package/src/client/components/default/LogInDefault.js +41 -41
  117. package/src/client/components/default/LogOutDefault.js +28 -28
  118. package/src/client/components/default/MenuDefault.js +389 -389
  119. package/src/client/components/default/RoutesDefault.js +48 -48
  120. package/src/client/components/default/SettingsDefault.js +16 -16
  121. package/src/client/components/default/SignUpDefault.js +9 -9
  122. package/src/client/components/default/SocketIoDefault.js +54 -54
  123. package/src/client/components/default/TranslateDefault.js +7 -7
  124. package/src/client/public/default/assets/mailer/api-user-check.png +0 -0
  125. package/src/client/public/default/assets/mailer/api-user-invalid-token.png +0 -0
  126. package/src/client/public/default/assets/mailer/api-user-recover.png +0 -0
  127. package/src/client/public/default/browserconfig.xml +11 -11
  128. package/src/client/public/default/manifest.webmanifest +68 -68
  129. package/src/client/public/default/plantuml/client-conf.svg +1 -0
  130. package/src/client/public/default/plantuml/client-schema.svg +1 -0
  131. package/src/client/public/default/plantuml/cron-conf.svg +1 -0
  132. package/src/client/public/default/plantuml/cron-schema.svg +1 -0
  133. package/src/client/public/default/plantuml/server-conf.svg +1 -0
  134. package/src/client/public/default/plantuml/server-schema.svg +1 -0
  135. package/src/client/public/default/plantuml/ssr-conf.svg +1 -0
  136. package/src/client/public/default/plantuml/ssr-schema.svg +1 -0
  137. package/src/client/public/default/sitemap +147 -147
  138. package/src/client/public/default/yandex-browser-manifest.json +8 -8
  139. package/src/client/public/doc/sitemap +147 -147
  140. package/src/client/public/test/sitemap +147 -147
  141. package/src/client/services/core/core.service.js +170 -152
  142. package/src/client/services/crypto/crypto.service.js +70 -70
  143. package/src/client/services/default/default.management.js +345 -345
  144. package/src/client/services/default/default.service.js +89 -89
  145. package/src/client/services/file/file.service.js +70 -70
  146. package/src/client/services/instance/instance.management.js +74 -74
  147. package/src/client/services/instance/instance.service.js +89 -89
  148. package/src/client/services/test/test.service.js +70 -70
  149. package/src/client/services/user/user.management.js +50 -50
  150. package/src/client/services/user/user.service.js +89 -89
  151. package/src/client/ssr/Render.js +16 -16
  152. package/src/client/ssr/body-components/CacheControl.js +114 -113
  153. package/src/client/ssr/body-components/DefaultSplashScreen.js +79 -79
  154. package/src/client/ssr/email-components/DefaultRecoverEmail.js +21 -21
  155. package/src/client/ssr/email-components/DefaultVerifyEmail.js +17 -17
  156. package/src/client/ssr/head-components/Css.js +241 -241
  157. package/src/client/ssr/head-components/DefaultScripts.js +3 -3
  158. package/src/client/ssr/head-components/Microdata.js +11 -11
  159. package/src/client/ssr/head-components/Production.js +1 -1
  160. package/src/client/ssr/head-components/PwaDefault.js +59 -59
  161. package/src/client/ssr/head-components/Seo.js +14 -14
  162. package/src/client/sw/default.sw.js +201 -201
  163. package/src/client/sw/template.sw.js +84 -84
  164. package/src/client.build.js +22 -22
  165. package/src/client.dev.js +21 -21
  166. package/src/cron.js +25 -25
  167. package/src/db/DataBaseProvider.js +34 -34
  168. package/src/db/mariadb/MariaDB.js +33 -33
  169. package/src/db/mongo/MongooseDB.js +46 -46
  170. package/src/dns.js +22 -22
  171. package/src/index.js +42 -0
  172. package/src/mailer/EmailRender.js +69 -69
  173. package/src/mailer/MailerProvider.js +96 -96
  174. package/src/proxy.js +22 -22
  175. package/src/runtime/lampp/Lampp.js +69 -44
  176. package/src/runtime/nginx/Nginx.js +3 -3
  177. package/src/runtime/xampp/Xampp.js +49 -49
  178. package/src/server/auth.js +235 -204
  179. package/src/server/backup.js +101 -84
  180. package/src/server/client-build-live.js +72 -72
  181. package/src/server/client-build.js +705 -699
  182. package/src/server/client-dev-server.js +60 -58
  183. package/src/server/client-formatted.js +48 -48
  184. package/src/server/client-icons.js +149 -150
  185. package/src/server/conf.js +860 -611
  186. package/src/server/dns.js +98 -87
  187. package/src/server/downloader.js +42 -42
  188. package/src/server/logger.js +180 -135
  189. package/src/server/network.js +122 -122
  190. package/src/server/peer.js +33 -33
  191. package/src/server/process.js +66 -66
  192. package/src/server/prompt-optimizer.js +28 -0
  193. package/src/server/proxy.js +118 -118
  194. package/src/server/runtime.js +444 -393
  195. package/src/server/ssl.js +109 -107
  196. package/src/server.js +25 -25
  197. package/src/ws/IoInterface.js +45 -45
  198. package/src/ws/IoServer.js +39 -39
  199. package/src/ws/core/channels/core.ws.chat.js +23 -23
  200. package/src/ws/core/channels/core.ws.mailer.js +35 -35
  201. package/src/ws/core/channels/core.ws.stream.js +31 -31
  202. package/src/ws/core/core.ws.connection.js +28 -28
  203. package/src/ws/core/core.ws.emit.js +14 -14
  204. package/src/ws/core/core.ws.server.js +24 -24
  205. package/src/ws/core/management/core.ws.chat.js +8 -8
  206. package/src/ws/core/management/core.ws.mailer.js +16 -16
  207. package/src/ws/core/management/core.ws.stream.js +8 -8
  208. package/src/ws/default/channels/default.ws.main.js +16 -16
  209. package/src/ws/default/default.ws.connection.js +22 -22
  210. package/src/ws/default/default.ws.emit.js +14 -14
  211. package/src/ws/default/default.ws.server.js +20 -20
  212. package/src/ws/default/management/default.ws.main.js +8 -8
  213. package/startup.js +11 -11
  214. package/supervisord-openssh-server.conf +4 -4
  215. package/test/api.test.js +60 -60
  216. package/bin/help.js +0 -110
@@ -1,181 +1,187 @@
1
- import { CoreService } from '../../services/core/core.service.js';
2
- import { FileService } from '../../services/file/file.service.js';
3
- import { UserService } from '../../services/user/user.service.js';
4
- import { BtnIcon } from './BtnIcon.js';
5
- import { EventsUI } from './EventsUI.js';
6
- import { Input } from './Input.js';
7
- import { NotificationManager } from './NotificationManager.js';
8
- import { Translate } from './Translate.js';
9
- import { Validator } from './Validator.js';
10
- import { htmls, s } from './VanillaJs.js';
11
- import { Webhook } from './Webhook.js';
12
-
13
- const LogIn = {
14
- Scope: {
15
- user: {
16
- main: {
17
- model: {
18
- user: {},
19
- },
20
- },
21
- },
22
- },
23
- Event: {},
24
- Trigger: async function (options) {
25
- const { user } = options;
26
- await Webhook.register({ user });
27
- for (const eventKey of Object.keys(this.Event)) await this.Event[eventKey](options);
28
- if (s(`.session`))
29
- htmls(
30
- `.session`,
31
- html`<style>
32
- .session-in-log-in {
33
- display: block;
34
- }
35
- .session-inl-log-in {
36
- display: inline-table;
37
- }
38
- .session-in-log-out {
39
- display: none;
40
- }
41
- .session-inl-log-out {
42
- display: none;
43
- }
44
- </style>`,
45
- );
46
- if (!this.Scope.user.main.model.user.profileImage) {
47
- const resultFile = await FileService.get({ id: user.profileImageId });
48
- if (resultFile && resultFile.status === 'success' && resultFile.data[0]) {
49
- const imageData = resultFile.data[0];
50
-
51
- const imageBlob = new Blob([new Uint8Array(imageData.data.data)], { type: imageData.mimetype });
52
-
53
- const imageFile = new File([imageBlob], imageData.name, { type: imageData.mimetype });
54
-
55
- const imageSrc = URL.createObjectURL(imageFile);
56
-
57
- // const rawSvg = await CoreService.getRaw({ url: imageSrc });
58
- // rawSvg = rawSvg.replace(`<svg`, `<svg class="abs account-profile-image" `).replace(`#5f5f5f`, `#ffffffc8`);
59
-
60
- this.Scope.user.main.model.user.profileImage = {
61
- resultFile,
62
- imageData,
63
- imageBlob,
64
- imageFile,
65
- imageSrc,
66
- };
67
- }
68
- }
69
-
70
- htmls(
71
- `.action-btn-profile-log-in-render`,
72
- html`<div class="abs center top-box-profile-img-container">
73
- <img
74
- class="abs center top-box-profile-img"
75
- ${this.Scope.user.main.model.user.profileImage
76
- ? `src="${this.Scope.user.main.model.user.profileImage.imageSrc}"`
77
- : ``}
78
- />
79
- </div>`,
80
- );
81
- },
82
- Render: async function () {
83
- setTimeout(async () => {
84
- const formData = [
85
- { model: 'email', id: `log-in-email`, rules: [{ type: 'isEmpty' }, { type: 'isEmail' }] },
86
- { model: 'password', id: `log-in-password`, rules: [{ type: 'isEmpty' }] },
87
- ];
88
- const validators = await Validator.instance(formData);
89
-
90
- EventsUI.onClick(`.btn-log-in`, async (e) => {
91
- e.preventDefault();
92
- const { errorMessage } = await validators();
93
- if (errorMessage) return;
94
- const body = {};
95
- for (const inputData of formData) {
96
- if ('model' in inputData) body[inputData.model] = s(`.${inputData.id}`).value;
97
- }
98
- const result = await UserService.post({ id: 'auth', body });
99
- if (result.status === 'success') this.Trigger(result.data);
100
- if (result.status === 'error' && result.message.match('attempts')) {
101
- htmls(`.login-attempt-warn-value`, result.message.split(':')[1]);
102
- s(`.login-attempt-warn-container`).classList.remove('hide');
103
- } else s(`.login-attempt-warn-container`).classList.add('hide');
104
-
105
- if (result.status === 'error' && result.message.match('locked')) {
106
- htmls(`.login-attempt-warn-value0`, result.message.split(':')[1]);
107
- s(`.login-attempt-warn-container0`).classList.remove('hide');
108
- } else s(`.login-attempt-warn-container0`).classList.add('hide');
109
- NotificationManager.Push({
110
- html: result.status === 'success' ? Translate.Render(`${result.status}-user-log-in`) : result.message,
111
- status: result.status,
112
- });
113
- });
114
- s(`.btn-log-in-forgot-password`).onclick = () => {
115
- s(`.main-btn-recover`).click();
116
- };
117
-
118
- s(`.btn-log-in-i-not-have-account`).onclick = () => {
119
- s(`.main-btn-sign-up`).click();
120
- };
121
- });
122
- return html`
123
- <div class="in">
124
- ${await BtnIcon.Render({
125
- class: 'section-mp form-button btn-log-in-i-not-have-account',
126
- label: html`<i class="fas fa-user-plus"></i> ${Translate.Render(`i-not-have-account`)}
127
- <br />
128
- ${Translate.Render(`sign-up`)}`,
129
- type: 'button',
130
- })}
131
- </div>
132
- <form class="in">
133
- <div class="in">
134
- ${await Input.Render({
135
- id: `log-in-email`,
136
- type: 'email',
137
- label: html`<i class="fa-solid fa-envelope"></i> ${Translate.Render('email')}`,
138
- containerClass: 'inl section-mp width-mini-box input-container',
139
- placeholder: true,
140
- autocomplete: 'email',
141
- })}
142
- </div>
143
- <div class="in">
144
- ${await Input.Render({
145
- id: `log-in-password`,
146
- type: 'password',
147
- autocomplete: 'new-password',
148
- label: html`<i class="fa-solid fa-lock"></i> ${Translate.Render('password')}`,
149
- containerClass: 'inl section-mp width-mini-box input-container',
150
- placeholder: true,
151
- })}
152
- </div>
153
- <div class="in">
154
- ${await BtnIcon.Render({
155
- class: 'section-mp form-button btn-log-in-forgot-password',
156
- label: html`<i class="fas fa-question-circle"></i> ${Translate.Render(`forgot-password`)}`,
157
- type: 'button',
158
- })}
159
- </div>
160
- <div class="in section-mp form-button login-attempt-warn-container hide">
161
- <i class="fa-solid fa-triangle-exclamation"></i> ${Translate.Render('login-attempts-remaining')}
162
- <span style="color: #ed9d0f" class="login-attempt-warn-value"></span>
163
- </div>
164
- <div class="in section-mp form-button login-attempt-warn-container0 hide">
165
- <i class="fa-solid fa-triangle-exclamation"></i> ${Translate.Render('account-locked-try-again-in')}
166
- <span style="color: #ed9d0f" class="login-attempt-warn-value0"></span>
167
- </div>
168
-
169
- <div class="in">
170
- ${await BtnIcon.Render({
171
- class: 'section-mp form-button btn-log-in',
172
- label: Translate.Render('log-in'),
173
- type: 'submit',
174
- })}
175
- </div>
176
- </form>
177
- `;
178
- },
179
- };
180
-
181
- export { LogIn };
1
+ import { CoreService } from '../../services/core/core.service.js';
2
+ import { FileService } from '../../services/file/file.service.js';
3
+ import { UserService } from '../../services/user/user.service.js';
4
+ import { BtnIcon } from './BtnIcon.js';
5
+ import { EventsUI } from './EventsUI.js';
6
+ import { Input } from './Input.js';
7
+ import { NotificationManager } from './NotificationManager.js';
8
+ import { Translate } from './Translate.js';
9
+ import { Validator } from './Validator.js';
10
+ import { htmls, s } from './VanillaJs.js';
11
+ import { Webhook } from './Webhook.js';
12
+
13
+ const LogIn = {
14
+ Scope: {
15
+ user: {
16
+ main: {
17
+ model: {
18
+ user: {},
19
+ },
20
+ },
21
+ },
22
+ },
23
+ Event: {},
24
+ Trigger: async function (options) {
25
+ const { user } = options;
26
+ await Webhook.register({ user });
27
+ for (const eventKey of Object.keys(this.Event)) await this.Event[eventKey](options);
28
+ if (s(`.session`))
29
+ htmls(
30
+ `.session`,
31
+ html`<style>
32
+ .session-in-log-in {
33
+ display: block;
34
+ }
35
+ .session-inl-log-in {
36
+ display: inline-table;
37
+ }
38
+ .session-fl-log-in {
39
+ display: flow-root;
40
+ }
41
+ .session-in-log-out {
42
+ display: none;
43
+ }
44
+ .session-inl-log-out {
45
+ display: none;
46
+ }
47
+ .session-fl-log-out {
48
+ display: none;
49
+ }
50
+ </style>`,
51
+ );
52
+ if (!this.Scope.user.main.model.user.profileImage) {
53
+ const resultFile = await FileService.get({ id: user.profileImageId });
54
+ if (resultFile && resultFile.status === 'success' && resultFile.data[0]) {
55
+ const imageData = resultFile.data[0];
56
+
57
+ const imageBlob = new Blob([new Uint8Array(imageData.data.data)], { type: imageData.mimetype });
58
+
59
+ const imageFile = new File([imageBlob], imageData.name, { type: imageData.mimetype });
60
+
61
+ const imageSrc = URL.createObjectURL(imageFile);
62
+
63
+ // const rawSvg = await CoreService.getRaw({ url: imageSrc });
64
+ // rawSvg = rawSvg.replace(`<svg`, `<svg class="abs account-profile-image" `).replace(`#5f5f5f`, `#ffffffc8`);
65
+
66
+ this.Scope.user.main.model.user.profileImage = {
67
+ resultFile,
68
+ imageData,
69
+ imageBlob,
70
+ imageFile,
71
+ imageSrc,
72
+ };
73
+ }
74
+ }
75
+
76
+ htmls(
77
+ `.action-btn-profile-log-in-render`,
78
+ html`<div class="abs center top-box-profile-img-container">
79
+ <img
80
+ class="abs center top-box-profile-img"
81
+ ${this.Scope.user.main.model.user.profileImage
82
+ ? `src="${this.Scope.user.main.model.user.profileImage.imageSrc}"`
83
+ : ``}
84
+ />
85
+ </div>`,
86
+ );
87
+ },
88
+ Render: async function () {
89
+ setTimeout(async () => {
90
+ const formData = [
91
+ { model: 'email', id: `log-in-email`, rules: [{ type: 'isEmpty' }, { type: 'isEmail' }] },
92
+ { model: 'password', id: `log-in-password`, rules: [{ type: 'isEmpty' }] },
93
+ ];
94
+ const validators = await Validator.instance(formData);
95
+
96
+ EventsUI.onClick(`.btn-log-in`, async (e) => {
97
+ e.preventDefault();
98
+ const { errorMessage } = await validators();
99
+ if (errorMessage) return;
100
+ const body = {};
101
+ for (const inputData of formData) {
102
+ if ('model' in inputData) body[inputData.model] = s(`.${inputData.id}`).value;
103
+ }
104
+ const result = await UserService.post({ id: 'auth', body });
105
+ if (result.status === 'success') this.Trigger(result.data);
106
+ if (result.status === 'error' && result.message.match('attempts')) {
107
+ htmls(`.login-attempt-warn-value`, result.message.split(':')[1]);
108
+ s(`.login-attempt-warn-container`).classList.remove('hide');
109
+ } else s(`.login-attempt-warn-container`).classList.add('hide');
110
+
111
+ if (result.status === 'error' && result.message.match('locked')) {
112
+ htmls(`.login-attempt-warn-value0`, result.message.split(':')[1]);
113
+ s(`.login-attempt-warn-container0`).classList.remove('hide');
114
+ } else s(`.login-attempt-warn-container0`).classList.add('hide');
115
+ NotificationManager.Push({
116
+ html: result.status === 'success' ? Translate.Render(`${result.status}-user-log-in`) : result.message,
117
+ status: result.status,
118
+ });
119
+ });
120
+ s(`.btn-log-in-forgot-password`).onclick = () => {
121
+ s(`.main-btn-recover`).click();
122
+ };
123
+
124
+ s(`.btn-log-in-i-not-have-account`).onclick = () => {
125
+ s(`.main-btn-sign-up`).click();
126
+ };
127
+ });
128
+ return html`
129
+ <div class="in">
130
+ ${await BtnIcon.Render({
131
+ class: 'section-mp form-button btn-log-in-i-not-have-account',
132
+ label: html`<i class="fas fa-user-plus"></i> ${Translate.Render(`i-not-have-account`)}
133
+ <br />
134
+ ${Translate.Render(`sign-up`)}`,
135
+ type: 'button',
136
+ })}
137
+ </div>
138
+ <form class="in">
139
+ <div class="in">
140
+ ${await Input.Render({
141
+ id: `log-in-email`,
142
+ type: 'email',
143
+ label: html`<i class="fa-solid fa-envelope"></i> ${Translate.Render('email')}`,
144
+ containerClass: 'inl section-mp width-mini-box input-container',
145
+ placeholder: true,
146
+ autocomplete: 'email',
147
+ })}
148
+ </div>
149
+ <div class="in">
150
+ ${await Input.Render({
151
+ id: `log-in-password`,
152
+ type: 'password',
153
+ autocomplete: 'new-password',
154
+ label: html`<i class="fa-solid fa-lock"></i> ${Translate.Render('password')}`,
155
+ containerClass: 'inl section-mp width-mini-box input-container',
156
+ placeholder: true,
157
+ })}
158
+ </div>
159
+ <div class="in">
160
+ ${await BtnIcon.Render({
161
+ class: 'section-mp form-button btn-log-in-forgot-password',
162
+ label: html`<i class="fas fa-question-circle"></i> ${Translate.Render(`forgot-password`)}`,
163
+ type: 'button',
164
+ })}
165
+ </div>
166
+ <div class="in section-mp form-button login-attempt-warn-container hide">
167
+ <i class="fa-solid fa-triangle-exclamation"></i> ${Translate.Render('login-attempts-remaining')}
168
+ <span style="color: #ed9d0f" class="login-attempt-warn-value"></span>
169
+ </div>
170
+ <div class="in section-mp form-button login-attempt-warn-container0 hide">
171
+ <i class="fa-solid fa-triangle-exclamation"></i> ${Translate.Render('account-locked-try-again-in')}
172
+ <span style="color: #ed9d0f" class="login-attempt-warn-value0"></span>
173
+ </div>
174
+
175
+ <div class="in">
176
+ ${await BtnIcon.Render({
177
+ class: 'section-mp form-button btn-log-in',
178
+ label: Translate.Render('log-in'),
179
+ type: 'submit',
180
+ })}
181
+ </div>
182
+ </form>
183
+ `;
184
+ },
185
+ };
186
+
187
+ export { LogIn };
@@ -1,52 +1,58 @@
1
- import { BtnIcon } from './BtnIcon.js';
2
- import { LogIn } from './LogIn.js';
3
- import { Translate } from './Translate.js';
4
- import { htmls, s } from './VanillaJs.js';
5
- import { Webhook } from './Webhook.js';
6
-
7
- const LogOut = {
8
- Event: {},
9
- Trigger: async function (options) {
10
- LogIn.Scope.user.main.model.user = {};
11
- await Webhook.unregister();
12
- for (const eventKey of Object.keys(this.Event)) await this.Event[eventKey](options);
13
- if (s(`.session`))
14
- htmls(
15
- `.session`,
16
- html`<style>
17
- .session-in-log-out {
18
- display: block;
19
- }
20
- .session-inl-log-out {
21
- display: inline-table;
22
- }
23
- .session-in-log-in {
24
- display: none;
25
- }
26
- .session-inl-log-in {
27
- display: none;
28
- }
29
- </style>`,
30
- );
31
- },
32
- Render: async function () {
33
- setTimeout(() => {
34
- s('.btn-log-out').onclick = (e) => {
35
- e.preventDefault();
36
- LogOut.Trigger();
37
- };
38
- });
39
- // Translate.Render('confirm-logout')
40
- return html` <form class="in">
41
- <div class="in">
42
- ${await BtnIcon.Render({
43
- class: 'section-mp btn-custom btn-log-out',
44
- label: html`<i class="fa-solid fa-power-off"></i> ${Translate.Render('log-out')}`,
45
- type: 'submit',
46
- })}
47
- </div>
48
- </form>`;
49
- },
50
- };
51
-
52
- export { LogOut };
1
+ import { BtnIcon } from './BtnIcon.js';
2
+ import { LogIn } from './LogIn.js';
3
+ import { Translate } from './Translate.js';
4
+ import { htmls, s } from './VanillaJs.js';
5
+ import { Webhook } from './Webhook.js';
6
+
7
+ const LogOut = {
8
+ Event: {},
9
+ Trigger: async function (options) {
10
+ LogIn.Scope.user.main.model.user = {};
11
+ await Webhook.unregister();
12
+ for (const eventKey of Object.keys(this.Event)) await this.Event[eventKey](options);
13
+ if (s(`.session`))
14
+ htmls(
15
+ `.session`,
16
+ html`<style>
17
+ .session-in-log-out {
18
+ display: block;
19
+ }
20
+ .session-inl-log-out {
21
+ display: inline-table;
22
+ }
23
+ .session-fl-log-out {
24
+ display: flow-root;
25
+ }
26
+ .session-in-log-in {
27
+ display: none;
28
+ }
29
+ .session-inl-log-in {
30
+ display: none;
31
+ }
32
+ .session-fl-log-in {
33
+ display: none;
34
+ }
35
+ </style>`,
36
+ );
37
+ },
38
+ Render: async function () {
39
+ setTimeout(() => {
40
+ s('.btn-log-out').onclick = (e) => {
41
+ e.preventDefault();
42
+ LogOut.Trigger();
43
+ };
44
+ });
45
+ // Translate.Render('confirm-logout')
46
+ return html` <form class="in">
47
+ <div class="in">
48
+ ${await BtnIcon.Render({
49
+ class: 'section-mp btn-custom btn-log-out',
50
+ label: html`<i class="fa-solid fa-power-off"></i> ${Translate.Render('log-out')}`,
51
+ type: 'submit',
52
+ })}
53
+ </div>
54
+ </form>`;
55
+ },
56
+ };
57
+
58
+ export { LogOut };
@@ -1,26 +1,26 @@
1
- const loggerFactory = (meta) => {
2
- meta = meta.url.split('/').pop();
3
- const types = ['error', 'warn', 'info', 'debug'];
4
- const logger = {
5
- log: function (type, args) {
6
- if (location.hostname !== 'localhost' && console.log() !== null) {
7
- console.log = () => null;
8
- console.error = () => null;
9
- console.info = () => null;
10
- console.warn = () => null;
11
- }
12
- return location.hostname === 'localhost'
13
- ? console[type](`[${meta}] ${new Date().toISOString()} ${type}:`, ...args)
14
- : null;
15
- },
16
- };
17
- types.map(
18
- (type) =>
19
- (logger[type] = function (...args) {
20
- return this.log(type, args);
21
- }),
22
- );
23
- return logger;
24
- };
25
-
26
- export { loggerFactory };
1
+ const loggerFactory = (meta) => {
2
+ meta = meta.url.split('/').pop();
3
+ const types = ['error', 'warn', 'info', 'debug'];
4
+ const logger = {
5
+ log: function (type, args) {
6
+ if (location.hostname !== 'localhost' && console.log() !== null) {
7
+ console.log = () => null;
8
+ console.error = () => null;
9
+ console.info = () => null;
10
+ console.warn = () => null;
11
+ }
12
+ return location.hostname === 'localhost'
13
+ ? console[type](`[${meta}] ${new Date().toISOString()} ${type}:`, ...args)
14
+ : null;
15
+ },
16
+ };
17
+ types.map(
18
+ (type) =>
19
+ (logger[type] = function (...args) {
20
+ return this.log(type, args);
21
+ }),
22
+ );
23
+ return logger;
24
+ };
25
+
26
+ export { loggerFactory };