underpost 2.8.85 → 2.8.87

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 (70) hide show
  1. package/.env.development +7 -2
  2. package/.env.production +7 -2
  3. package/.env.test +7 -2
  4. package/.github/workflows/pwa-microservices-template-page.cd.yml +1 -1
  5. package/.github/workflows/release.cd.yml +37 -0
  6. package/README.md +7 -24
  7. package/bin/build.js +1 -0
  8. package/bin/db.js +1 -3
  9. package/bin/deploy.js +43 -368
  10. package/bin/file.js +16 -3
  11. package/bin/util.js +1 -56
  12. package/cli.md +46 -21
  13. package/conf.js +3 -3
  14. package/manifests/deployment/{dd-template-development → dd-default-development}/deployment.yaml +16 -16
  15. package/manifests/deployment/{dd-template-development → dd-default-development}/proxy.yaml +3 -3
  16. package/manifests/deployment/mongo-express/deployment.yaml +12 -12
  17. package/manifests/grafana/deployment.yaml +57 -0
  18. package/manifests/grafana/kustomization.yaml +7 -0
  19. package/manifests/grafana/pvc.yaml +12 -0
  20. package/manifests/grafana/service.yaml +14 -0
  21. package/manifests/maas/nvim.sh +91 -0
  22. package/manifests/maas/ssh-cluster-info.sh +14 -0
  23. package/manifests/prometheus/deployment.yaml +82 -0
  24. package/package.json +3 -12
  25. package/src/api/file/file.service.js +28 -8
  26. package/src/api/user/user.router.js +31 -5
  27. package/src/api/user/user.service.js +11 -38
  28. package/src/cli/cluster.js +45 -25
  29. package/src/cli/cron.js +12 -45
  30. package/src/cli/db.js +149 -19
  31. package/src/cli/deploy.js +41 -110
  32. package/src/cli/fs.js +1 -0
  33. package/src/cli/index.js +24 -7
  34. package/src/cli/monitor.js +1 -4
  35. package/src/cli/repository.js +15 -6
  36. package/src/cli/run.js +94 -16
  37. package/src/client/Default.index.js +0 -2
  38. package/src/client/components/core/Account.js +6 -2
  39. package/src/client/components/core/Content.js +11 -7
  40. package/src/client/components/core/Css.js +5 -1
  41. package/src/client/components/core/CssCore.js +12 -0
  42. package/src/client/components/core/FullScreen.js +19 -28
  43. package/src/client/components/core/Input.js +7 -1
  44. package/src/client/components/core/LogIn.js +3 -0
  45. package/src/client/components/core/LogOut.js +1 -1
  46. package/src/client/components/core/Modal.js +32 -43
  47. package/src/client/components/core/ObjectLayerEngine.js +229 -4
  48. package/src/client/components/core/ObjectLayerEngineModal.js +441 -0
  49. package/src/client/components/core/Recover.js +5 -2
  50. package/src/client/components/core/Scroll.js +65 -120
  51. package/src/client/components/core/SignUp.js +1 -0
  52. package/src/client/components/core/ToggleSwitch.js +15 -1
  53. package/src/client/components/core/VanillaJs.js +48 -2
  54. package/src/client/components/default/MenuDefault.js +2 -2
  55. package/src/client/components/default/RoutesDefault.js +3 -3
  56. package/src/client/public/default/assets/mailer/api-user-default-avatar.png +0 -0
  57. package/src/index.js +1 -1
  58. package/src/mailer/MailerProvider.js +37 -0
  59. package/src/server/client-build-docs.js +1 -1
  60. package/src/server/client-build-live.js +1 -1
  61. package/src/server/client-build.js +4 -12
  62. package/src/server/client-dev-server.js +1 -1
  63. package/src/server/client-icons.js +6 -78
  64. package/src/server/conf.js +83 -408
  65. package/src/server/proxy.js +2 -3
  66. package/src/server/runtime.js +1 -2
  67. package/src/server/start.js +5 -5
  68. package/test/api.test.js +3 -2
  69. package/docker-compose.yml +0 -67
  70. package/prometheus.yml +0 -36
@@ -1026,7 +1026,8 @@ const imageShimmer = () => html`<div
1026
1026
  </div>
1027
1027
  </div>`;
1028
1028
 
1029
- const renderChessPattern = () => `background: repeating-conic-gradient(#808080 0 25%, #0000 0 50%) 50% / 20px 20px`;
1029
+ const renderChessPattern = (patternSize = 20) =>
1030
+ `background: repeating-conic-gradient(#808080 0 25%, #0000 0 50%) 50% / ${patternSize}px ${patternSize}px`;
1030
1031
 
1031
1032
  const extractBackgroundImageUrl = (element) => {
1032
1033
  const style = window.getComputedStyle(element);
@@ -1044,6 +1045,8 @@ const simpleIconsRender = (selector) => {
1044
1045
  });
1045
1046
  };
1046
1047
 
1048
+ const styleFactory = (payload, plain = '') => `style="${renderCssAttr({ style: payload })} ${plain}"`;
1049
+
1047
1050
  export {
1048
1051
  Css,
1049
1052
  Themes,
@@ -1083,4 +1086,5 @@ export {
1083
1086
  lightenHex,
1084
1087
  darkenHex,
1085
1088
  adjustHex,
1089
+ styleFactory,
1086
1090
  };
@@ -524,6 +524,12 @@ const CssCoreDark = {
524
524
  }
525
525
  .btn-input-extension:hover {
526
526
  }
527
+ .section-mp-border {
528
+ border: 2px solid #313131;
529
+ border-radius: 5px;
530
+ padding: 5px;
531
+ margin: 5px;
532
+ }
527
533
  </style>
528
534
  ${scrollBarDarkRender()} ${borderChar(1, 'black', ['.main-body-btn-container'])}
529
535
  `,
@@ -848,6 +854,12 @@ const CssCoreLight = {
848
854
  }
849
855
  .btn-input-extension:hover {
850
856
  }
857
+ .section-mp-border {
858
+ border: 2px solid #bbb;
859
+ border-radius: 5px;
860
+ padding: 5px;
861
+ margin: 5px;
862
+ }
851
863
  </style>
852
864
  ${scrollBarLightRender()} ${borderChar(1, 'white', ['.main-body-btn-container'])}
853
865
  `,
@@ -9,35 +9,26 @@ const FullScreen = {
9
9
  Responsive.Event['full-screen-settings'] = () => {
10
10
  let fullScreenMode = checkFullScreen();
11
11
  if ((fullScreenSwitch && !fullScreenMode) || (!fullScreenSwitch && fullScreenMode))
12
- if (s('.fullscreen-toggle')) ToggleSwitch.Tokens[`fullscreen-toggle`].click();
12
+ if (s('.fullscreen')) ToggleSwitch.Tokens[`fullscreen`].click();
13
13
  };
14
- setTimeout(
15
- () => (s(`.toggle-form-container-fullscreen`).onclick = () => ToggleSwitch.Tokens[`fullscreen-toggle`].click()),
16
- );
17
- return html`<div class="in section-mp toggle-form-container toggle-form-container-fullscreen hover">
18
- <div class="fl ">
19
- <div class="in fll" style="width: 70%">
20
- <div class="in"><i class="fa-solid fa-expand"></i> ${Translate.Render('fullscreen')}</div>
21
- </div>
22
- <div class="in fll" style="width: 30%">
23
- ${await ToggleSwitch.Render({
24
- id: 'fullscreen-toggle',
25
- containerClass: 'inl',
26
- disabledOnClick: true,
27
- checked: fullScreenSwitch,
28
- on: {
29
- unchecked: () => {
30
- fullScreenSwitch = false;
31
- if (checkFullScreen()) fullScreenOut();
32
- },
33
- checked: () => {
34
- fullScreenSwitch = true;
35
- if (!checkFullScreen()) fullScreenIn();
36
- },
37
- },
38
- })}
39
- </div>
40
- </div>
14
+ return html`<div class="in section-mp">
15
+ ${await ToggleSwitch.Render({
16
+ wrapper: true,
17
+ wrapperLabel: html`<i class="fa-solid fa-expand"></i> ${Translate.Render('fullscreen')}`,
18
+ id: 'fullscreen',
19
+ disabledOnClick: true,
20
+ checked: fullScreenSwitch,
21
+ on: {
22
+ unchecked: () => {
23
+ fullScreenSwitch = false;
24
+ if (checkFullScreen()) fullScreenOut();
25
+ },
26
+ checked: () => {
27
+ fullScreenSwitch = true;
28
+ if (!checkFullScreen()) fullScreenIn();
29
+ },
30
+ },
31
+ })}
41
32
  </div>`;
42
33
  },
43
34
  };
@@ -65,6 +65,7 @@ const Input = {
65
65
  type="${options?.type ? options.type : 'text'}"
66
66
  class="${options.inputClass ? options.inputClass : 'in wfa'} ${id}"
67
67
  ${options?.min !== undefined ? `min="${options.min}"` : ''}
68
+ ${options?.max !== undefined ? `max="${options.max}"` : ''}
68
69
  placeholder${options?.placeholder ? `="${options.placeholder}"` : ''}
69
70
  ${options?.value !== undefined ? `value="${options.value}"` : ''}
70
71
  ${options?.autocomplete ? `autocomplete="${options.autocomplete}"` : ''}
@@ -359,4 +360,9 @@ const InputFile = {
359
360
  },
360
361
  };
361
362
 
362
- export { Input, InputFile, fileFormDataFactory, getSrcFromFileData, getFileFromFileData };
363
+ function isTextInputFocused() {
364
+ const active = document.activeElement;
365
+ return active && (active.tagName === 'INPUT' || active.tagName === 'TEXTAREA');
366
+ }
367
+
368
+ export { Input, InputFile, fileFormDataFactory, getSrcFromFileData, getFileFromFileData, isTextInputFocused };
@@ -189,6 +189,9 @@ const LogIn = {
189
189
  </form>
190
190
  `;
191
191
  },
192
+ cleanMainUser: () => {
193
+ LogIn.Scope.user.main.model.user = {};
194
+ },
192
195
  };
193
196
 
194
197
  export { LogIn };
@@ -8,7 +8,7 @@ import { Webhook } from './Webhook.js';
8
8
  const LogOut = {
9
9
  Event: {},
10
10
  Trigger: async function (options) {
11
- LogIn.Scope.user.main.model.user = {};
11
+ LogIn.cleanMainUser();
12
12
  await Webhook.unregister();
13
13
  for (const eventKey of Object.keys(this.Event)) await this.Event[eventKey](options);
14
14
  if (s(`.session`))
@@ -28,7 +28,7 @@ import { setDocTitle, closeModalRouteChangeEvent, handleModalViewRoute } from '.
28
28
  import { NotificationManager } from './NotificationManager.js';
29
29
  import { EventsUI } from './EventsUI.js';
30
30
  import { Translate } from './Translate.js';
31
- import { Input } from './Input.js';
31
+ import { Input, isTextInputFocused } from './Input.js';
32
32
  import { Validator } from './Validator.js';
33
33
  import { DropDown } from './DropDown.js';
34
34
  import { Keyboard } from './Keyboard.js';
@@ -51,6 +51,7 @@ const Modal = {
51
51
  RouterInstance: {},
52
52
  disableTools: [],
53
53
  observer: false,
54
+ disableBoxShadow: false,
54
55
  },
55
56
  ) {
56
57
  if (options.heightBottomBar === undefined) options.heightBottomBar = 50;
@@ -89,6 +90,11 @@ const Modal = {
89
90
  onHome: {},
90
91
  homeModals: options.homeModals ? options.homeModals : [],
91
92
  query: options.query ? `${window.location.search}` : undefined,
93
+ getTop: () => window.innerHeight - (options.heightBottomBar ? options.heightBottomBar : heightDefaultBottomBar),
94
+ getHeight: () =>
95
+ window.innerHeight -
96
+ (options.heightTopBar ? options.heightTopBar : heightDefaultTopBar) -
97
+ (options.heightBottomBar ? options.heightBottomBar : heightDefaultBottomBar),
92
98
  };
93
99
 
94
100
  if (idModal !== 'main-body' && options.mode !== 'view') {
@@ -117,12 +123,7 @@ const Modal = {
117
123
 
118
124
  Responsive.Event[`view-${idModal}`] = () => {
119
125
  if (!this.Data[idModal]) return delete Responsive.Event[`view-${idModal}`];
120
- if (this.Data[idModal].slideMenu)
121
- s(`.${idModal}`).style.height = `${
122
- window.innerHeight -
123
- (options.heightTopBar ? options.heightTopBar : heightDefaultTopBar) -
124
- (options.heightBottomBar ? options.heightBottomBar : heightDefaultBottomBar)
125
- }px`;
126
+ if (this.Data[idModal].slideMenu) s(`.${idModal}`).style.height = `${this.Data[idModal].getHeight()}px`;
126
127
  };
127
128
  Responsive.Event[`view-${idModal}`]();
128
129
 
@@ -186,7 +187,7 @@ const Modal = {
186
187
  `.default-slide-menu-top-bar-fix-title-container`,
187
188
  html`
188
189
  <div class="inl default-slide-menu-top-bar-fix-title-container-text">
189
- ${options.RouterInstance.NameApp}
190
+ ${options.RouterInstance.BannerAppTemplate}
190
191
  </div>
191
192
  `,
192
193
  );
@@ -207,11 +208,7 @@ const Modal = {
207
208
  const { barConfig } = options;
208
209
  options.style = {
209
210
  position: 'absolute',
210
- height: `${
211
- window.innerHeight -
212
- (options.heightTopBar ? options.heightTopBar : heightDefaultTopBar) -
213
- (options.heightBottomBar ? options.heightBottomBar : heightDefaultBottomBar)
214
- }px`,
211
+ height: `${Modal.Data[idModal].getHeight()}px`,
215
212
  width: `${slideMenuWidth}px`,
216
213
  // 'overflow-x': 'hidden',
217
214
  // overflow: 'visible', // required for tooltip
@@ -239,11 +236,7 @@ const Modal = {
239
236
  if (this.Data[_idModal].slideMenu && this.Data[_idModal].slideMenu.id === idModal)
240
237
  this.Data[_idModal].slideMenu.callBack();
241
238
  }
242
- s(`.${idModal}`).style.height = `${
243
- window.innerHeight -
244
- (options.heightTopBar ? options.heightTopBar : heightDefaultTopBar) -
245
- (options.heightBottomBar ? options.heightBottomBar : heightDefaultBottomBar)
246
- }px`;
239
+ s(`.${idModal}`).style.height = `${Modal.Data[idModal].getHeight()}px`;
247
240
  if (s(`.main-body-top`)) {
248
241
  if (Modal.mobileModal()) {
249
242
  if (s(`.btn-menu-${idModal}`).classList.contains('hide') && collapseSlideMenuWidth !== slideMenuWidth)
@@ -502,7 +495,7 @@ const Modal = {
502
495
  class="abs modal slide-menu-top-bar-fix"
503
496
  style="height: ${options.heightTopBar}px; top: 0px"
504
497
  >
505
- <a class="a-link-top-banner">
498
+ <a class="a-link-top-banner fl">
506
499
  <div class="inl">${await options.slideMenuTopBarBannerFix()}</div></a
507
500
  >
508
501
  </div>`
@@ -608,6 +601,7 @@ const Modal = {
608
601
  }),
609
602
  );
610
603
  s(`.search-result-btn-${result.routerId}`).onclick = () => {
604
+ if (!s(`.html-${searchBoxHistoryId}`) || !s(`.html-${searchBoxHistoryId}`).hasChildNodes()) return;
611
605
  s(`.html-${searchBoxHistoryId}`).childNodes[currentKeyBoardSearchBoxIndex].classList.remove(
612
606
  `main-btn-menu-active`,
613
607
  );
@@ -621,6 +615,7 @@ const Modal = {
621
615
  };
622
616
 
623
617
  const getResultSearchBox = (validatorData) => {
618
+ if (!s(`.html-${searchBoxHistoryId}`) || !s(`.html-${searchBoxHistoryId}`).hasChildNodes()) return;
624
619
  const { model, id } = validatorData;
625
620
  switch (model) {
626
621
  case 'search-box':
@@ -751,9 +746,12 @@ const Modal = {
751
746
  s(`.main-btn-${results[currentKeyBoardSearchBoxIndex].routerId}`).click();
752
747
  Modal.removeModal(searchBoxHistoryId);
753
748
  };
754
-
749
+ let boxHistoryDelayRender = 0;
755
750
  const searchBoxHistoryOpen = async () => {
756
- if (!s(`.${id}`)) {
751
+ if (boxHistoryDelayRender) return;
752
+ boxHistoryDelayRender = 1000;
753
+ setTimeout(() => (boxHistoryDelayRender = 0));
754
+ if (!s(`.${searchBoxHistoryId}`)) {
757
755
  const { barConfig } = await Themes[Css.currentTheme]();
758
756
  barConfig.buttons.maximize.disabled = true;
759
757
  barConfig.buttons.minimize.disabled = true;
@@ -761,7 +759,7 @@ const Modal = {
761
759
  barConfig.buttons.menu.disabled = true;
762
760
  barConfig.buttons.close.disabled = false;
763
761
  await Modal.Render({
764
- id,
762
+ id: searchBoxHistoryId,
765
763
  barConfig,
766
764
  title: html`<div class="search-box-recent-title">
767
765
  ${renderViewTitle({
@@ -962,6 +960,7 @@ const Modal = {
962
960
  heightBottomBar: originHeightBottomBar,
963
961
  barMode: options.barMode,
964
962
  observer: true,
963
+ disableBoxShadow: true,
965
964
  });
966
965
  const maxWidthInputSearchBox = 450;
967
966
  const paddingInputSearchBox = 5;
@@ -983,12 +982,7 @@ const Modal = {
983
982
  s(`.top-bar-search-box`).style.top = `${
984
983
  (originHeightTopBar - s(`.top-bar-search-box`).clientHeight) / 2
985
984
  }px`;
986
- if (this.Data[id].slideMenu)
987
- s(`.${id}`).style.height = `${
988
- window.innerHeight -
989
- (options.heightTopBar ? options.heightTopBar : heightDefaultTopBar) -
990
- (options.heightBottomBar ? options.heightBottomBar : heightDefaultBottomBar)
991
- }px`;
985
+ if (this.Data[id].slideMenu) s(`.${id}`).style.height = `${Modal.Data[id].getHeight()}px`;
992
986
  };
993
987
  Responsive.Event[`view-${id}`]();
994
988
  Keyboard.instanceMultiPressKey({
@@ -998,6 +992,7 @@ const Modal = {
998
992
  ['Alt', 'k'],
999
993
  ],
1000
994
  eventCallBack: () => {
995
+ if (isTextInputFocused()) return;
1001
996
  if (s(`.top-bar-search-box`)) {
1002
997
  if (s(`.main-body-btn-ui-close`).classList.contains('hide')) {
1003
998
  s(`.main-body-btn-ui-open`).click();
@@ -1116,9 +1111,7 @@ const Modal = {
1116
1111
  if (!this.Data[id] || !s(`.${id}`)) return delete Responsive.Event[`view-${id}`];
1117
1112
  // <div class="in fll right-offset-menu-bottom-bar" style="height: 100%"></div>
1118
1113
  // s(`.right-offset-menu-bottom-bar`).style.width = `${window.innerWidth - slideMenuWidth}px`;
1119
- s(`.${id}`).style.top = `${
1120
- window.innerHeight - (options.heightBottomBar ? options.heightBottomBar : heightDefaultBottomBar)
1121
- }px`;
1114
+ s(`.${id}`).style.top = `${Modal.Data[id].getTop()}px`;
1122
1115
  };
1123
1116
  Responsive.Event[`view-${id}`]();
1124
1117
  }
@@ -1157,7 +1150,7 @@ const Modal = {
1157
1150
  if (s(`.slide-menu-top-bar-fix`)) {
1158
1151
  htmls(
1159
1152
  `.slide-menu-top-bar-fix`,
1160
- html`<a class="a-link-top-banner">${await options.slideMenuTopBarBannerFix()}</a>`,
1153
+ html`<a class="a-link-top-banner fl">${await options.slideMenuTopBarBannerFix()}</a>`,
1161
1154
  );
1162
1155
  Modal.setTopBannerLink();
1163
1156
  }
@@ -1290,11 +1283,7 @@ const Modal = {
1290
1283
  s(`.main-body-btn-ui-close`).classList.contains('hide') &&
1291
1284
  s(`.btn-restore-${id}`).style.display !== 'none'
1292
1285
  ? `${window.innerHeight}px`
1293
- : `${
1294
- window.innerHeight -
1295
- (options.heightTopBar ? options.heightTopBar : heightDefaultTopBar) -
1296
- (options.heightBottomBar ? options.heightBottomBar : heightDefaultBottomBar)
1297
- }px`;
1286
+ : `${Modal.Data[id].getHeight()}px`;
1298
1287
 
1299
1288
  if (
1300
1289
  s(`.main-body-btn-ui-close`).classList.contains('hide') &&
@@ -1402,7 +1391,11 @@ const Modal = {
1402
1391
  }
1403
1392
  </style>
1404
1393
  ${renderStyleTag(`style-${idModal}`, `.${idModal}`, options)}
1405
- <div class="fix ${options && options.class ? options.class : ''} modal box-shadow ${idModal}">
1394
+ <div
1395
+ class="fix ${options && options.class ? options.class : ''} modal ${options.disableBoxShadow
1396
+ ? ''
1397
+ : 'box-shadow'} ${idModal}"
1398
+ >
1406
1399
  <div class="abs modal-handle-${idModal}"></div>
1407
1400
  <div class="in modal-html-${idModal}">
1408
1401
  <div class="stq bar-default-modal bar-default-modal-${idModal}">
@@ -1915,11 +1908,7 @@ const Modal = {
1915
1908
  if (s(`.btn-restore-${idModal}`) && s(`.btn-restore-${idModal}`).style.display !== 'none') {
1916
1909
  s(`.${idModal}`).style.height = s(`.main-body-btn-ui-close`).classList.contains('hide')
1917
1910
  ? `${window.innerHeight}px`
1918
- : `${
1919
- window.innerHeight -
1920
- (options.heightTopBar ? options.heightTopBar : heightDefaultTopBar) -
1921
- (options.heightBottomBar ? options.heightBottomBar : heightDefaultBottomBar)
1922
- }px`;
1911
+ : `${Modal.Data[idModal].getHeight()}px`;
1923
1912
  }
1924
1913
  s(`.${idModal}`).style.top = s(`.main-body-btn-ui-close`).classList.contains('hide')
1925
1914
  ? `0px`