@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
|
@@ -577,7 +577,8 @@ const getCurrentTrace = () => {
|
|
|
577
577
|
try {
|
|
578
578
|
_stack;
|
|
579
579
|
} catch (error) {
|
|
580
|
-
|
|
580
|
+
console.error(error);
|
|
581
|
+
return error;
|
|
581
582
|
}
|
|
582
583
|
};
|
|
583
584
|
|
|
@@ -890,8 +891,58 @@ const commitData = {
|
|
|
890
891
|
},
|
|
891
892
|
};
|
|
892
893
|
|
|
893
|
-
const
|
|
894
|
+
const emotionsData = [
|
|
895
|
+
{
|
|
896
|
+
name: 'like',
|
|
897
|
+
ad_display: {
|
|
898
|
+
es: 'Me gusta',
|
|
899
|
+
en: 'Like',
|
|
900
|
+
},
|
|
901
|
+
emoji: '👍',
|
|
902
|
+
},
|
|
903
|
+
{
|
|
904
|
+
name: 'love',
|
|
905
|
+
ad_display: {
|
|
906
|
+
es: 'Me encanta',
|
|
907
|
+
en: 'Love',
|
|
908
|
+
},
|
|
909
|
+
emoji: '❤️',
|
|
910
|
+
},
|
|
911
|
+
{
|
|
912
|
+
name: 'haha',
|
|
913
|
+
ad_display: {
|
|
914
|
+
es: 'Me divierte',
|
|
915
|
+
en: 'Haha',
|
|
916
|
+
},
|
|
917
|
+
emoji: '😂',
|
|
918
|
+
},
|
|
919
|
+
{
|
|
920
|
+
name: 'wow',
|
|
921
|
+
ad_display: {
|
|
922
|
+
es: 'Me asombra',
|
|
923
|
+
en: 'Wow',
|
|
924
|
+
},
|
|
925
|
+
emoji: '😮',
|
|
926
|
+
},
|
|
927
|
+
{
|
|
928
|
+
name: 'sad',
|
|
929
|
+
ad_display: {
|
|
930
|
+
es: 'Me entristece',
|
|
931
|
+
en: 'Sad',
|
|
932
|
+
},
|
|
933
|
+
emoji: '😢',
|
|
934
|
+
},
|
|
935
|
+
{
|
|
936
|
+
name: 'angry',
|
|
937
|
+
ad_display: {
|
|
938
|
+
es: 'Me enoja',
|
|
939
|
+
en: 'Angry',
|
|
940
|
+
},
|
|
941
|
+
emoji: '😠',
|
|
942
|
+
},
|
|
943
|
+
];
|
|
894
944
|
|
|
945
|
+
const userRoleEnum = ['admin', 'moderator', 'user', 'guest'];
|
|
895
946
|
const commonAdminGuard = (role) => userRoleEnum.indexOf(role) === userRoleEnum.indexOf('admin');
|
|
896
947
|
const commonModeratorGuard = (role) => userRoleEnum.indexOf(role) <= userRoleEnum.indexOf('moderator');
|
|
897
948
|
|
|
@@ -954,4 +1005,5 @@ export {
|
|
|
954
1005
|
getCurrentTrace,
|
|
955
1006
|
userRoleEnum,
|
|
956
1007
|
commitData,
|
|
1008
|
+
emotionsData,
|
|
957
1009
|
};
|
|
@@ -761,7 +761,6 @@ const renderWave = ({ id }) => {
|
|
|
761
761
|
const cssTokensEffect = {};
|
|
762
762
|
const cssTokensContainer = {};
|
|
763
763
|
const cssEffect = async (containerSelector, event) => {
|
|
764
|
-
return;
|
|
765
764
|
// Array.from(event.target.classList)
|
|
766
765
|
let offsetX, offsetY;
|
|
767
766
|
if (Array.from(event.srcElement.classList).includes('ripple') && cssTokensContainer[containerSelector]) {
|
|
@@ -396,8 +396,8 @@ const CssCoreDark = {
|
|
|
396
396
|
text-align: center;
|
|
397
397
|
background: #1a1a1a;
|
|
398
398
|
font-size: 17px;
|
|
399
|
-
|
|
400
|
-
padding
|
|
399
|
+
height: 30px;
|
|
400
|
+
padding: 5px 0px 5px 0px;
|
|
401
401
|
}
|
|
402
402
|
::placeholder {
|
|
403
403
|
color: #c6c4c4;
|
|
@@ -472,6 +472,7 @@ const CssCoreDark = {
|
|
|
472
472
|
width: 260px;
|
|
473
473
|
font-size: 20px;
|
|
474
474
|
padding: 10px;
|
|
475
|
+
min-height: 45px;
|
|
475
476
|
}
|
|
476
477
|
.toggle-form-container {
|
|
477
478
|
border: 2px solid #313131;
|
|
@@ -495,6 +496,7 @@ const CssCoreDark = {
|
|
|
495
496
|
font-size: 20px;
|
|
496
497
|
padding: 10px;
|
|
497
498
|
text-align: center;
|
|
499
|
+
min-height: 45px;
|
|
498
500
|
}
|
|
499
501
|
.drop-zone-file-explorer {
|
|
500
502
|
min-height: 300px;
|
|
@@ -522,6 +524,7 @@ const CssCoreDark = {
|
|
|
522
524
|
margin: 5px 0 0 0;
|
|
523
525
|
padding: 5px;
|
|
524
526
|
font-size: 16px;
|
|
527
|
+
min-height: 40px;
|
|
525
528
|
}
|
|
526
529
|
.btn-input-extension:hover {
|
|
527
530
|
}
|
|
@@ -701,8 +704,8 @@ const CssCoreLight = {
|
|
|
701
704
|
text-align: center;
|
|
702
705
|
background: #eaeaea;
|
|
703
706
|
font-size: 17px;
|
|
704
|
-
|
|
705
|
-
padding
|
|
707
|
+
height: 30px;
|
|
708
|
+
padding: 5px 0px 5px 0px;
|
|
706
709
|
}
|
|
707
710
|
::placeholder {
|
|
708
711
|
color: #333;
|
|
@@ -778,6 +781,7 @@ const CssCoreLight = {
|
|
|
778
781
|
width: 260px;
|
|
779
782
|
font-size: 20px;
|
|
780
783
|
padding: 10px;
|
|
784
|
+
min-height: 45px;
|
|
781
785
|
}
|
|
782
786
|
.toggle-form-container {
|
|
783
787
|
border-radius: 5px;
|
|
@@ -802,6 +806,7 @@ const CssCoreLight = {
|
|
|
802
806
|
font-size: 20px;
|
|
803
807
|
padding: 10px;
|
|
804
808
|
text-align: center;
|
|
809
|
+
min-height: 45px;
|
|
805
810
|
}
|
|
806
811
|
.input-container-width {
|
|
807
812
|
cursor: pointer;
|
|
@@ -839,6 +844,7 @@ const CssCoreLight = {
|
|
|
839
844
|
margin: 5px 0 0 0;
|
|
840
845
|
padding: 5px;
|
|
841
846
|
font-size: 16px;
|
|
847
|
+
min-height: 40px;
|
|
842
848
|
}
|
|
843
849
|
.btn-input-extension:hover {
|
|
844
850
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { _VERSION, CoreService } from '../../services/core/core.service.js';
|
|
2
1
|
import { Badge } from './Badge.js';
|
|
3
2
|
import { BtnIcon } from './BtnIcon.js';
|
|
4
3
|
import { rgbToHex } from './CommonJs.js';
|
|
@@ -80,7 +79,7 @@ const Docs = {
|
|
|
80
79
|
icon: html`<i class="fa-brands fa-osi"></i>`,
|
|
81
80
|
text: 'Source Docs',
|
|
82
81
|
url: function () {
|
|
83
|
-
return `${getProxyPath()}docs/engine/${
|
|
82
|
+
return `${getProxyPath()}docs/engine/${window.renderPayload.version.replace('v', '')}`;
|
|
84
83
|
},
|
|
85
84
|
},
|
|
86
85
|
{
|
|
@@ -12,11 +12,11 @@ const EventsUI = {
|
|
|
12
12
|
if (!s(id)) return;
|
|
13
13
|
let complete = true;
|
|
14
14
|
s(id)[type] = async function (e) {
|
|
15
|
-
cssEffect(id, e);
|
|
15
|
+
if (options.clickEffect) cssEffect(id, e);
|
|
16
16
|
if (complete) {
|
|
17
17
|
complete = false;
|
|
18
18
|
await LoadingAnimation.spinner.play(loadingContainer ? loadingContainer : id);
|
|
19
|
-
await LoadingAnimation.bar.play(id);
|
|
19
|
+
if (options.context !== 'modal') await LoadingAnimation.bar.play(id);
|
|
20
20
|
try {
|
|
21
21
|
await logic(e);
|
|
22
22
|
} catch (error) {
|
|
@@ -26,7 +26,7 @@ const EventsUI = {
|
|
|
26
26
|
html: error?.message ? error.message : error ? error : 'Event error',
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
|
-
LoadingAnimation.bar.stop(id);
|
|
29
|
+
if (options.context !== 'modal') LoadingAnimation.bar.stop(id);
|
|
30
30
|
await LoadingAnimation.spinner.stop(loadingContainer ? loadingContainer : id);
|
|
31
31
|
complete = true;
|
|
32
32
|
return;
|
|
@@ -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(
|
|
327
|
-
|
|
328
|
-
{
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
<
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
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
|
-
|
|
344
|
-
|
|
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
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
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(
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
<
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
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
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
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
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
}
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
}
|
|
439
|
-
|
|
440
|
-
|
|
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
|
|
|
@@ -88,8 +88,10 @@ const Input = {
|
|
|
88
88
|
<div class="fl input-row-${id}">
|
|
89
89
|
<div class="in fll" style="width: 80%;">${inputElement}</div>
|
|
90
90
|
<div class="in fll btn-eye-password btn-eye-${id}" style="width: 20%;">
|
|
91
|
-
<
|
|
92
|
-
|
|
91
|
+
<div class="abs center">
|
|
92
|
+
<i class="fas fa-eye fa-eye-${id} eye-password"></i>
|
|
93
|
+
<i class="fas fa-eye-slash fa-eye-slash-${id} eye-password" style="display: none"></i>
|
|
94
|
+
</div>
|
|
93
95
|
</div>
|
|
94
96
|
</div>
|
|
95
97
|
`
|
|
@@ -76,22 +76,11 @@ const LoadingAnimation = {
|
|
|
76
76
|
'text-align': 'center',
|
|
77
77
|
};
|
|
78
78
|
|
|
79
|
-
if (s(container).classList) {
|
|
80
|
-
const classes = Array.from(s(container).classList);
|
|
81
|
-
if (classes.find((e) => e.match('management-table-btn-mini'))) {
|
|
82
|
-
style.top = '-2px';
|
|
83
|
-
style.left = '-2px';
|
|
84
|
-
} else if (classes.find((e) => e.match('action-bar-box'))) {
|
|
85
|
-
style.top = '-30px';
|
|
86
|
-
style.left = '-12px';
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
|
|
90
79
|
append(
|
|
91
80
|
container,
|
|
92
81
|
html`
|
|
93
82
|
<div
|
|
94
|
-
class="
|
|
83
|
+
class="abs center ${id}"
|
|
95
84
|
style="${renderCssAttr({
|
|
96
85
|
style,
|
|
97
86
|
})}"
|
|
@@ -145,6 +134,8 @@ const LoadingAnimation = {
|
|
|
145
134
|
s(backgroundContainer).style.opacity = 0;
|
|
146
135
|
setTimeout(async () => {
|
|
147
136
|
s(backgroundContainer).style.display = 'none';
|
|
137
|
+
if (s(`.modal-menu`)) s(`.modal-menu`).classList.remove('hide');
|
|
138
|
+
if (s(`.main-body-btn-container`)) s(`.main-body-btn-container`).classList.remove('hide');
|
|
148
139
|
if (callBack) callBack();
|
|
149
140
|
}, 300);
|
|
150
141
|
});
|
|
@@ -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
|
})}
|
|
@@ -49,6 +49,7 @@ const Modal = {
|
|
|
49
49
|
mode: '' /* slide-menu */,
|
|
50
50
|
RouterInstance: {},
|
|
51
51
|
disableTools: [],
|
|
52
|
+
observer: false,
|
|
52
53
|
},
|
|
53
54
|
) {
|
|
54
55
|
if (options.heightBottomBar === undefined) options.heightBottomBar = 50;
|
|
@@ -76,12 +77,15 @@ const Modal = {
|
|
|
76
77
|
options,
|
|
77
78
|
onCloseListener: {},
|
|
78
79
|
onMenuListener: {},
|
|
80
|
+
onCollapseMenuListener: {},
|
|
81
|
+
onExtendMenuListener: {},
|
|
79
82
|
onDragEndListener: {},
|
|
80
83
|
onObserverListener: {},
|
|
81
84
|
onClickListener: {},
|
|
82
85
|
onExpandUiListener: {},
|
|
83
86
|
onBarUiOpen: {},
|
|
84
87
|
onBarUiClose: {},
|
|
88
|
+
onHome: {},
|
|
85
89
|
query: options.query ? `${window.location.search}` : undefined,
|
|
86
90
|
};
|
|
87
91
|
const setCenterRestore = () => {
|
|
@@ -156,7 +160,8 @@ const Modal = {
|
|
|
156
160
|
};
|
|
157
161
|
options.mode === 'slide-menu-right' ? (options.style.right = '0px') : (options.style.left = '0px');
|
|
158
162
|
const contentIconClass = 'abs center';
|
|
159
|
-
|
|
163
|
+
if (options.class) options.class += ' hide';
|
|
164
|
+
else options.class = 'hide';
|
|
160
165
|
options.dragDisabled = true;
|
|
161
166
|
options.titleClass = 'hide';
|
|
162
167
|
top = '0px';
|
|
@@ -238,7 +243,7 @@ const Modal = {
|
|
|
238
243
|
'body',
|
|
239
244
|
html`
|
|
240
245
|
<div
|
|
241
|
-
class="abs main-body-btn-container"
|
|
246
|
+
class="abs main-body-btn-container hide"
|
|
242
247
|
style="top: ${options.heightTopBar + 50}px; z-index: 9; ${true ||
|
|
243
248
|
(options.mode && options.mode.match('right'))
|
|
244
249
|
? 'right'
|
|
@@ -1006,14 +1011,15 @@ const Modal = {
|
|
|
1006
1011
|
e.preventDefault();
|
|
1007
1012
|
window.history.forward();
|
|
1008
1013
|
});
|
|
1009
|
-
EventsUI.onClick(`.action-btn-home`, () =>
|
|
1010
|
-
|
|
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());
|
|
1011
1019
|
Keyboard.instanceMultiPressKey({
|
|
1012
1020
|
id: 'input-shortcut-global-escape',
|
|
1013
1021
|
keys: ['Escape'],
|
|
1014
1022
|
eventCallBack: () => {
|
|
1015
|
-
// if (s(`.main-btn-home`)) s(`.main-btn-home`).click();
|
|
1016
|
-
|
|
1017
1023
|
if (s(`.btn-close-${this.currentTopModalId}`)) s(`.btn-close-${this.currentTopModalId}`).click();
|
|
1018
1024
|
},
|
|
1019
1025
|
});
|
|
@@ -1153,7 +1159,7 @@ const Modal = {
|
|
|
1153
1159
|
top: ${top};
|
|
1154
1160
|
left: ${left};
|
|
1155
1161
|
overflow: auto; /* resizable required */
|
|
1156
|
-
resize:
|
|
1162
|
+
resize: both; /* resizable required */
|
|
1157
1163
|
transition: ${transition};
|
|
1158
1164
|
opacity: 0;
|
|
1159
1165
|
z-index: 1;
|
|
@@ -1339,7 +1345,7 @@ const Modal = {
|
|
|
1339
1345
|
s(`.btn-icon-menu-back`).classList.add('hide');
|
|
1340
1346
|
if (s(`.menu-btn-container-main`)) s(`.menu-btn-container-main`).classList.remove('hide');
|
|
1341
1347
|
};
|
|
1342
|
-
|
|
1348
|
+
this.onHomeRouterEvent = async () => {
|
|
1343
1349
|
for (const keyModal of Object.keys(this.Data)) {
|
|
1344
1350
|
if (
|
|
1345
1351
|
![idModal, 'main-body-top', 'main-body']
|
|
@@ -1353,6 +1359,9 @@ const Modal = {
|
|
|
1353
1359
|
setPath(getProxyPath());
|
|
1354
1360
|
setDocTitle({ ...options.RouterInstance, route: '' });
|
|
1355
1361
|
};
|
|
1362
|
+
s(`.main-btn-home`).onclick = async () => {
|
|
1363
|
+
await this.onHomeRouterEvent();
|
|
1364
|
+
};
|
|
1356
1365
|
EventsUI.onClick(`.btn-icon-menu-back`, backMenuButtonEvent);
|
|
1357
1366
|
EventsUI.onClick(`.btn-icon-menu-mode`, () => {
|
|
1358
1367
|
if (s(`.btn-icon-menu-mode-right`).classList.contains('hide')) {
|
|
@@ -1383,6 +1392,9 @@ const Modal = {
|
|
|
1383
1392
|
if (options.onCollapseMenu) options.onCollapseMenu();
|
|
1384
1393
|
s(`.sub-menu-title-container-${'modal-menu'}`).classList.add('hide');
|
|
1385
1394
|
s(`.nav-path-container-${'modal-menu'}`).classList.add('hide');
|
|
1395
|
+
Object.keys(this.Data[idModal].onCollapseMenuListener).map((keyListener) =>
|
|
1396
|
+
this.Data[idModal].onCollapseMenuListener[keyListener](),
|
|
1397
|
+
);
|
|
1386
1398
|
} else {
|
|
1387
1399
|
slideMenuWidth = originSlideMenuWidth;
|
|
1388
1400
|
setTimeout(() => {
|
|
@@ -1403,6 +1415,9 @@ const Modal = {
|
|
|
1403
1415
|
if (options.onExtendMenu) options.onExtendMenu();
|
|
1404
1416
|
s(`.sub-menu-title-container-${'modal-menu'}`).classList.remove('hide');
|
|
1405
1417
|
s(`.nav-path-container-${'modal-menu'}`).classList.remove('hide');
|
|
1418
|
+
Object.keys(this.Data[idModal].onExtendMenuListener).map((keyListener) =>
|
|
1419
|
+
this.Data[idModal].onExtendMenuListener[keyListener](),
|
|
1420
|
+
);
|
|
1406
1421
|
}
|
|
1407
1422
|
// btn-bar-center-icon-menu
|
|
1408
1423
|
this.actionBtnCenter();
|
|
@@ -1610,9 +1625,11 @@ const Modal = {
|
|
|
1610
1625
|
...this.Data[idModal],
|
|
1611
1626
|
};
|
|
1612
1627
|
},
|
|
1628
|
+
onHomeRouterEvent: () => {},
|
|
1613
1629
|
currentTopModalId: '',
|
|
1614
1630
|
zIndexSync: function ({ idModal }) {
|
|
1615
1631
|
setTimeout(() => {
|
|
1632
|
+
if (!this.Data[idModal]) return;
|
|
1616
1633
|
const cleanTopModal = () => {
|
|
1617
1634
|
Object.keys(this.Data).map((_idModal) => {
|
|
1618
1635
|
if (this.Data[_idModal].options.zIndexSync && s(`.${_idModal}`)) s(`.${_idModal}`).style.zIndex = '3';
|
|
@@ -1721,7 +1738,7 @@ const Modal = {
|
|
|
1721
1738
|
titleClass: 'hide',
|
|
1722
1739
|
style: {
|
|
1723
1740
|
width: '300px',
|
|
1724
|
-
height: '
|
|
1741
|
+
height: '400px',
|
|
1725
1742
|
overflow: 'hidden',
|
|
1726
1743
|
'z-index': '11',
|
|
1727
1744
|
resize: 'none',
|
|
@@ -1755,7 +1772,6 @@ const Modal = {
|
|
|
1755
1772
|
},
|
|
1756
1773
|
headerTitleHeight: 40,
|
|
1757
1774
|
actionBtnCenter: function () {
|
|
1758
|
-
// if (!s(`.btn-close-modal-menu`).classList.contains('hide')) return s(`.main-btn-home`).click();
|
|
1759
1775
|
if (!s(`.btn-close-modal-menu`).classList.contains('hide')) {
|
|
1760
1776
|
return s(`.btn-close-modal-menu`).click();
|
|
1761
1777
|
}
|
|
@@ -1781,20 +1797,34 @@ const renderMenuLabel = ({ img, text, icon }) => {
|
|
|
1781
1797
|
<div class="abs center main-btn-menu-text">${text}</div>`;
|
|
1782
1798
|
};
|
|
1783
1799
|
|
|
1784
|
-
const renderViewTitle = (
|
|
1785
|
-
|
|
1800
|
+
const renderViewTitle = (
|
|
1801
|
+
options = { icon: '', img: '', text: '', assetFolder: '', 'ui-icons': '', dim, top, topText: '' },
|
|
1802
|
+
) => {
|
|
1803
|
+
if (options.dim === undefined) options.dim = 30;
|
|
1786
1804
|
const { img, text, icon, dim, top } = options;
|
|
1787
1805
|
if (!img && !options['ui-icon']) return html`<span class="view-title-icon">${icon}</span> ${text}`;
|
|
1788
1806
|
return html`<img
|
|
1789
1807
|
class="abs img-btn-square-view-title"
|
|
1790
1808
|
style="${renderCssAttr({
|
|
1791
|
-
style: {
|
|
1809
|
+
style: {
|
|
1810
|
+
width: `${dim}px`,
|
|
1811
|
+
height: `${dim}px`,
|
|
1812
|
+
top: top !== undefined ? `${top}px !important` : undefined,
|
|
1813
|
+
},
|
|
1792
1814
|
})}"
|
|
1793
1815
|
src="${options['ui-icon']
|
|
1794
1816
|
? `${getProxyPath()}assets/${options.assetFolder ? options.assetFolder : 'ui-icons'}/${options['ui-icon']}`
|
|
1795
1817
|
: img}"
|
|
1796
1818
|
/>
|
|
1797
|
-
<div
|
|
1819
|
+
<div
|
|
1820
|
+
class="in text-btn-square-view-title"
|
|
1821
|
+
style="${renderCssAttr({
|
|
1822
|
+
style: {
|
|
1823
|
+
// 'padding-left': `${20 + dim}px`,
|
|
1824
|
+
...(options.topText !== undefined ? { top: options.topText + 'px !important' } : {}),
|
|
1825
|
+
},
|
|
1826
|
+
})}"
|
|
1827
|
+
>
|
|
1798
1828
|
${text}
|
|
1799
1829
|
</div>`;
|
|
1800
1830
|
};
|