@underpostnet/underpost 2.8.5 → 2.8.7
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.
- package/.github/workflows/ghpkg.yml +1 -1
- package/.github/workflows/npmpkg.yml +1 -1
- package/.github/workflows/pwa-microservices-template.page.yml +1 -1
- package/.vscode/extensions.json +3 -2
- package/.vscode/settings.json +6 -0
- package/CHANGELOG.md +44 -0
- package/Dockerfile +9 -10
- package/README.md +39 -2
- package/bin/build.js +31 -6
- package/bin/deploy.js +1404 -202
- package/bin/file.js +8 -0
- package/bin/hwt.js +0 -10
- package/bin/index.js +1 -187
- package/bin/util.js +0 -7
- package/bin/vs.js +1 -0
- package/cli.md +451 -0
- package/conf.js +0 -2
- package/docker-compose.yml +1 -1
- package/jsdoc.json +1 -1
- package/manifests/calico-custom-resources.yaml +25 -0
- package/manifests/deployment/adminer/deployment.yaml +32 -0
- package/manifests/deployment/adminer/kustomization.yaml +7 -0
- package/manifests/deployment/adminer/service.yaml +13 -0
- package/manifests/deployment/fastapi/backend-deployment.yml +120 -0
- package/manifests/deployment/fastapi/backend-service.yml +19 -0
- package/manifests/deployment/fastapi/frontend-deployment.yml +54 -0
- package/manifests/deployment/fastapi/frontend-service.yml +15 -0
- package/manifests/deployment/kafka/deployment.yaml +69 -0
- package/manifests/kind-config-dev.yaml +12 -0
- package/manifests/kubeadm-calico-config.yaml +119 -0
- package/manifests/mongodb/kustomization.yaml +2 -2
- package/manifests/mongodb-4.4/kustomization.yaml +7 -0
- package/manifests/mongodb-4.4/service-deployment.yaml +63 -0
- package/manifests/postgresql/configmap.yaml +9 -0
- package/manifests/postgresql/kustomization.yaml +10 -0
- package/manifests/postgresql/pv.yaml +15 -0
- package/manifests/postgresql/pvc.yaml +13 -0
- package/manifests/{core/underpost-engine-headless-service.yaml → postgresql/service.yaml} +3 -3
- package/manifests/postgresql/statefulset.yaml +37 -0
- package/manifests/valkey/statefulset.yaml +6 -4
- package/package.json +10 -14
- package/src/api/default/default.service.js +1 -1
- package/src/api/user/user.service.js +14 -11
- package/src/cli/cluster.js +298 -63
- package/src/cli/cron.js +39 -8
- package/src/cli/db.js +118 -44
- package/src/cli/deploy.js +312 -102
- package/src/cli/env.js +9 -3
- package/src/cli/fs.js +161 -0
- package/src/cli/image.js +45 -104
- package/src/cli/index.js +312 -0
- package/src/cli/monitor.js +236 -0
- package/src/cli/repository.js +26 -2
- package/src/cli/script.js +25 -1
- package/src/cli/test.js +39 -4
- package/src/client/components/core/Account.js +28 -24
- package/src/client/components/core/Blockchain.js +1 -1
- package/src/client/components/core/CalendarCore.js +14 -73
- package/src/client/components/core/CommonJs.js +54 -2
- package/src/client/components/core/Css.js +0 -1
- package/src/client/components/core/CssCore.js +10 -4
- package/src/client/components/core/Docs.js +1 -2
- package/src/client/components/core/EventsUI.js +3 -3
- package/src/client/components/core/FileExplorer.js +86 -78
- package/src/client/components/core/Input.js +4 -2
- package/src/client/components/core/JoyStick.js +2 -2
- package/src/client/components/core/LoadingAnimation.js +3 -12
- package/src/client/components/core/LogIn.js +3 -3
- package/src/client/components/core/LogOut.js +1 -1
- package/src/client/components/core/Modal.js +44 -14
- package/src/client/components/core/Panel.js +26 -66
- package/src/client/components/core/PanelForm.js +22 -15
- package/src/client/components/core/Recover.js +3 -3
- package/src/client/components/core/RichText.js +1 -11
- package/src/client/components/core/Router.js +3 -1
- package/src/client/components/core/SignUp.js +2 -2
- package/src/client/components/default/RoutesDefault.js +3 -2
- package/src/client/services/core/core.service.js +15 -10
- package/src/client/services/default/default.management.js +45 -38
- package/src/client/ssr/Render.js +6 -1
- package/src/client/ssr/body/CacheControl.js +2 -3
- package/src/client/sw/default.sw.js +3 -3
- package/src/db/mongo/MongooseDB.js +17 -1
- package/src/index.js +25 -1
- package/src/mailer/MailerProvider.js +3 -0
- package/src/runtime/lampp/Dockerfile +65 -0
- package/src/server/backup.js +3 -3
- package/src/server/client-build.js +45 -23
- package/src/server/client-formatted.js +2 -1
- package/src/server/conf.js +110 -16
- package/src/server/dns.js +74 -43
- package/src/server/downloader.js +0 -8
- package/src/server/json-schema.js +77 -0
- package/src/server/network.js +7 -122
- package/src/server/peer.js +2 -2
- package/src/server/proxy.js +4 -4
- package/src/server/runtime.js +40 -12
- package/src/server/start.js +122 -0
- package/src/server/valkey.js +25 -11
- package/test/api.test.js +0 -8
- package/manifests/core/kustomization.yaml +0 -11
- package/manifests/core/underpost-engine-backup-access.yaml +0 -16
- package/manifests/core/underpost-engine-backup-pv-pvc.yaml +0 -22
- package/manifests/core/underpost-engine-mongodb-backup-cronjob.yaml +0 -40
- package/manifests/core/underpost-engine-mongodb-configmap.yaml +0 -26
- package/manifests/core/underpost-engine-statefulset.yaml +0 -91
- package/manifests/valkey/underpost-engine-valkey-service.yaml +0 -17
- package/manifests/valkey/underpost-engine-valkey-statefulset.yaml +0 -39
- /package/manifests/{core/underpost-engine-pv-pvc.yaml → mongodb-4.4/pv-pvc.yaml} +0 -0
|
@@ -26,6 +26,7 @@ const Panel = {
|
|
|
26
26
|
idPanel: '',
|
|
27
27
|
parentIdModal: '',
|
|
28
28
|
scrollClassContainer: '',
|
|
29
|
+
htmlFormHeader: async () => '',
|
|
29
30
|
formData: [],
|
|
30
31
|
data: [],
|
|
31
32
|
originData: () => [],
|
|
@@ -54,7 +55,7 @@ const Panel = {
|
|
|
54
55
|
const openPanelForm = () => {
|
|
55
56
|
s(`.${idPanel}-form-body`).classList.remove('hide');
|
|
56
57
|
s(`.btn-${idPanel}-add`).classList.add('hide');
|
|
57
|
-
s(`.${scrollClassContainer}`).style.overflow = 'hidden';
|
|
58
|
+
// s(`.${scrollClassContainer}`).style.overflow = 'hidden';
|
|
58
59
|
if (options.customButtons) {
|
|
59
60
|
let customBtnIndex = -1;
|
|
60
61
|
for (const dataBtn of options.customButtons) {
|
|
@@ -88,12 +89,16 @@ const Panel = {
|
|
|
88
89
|
htmls(`.${idPanel}-cell-col-a-${id}`, render);
|
|
89
90
|
},
|
|
90
91
|
});
|
|
91
|
-
EventsUI.onClick(
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
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
|
+
);
|
|
97
102
|
EventsUI.onClick(`.${idPanel}-btn-edit-${id}`, async () => {
|
|
98
103
|
logger.warn('edit', obj);
|
|
99
104
|
if (obj._id) Panel.Tokens[idPanel].editId = obj._id;
|
|
@@ -120,7 +125,7 @@ const Panel = {
|
|
|
120
125
|
if (options.onClick) await options.onClick({ payload });
|
|
121
126
|
};
|
|
122
127
|
});
|
|
123
|
-
|
|
128
|
+
if (s(`.${idPanel}-${id}`)) s(`.${idPanel}-${id}`).remove();
|
|
124
129
|
return html` <div class="in box-shadow ${idPanel} ${idPanel}-${id}">
|
|
125
130
|
<div class="fl ${idPanel}-tools session-fl-log-in ${obj.tools ? '' : 'hide'}">
|
|
126
131
|
${await BtnIcon.Render({
|
|
@@ -243,13 +248,14 @@ const Panel = {
|
|
|
243
248
|
};
|
|
244
249
|
|
|
245
250
|
let render = '';
|
|
246
|
-
let renderForm = html` <div class="in modal
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
251
|
+
let renderForm = html` <div class="in modal" style="top: 0px; z-index: 1; padding-bottom: 5px">
|
|
252
|
+
${await BtnIcon.Render({
|
|
253
|
+
class: `inl section-mp btn-custom btn-${idPanel}-close`,
|
|
254
|
+
label: html`<i class="fa-solid fa-xmark"></i> ${Translate.Render('close')}`,
|
|
255
|
+
type: 'button',
|
|
256
|
+
})}
|
|
257
|
+
</div>
|
|
258
|
+
${options?.htmlFormHeader ? await options.htmlFormHeader() : ''}`;
|
|
253
259
|
|
|
254
260
|
for (const modelData of formData) {
|
|
255
261
|
if (modelData.disableRender) continue;
|
|
@@ -402,62 +408,19 @@ const Panel = {
|
|
|
402
408
|
}
|
|
403
409
|
let renderFormBtn = html`
|
|
404
410
|
${await BtnIcon.Render({
|
|
405
|
-
class: `section-mp btn-custom btn-${idPanel}-submit`,
|
|
411
|
+
class: `inl section-mp btn-custom btn-${idPanel}-submit`,
|
|
406
412
|
label: html`<span class="btn-${idPanel}-label-add"><i class="fas fa-plus"></i> ${Translate.Render('add')}</span
|
|
407
413
|
><span class="btn-${idPanel}-label-edit hide"><i class="fas fa-edit"></i> ${Translate.Render('edit')}</span>`,
|
|
408
414
|
type: 'submit',
|
|
409
415
|
})}
|
|
410
416
|
${await BtnIcon.Render({
|
|
411
|
-
class: `section-mp btn-custom btn-${idPanel}-clean`,
|
|
417
|
+
class: `inl section-mp btn-custom btn-${idPanel}-clean`,
|
|
412
418
|
label: html`<i class="fa-solid fa-broom"></i> ${Translate.Render('clear')}`,
|
|
413
419
|
type: 'button',
|
|
414
420
|
})}
|
|
415
421
|
`;
|
|
416
422
|
|
|
417
423
|
setTimeout(async () => {
|
|
418
|
-
const resizeParentModal = () => {
|
|
419
|
-
if (options.parentIdModal) {
|
|
420
|
-
Modal.Data[options.parentIdModal].onObserverListener[`form-panel-${options.parentIdModal}`] = () => {
|
|
421
|
-
if (s(`.${idPanel}-form-container`))
|
|
422
|
-
s(`.${idPanel}-form-container`).style.maxHeight = `${
|
|
423
|
-
s(`.${options.parentIdModal}`).offsetHeight - Modal.headerTitleHeight
|
|
424
|
-
}px`;
|
|
425
|
-
};
|
|
426
|
-
Modal.Data[options.parentIdModal].onObserverListener[`form-panel-${options.parentIdModal}`]();
|
|
427
|
-
} else {
|
|
428
|
-
Responsive.Event[`${idPanel}-responsive`] = () => {
|
|
429
|
-
if (s(`.${idPanel}-form-container`))
|
|
430
|
-
s(`.${idPanel}-form-container`).style.maxHeight =
|
|
431
|
-
options.route === 'home' &&
|
|
432
|
-
s(`.${idPanel}-form-body`) &&
|
|
433
|
-
!s(`.${idPanel}-form-body`).classList.contains('hide') &&
|
|
434
|
-
!s(`.main-body-btn-ui-open`).classList.contains('hide')
|
|
435
|
-
? `${window.innerHeight}px`
|
|
436
|
-
: `${window.innerHeight - heightTopBar - heightBottomBar}px`;
|
|
437
|
-
};
|
|
438
|
-
Responsive.Event[`${idPanel}-responsive`]();
|
|
439
|
-
}
|
|
440
|
-
};
|
|
441
|
-
if (options.route === 'home') {
|
|
442
|
-
Modal.Data['modal-menu'].onBarUiClose[`${idPanel}-responsive`] = () => {
|
|
443
|
-
resizeParentModal();
|
|
444
|
-
};
|
|
445
|
-
|
|
446
|
-
Modal.Data['modal-menu'].onBarUiOpen[`${idPanel}-responsive`] = () => {
|
|
447
|
-
resizeParentModal();
|
|
448
|
-
};
|
|
449
|
-
}
|
|
450
|
-
setTimeout(resizeParentModal);
|
|
451
|
-
if (options.route) {
|
|
452
|
-
RouterEvents[options.parentIdModal] = ({ route }) => {
|
|
453
|
-
if (route === options.route) {
|
|
454
|
-
setTimeout(() => {
|
|
455
|
-
resizeParentModal();
|
|
456
|
-
}, 350);
|
|
457
|
-
}
|
|
458
|
-
};
|
|
459
|
-
}
|
|
460
|
-
|
|
461
424
|
const validators = await Validator.instance(formData);
|
|
462
425
|
|
|
463
426
|
s(`.${idPanel}-form`).onsubmit = (e) => {
|
|
@@ -544,7 +507,7 @@ const Panel = {
|
|
|
544
507
|
s(`.${btnSelector}`).onclick = () => dataBtn.onClick();
|
|
545
508
|
});
|
|
546
509
|
customButtonsRender += ` ${await BtnIcon.Render({
|
|
547
|
-
class: `section-mp btn-custom ${btnSelector}`,
|
|
510
|
+
class: `inl section-mp btn-custom ${btnSelector}`,
|
|
548
511
|
label: dataBtn.label,
|
|
549
512
|
type: 'button',
|
|
550
513
|
})}`;
|
|
@@ -579,7 +542,6 @@ const Panel = {
|
|
|
579
542
|
padding: 10px;
|
|
580
543
|
cursor: pointer;
|
|
581
544
|
min-height: 400px;
|
|
582
|
-
overflow: hidden;
|
|
583
545
|
}
|
|
584
546
|
.${idPanel}:hover {
|
|
585
547
|
background: #ffffff;
|
|
@@ -649,12 +611,10 @@ const Panel = {
|
|
|
649
611
|
}
|
|
650
612
|
</style>
|
|
651
613
|
<div class="${idPanel}-container">
|
|
652
|
-
<div
|
|
653
|
-
class="stq modal ${idPanel}-form-container ${options.formContainerClass ? options.formContainerClass : ''}"
|
|
654
|
-
>
|
|
614
|
+
<div class="in modal ${idPanel}-form-container ${options.formContainerClass ? options.formContainerClass : ''}">
|
|
655
615
|
<div class="in ${idPanel}-form-header">
|
|
656
616
|
${await BtnIcon.Render({
|
|
657
|
-
class: `section-mp btn-custom btn-${idPanel}-add ${
|
|
617
|
+
class: `inl section-mp btn-custom btn-${idPanel}-add ${
|
|
658
618
|
options?.role?.add ? (!options.role.add() ? 'hide' : '') : ''
|
|
659
619
|
}`,
|
|
660
620
|
label: html`<i class="fas fa-plus"></i> ${Translate.Render('add')}`,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getCapVariableName,
|
|
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';
|
|
@@ -29,6 +28,8 @@ const PanelForm = {
|
|
|
29
28
|
Elements: {},
|
|
30
29
|
parentIdModal: undefined,
|
|
31
30
|
route: 'home',
|
|
31
|
+
htmlFormHeader: async () => '',
|
|
32
|
+
firsUpdateEvent: async () => {},
|
|
32
33
|
},
|
|
33
34
|
) {
|
|
34
35
|
const { idPanel, heightTopBar, heightBottomBar, defaultUrlImage, Elements } = options;
|
|
@@ -99,6 +100,7 @@ const PanelForm = {
|
|
|
99
100
|
heightTopBar,
|
|
100
101
|
heightBottomBar,
|
|
101
102
|
data,
|
|
103
|
+
htmlFormHeader: options.htmlFormHeader,
|
|
102
104
|
parentIdModal: options.parentIdModal,
|
|
103
105
|
originData: () => PanelForm.Data[idPanel].originData,
|
|
104
106
|
filesData: () => PanelForm.Data[idPanel].filesData,
|
|
@@ -380,7 +382,7 @@ const PanelForm = {
|
|
|
380
382
|
};
|
|
381
383
|
const renderSrrPanelData = async () =>
|
|
382
384
|
await panelRender({
|
|
383
|
-
data: range(0,
|
|
385
|
+
data: range(0, 0).map((i) => ({
|
|
384
386
|
id: i,
|
|
385
387
|
title: html`<div class="fl">
|
|
386
388
|
<div
|
|
@@ -421,9 +423,12 @@ const PanelForm = {
|
|
|
421
423
|
ssr: true,
|
|
422
424
|
})),
|
|
423
425
|
});
|
|
424
|
-
|
|
426
|
+
let firsUpdateEvent = false;
|
|
427
|
+
let lastCid;
|
|
425
428
|
this.Data[idPanel].updatePanel = async () => {
|
|
426
429
|
const cid = getQueryParams().cid ? getQueryParams().cid : '';
|
|
430
|
+
if (lastCid === cid) return;
|
|
431
|
+
lastCid = cid;
|
|
427
432
|
if (options.route === 'home') Modal.homeCid = newInstance(cid);
|
|
428
433
|
htmls(`.${options.parentIdModal ? 'html-' + options.parentIdModal : 'main-body'}`, await renderSrrPanelData());
|
|
429
434
|
await getPanelData();
|
|
@@ -431,24 +436,26 @@ const PanelForm = {
|
|
|
431
436
|
`.${options.parentIdModal ? 'html-' + options.parentIdModal : 'main-body'}`,
|
|
432
437
|
await panelRender({ data: this.Data[idPanel].data }),
|
|
433
438
|
);
|
|
439
|
+
if (!firsUpdateEvent && options.firsUpdateEvent) {
|
|
440
|
+
firsUpdateEvent = true;
|
|
441
|
+
await options.firsUpdateEvent();
|
|
442
|
+
}
|
|
434
443
|
};
|
|
435
|
-
if (options.route)
|
|
444
|
+
if (options.route) {
|
|
436
445
|
listenQueryPathInstance({
|
|
437
446
|
id: options.parentIdModal ? 'html-' + options.parentIdModal : 'main-body',
|
|
438
447
|
routeId: options.route,
|
|
439
448
|
event: async (path) => {
|
|
440
|
-
|
|
449
|
+
await this.Data[idPanel].updatePanel();
|
|
441
450
|
},
|
|
442
451
|
});
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
this.Data[idPanel].updatePanel();
|
|
451
|
-
});
|
|
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
|
+
}
|
|
452
459
|
|
|
453
460
|
if (options.parentIdModal) {
|
|
454
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
|
})}
|
|
@@ -7,28 +7,18 @@ const RichText = {
|
|
|
7
7
|
Render: async function (options = { id: '', parentIdModal: '' }) {
|
|
8
8
|
const id = options?.id ? options.id : getId(this.Tokens, 'rich-text-');
|
|
9
9
|
this.Tokens[id] = {};
|
|
10
|
-
let top, height;
|
|
11
10
|
setTimeout(() => {
|
|
12
11
|
const easyMDE = new EasyMDE({
|
|
13
12
|
element: s(`.${id}`),
|
|
13
|
+
hideIcons: ['fullscreen', 'side-by-side'],
|
|
14
14
|
onToggleFullScreen: (onFs) => {
|
|
15
15
|
if (onFs) {
|
|
16
16
|
if (options.parentIdModal) {
|
|
17
|
-
s(`.btn-bar-modal-container-${options.parentIdModal}`).classList.add('hide');
|
|
18
|
-
top = newInstance(s(`.${options.parentIdModal}`).style.top);
|
|
19
|
-
height = newInstance(s(`.${options.parentIdModal}`).style.height);
|
|
20
|
-
s(`.${options.parentIdModal}`).style.top = '0px';
|
|
21
|
-
s(`.${options.parentIdModal}`).style.height = `${window.innerHeight}px`;
|
|
22
17
|
}
|
|
23
18
|
// Modal.cleanUI();
|
|
24
|
-
if (s(`.slide-menu-top-bar`)) s(`.slide-menu-top-bar`).classList.add('hide');
|
|
25
19
|
} else {
|
|
26
20
|
if (options.parentIdModal) {
|
|
27
|
-
s(`.btn-bar-modal-container-${options.parentIdModal}`).classList.remove('hide');
|
|
28
|
-
s(`.${options.parentIdModal}`).style.top = top;
|
|
29
|
-
s(`.${options.parentIdModal}`).style.height = height;
|
|
30
21
|
}
|
|
31
|
-
if (s(`.slide-menu-top-bar`)) s(`.slide-menu-top-bar`).classList.add('remove');
|
|
32
22
|
// Modal.restoreUI();
|
|
33
23
|
}
|
|
34
24
|
},
|
|
@@ -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}/`}${
|
|
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: () =>
|
|
14
|
+
render: () => Modal.onHomeRouterEvent(),
|
|
14
15
|
upperCase: false,
|
|
15
16
|
},
|
|
16
|
-
'/home': { title: 'home', render: () =>
|
|
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 },
|
|
@@ -4,13 +4,24 @@ import { getProxyPath } from '../../components/core/VanillaJs.js';
|
|
|
4
4
|
|
|
5
5
|
const logger = loggerFactory(import.meta);
|
|
6
6
|
|
|
7
|
+
logger.info('Load service');
|
|
8
|
+
|
|
9
|
+
const endpoint = 'core';
|
|
10
|
+
|
|
7
11
|
// https://developer.mozilla.org/en-US/docs/Web/API/AbortController
|
|
8
|
-
const getBaseHost = () => location.host;
|
|
12
|
+
const getBaseHost = () => (window.renderPayload?.apiBaseHost ? window.renderPayload.apiBaseHost : location.host);
|
|
9
13
|
|
|
10
|
-
const getApiBasePath = () =>
|
|
14
|
+
const getApiBasePath = (options) =>
|
|
15
|
+
`${
|
|
16
|
+
options?.proxyPath
|
|
17
|
+
? `/${options.proxyPath}/`
|
|
18
|
+
: window.renderPayload?.apiBaseProxyPath
|
|
19
|
+
? window.renderPayload.apiBaseProxyPath
|
|
20
|
+
: getProxyPath()
|
|
21
|
+
}${window.renderPayload?.apiBasePath ? window.renderPayload.apiBasePath : 'api'}/`;
|
|
11
22
|
|
|
12
|
-
const getApiBaseUrl = (options = { id: '', endpoint: '' }) =>
|
|
13
|
-
`${location.protocol}//${getBaseHost()}${getApiBasePath()}${options?.endpoint ? options.endpoint : ''}${
|
|
23
|
+
const getApiBaseUrl = (options = { id: '', endpoint: '', proxyPath: '' }) =>
|
|
24
|
+
`${location.protocol}//${getBaseHost()}${getApiBasePath(options)}${options?.endpoint ? options.endpoint : ''}${
|
|
14
25
|
options?.id ? `/${options.id}` : ''
|
|
15
26
|
}`;
|
|
16
27
|
|
|
@@ -38,11 +49,6 @@ const payloadFactory = (body) => {
|
|
|
38
49
|
return JSON.stringify(body);
|
|
39
50
|
};
|
|
40
51
|
|
|
41
|
-
logger.info('Load service');
|
|
42
|
-
|
|
43
|
-
const endpoint = 'core';
|
|
44
|
-
const _VERSION = window._VERSION;
|
|
45
|
-
|
|
46
52
|
const CoreService = {
|
|
47
53
|
getRaw: (options = { url: '' }) =>
|
|
48
54
|
new Promise((resolve, reject) =>
|
|
@@ -159,7 +165,6 @@ const CoreService = {
|
|
|
159
165
|
const ApiBase = getApiBaseUrl;
|
|
160
166
|
|
|
161
167
|
export {
|
|
162
|
-
_VERSION,
|
|
163
168
|
CoreService,
|
|
164
169
|
headersFactory,
|
|
165
170
|
payloadFactory,
|
|
@@ -80,36 +80,40 @@ const DefaultManagement = {
|
|
|
80
80
|
class: `in fll section-mp management-table-btn-mini management-table-btn-remove-${id}-${cellRenderId}`,
|
|
81
81
|
})}`;
|
|
82
82
|
setTimeout(() => {
|
|
83
|
-
EventsUI.onClick(
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
83
|
+
EventsUI.onClick(
|
|
84
|
+
`.management-table-btn-remove-${id}-${cellRenderId}`,
|
|
85
|
+
async () => {
|
|
86
|
+
const confirmResult = await Modal.RenderConfirm({
|
|
87
|
+
html: async () => {
|
|
88
|
+
return html`
|
|
89
|
+
<div class="in section-mp" style="text-align: center">
|
|
90
|
+
${Translate.Render('confirm-delete-item')}
|
|
91
|
+
${Object.keys(params.data).length > 0
|
|
92
|
+
? html`<br />
|
|
93
|
+
"${options.defaultColKeyFocus
|
|
94
|
+
? getValueFromJoinString(params.data, options.defaultColKeyFocus)
|
|
95
|
+
: params.data[Object.keys(params.data)[0]]}"`
|
|
96
|
+
: ''}
|
|
97
|
+
</div>
|
|
98
|
+
`;
|
|
99
|
+
},
|
|
100
|
+
id: `delete-${params.data._id}`,
|
|
101
|
+
});
|
|
102
|
+
if (confirmResult.status !== 'confirm') return;
|
|
103
|
+
let result;
|
|
104
|
+
if (params.data._id) result = await ServiceProvider.delete({ id: params.data._id });
|
|
105
|
+
else result = { status: 'success' };
|
|
104
106
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
107
|
+
NotificationManager.Push({
|
|
108
|
+
html: result.status === 'error' ? result.message : Translate.Render('item-success-delete'),
|
|
109
|
+
status: result.status,
|
|
110
|
+
});
|
|
111
|
+
if (result.status === 'success') {
|
|
112
|
+
AgGrid.grids[gridId].applyTransaction({ remove: [params.data] });
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
{ context: 'modal' },
|
|
116
|
+
);
|
|
113
117
|
});
|
|
114
118
|
}
|
|
115
119
|
|
|
@@ -220,16 +224,19 @@ const DefaultManagement = {
|
|
|
220
224
|
});
|
|
221
225
|
});
|
|
222
226
|
EventsUI.onClick(`.management-table-btn-clean-${id}`, async () => {
|
|
223
|
-
const confirmResult = await Modal.RenderConfirm(
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
<
|
|
228
|
-
|
|
229
|
-
|
|
227
|
+
const confirmResult = await Modal.RenderConfirm(
|
|
228
|
+
{
|
|
229
|
+
html: async () => {
|
|
230
|
+
return html`
|
|
231
|
+
<div class="in section-mp" style="text-align: center;">
|
|
232
|
+
<strong>${Translate.Render('confirm-delete-all-data')}</strong>
|
|
233
|
+
</div>
|
|
234
|
+
`;
|
|
235
|
+
},
|
|
236
|
+
id: `clean-table-${id}`,
|
|
230
237
|
},
|
|
231
|
-
|
|
232
|
-
|
|
238
|
+
{ context: 'modal' },
|
|
239
|
+
);
|
|
233
240
|
if (confirmResult.status === 'cancelled') return;
|
|
234
241
|
const result = await ServiceProvider.delete();
|
|
235
242
|
NotificationManager.Push({
|
package/src/client/ssr/Render.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
SrrComponent = ({ title, ssrPath, buildId, ssrHeadComponents, ssrBodyComponents }) => html`
|
|
1
|
+
SrrComponent = ({ title, ssrPath, buildId, ssrHeadComponents, ssrBodyComponents, renderPayload, renderApi }) => html`
|
|
2
2
|
<!DOCTYPE html>
|
|
3
3
|
<html dir="ltr" lang="en">
|
|
4
4
|
<head>
|
|
@@ -6,6 +6,9 @@ SrrComponent = ({ title, ssrPath, buildId, ssrHeadComponents, ssrBodyComponents
|
|
|
6
6
|
<link rel="icon" type="image/x-icon" href="${ssrPath}favicon.ico" />
|
|
7
7
|
<meta charset="UTF-8" />
|
|
8
8
|
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
|
|
9
|
+
<script>
|
|
10
|
+
window.renderPayload = ${renderApi.JSONweb(renderPayload)};
|
|
11
|
+
</script>
|
|
9
12
|
${ssrHeadComponents}
|
|
10
13
|
</head>
|
|
11
14
|
<body>
|
|
@@ -130,6 +133,8 @@ SrrComponent = ({ title, ssrPath, buildId, ssrHeadComponents, ssrBodyComponents
|
|
|
130
133
|
border: none;
|
|
131
134
|
padding-block: 0;
|
|
132
135
|
padding-inline: 0;
|
|
136
|
+
height: 30px;
|
|
137
|
+
line-height: 30px;
|
|
133
138
|
}
|
|
134
139
|
input::file-selector-button {
|
|
135
140
|
outline: none !important;
|
|
@@ -70,7 +70,7 @@ const CacheControl = function ({ ttiLoadTimeLimit }) {
|
|
|
70
70
|
setTimeout(window.cacheControlCallBack, ttiLoadTimeLimit); // 70s limit);
|
|
71
71
|
};
|
|
72
72
|
|
|
73
|
-
SrrComponent = ({ ttiLoadTimeLimit }) => {
|
|
73
|
+
SrrComponent = ({ ttiLoadTimeLimit, version }) => {
|
|
74
74
|
const borderChar = (px, color, selectors) => {
|
|
75
75
|
if (selectors) {
|
|
76
76
|
return selectors
|
|
@@ -106,10 +106,9 @@ SrrComponent = ({ ttiLoadTimeLimit }) => {
|
|
|
106
106
|
</style>
|
|
107
107
|
${borderChar(1, 'black', ['.clean-cache-container'])}
|
|
108
108
|
<script>
|
|
109
|
-
window._VERSION = '${npm_package_version}';
|
|
110
109
|
const CacheControl = ${CacheControl};
|
|
111
110
|
CacheControl({ ttiLoadTimeLimit: ${ttiLoadTimeLimit ? ttiLoadTimeLimit : 1000 * 70 * 1} });
|
|
112
111
|
</script>
|
|
113
|
-
<div class="clean-cache-container">${
|
|
112
|
+
<div class="clean-cache-container">${version}</div>
|
|
114
113
|
`;
|
|
115
114
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const PRE_CACHED_RESOURCES = [];
|
|
2
|
-
const CACHE_NAME = 'app-cache';
|
|
3
|
-
const PROXY_PATH = '/';
|
|
1
|
+
const PRE_CACHED_RESOURCES = self.renderPayload?.PRE_CACHED_RESOURCES ? self.renderPayload.PRE_CACHED_RESOURCES : [];
|
|
2
|
+
const CACHE_NAME = self.renderPayload?.CACHE_NAME ? self.renderPayload.CACHE_NAME : 'app-cache';
|
|
3
|
+
const PROXY_PATH = self.renderPayload?.PROXY_PATH ? self.renderPayload.PROXY_PATH : '/';
|
|
4
4
|
self.addEventListener('install', (event) => {
|
|
5
5
|
// Activate right away
|
|
6
6
|
self.skipWaiting();
|
|
@@ -79,7 +79,19 @@ const MongooseDB = {
|
|
|
79
79
|
if (process.argv.includes('rocky')) {
|
|
80
80
|
// https://github.com/mongodb/mongodb-selinux
|
|
81
81
|
// https://www.mongodb.com/docs/v7.0/tutorial/install-mongodb-enterprise-on-red-hat/
|
|
82
|
-
|
|
82
|
+
// https://www.mongodb.com/docs/v6.0/tutorial/install-mongodb-on-red-hat/
|
|
83
|
+
// https://www.mongodb.com/docs/v4.4/tutorial/install-mongodb-on-red-hat/
|
|
84
|
+
// dnf install selinux-policy-devel
|
|
85
|
+
// git clone https://github.com/mongodb/mongodb-selinux
|
|
86
|
+
// cd mongodb-selinux
|
|
87
|
+
// make
|
|
88
|
+
// sudo make install
|
|
89
|
+
// yum list installed | grep mongo
|
|
90
|
+
// sudo yum erase $(rpm -qa | grep mongodb)
|
|
91
|
+
// remove service
|
|
92
|
+
// sudo systemctl reset-failed
|
|
93
|
+
// MongoDB 5.0+ requires a CPU with AVX support
|
|
94
|
+
// check: grep avx /proc/cpuinfo
|
|
83
95
|
}
|
|
84
96
|
logger.info('install legacy 4.4');
|
|
85
97
|
shellExec(`wget -qO - https://www.mongodb.org/static/pgp/server-4.4.asc | sudo apt-key add -`);
|
|
@@ -112,9 +124,13 @@ const MongooseDB = {
|
|
|
112
124
|
shellExec(`sudo systemctl unmask mongod`);
|
|
113
125
|
shellExec(`sudo pkill -f mongod`);
|
|
114
126
|
shellExec(`sudo systemctl enable mongod.service`);
|
|
127
|
+
|
|
115
128
|
shellExec(`sudo chown -R mongodb:mongodb /var/lib/mongodb`);
|
|
116
129
|
shellExec(`sudo chown mongodb:mongodb /tmp/mongodb-27017.sock`);
|
|
117
130
|
|
|
131
|
+
shellExec(`sudo chown -R mongod:mongod /var/lib/mongodb`);
|
|
132
|
+
shellExec(`sudo chown mongod:mongod /tmp/mongodb-27017.sock`);
|
|
133
|
+
|
|
118
134
|
logger.info('run server');
|
|
119
135
|
shellExec(`sudo service mongod restart`);
|
|
120
136
|
|