underpost 2.8.62 → 2.8.64

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 (39) hide show
  1. package/Dockerfile +9 -10
  2. package/bin/build.js +2 -2
  3. package/bin/deploy.js +1 -1
  4. package/bin/index.js +21 -7
  5. package/docker-compose.yml +1 -1
  6. package/package.json +1 -1
  7. package/src/api/default/default.service.js +1 -1
  8. package/src/api/user/user.service.js +1 -1
  9. package/src/cli/cron.js +39 -8
  10. package/src/cli/deploy.js +83 -42
  11. package/src/cli/fs.js +7 -6
  12. package/src/cli/image.js +81 -75
  13. package/src/cli/monitor.js +92 -0
  14. package/src/client/components/core/Account.js +25 -21
  15. package/src/client/components/core/Blockchain.js +1 -1
  16. package/src/client/components/core/CalendarCore.js +14 -83
  17. package/src/client/components/core/CommonJs.js +2 -1
  18. package/src/client/components/core/CssCore.js +8 -2
  19. package/src/client/components/core/Docs.js +1 -1
  20. package/src/client/components/core/EventsUI.js +2 -2
  21. package/src/client/components/core/FileExplorer.js +86 -78
  22. package/src/client/components/core/LoadingAnimation.js +1 -17
  23. package/src/client/components/core/LogIn.js +3 -3
  24. package/src/client/components/core/LogOut.js +1 -1
  25. package/src/client/components/core/Modal.js +12 -7
  26. package/src/client/components/core/Panel.js +19 -61
  27. package/src/client/components/core/PanelForm.js +13 -22
  28. package/src/client/components/core/Recover.js +3 -3
  29. package/src/client/components/core/Router.js +3 -1
  30. package/src/client/components/core/SignUp.js +2 -2
  31. package/src/client/components/default/RoutesDefault.js +3 -2
  32. package/src/client/services/default/default.management.js +45 -38
  33. package/src/client/ssr/Render.js +2 -0
  34. package/src/index.js +17 -2
  35. package/src/runtime/lampp/Dockerfile +65 -0
  36. package/src/server/conf.js +45 -1
  37. package/src/server/dns.js +9 -1
  38. package/src/server/network.js +7 -122
  39. package/src/server/runtime.js +1 -3
@@ -323,50 +323,54 @@ const FileExplorer = {
323
323
 
324
324
  downloadFile(new Blob([new Uint8Array(file.data.data)], { type: params.data.mimetype }), params.data.name);
325
325
  });
326
- EventsUI.onClick(`.btn-file-delete-${params.data._id}`, async (e) => {
327
- e.preventDefault();
328
- {
329
- const confirmResult = await Modal.RenderConfirm({
330
- html: async () => {
331
- return html`
332
- <div class="in section-mp" style="text-align: center">
333
- ${Translate.Render('confirm-delete-item')}
334
- <br />
335
- "${params.data.title}"
336
- </div>
337
- `;
338
- },
339
- id: `delete-${params.data._id}`,
340
- });
341
- if (confirmResult.status !== 'confirm') return;
326
+ EventsUI.onClick(
327
+ `.btn-file-delete-${params.data._id}`,
328
+ async (e) => {
329
+ e.preventDefault();
330
+ {
331
+ const confirmResult = await Modal.RenderConfirm({
332
+ html: async () => {
333
+ return html`
334
+ <div class="in section-mp" style="text-align: center">
335
+ ${Translate.Render('confirm-delete-item')}
336
+ <br />
337
+ "${params.data.title}"
338
+ </div>
339
+ `;
340
+ },
341
+ id: `delete-${params.data._id}`,
342
+ });
343
+ if (confirmResult.status !== 'confirm') return;
342
344
 
343
- const { data, status, message } = await FileService.delete({
344
- id: params.data.fileId,
345
+ const { data, status, message } = await FileService.delete({
346
+ id: params.data.fileId,
347
+ });
348
+ NotificationManager.Push({
349
+ html: status,
350
+ status,
351
+ });
352
+ if (status === 'error') return;
353
+ }
354
+ const { data, status, message } = await DocumentService.delete({
355
+ id: params.data._id,
345
356
  });
346
357
  NotificationManager.Push({
347
358
  html: status,
348
359
  status,
349
360
  });
350
361
  if (status === 'error') return;
351
- }
352
- const { data, status, message } = await DocumentService.delete({
353
- id: params.data._id,
354
- });
355
- NotificationManager.Push({
356
- html: status,
357
- status,
358
- });
359
- if (status === 'error') return;
360
-
361
- documentInstance = documentInstance.filter((f) => f._id !== params.data._id);
362
- const format = FileExplorer.documentDataFormat({ document: documentInstance, location });
363
- files = format.files;
364
- folders = format.folders;
365
- // AgGrid.grids[gridFileId].setGridOption('rowData', files);
366
- // const selectedData = gridApi.getSelectedRows();
367
- AgGrid.grids[gridFileId].applyTransaction({ remove: [params.data] });
368
- AgGrid.grids[gridFolderId].setGridOption('rowData', folders);
369
- });
362
+
363
+ documentInstance = documentInstance.filter((f) => f._id !== params.data._id);
364
+ const format = FileExplorer.documentDataFormat({ document: documentInstance, location });
365
+ files = format.files;
366
+ folders = format.folders;
367
+ // AgGrid.grids[gridFileId].setGridOption('rowData', files);
368
+ // const selectedData = gridApi.getSelectedRows();
369
+ AgGrid.grids[gridFileId].applyTransaction({ remove: [params.data] });
370
+ AgGrid.grids[gridFolderId].setGridOption('rowData', folders);
371
+ },
372
+ { context: 'modal' },
373
+ );
370
374
  });
371
375
  }
372
376
 
@@ -400,49 +404,53 @@ const FileExplorer = {
400
404
  `;
401
405
 
402
406
  setTimeout(() => {
403
- EventsUI.onClick(`.btn-folder-delete-${id}`, async (e) => {
404
- const confirmResult = await Modal.RenderConfirm({
405
- html: async () => {
406
- return html`
407
- <div class="in section-mp" style="text-align: center">
408
- ${Translate.Render('confirm-delete-item')}
409
- <br />
410
- "${params.data.location}"
411
- </div>
412
- `;
413
- },
414
- id: `delete-${id}`,
415
- });
416
- if (confirmResult.status !== 'confirm') return;
407
+ EventsUI.onClick(
408
+ `.btn-folder-delete-${id}`,
409
+ async (e) => {
410
+ const confirmResult = await Modal.RenderConfirm({
411
+ html: async () => {
412
+ return html`
413
+ <div class="in section-mp" style="text-align: center">
414
+ ${Translate.Render('confirm-delete-item')}
415
+ <br />
416
+ "${params.data.location}"
417
+ </div>
418
+ `;
419
+ },
420
+ id: `delete-${id}`,
421
+ });
422
+ if (confirmResult.status !== 'confirm') return;
417
423
 
418
- e.preventDefault();
419
- const idFilesDelete = [];
420
- for (const file of documentInstance.filter(
421
- (f) => FileExplorer.locationFormat({ f }) === params.data.location, // .startsWith(params.data.location),
422
- )) {
423
- {
424
- const { data, status, message } = await FileService.delete({
425
- id: file.fileId._id,
426
- });
424
+ e.preventDefault();
425
+ const idFilesDelete = [];
426
+ for (const file of documentInstance.filter(
427
+ (f) => FileExplorer.locationFormat({ f }) === params.data.location, // .startsWith(params.data.location),
428
+ )) {
429
+ {
430
+ const { data, status, message } = await FileService.delete({
431
+ id: file.fileId._id,
432
+ });
433
+ }
434
+ {
435
+ idFilesDelete.push(file._id);
436
+ const { data, status, message } = await DocumentService.delete({
437
+ id: file._id,
438
+ });
439
+ }
427
440
  }
428
- {
429
- idFilesDelete.push(file._id);
430
- const { data, status, message } = await DocumentService.delete({
431
- id: file._id,
432
- });
433
- }
434
- }
435
- NotificationManager.Push({
436
- html: Translate.Render('success-delete'),
437
- status: 'success',
438
- });
439
- documentInstance = documentInstance.filter((f) => !idFilesDelete.includes(f._id));
440
- const format = FileExplorer.documentDataFormat({ document: documentInstance, location });
441
- files = format.files;
442
- folders = format.folders;
443
- AgGrid.grids[gridFileId].setGridOption('rowData', files);
444
- AgGrid.grids[gridFolderId].setGridOption('rowData', folders);
445
- });
441
+ NotificationManager.Push({
442
+ html: Translate.Render('success-delete'),
443
+ status: 'success',
444
+ });
445
+ documentInstance = documentInstance.filter((f) => !idFilesDelete.includes(f._id));
446
+ const format = FileExplorer.documentDataFormat({ document: documentInstance, location });
447
+ files = format.files;
448
+ folders = format.folders;
449
+ AgGrid.grids[gridFileId].setGridOption('rowData', files);
450
+ AgGrid.grids[gridFolderId].setGridOption('rowData', folders);
451
+ },
452
+ { context: 'modal' },
453
+ );
446
454
  });
447
455
  }
448
456
 
@@ -75,28 +75,12 @@ const LoadingAnimation = {
75
75
  const style = {
76
76
  'text-align': 'center',
77
77
  };
78
- if (s(container).classList) {
79
- const classes = Array.from(s(container).classList);
80
- if (classes.find((e) => e.match('management-table-btn-mini'))) {
81
- style.top = '-2px';
82
- style.left = '-2px';
83
- } else if (classes.find((e) => e.match('-btn-tool'))) {
84
- style.top = '-26px';
85
- style.left = '-10px';
86
- } else if (classes.find((e) => e.match('main-btn-')) && !classes.find((e) => e.match('main-btn-square-menu'))) {
87
- style.top = '-8px';
88
- style.left = '-10px';
89
- } else if (classes.find((e) => e.match('action-bar-box'))) {
90
- style.top = '-30px';
91
- style.left = '-12px';
92
- }
93
- }
94
78
 
95
79
  append(
96
80
  container,
97
81
  html`
98
82
  <div
99
- class="in ${id}"
83
+ class="abs center ${id}"
100
84
  style="${renderCssAttr({
101
85
  style,
102
86
  })}"
@@ -135,7 +135,7 @@ const LogIn = {
135
135
  return html`
136
136
  <div class="in">
137
137
  ${await BtnIcon.Render({
138
- class: 'section-mp form-button btn-log-in-i-not-have-account',
138
+ class: 'in section-mp form-button btn-log-in-i-not-have-account',
139
139
  label: html`<i class="fas fa-user-plus"></i> ${Translate.Render(`i-not-have-account`)}
140
140
  <br />
141
141
  ${Translate.Render(`sign-up`)}`,
@@ -165,7 +165,7 @@ const LogIn = {
165
165
  </div>
166
166
  <div class="in">
167
167
  ${await BtnIcon.Render({
168
- class: 'section-mp form-button btn-log-in-forgot-password',
168
+ class: 'in section-mp form-button btn-log-in-forgot-password',
169
169
  label: html`<i class="fas fa-question-circle"></i> ${Translate.Render(`forgot-password`)}`,
170
170
  type: 'button',
171
171
  })}
@@ -181,7 +181,7 @@ const LogIn = {
181
181
 
182
182
  <div class="in">
183
183
  ${await BtnIcon.Render({
184
- class: 'section-mp form-button btn-log-in',
184
+ class: 'in section-mp form-button btn-log-in',
185
185
  label: Translate.Render('log-in'),
186
186
  type: 'submit',
187
187
  })}
@@ -47,7 +47,7 @@ const LogOut = {
47
47
  return html` <form class="in">
48
48
  <div class="in">
49
49
  ${await BtnIcon.Render({
50
- class: 'section-mp btn-custom btn-log-out',
50
+ class: 'inl section-mp btn-custom btn-log-out',
51
51
  label: html`<i class="fa-solid fa-power-off"></i> ${Translate.Render('log-out')}`,
52
52
  type: 'submit',
53
53
  })}
@@ -85,6 +85,7 @@ const Modal = {
85
85
  onExpandUiListener: {},
86
86
  onBarUiOpen: {},
87
87
  onBarUiClose: {},
88
+ onHome: {},
88
89
  query: options.query ? `${window.location.search}` : undefined,
89
90
  };
90
91
  const setCenterRestore = () => {
@@ -1010,14 +1011,15 @@ const Modal = {
1010
1011
  e.preventDefault();
1011
1012
  window.history.forward();
1012
1013
  });
1013
- EventsUI.onClick(`.action-btn-home`, () => s(`.main-btn-home`).click());
1014
- EventsUI.onClick(`.action-btn-app-icon`, () => s(`.action-btn-home`).click());
1014
+ EventsUI.onClick(`.action-btn-home`, async () => {
1015
+ await Modal.onHomeRouterEvent();
1016
+ Object.keys(this.Data[idModal].onHome).map((keyListener) => this.Data[idModal].onHome[keyListener]());
1017
+ });
1018
+ EventsUI.onClick(`.action-btn-app-icon`, () => Modal.onHomeRouterEvent());
1015
1019
  Keyboard.instanceMultiPressKey({
1016
1020
  id: 'input-shortcut-global-escape',
1017
1021
  keys: ['Escape'],
1018
1022
  eventCallBack: () => {
1019
- // if (s(`.main-btn-home`)) s(`.main-btn-home`).click();
1020
-
1021
1023
  if (s(`.btn-close-${this.currentTopModalId}`)) s(`.btn-close-${this.currentTopModalId}`).click();
1022
1024
  },
1023
1025
  });
@@ -1343,7 +1345,7 @@ const Modal = {
1343
1345
  s(`.btn-icon-menu-back`).classList.add('hide');
1344
1346
  if (s(`.menu-btn-container-main`)) s(`.menu-btn-container-main`).classList.remove('hide');
1345
1347
  };
1346
- s(`.main-btn-home`).onclick = () => {
1348
+ this.onHomeRouterEvent = async () => {
1347
1349
  for (const keyModal of Object.keys(this.Data)) {
1348
1350
  if (
1349
1351
  ![idModal, 'main-body-top', 'main-body']
@@ -1357,6 +1359,9 @@ const Modal = {
1357
1359
  setPath(getProxyPath());
1358
1360
  setDocTitle({ ...options.RouterInstance, route: '' });
1359
1361
  };
1362
+ s(`.main-btn-home`).onclick = async () => {
1363
+ await this.onHomeRouterEvent();
1364
+ };
1360
1365
  EventsUI.onClick(`.btn-icon-menu-back`, backMenuButtonEvent);
1361
1366
  EventsUI.onClick(`.btn-icon-menu-mode`, () => {
1362
1367
  if (s(`.btn-icon-menu-mode-right`).classList.contains('hide')) {
@@ -1620,6 +1625,7 @@ const Modal = {
1620
1625
  ...this.Data[idModal],
1621
1626
  };
1622
1627
  },
1628
+ onHomeRouterEvent: () => {},
1623
1629
  currentTopModalId: '',
1624
1630
  zIndexSync: function ({ idModal }) {
1625
1631
  setTimeout(() => {
@@ -1731,7 +1737,7 @@ const Modal = {
1731
1737
  titleClass: 'hide',
1732
1738
  style: {
1733
1739
  width: '300px',
1734
- height: '350px',
1740
+ height: '400px',
1735
1741
  overflow: 'hidden',
1736
1742
  'z-index': '11',
1737
1743
  resize: 'none',
@@ -1765,7 +1771,6 @@ const Modal = {
1765
1771
  },
1766
1772
  headerTitleHeight: 40,
1767
1773
  actionBtnCenter: function () {
1768
- // if (!s(`.btn-close-modal-menu`).classList.contains('hide')) return s(`.main-btn-home`).click();
1769
1774
  if (!s(`.btn-close-modal-menu`).classList.contains('hide')) {
1770
1775
  return s(`.btn-close-modal-menu`).click();
1771
1776
  }
@@ -55,7 +55,7 @@ const Panel = {
55
55
  const openPanelForm = () => {
56
56
  s(`.${idPanel}-form-body`).classList.remove('hide');
57
57
  s(`.btn-${idPanel}-add`).classList.add('hide');
58
- s(`.${scrollClassContainer}`).style.overflow = 'hidden';
58
+ // s(`.${scrollClassContainer}`).style.overflow = 'hidden';
59
59
  if (options.customButtons) {
60
60
  let customBtnIndex = -1;
61
61
  for (const dataBtn of options.customButtons) {
@@ -89,12 +89,16 @@ const Panel = {
89
89
  htmls(`.${idPanel}-cell-col-a-${id}`, render);
90
90
  },
91
91
  });
92
- EventsUI.onClick(`.${idPanel}-btn-delete-${id}`, async (e) => {
93
- logger.warn('delete', obj);
94
- const { status } = await options.on.remove({ e, data: obj });
95
- if (status === 'error') return;
96
- if (s(`.${idPanel}-${id}`)) s(`.${idPanel}-${id}`).remove();
97
- });
92
+ EventsUI.onClick(
93
+ `.${idPanel}-btn-delete-${id}`,
94
+ async (e) => {
95
+ logger.warn('delete', obj);
96
+ const { status } = await options.on.remove({ e, data: obj });
97
+ if (status === 'error') return;
98
+ if (s(`.${idPanel}-${id}`)) s(`.${idPanel}-${id}`).remove();
99
+ },
100
+ { context: 'modal' },
101
+ );
98
102
  EventsUI.onClick(`.${idPanel}-btn-edit-${id}`, async () => {
99
103
  logger.warn('edit', obj);
100
104
  if (obj._id) Panel.Tokens[idPanel].editId = obj._id;
@@ -121,7 +125,7 @@ const Panel = {
121
125
  if (options.onClick) await options.onClick({ payload });
122
126
  };
123
127
  });
124
-
128
+ if (s(`.${idPanel}-${id}`)) s(`.${idPanel}-${id}`).remove();
125
129
  return html` <div class="in box-shadow ${idPanel} ${idPanel}-${id}">
126
130
  <div class="fl ${idPanel}-tools session-fl-log-in ${obj.tools ? '' : 'hide'}">
127
131
  ${await BtnIcon.Render({
@@ -244,9 +248,9 @@ const Panel = {
244
248
  };
245
249
 
246
250
  let render = '';
247
- let renderForm = html` <div class="in modal stq" style="top: 0px; z-index: 1; padding-bottom: 5px">
251
+ let renderForm = html` <div class="in modal" style="top: 0px; z-index: 1; padding-bottom: 5px">
248
252
  ${await BtnIcon.Render({
249
- class: `section-mp btn-custom btn-${idPanel}-close`,
253
+ class: `inl section-mp btn-custom btn-${idPanel}-close`,
250
254
  label: html`<i class="fa-solid fa-xmark"></i> ${Translate.Render('close')}`,
251
255
  type: 'button',
252
256
  })}
@@ -404,62 +408,19 @@ const Panel = {
404
408
  }
405
409
  let renderFormBtn = html`
406
410
  ${await BtnIcon.Render({
407
- class: `section-mp btn-custom btn-${idPanel}-submit`,
411
+ class: `inl section-mp btn-custom btn-${idPanel}-submit`,
408
412
  label: html`<span class="btn-${idPanel}-label-add"><i class="fas fa-plus"></i> ${Translate.Render('add')}</span
409
413
  ><span class="btn-${idPanel}-label-edit hide"><i class="fas fa-edit"></i> ${Translate.Render('edit')}</span>`,
410
414
  type: 'submit',
411
415
  })}
412
416
  ${await BtnIcon.Render({
413
- class: `section-mp btn-custom btn-${idPanel}-clean`,
417
+ class: `inl section-mp btn-custom btn-${idPanel}-clean`,
414
418
  label: html`<i class="fa-solid fa-broom"></i> ${Translate.Render('clear')}`,
415
419
  type: 'button',
416
420
  })}
417
421
  `;
418
422
 
419
423
  setTimeout(async () => {
420
- const resizeParentModal = () => {
421
- if (options.parentIdModal) {
422
- Modal.Data[options.parentIdModal].onObserverListener[`form-panel-${options.parentIdModal}`] = () => {
423
- if (s(`.${idPanel}-form-container`))
424
- s(`.${idPanel}-form-container`).style.maxHeight = `${
425
- s(`.${options.parentIdModal}`).offsetHeight - Modal.headerTitleHeight
426
- }px`;
427
- };
428
- Modal.Data[options.parentIdModal].onObserverListener[`form-panel-${options.parentIdModal}`]();
429
- } else {
430
- Responsive.Event[`${idPanel}-responsive`] = () => {
431
- if (s(`.${idPanel}-form-container`))
432
- s(`.${idPanel}-form-container`).style.maxHeight =
433
- options.route === 'home' &&
434
- s(`.${idPanel}-form-body`) &&
435
- !s(`.${idPanel}-form-body`).classList.contains('hide') &&
436
- !s(`.main-body-btn-ui-open`).classList.contains('hide')
437
- ? `${window.innerHeight}px`
438
- : `${window.innerHeight - heightTopBar - heightBottomBar}px`;
439
- };
440
- Responsive.Event[`${idPanel}-responsive`]();
441
- }
442
- };
443
- if (options.route === 'home') {
444
- Modal.Data['modal-menu'].onBarUiClose[`${idPanel}-responsive`] = () => {
445
- resizeParentModal();
446
- };
447
-
448
- Modal.Data['modal-menu'].onBarUiOpen[`${idPanel}-responsive`] = () => {
449
- resizeParentModal();
450
- };
451
- }
452
- setTimeout(resizeParentModal);
453
- if (options.route) {
454
- RouterEvents[options.parentIdModal] = ({ route }) => {
455
- if (route === options.route) {
456
- setTimeout(() => {
457
- resizeParentModal();
458
- }, 350);
459
- }
460
- };
461
- }
462
-
463
424
  const validators = await Validator.instance(formData);
464
425
 
465
426
  s(`.${idPanel}-form`).onsubmit = (e) => {
@@ -546,7 +507,7 @@ const Panel = {
546
507
  s(`.${btnSelector}`).onclick = () => dataBtn.onClick();
547
508
  });
548
509
  customButtonsRender += ` ${await BtnIcon.Render({
549
- class: `section-mp btn-custom ${btnSelector}`,
510
+ class: `inl section-mp btn-custom ${btnSelector}`,
550
511
  label: dataBtn.label,
551
512
  type: 'button',
552
513
  })}`;
@@ -581,7 +542,6 @@ const Panel = {
581
542
  padding: 10px;
582
543
  cursor: pointer;
583
544
  min-height: 400px;
584
- overflow: hidden;
585
545
  }
586
546
  .${idPanel}:hover {
587
547
  background: #ffffff;
@@ -651,12 +611,10 @@ const Panel = {
651
611
  }
652
612
  </style>
653
613
  <div class="${idPanel}-container">
654
- <div
655
- class="stq modal ${idPanel}-form-container ${options.formContainerClass ? options.formContainerClass : ''}"
656
- >
614
+ <div class="in modal ${idPanel}-form-container ${options.formContainerClass ? options.formContainerClass : ''}">
657
615
  <div class="in ${idPanel}-form-header">
658
616
  ${await BtnIcon.Render({
659
- class: `section-mp btn-custom btn-${idPanel}-add ${
617
+ class: `inl section-mp btn-custom btn-${idPanel}-add ${
660
618
  options?.role?.add ? (!options.role.add() ? 'hide' : '') : ''
661
619
  }`,
662
620
  label: html`<i class="fas fa-plus"></i> ${Translate.Render('add')}`,
@@ -1,4 +1,4 @@
1
- import { getCapVariableName, getId, newInstance, random, range, timer, uniqueArray } from './CommonJs.js';
1
+ import { getCapVariableName, newInstance, random, range, uniqueArray } from './CommonJs.js';
2
2
  import { marked } from 'marked';
3
3
  import {
4
4
  getBlobFromUint8ArrayFile,
@@ -12,7 +12,6 @@ import { NotificationManager } from './NotificationManager.js';
12
12
  import { DocumentService } from '../../services/document/document.service.js';
13
13
  import { FileService } from '../../services/file/file.service.js';
14
14
  import { getSrcFromFileData } from './Input.js';
15
- import { Auth } from './Auth.js';
16
15
  import { imageShimmer, renderCssAttr } from './Css.js';
17
16
  import { Translate } from './Translate.js';
18
17
  import { Modal } from './Modal.js';
@@ -383,7 +382,7 @@ const PanelForm = {
383
382
  };
384
383
  const renderSrrPanelData = async () =>
385
384
  await panelRender({
386
- data: range(0, 5).map((i) => ({
385
+ data: range(0, 0).map((i) => ({
387
386
  id: i,
388
387
  title: html`<div class="fl">
389
388
  <div
@@ -424,17 +423,12 @@ const PanelForm = {
424
423
  ssr: true,
425
424
  })),
426
425
  });
427
- let delayBlock = false;
428
426
  let firsUpdateEvent = false;
427
+ let lastCid;
429
428
  this.Data[idPanel].updatePanel = async () => {
430
- if (delayBlock) return;
431
- else {
432
- delayBlock = true;
433
- setTimeout(() => {
434
- delayBlock = false;
435
- }, 500);
436
- }
437
429
  const cid = getQueryParams().cid ? getQueryParams().cid : '';
430
+ if (lastCid === cid) return;
431
+ lastCid = cid;
438
432
  if (options.route === 'home') Modal.homeCid = newInstance(cid);
439
433
  htmls(`.${options.parentIdModal ? 'html-' + options.parentIdModal : 'main-body'}`, await renderSrrPanelData());
440
434
  await getPanelData();
@@ -447,24 +441,21 @@ const PanelForm = {
447
441
  await options.firsUpdateEvent();
448
442
  }
449
443
  };
450
- if (options.route)
444
+ if (options.route) {
451
445
  listenQueryPathInstance({
452
446
  id: options.parentIdModal ? 'html-' + options.parentIdModal : 'main-body',
453
447
  routeId: options.route,
454
448
  event: async (path) => {
455
- // if (!PanelForm.Data[idPanel].sessionIn)
456
449
  await this.Data[idPanel].updatePanel();
457
450
  },
458
451
  });
459
-
460
- // if (options.route === 'home') setTimeout(this.Data[idPanel].updatePanel);
461
- setTimeout(() => {
462
- // if (
463
- // options.route !== 'home' &&
464
- // (!PanelForm.Data[idPanel].originData || PanelForm.Data[idPanel].originData.length === 0)
465
- // )
466
- this.Data[idPanel].updatePanel();
467
- });
452
+ if (!options.parentIdModal)
453
+ Modal.Data['modal-menu'].onHome[idPanel] = async () => {
454
+ lastCid = undefined;
455
+ setQueryPath({ path: options.route, queryPath: '' });
456
+ await this.Data[idPanel].updatePanel();
457
+ };
458
+ }
468
459
 
469
460
  if (options.parentIdModal) {
470
461
  htmls(`.html-${options.parentIdModal}`, await renderSrrPanelData());
@@ -126,7 +126,7 @@ const Recover = {
126
126
  });
127
127
  return html`
128
128
  ${await BtnIcon.Render({
129
- class: 'section-mp form-button btn-recover-log-in hide',
129
+ class: 'in section-mp form-button btn-recover-log-in hide',
130
130
  label: Translate.Render('log-in'),
131
131
  type: 'button',
132
132
  })}
@@ -181,7 +181,7 @@ const Recover = {
181
181
  ${options?.bottomRender ? await options.bottomRender() : ``}
182
182
  <div class="in recover-send-btn-container">
183
183
  ${await BtnIcon.Render({
184
- class: 'section-mp form-button btn-recover',
184
+ class: 'in section-mp form-button btn-recover',
185
185
  label: Translate.Render(mode === 'recover-verify-email' ? 'send-recover-verify-email' : 'change-password'),
186
186
  type: 'button',
187
187
  })}
@@ -191,7 +191,7 @@ const Recover = {
191
191
  <i class="fa-solid fa-triangle-exclamation"></i> ${Translate.Render('15-min-valid-recover-email')}
192
192
  </div>
193
193
  ${await BtnIcon.Render({
194
- class: 'section-mp form-button btn-recover-resend',
194
+ class: 'in section-mp form-button btn-recover-resend',
195
195
  label: html`${Translate.Render('resend')} ${Translate.Render('recover-verify-email')}`,
196
196
  type: 'submit',
197
197
  })}
@@ -52,7 +52,9 @@ const LoadRouter = function (RouterInstance) {
52
52
 
53
53
  const setQueryPath = (options = { path: '', queryPath: '' }, queryKey = 'cid') => {
54
54
  const { queryPath, path } = options;
55
- const newUri = `${getProxyPath()}${path === 'home' ? '' : `${path}/`}${queryPath ? `?${queryKey}=${queryPath}` : ''}`;
55
+ const newUri = `${getProxyPath()}${path === 'home' ? '' : `${path}/`}${
56
+ typeof queryPath === 'string' ? `?${queryKey}=${queryPath}` : ''
57
+ }`;
56
58
  const currentUri = `${window.location.pathname}${location.search}`;
57
59
  if (currentUri !== newUri && currentUri !== `${newUri}/`) setPath(newUri);
58
60
  };
@@ -63,7 +63,7 @@ const SignUp = {
63
63
  });
64
64
  return html`
65
65
  ${await BtnIcon.Render({
66
- class: 'section-mp form-button btn-sign-up-i-have-account',
66
+ class: 'in section-mp form-button btn-sign-up-i-have-account',
67
67
  label: html`<i class="fas fa-sign-in-alt"></i> ${Translate.Render('i-have-account')}<br />${Translate.Render(
68
68
  'log-in',
69
69
  )}`,
@@ -112,7 +112,7 @@ const SignUp = {
112
112
  ${options?.bottomRender ? await options.bottomRender() : ``}
113
113
  <div class="in">
114
114
  ${await BtnIcon.Render({
115
- class: 'section-mp form-button btn-sign-up',
115
+ class: 'in section-mp form-button btn-sign-up',
116
116
  label: Translate.Render('sign-up'),
117
117
  type: 'submit',
118
118
  })}
@@ -1,4 +1,5 @@
1
1
  import { loggerFactory } from '../core/Logger.js';
2
+ import { Modal } from '../core/Modal.js';
2
3
  import { getProxyPath, s } from '../core/VanillaJs.js';
3
4
 
4
5
  const logger = loggerFactory(import.meta);
@@ -10,10 +11,10 @@ const RoutesDefault = () => {
10
11
  return {
11
12
  '/': {
12
13
  title: 'Home',
13
- render: () => s(`.main-btn-home`).click(),
14
+ render: () => Modal.onHomeRouterEvent(),
14
15
  upperCase: false,
15
16
  },
16
- '/home': { title: 'home', render: () => s(`.main-btn-home`).click() },
17
+ '/home': { title: 'home', render: () => Modal.onHomeRouterEvent() },
17
18
  '/settings': { title: 'settings', render: () => s(`.main-btn-settings`).click(), translateTitle: true },
18
19
  '/log-in': { title: 'log-in', render: () => s(`.main-btn-log-in`).click(), translateTitle: true },
19
20
  '/sign-up': { title: 'sign-up', render: () => s(`.main-btn-sign-up`).click(), translateTitle: true },