underpost 2.85.1 → 2.89.0

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 (53) hide show
  1. package/.env.development +2 -1
  2. package/.env.production +2 -1
  3. package/.env.test +2 -1
  4. package/.github/workflows/release.cd.yml +3 -3
  5. package/.vscode/zed.keymap.json +22 -0
  6. package/README.md +3 -3
  7. package/bin/build.js +8 -10
  8. package/bin/deploy.js +4 -2
  9. package/bin/file.js +4 -0
  10. package/bin/vs.js +4 -4
  11. package/cli.md +16 -11
  12. package/manifests/deployment/dd-default-development/deployment.yaml +2 -2
  13. package/manifests/deployment/dd-test-development/deployment.yaml +50 -50
  14. package/manifests/deployment/dd-test-development/proxy.yaml +4 -4
  15. package/package.json +2 -2
  16. package/src/api/file/file.service.js +29 -3
  17. package/src/cli/baremetal.js +4 -5
  18. package/src/cli/deploy.js +26 -4
  19. package/src/cli/index.js +8 -3
  20. package/src/cli/repository.js +42 -45
  21. package/src/cli/run.js +217 -48
  22. package/src/client/components/core/AgGrid.js +42 -3
  23. package/src/client/components/core/CommonJs.js +5 -0
  24. package/src/client/components/core/Css.js +95 -48
  25. package/src/client/components/core/CssCore.js +0 -1
  26. package/src/client/components/core/LoadingAnimation.js +2 -2
  27. package/src/client/components/core/Logger.js +2 -9
  28. package/src/client/components/core/Modal.js +22 -14
  29. package/src/client/components/core/ObjectLayerEngine.js +300 -9
  30. package/src/client/components/core/ObjectLayerEngineModal.js +686 -148
  31. package/src/client/components/core/ObjectLayerEngineViewer.js +1061 -0
  32. package/src/client/components/core/Pagination.js +15 -5
  33. package/src/client/components/core/Router.js +5 -1
  34. package/src/client/components/core/SocketIo.js +5 -1
  35. package/src/client/components/core/Translate.js +4 -0
  36. package/src/client/components/core/Worker.js +8 -1
  37. package/src/client/services/default/default.management.js +86 -16
  38. package/src/client/sw/default.sw.js +193 -97
  39. package/src/client.dev.js +1 -1
  40. package/src/db/mariadb/MariaDB.js +2 -2
  41. package/src/index.js +1 -1
  42. package/src/proxy.js +1 -1
  43. package/src/runtime/express/Express.js +4 -1
  44. package/src/server/auth.js +2 -1
  45. package/src/server/client-build.js +57 -2
  46. package/src/server/conf.js +132 -15
  47. package/src/server/object-layer.js +44 -0
  48. package/src/server/proxy.js +53 -26
  49. package/src/server/start.js +25 -3
  50. package/src/server/tls.js +1 -1
  51. package/src/ws/IoInterface.js +2 -3
  52. package/AUTHORS.md +0 -21
  53. package/src/server/network.js +0 -72
@@ -221,8 +221,11 @@ const borderChar = (px, color, selectors, hover = false) => {
221
221
  (selector) => html`
222
222
  <style>
223
223
  ${selector}${hover ? ':hover' : ''} {
224
- text-shadow: ${px}px -${px}px ${px}px ${color}, -${px}px ${px}px ${px}px ${color},
225
- -${px}px -${px}px ${px}px ${color}, ${px}px ${px}px ${px}px ${color};
224
+ text-shadow:
225
+ ${px}px -${px}px ${px}px ${color},
226
+ -${px}px ${px}px ${px}px ${color},
227
+ -${px}px -${px}px ${px}px ${color},
228
+ ${px}px ${px}px ${px}px ${color};
226
229
  }
227
230
  </style>
228
231
  `,
@@ -239,20 +242,28 @@ const boxShadow = ({ selector }) => html`
239
242
  ? html`
240
243
  <style>
241
244
  ${selector} {
242
- box-shadow: 0 4px 8px 0 rgba(255, 255, 255, 0.1), 0 6px 20px 0 rgba(255, 255, 255, 0.08);
245
+ box-shadow:
246
+ 0 4px 8px 0 rgba(255, 255, 255, 0.1),
247
+ 0 6px 20px 0 rgba(255, 255, 255, 0.08);
243
248
  }
244
249
  ${selector}:hover {
245
- box-shadow: 0 8px 16px 0 rgba(255, 255, 255, 0.15), 0 10px 30px 0 rgba(255, 255, 255, 0.1);
250
+ box-shadow:
251
+ 0 8px 16px 0 rgba(255, 255, 255, 0.15),
252
+ 0 10px 30px 0 rgba(255, 255, 255, 0.1);
246
253
  }
247
254
  </style>
248
255
  `
249
256
  : html`
250
257
  <style>
251
258
  ${selector} {
252
- box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
259
+ box-shadow:
260
+ 0 4px 8px 0 rgba(0, 0, 0, 0.2),
261
+ 0 6px 20px 0 rgba(0, 0, 0, 0.19);
253
262
  }
254
263
  ${selector}:hover {
255
- box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.2), 0 10px 30px 0 rgba(0, 0, 0, 0.3);
264
+ box-shadow:
265
+ 0 8px 16px 0 rgba(0, 0, 0, 0.2),
266
+ 0 10px 30px 0 rgba(0, 0, 0, 0.3);
256
267
  }
257
268
  </style>
258
269
  `}
@@ -452,7 +463,9 @@ const typeWriter = async function ({ id, html, seconds, endHideBlink, container
452
463
  overflow: hidden;
453
464
  border-right: 0.15em solid orange;
454
465
  white-space: nowrap;
455
- animation: typing-${id} ${typingAnimationTransitionStyle[1]}, blink-caret-${id} 0.5s step-end infinite;
466
+ animation:
467
+ typing-${id} ${typingAnimationTransitionStyle[1]},
468
+ blink-caret-${id} 0.5s step-end infinite;
456
469
  animation-fill-mode: forwards;
457
470
  width: 0;
458
471
  }
@@ -517,12 +530,20 @@ const dashRange = ({ selector, color }) => {
517
530
  return html`
518
531
  <style>
519
532
  .${selector} {
520
- background: linear-gradient(90deg, ${color} 50%, transparent 50%),
521
- linear-gradient(90deg, ${color} 50%, transparent 50%), linear-gradient(0deg, ${color} 50%, transparent 50%),
522
- linear-gradient(0deg, ${color} 50%, transparent 50%);
533
+ background:
534
+ linear-gradient(90deg, ${color} 50%, transparent 50%), linear-gradient(90deg, ${color} 50%, transparent 50%),
535
+ linear-gradient(0deg, ${color} 50%, transparent 50%), linear-gradient(0deg, ${color} 50%, transparent 50%);
523
536
  background-repeat: repeat-x, repeat-x, repeat-y, repeat-y;
524
- background-size: 16px 4px, 16px 4px, 4px 16px, 4px 16px;
525
- background-position: 0% 0%, 100% 100%, 0% 100%, 100% 0px;
537
+ background-size:
538
+ 16px 4px,
539
+ 16px 4px,
540
+ 4px 16px,
541
+ 4px 16px;
542
+ background-position:
543
+ 0% 0%,
544
+ 100% 100%,
545
+ 0% 100%,
546
+ 100% 0px;
526
547
  border-radius: 5px;
527
548
  padding: 10px;
528
549
  animation: ${selector}_dash_range 5s linear infinite;
@@ -530,7 +551,11 @@ const dashRange = ({ selector, color }) => {
530
551
 
531
552
  @keyframes ${selector}_dash_range {
532
553
  to {
533
- background-position: 100% 0%, 0% 100%, 0% 0%, 100% 100%;
554
+ background-position:
555
+ 100% 0%,
556
+ 0% 100%,
557
+ 0% 0%,
558
+ 100% 100%;
534
559
  }
535
560
  }
536
561
  </style>
@@ -660,8 +685,8 @@ const scrollBarLightRender = () => {
660
685
  ::-` +
661
686
  b +
662
687
  `-scrollbar {
663
- width: 5px;
664
- height: 5px;
688
+ width: 5px;
689
+ height: 5px;
665
690
  }
666
691
 
667
692
  /* Track */
@@ -690,6 +715,10 @@ const scrollBarLightRender = () => {
690
715
  .join('');
691
716
  };
692
717
 
718
+ // adjustHex: supports #RGB #RGBA #RRGGBB #RRGGBBAA
719
+ // preserves alpha channel if present (does not modify it)
720
+ // usage: adjustHex('#24FBFFFF', 0.1)
721
+
693
722
  function adjustHex(hex, factor = 0.1, options = {}) {
694
723
  if (typeof hex !== 'string') throw new TypeError('hex must be a string');
695
724
  if (typeof factor !== 'number') throw new TypeError('factor must be a number');
@@ -701,27 +730,34 @@ function adjustHex(hex, factor = 0.1, options = {}) {
701
730
 
702
731
  const mode = options.mode === 'hsl' ? 'hsl' : 'mix';
703
732
 
704
- // normalize hex
733
+ // normalize hex: accept 3,4,6,8 (with or without #)
705
734
  let h = hex.replace(/^#/, '').trim();
706
- if (!(h.length === 3 || h.length === 6)) throw new Error('Invalid hex format');
707
- if (h.length === 3)
735
+ if (![3, 4, 6, 8].includes(h.length)) {
736
+ throw new Error('Invalid hex format — expected 3, 4, 6 or 8 hex digits');
737
+ }
738
+
739
+ // expand shorthand (#RGB or #RGBA -> #RRGGBB or #RRGGBBAA)
740
+ if (h.length === 3 || h.length === 4) {
708
741
  h = h
709
742
  .split('')
710
743
  .map((c) => c + c)
711
744
  .join('');
745
+ }
746
+
747
+ const hasAlpha = h.length === 8;
712
748
 
713
749
  const r = parseInt(h.slice(0, 2), 16);
714
750
  const g = parseInt(h.slice(2, 4), 16);
715
751
  const b = parseInt(h.slice(4, 6), 16);
752
+ const a = hasAlpha ? parseInt(h.slice(6, 8), 16) : null; // keep alpha as-is if present
716
753
 
717
- const clamp = (v, a = 0, z = 255) => Math.max(a, Math.min(z, v));
754
+ const clamp = (v, a0 = 0, z = 255) => Math.max(a0, Math.min(z, v));
718
755
 
719
- const rgbToHex = (rr, gg, bb) =>
720
- '#' +
721
- [rr, gg, bb]
722
- .map((v) => Math.round(v).toString(16).padStart(2, '0'))
723
- .join('')
724
- .toLowerCase();
756
+ const rgbToHex = (rr, gg, bb, aa = null) => {
757
+ const parts = [rr, gg, bb].map((v) => Math.round(v).toString(16).padStart(2, '0'));
758
+ if (aa !== null) parts.push(Math.round(aa).toString(16).padStart(2, '0'));
759
+ return '#' + parts.join('').toLowerCase();
760
+ };
725
761
 
726
762
  if (mode === 'mix') {
727
763
  // positive: mix toward white (255); negative: mix toward black (0)
@@ -729,11 +765,15 @@ function adjustHex(hex, factor = 0.1, options = {}) {
729
765
  if (factor >= 0) {
730
766
  return clamp(Math.round(c + (255 - c) * factor));
731
767
  } else {
732
- const a = Math.abs(factor);
733
- return clamp(Math.round(c * (1 - a)));
768
+ const aFactor = Math.abs(factor);
769
+ return clamp(Math.round(c * (1 - aFactor)));
734
770
  }
735
771
  };
736
- return rgbToHex(mixChannel(r), mixChannel(g), mixChannel(b));
772
+
773
+ const rr = mixChannel(r);
774
+ const gg = mixChannel(g);
775
+ const bb = mixChannel(b);
776
+ return rgbToHex(rr, gg, bb, a);
737
777
  } else {
738
778
  // HSL mode: convert rgb to hsl, adjust L by factor, convert back
739
779
  const rgbToHsl = (r, g, b) => {
@@ -791,10 +831,16 @@ function adjustHex(hex, factor = 0.1, options = {}) {
791
831
  let newL = ll + factor;
792
832
  newL = Math.max(0, Math.min(1, newL));
793
833
  const { r: r2, g: g2, b: b2 } = hslToRgb(hh, ss, newL);
794
- return rgbToHex(r2, g2, b2);
834
+ return rgbToHex(r2, g2, b2, a);
795
835
  }
796
836
  }
797
837
 
838
+ // Examples (uncomment to test):
839
+ // console.log(adjustHex('#24FBFFFF', 0.1)); // accepts 8-digit input
840
+ // console.log(adjustHex('#24FBFF', 0.1)); // 6-digit
841
+ // console.log(adjustHex('#4bf', -0.2)); // 3-digit
842
+ // console.log(adjustHex('#4bf8', -0.2)); // 4-digit (with alpha)
843
+
798
844
  // Convenience helpers:
799
845
  function lightenHex(hex, percentOr01 = 0.1, options = {}) {
800
846
  return adjustHex(hex, Math.abs(percentOr01), options);
@@ -867,7 +913,7 @@ const scrollBarDarkRender = () => {
867
913
  b +
868
914
  `-scrollbar {
869
915
  width: 8px;
870
- height: 8px;
916
+ height: 8px;
871
917
  /* line-height: 1em; */
872
918
  }
873
919
 
@@ -1011,29 +1057,30 @@ const cssEffect = async (containerSelector, event) => {
1011
1057
  }, 600);
1012
1058
  };
1013
1059
 
1014
- const imageShimmer = () => html`<div
1015
- class="abs center ssr-shimmer-search-box"
1016
- style="${renderCssAttr({
1017
- style: {
1018
- width: '95%',
1019
- height: '95%',
1020
- 'border-radius': '10px',
1021
- overflow: 'hidden',
1022
- },
1023
- })}"
1024
- >
1025
- <div
1026
- class="abs center"
1060
+ const imageShimmer = () =>
1061
+ html`<div
1062
+ class="abs center ssr-shimmer-search-box"
1027
1063
  style="${renderCssAttr({
1028
1064
  style: {
1029
- 'font-size': '70px',
1030
- color: `#bababa`,
1065
+ width: '95%',
1066
+ height: '95%',
1067
+ 'border-radius': '10px',
1068
+ overflow: 'hidden',
1031
1069
  },
1032
1070
  })}"
1033
1071
  >
1034
- <i class="fa-solid fa-photo-film"></i>
1035
- </div>
1036
- </div>`;
1072
+ <div
1073
+ class="abs center"
1074
+ style="${renderCssAttr({
1075
+ style: {
1076
+ 'font-size': '70px',
1077
+ color: `#bababa`,
1078
+ },
1079
+ })}"
1080
+ >
1081
+ <i class="fa-solid fa-photo-film"></i>
1082
+ </div>
1083
+ </div>`;
1037
1084
 
1038
1085
  const renderChessPattern = (patternSize = 20) =>
1039
1086
  `background: repeating-conic-gradient(#808080 0 25%, #0000 0 50%) 50% / ${patternSize}px ${patternSize}px`;
@@ -230,7 +230,6 @@ const CssCommonCore = async () => {
230
230
  .menu-btn-icon {
231
231
  font-size: 20px;
232
232
  width: 40px;
233
- overflow: hidden;
234
233
  text-align: center;
235
234
  }
236
235
  </style>
@@ -57,7 +57,7 @@ const LoadingAnimation = {
57
57
  },
58
58
  spinner: {
59
59
  getId: (id) => `spinner-progress-${id.slice(1)}`,
60
- play: async function (container, spinner) {
60
+ play: async function (container, spinner, options = { append: '', prepend: '' }) {
61
61
  if (!s(container)) return;
62
62
  const id = this.getId(container);
63
63
 
@@ -85,7 +85,7 @@ const LoadingAnimation = {
85
85
  style,
86
86
  })}"
87
87
  >
88
- ${render}
88
+ ${options.prepend ? options.prepend : ''} ${render} ${options.append ? options.append : ''}
89
89
  </div>
90
90
  `,
91
91
  );
@@ -5,16 +5,9 @@ const loggerFactory = (meta, options = { trace: false }) => {
5
5
  const types = ['error', 'warn', 'info', 'debug'];
6
6
  const logger = {
7
7
  log: function (type, args) {
8
- if (location.hostname !== 'localhost' && console.log() !== null) {
9
- console.log = () => null;
10
- console.error = () => null;
11
- console.info = () => null;
12
- console.warn = () => null;
13
- }
8
+ if (!window.renderPayload.dev) return;
14
9
  if (options.trace === true) args.push(getCurrentTrace().split('Logger.js:23')[1]);
15
- return location.hostname === 'localhost'
16
- ? console[type](`[${meta}] ${new Date().toISOString()} ${type}:`, ...args)
17
- : null;
10
+ return console[type](`[${meta}] ${new Date().toISOString()} ${type}:`, ...args);
18
11
  },
19
12
  };
20
13
  types.map(
@@ -465,6 +465,7 @@ const Modal = {
465
465
  >
466
466
  ${await Input.Render({
467
467
  id: inputSearchBoxId,
468
+ autocomplete: 'off',
468
469
  placeholder: Modal.mobileModal() ? Translate.Render('search', '.top-bar-search-box') : undefined, // html`<i class="fa-solid fa-magnifying-glass"></i> ${Translate.Render('search')}`,
469
470
  placeholderIcon: html`<div
470
471
  class="in fll"
@@ -619,12 +620,12 @@ const Modal = {
619
620
  result.fontAwesomeIcon
620
621
  ? html`<i class="${result.fontAwesomeIcon.classList.toString()}"></i> `
621
622
  : result.imgElement
622
- ? html`<img
623
- class="inl"
624
- src="${result.imgElement.src}"
625
- style="${renderCssAttr({ style: { width: '25px', height: '25px' } })}"
626
- />`
627
- : ''
623
+ ? html`<img
624
+ class="inl"
625
+ src="${result.imgElement.src}"
626
+ style="${renderCssAttr({ style: { width: '25px', height: '25px' } })}"
627
+ />`
628
+ : ''
628
629
  } ${Translate.Render(result.routerId)}`,
629
630
  class: `wfa search-result-btn-${result.routerId} ${
630
631
  indexResult === currentKeyBoardSearchBoxIndex ? 'main-btn-menu-active' : ''
@@ -692,10 +693,12 @@ const Modal = {
692
693
  });
693
694
  const imgElement = getAllChildNodes(s(`.main-btn-${routerId}`)).find((e) => {
694
695
  return (
695
- typeof e.src === 'string' &&
696
- e.src.match(routerId) &&
697
696
  e.classList &&
698
- Array.from(e.classList).find((e) => e.match('img-btn-square-menu'))
697
+ Array.from(e.classList).find((e) =>
698
+ options.searchCustomImgClass
699
+ ? e.match(options.searchCustomImgClass)
700
+ : e.match('img-btn-square-menu'),
701
+ )
699
702
  );
700
703
  });
701
704
  if (imgElement || fontAwesomeIcon) {
@@ -1896,8 +1899,8 @@ const Modal = {
1896
1899
  const idSlide = this.Data[options.slideMenu]['slide-menu']
1897
1900
  ? 'slide-menu'
1898
1901
  : this.Data[options.slideMenu]['slide-menu-right']
1899
- ? 'slide-menu-right'
1900
- : 'slide-menu-left';
1902
+ ? 'slide-menu-right'
1903
+ : 'slide-menu-left';
1901
1904
  const callBack = () => {
1902
1905
  s(`.${idModal}`).style.transition = '0.3s';
1903
1906
  s(`.${idModal}`).style.width = `${windowGetW() - this.Data[options.slideMenu][idSlide].width}px`;
@@ -2038,7 +2041,10 @@ const Modal = {
2038
2041
  setTopModal();
2039
2042
  this.Data[idModal].onClickListener[`${idModal}-z-index`] = () => {
2040
2043
  if (s(`.${idModal}`) && s(`.${idModal}`).style.zIndex === '3') {
2041
- if (this.Data[idModal].options.route) setPath(`${getProxyPath()}${this.Data[idModal].options.route}`);
2044
+ if (this.Data[idModal].options.route)
2045
+ setPath(
2046
+ `${getProxyPath()}${this.Data[idModal].options.route}${location.search ?? ''}${location.hash ?? ''}`,
2047
+ );
2042
2048
  cleanTopModal();
2043
2049
  setTopModal();
2044
2050
  }
@@ -2159,6 +2165,8 @@ const Modal = {
2159
2165
  };
2160
2166
  });
2161
2167
  },
2168
+ labelSelectorTopOffsetStartAnimation: `-40px`,
2169
+ labelSelectorTopOffsetEndAnimation: `-3px`,
2162
2170
  menuTextLabelAnimation: (idModal, subMenuId) => {
2163
2171
  if (
2164
2172
  !s(
@@ -2193,12 +2201,12 @@ const Modal = {
2193
2201
  el.style.transition = null;
2194
2202
  });
2195
2203
  sa(labelSelector).forEach((el) => {
2196
- el.style.top = '-40px';
2204
+ el.style.top = Modal.labelSelectorTopOffsetStartAnimation;
2197
2205
  });
2198
2206
  }, 300);
2199
2207
  setTimeout(() => {
2200
2208
  sa(labelSelector).forEach((el) => {
2201
- el.style.top = '-3px';
2209
+ el.style.top = Modal.labelSelectorTopOffsetEndAnimation;
2202
2210
  });
2203
2211
  }, 400);
2204
2212
  }