@underpostnet/underpost 2.8.4 → 2.8.6
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 +12 -45
- package/.github/workflows/npmpkg.yml +67 -0
- package/.github/workflows/publish.yml +5 -5
- package/.github/workflows/pwa-microservices-template.page.yml +2 -1
- package/.github/workflows/pwa-microservices-template.test.yml +2 -2
- package/.vscode/settings.json +10 -1
- package/CHANGELOG.md +40 -0
- package/Dockerfile +6 -27
- package/bin/build.js +73 -165
- package/bin/deploy.js +76 -101
- package/bin/file.js +29 -15
- package/bin/hwt.js +0 -10
- package/bin/index.js +191 -32
- package/bin/util.js +0 -15
- package/bin/vs.js +1 -0
- package/conf.js +0 -2
- package/docker-compose.yml +1 -1
- package/manifests/kind-config-dev.yaml +12 -0
- package/manifests/{core/underpost-engine-mongodb-backup-cronjob.yaml → mongodb/backup-cronjob.yaml} +14 -12
- package/manifests/mongodb/kustomization.yaml +11 -0
- package/manifests/mongodb/pv-pvc.yaml +23 -0
- package/manifests/{core/underpost-engine-statefulset.yaml → mongodb/statefulset.yaml} +34 -0
- package/manifests/mongodb-4.4/kustomization.yaml +7 -0
- package/manifests/mongodb-4.4/service-deployment.yaml +63 -0
- package/manifests/valkey/kustomization.yaml +2 -2
- package/package.json +22 -4
- package/src/api/core/core.service.js +1 -1
- package/src/cli/cluster.js +202 -0
- package/src/cli/cron.js +90 -0
- package/src/cli/db.js +212 -0
- package/src/cli/deploy.js +318 -0
- package/src/cli/env.js +52 -0
- package/src/cli/fs.js +149 -0
- package/src/cli/image.js +148 -0
- package/src/cli/repository.js +125 -0
- package/src/cli/script.js +53 -0
- package/src/cli/secrets.js +37 -0
- package/src/cli/test.js +118 -0
- package/src/client/components/core/Auth.js +22 -4
- package/src/client/components/core/CalendarCore.js +12 -1
- package/src/client/components/core/CommonJs.js +134 -2
- package/src/client/components/core/Css.js +1 -0
- package/src/client/components/core/CssCore.js +2 -4
- package/src/client/components/core/Docs.js +1 -2
- package/src/client/components/core/Input.js +5 -3
- package/src/client/components/core/LoadingAnimation.js +8 -1
- package/src/client/components/core/Modal.js +30 -7
- package/src/client/components/core/Panel.js +8 -6
- package/src/client/components/core/PanelForm.js +23 -7
- package/src/client/components/core/Scroll.js +1 -0
- package/src/client/components/core/Translate.js +4 -0
- package/src/client/components/core/VanillaJs.js +0 -9
- package/src/client/components/core/Worker.js +34 -31
- package/src/client/services/core/core.service.js +15 -10
- package/src/client/ssr/Render.js +4 -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 +85 -26
- package/src/server/backup.js +49 -93
- package/src/server/client-build.js +33 -33
- package/src/server/client-formatted.js +6 -3
- package/src/server/conf.js +82 -199
- package/src/server/dns.js +29 -53
- package/src/server/downloader.js +0 -8
- package/src/server/logger.js +7 -7
- package/src/server/network.js +17 -7
- package/src/server/runtime.js +24 -23
- package/test/api.test.js +0 -8
- package/manifests/core/kustomization.yaml +0 -11
- package/src/dns.js +0 -22
- package/src/server/project.js +0 -39
- package/startup.cjs +0 -12
- /package/manifests/deployment/{mongo-express.yaml → mongo-express/deployment.yaml} +0 -0
- /package/manifests/deployment/{phpmyadmin.yaml → phpmyadmin/deployment.yaml} +0 -0
- /package/manifests/{core/underpost-engine-backup-access.yaml → mongodb/backup-access.yaml} +0 -0
- /package/manifests/{core/underpost-engine-backup-pv-pvc.yaml → mongodb/backup-pv-pvc.yaml} +0 -0
- /package/manifests/{core/underpost-engine-mongodb-configmap.yaml → mongodb/configmap.yaml} +0 -0
- /package/manifests/{core/underpost-engine-headless-service.yaml → mongodb/headless-service.yaml} +0 -0
- /package/manifests/{core/underpost-engine-pv-pvc.yaml → mongodb-4.4/pv-pvc.yaml} +0 -0
- /package/manifests/valkey/{underpost-engine-valkey-service.yaml → service.yaml} +0 -0
- /package/manifests/valkey/{underpost-engine-valkey-statefulset.yaml → statefulset.yaml} +0 -0
|
@@ -3,7 +3,10 @@ import { Account } from './Account.js';
|
|
|
3
3
|
import { loggerFactory } from './Logger.js';
|
|
4
4
|
import { LogIn } from './LogIn.js';
|
|
5
5
|
import { LogOut } from './LogOut.js';
|
|
6
|
+
import { NotificationManager } from './NotificationManager.js';
|
|
6
7
|
import { SignUp } from './SignUp.js';
|
|
8
|
+
import { Translate } from './Translate.js';
|
|
9
|
+
import { s } from './VanillaJs.js';
|
|
7
10
|
|
|
8
11
|
const logger = loggerFactory(import.meta);
|
|
9
12
|
|
|
@@ -65,6 +68,7 @@ const Auth = {
|
|
|
65
68
|
const _result = await UserService.get({ id: 'auth' });
|
|
66
69
|
return {
|
|
67
70
|
status: _result.status,
|
|
71
|
+
message: _result.message,
|
|
68
72
|
data: {
|
|
69
73
|
user: _result.data,
|
|
70
74
|
},
|
|
@@ -77,6 +81,15 @@ const Auth = {
|
|
|
77
81
|
await Account.updateForm(data.user);
|
|
78
82
|
return { user: data.user };
|
|
79
83
|
}
|
|
84
|
+
if (message && message.match('expired'))
|
|
85
|
+
setTimeout(() => {
|
|
86
|
+
s(`.main-btn-log-in`).click();
|
|
87
|
+
NotificationManager.Push({
|
|
88
|
+
html: Translate.Render(`expired-session`),
|
|
89
|
+
status: 'warning',
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
return await Auth.sessionOut();
|
|
80
93
|
}
|
|
81
94
|
|
|
82
95
|
// anon guest session
|
|
@@ -92,20 +105,25 @@ const Auth = {
|
|
|
92
105
|
|
|
93
106
|
this.setGuestToken(guestToken);
|
|
94
107
|
let { data, status, message } = await UserService.get({ id: 'auth' });
|
|
95
|
-
if (status === 'error')
|
|
108
|
+
if (status === 'error') {
|
|
109
|
+
if (message && message.match('expired')) {
|
|
110
|
+
localStorage.removeItem('jwt.g');
|
|
111
|
+
return await Auth.sessionOut();
|
|
112
|
+
} else throw new Error(message);
|
|
113
|
+
}
|
|
96
114
|
await Account.updateForm(data);
|
|
97
115
|
return { user: data };
|
|
98
116
|
} catch (error) {
|
|
99
117
|
logger.error(error);
|
|
100
|
-
localStorage.removeItem('jwt');
|
|
101
|
-
localStorage.removeItem('jwt.g');
|
|
102
118
|
return { user: UserMock.default };
|
|
103
119
|
}
|
|
104
120
|
},
|
|
105
121
|
sessionOut: async function () {
|
|
106
122
|
this.deleteToken();
|
|
107
123
|
localStorage.removeItem('jwt');
|
|
108
|
-
|
|
124
|
+
const result = await this.sessionIn();
|
|
125
|
+
await LogOut.Trigger(result);
|
|
126
|
+
return result;
|
|
109
127
|
},
|
|
110
128
|
};
|
|
111
129
|
|
|
@@ -404,7 +404,15 @@ const CalendarCore = {
|
|
|
404
404
|
<div class="in" style="margin-bottom: 100px"></div>`;
|
|
405
405
|
};
|
|
406
406
|
|
|
407
|
+
let delayBlock = false;
|
|
407
408
|
this.Data[options.idModal].updatePanel = async () => {
|
|
409
|
+
if (delayBlock) return;
|
|
410
|
+
else {
|
|
411
|
+
delayBlock = true;
|
|
412
|
+
setTimeout(() => {
|
|
413
|
+
delayBlock = false;
|
|
414
|
+
}, 500);
|
|
415
|
+
}
|
|
408
416
|
const cid = getQueryParams().cid ? getQueryParams().cid : '';
|
|
409
417
|
if (options.route === 'home') Modal.homeCid = newInstance(cid);
|
|
410
418
|
if (s(`.main-body-calendar-${options.idModal}`)) {
|
|
@@ -426,7 +434,10 @@ const CalendarCore = {
|
|
|
426
434
|
},
|
|
427
435
|
});
|
|
428
436
|
|
|
429
|
-
if (options.route === 'home')
|
|
437
|
+
// if (options.route === 'home')
|
|
438
|
+
setTimeout(() => {
|
|
439
|
+
CalendarCore.Data[options.idModal].updatePanel();
|
|
440
|
+
});
|
|
430
441
|
|
|
431
442
|
return html`
|
|
432
443
|
<style>
|
|
@@ -573,6 +573,14 @@ const isValidFormat = (value, format) => {
|
|
|
573
573
|
}
|
|
574
574
|
};
|
|
575
575
|
|
|
576
|
+
const getCurrentTrace = () => {
|
|
577
|
+
try {
|
|
578
|
+
_stack;
|
|
579
|
+
} catch (error) {
|
|
580
|
+
return error.stack.split('is not defined')[1];
|
|
581
|
+
}
|
|
582
|
+
};
|
|
583
|
+
|
|
576
584
|
/**
|
|
577
585
|
* Returns the time difference between UTC time and local time, in minutes.
|
|
578
586
|
* @memberof CommonJS
|
|
@@ -811,8 +819,129 @@ const generateRandomPasswordSelection = (length) => {
|
|
|
811
819
|
// 0b = Binary
|
|
812
820
|
// 0o = Octal
|
|
813
821
|
|
|
814
|
-
const
|
|
822
|
+
const commitData = {
|
|
823
|
+
feat: {
|
|
824
|
+
description: 'A new feature',
|
|
825
|
+
title: 'Features',
|
|
826
|
+
emoji: '✨',
|
|
827
|
+
},
|
|
828
|
+
fix: {
|
|
829
|
+
description: 'A bug fix',
|
|
830
|
+
title: 'Bug Fixes',
|
|
831
|
+
emoji: '🐛',
|
|
832
|
+
},
|
|
833
|
+
docs: {
|
|
834
|
+
description: 'Documentation only changes',
|
|
835
|
+
title: 'Documentation',
|
|
836
|
+
emoji: '📚',
|
|
837
|
+
},
|
|
838
|
+
style: {
|
|
839
|
+
description:
|
|
840
|
+
'Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)',
|
|
841
|
+
title: 'Styles',
|
|
842
|
+
emoji: '💎',
|
|
843
|
+
},
|
|
844
|
+
refactor: {
|
|
845
|
+
description: 'A code change that neither fixes a bug nor adds a feature',
|
|
846
|
+
title: 'Code Refactoring',
|
|
847
|
+
emoji: '📦',
|
|
848
|
+
},
|
|
849
|
+
perf: {
|
|
850
|
+
description: 'A code change that improves performance',
|
|
851
|
+
title: 'Performance Improvements',
|
|
852
|
+
emoji: '⚡️',
|
|
853
|
+
},
|
|
854
|
+
cd: {
|
|
855
|
+
description:
|
|
856
|
+
'Changes to our Continuous Delivery configuration files and scripts (example scopes: Jenkins, Spinnaker, ArgoCD)',
|
|
857
|
+
title: 'Continuous Delivery',
|
|
858
|
+
emoji: '🚀',
|
|
859
|
+
},
|
|
860
|
+
test: {
|
|
861
|
+
description: 'Adding missing tests or correcting existing tests',
|
|
862
|
+
title: 'Tests',
|
|
863
|
+
emoji: '🚨',
|
|
864
|
+
},
|
|
865
|
+
build: {
|
|
866
|
+
description: 'Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)',
|
|
867
|
+
title: 'Builds',
|
|
868
|
+
emoji: '🛠',
|
|
869
|
+
},
|
|
870
|
+
ci: {
|
|
871
|
+
description:
|
|
872
|
+
'Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)',
|
|
873
|
+
title: 'Continuous Integrations',
|
|
874
|
+
emoji: '⚙️',
|
|
875
|
+
},
|
|
876
|
+
chore: {
|
|
877
|
+
description: "Other changes that don't modify src or test files",
|
|
878
|
+
title: 'Chores',
|
|
879
|
+
emoji: '♻️',
|
|
880
|
+
},
|
|
881
|
+
revert: {
|
|
882
|
+
description: 'Reverts a previous commit',
|
|
883
|
+
title: 'Reverts',
|
|
884
|
+
emoji: '🗑',
|
|
885
|
+
},
|
|
886
|
+
backup: {
|
|
887
|
+
description: 'Changes related to backups, including creation, restoration, and maintenance.',
|
|
888
|
+
title: 'Backups',
|
|
889
|
+
emoji: '💾',
|
|
890
|
+
},
|
|
891
|
+
};
|
|
892
|
+
|
|
893
|
+
const emotionsData = [
|
|
894
|
+
{
|
|
895
|
+
name: 'like',
|
|
896
|
+
ad_display: {
|
|
897
|
+
es: 'Me gusta',
|
|
898
|
+
en: 'Like',
|
|
899
|
+
},
|
|
900
|
+
emoji: '👍',
|
|
901
|
+
},
|
|
902
|
+
{
|
|
903
|
+
name: 'love',
|
|
904
|
+
ad_display: {
|
|
905
|
+
es: 'Me encanta',
|
|
906
|
+
en: 'Love',
|
|
907
|
+
},
|
|
908
|
+
emoji: '❤️',
|
|
909
|
+
},
|
|
910
|
+
{
|
|
911
|
+
name: 'haha',
|
|
912
|
+
ad_display: {
|
|
913
|
+
es: 'Me divierte',
|
|
914
|
+
en: 'Haha',
|
|
915
|
+
},
|
|
916
|
+
emoji: '😂',
|
|
917
|
+
},
|
|
918
|
+
{
|
|
919
|
+
name: 'wow',
|
|
920
|
+
ad_display: {
|
|
921
|
+
es: 'Me asombra',
|
|
922
|
+
en: 'Wow',
|
|
923
|
+
},
|
|
924
|
+
emoji: '😮',
|
|
925
|
+
},
|
|
926
|
+
{
|
|
927
|
+
name: 'sad',
|
|
928
|
+
ad_display: {
|
|
929
|
+
es: 'Me entristece',
|
|
930
|
+
en: 'Sad',
|
|
931
|
+
},
|
|
932
|
+
emoji: '😢',
|
|
933
|
+
},
|
|
934
|
+
{
|
|
935
|
+
name: 'angry',
|
|
936
|
+
ad_display: {
|
|
937
|
+
es: 'Me enoja',
|
|
938
|
+
en: 'Angry',
|
|
939
|
+
},
|
|
940
|
+
emoji: '😠',
|
|
941
|
+
},
|
|
942
|
+
];
|
|
815
943
|
|
|
944
|
+
const userRoleEnum = ['admin', 'moderator', 'user', 'guest'];
|
|
816
945
|
const commonAdminGuard = (role) => userRoleEnum.indexOf(role) === userRoleEnum.indexOf('admin');
|
|
817
946
|
const commonModeratorGuard = (role) => userRoleEnum.indexOf(role) <= userRoleEnum.indexOf('moderator');
|
|
818
947
|
|
|
@@ -869,8 +998,11 @@ export {
|
|
|
869
998
|
hexToNumber,
|
|
870
999
|
numberToHex,
|
|
871
1000
|
generateRandomPasswordSelection,
|
|
872
|
-
userRoleEnum,
|
|
873
1001
|
commonAdminGuard,
|
|
874
1002
|
commonModeratorGuard,
|
|
875
1003
|
isChileanIdentityDocument,
|
|
1004
|
+
getCurrentTrace,
|
|
1005
|
+
userRoleEnum,
|
|
1006
|
+
commitData,
|
|
1007
|
+
emotionsData,
|
|
876
1008
|
};
|
|
@@ -761,6 +761,7 @@ const renderWave = ({ id }) => {
|
|
|
761
761
|
const cssTokensEffect = {};
|
|
762
762
|
const cssTokensContainer = {};
|
|
763
763
|
const cssEffect = async (containerSelector, event) => {
|
|
764
|
+
return;
|
|
764
765
|
// Array.from(event.target.classList)
|
|
765
766
|
let offsetX, offsetY;
|
|
766
767
|
if (Array.from(event.srcElement.classList).includes('ripple') && cssTokensContainer[containerSelector]) {
|
|
@@ -396,8 +396,7 @@ const CssCoreDark = {
|
|
|
396
396
|
text-align: center;
|
|
397
397
|
background: #1a1a1a;
|
|
398
398
|
font-size: 17px;
|
|
399
|
-
|
|
400
|
-
padding-bottom: 6px;
|
|
399
|
+
height: 35px;
|
|
401
400
|
}
|
|
402
401
|
::placeholder {
|
|
403
402
|
color: #c6c4c4;
|
|
@@ -701,8 +700,7 @@ const CssCoreLight = {
|
|
|
701
700
|
text-align: center;
|
|
702
701
|
background: #eaeaea;
|
|
703
702
|
font-size: 17px;
|
|
704
|
-
|
|
705
|
-
padding-bottom: 6px;
|
|
703
|
+
height: 35px;
|
|
706
704
|
}
|
|
707
705
|
::placeholder {
|
|
708
706
|
color: #333;
|
|
@@ -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}`;
|
|
84
83
|
},
|
|
85
84
|
},
|
|
86
85
|
{
|
|
@@ -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
|
`
|
|
@@ -100,7 +102,7 @@ const Input = {
|
|
|
100
102
|
</div>
|
|
101
103
|
</div>`;
|
|
102
104
|
},
|
|
103
|
-
|
|
105
|
+
parseJson: (selector) => {
|
|
104
106
|
try {
|
|
105
107
|
return JSON.parse(s(selector).value);
|
|
106
108
|
} catch (error) {
|
|
@@ -75,12 +75,17 @@ const LoadingAnimation = {
|
|
|
75
75
|
const style = {
|
|
76
76
|
'text-align': 'center',
|
|
77
77
|
};
|
|
78
|
-
|
|
79
78
|
if (s(container).classList) {
|
|
80
79
|
const classes = Array.from(s(container).classList);
|
|
81
80
|
if (classes.find((e) => e.match('management-table-btn-mini'))) {
|
|
82
81
|
style.top = '-2px';
|
|
83
82
|
style.left = '-2px';
|
|
83
|
+
} else if (classes.find((e) => e.match('-btn-tool'))) {
|
|
84
|
+
style.top = '-26px';
|
|
85
|
+
style.left = '-10px';
|
|
86
|
+
} else if (classes.find((e) => e.match('main-btn-')) && !classes.find((e) => e.match('main-btn-square-menu'))) {
|
|
87
|
+
style.top = '-8px';
|
|
88
|
+
style.left = '-10px';
|
|
84
89
|
} else if (classes.find((e) => e.match('action-bar-box'))) {
|
|
85
90
|
style.top = '-30px';
|
|
86
91
|
style.left = '-12px';
|
|
@@ -145,6 +150,8 @@ const LoadingAnimation = {
|
|
|
145
150
|
s(backgroundContainer).style.opacity = 0;
|
|
146
151
|
setTimeout(async () => {
|
|
147
152
|
s(backgroundContainer).style.display = 'none';
|
|
153
|
+
if (s(`.modal-menu`)) s(`.modal-menu`).classList.remove('hide');
|
|
154
|
+
if (s(`.main-body-btn-container`)) s(`.main-body-btn-container`).classList.remove('hide');
|
|
148
155
|
if (callBack) callBack();
|
|
149
156
|
}, 300);
|
|
150
157
|
});
|
|
@@ -9,7 +9,6 @@ import {
|
|
|
9
9
|
htmls,
|
|
10
10
|
sa,
|
|
11
11
|
getAllChildNodes,
|
|
12
|
-
getCurrentTrace,
|
|
13
12
|
isActiveElement,
|
|
14
13
|
} from './VanillaJs.js';
|
|
15
14
|
import { BtnIcon } from './BtnIcon.js';
|
|
@@ -50,6 +49,7 @@ const Modal = {
|
|
|
50
49
|
mode: '' /* slide-menu */,
|
|
51
50
|
RouterInstance: {},
|
|
52
51
|
disableTools: [],
|
|
52
|
+
observer: false,
|
|
53
53
|
},
|
|
54
54
|
) {
|
|
55
55
|
if (options.heightBottomBar === undefined) options.heightBottomBar = 50;
|
|
@@ -77,6 +77,8 @@ const Modal = {
|
|
|
77
77
|
options,
|
|
78
78
|
onCloseListener: {},
|
|
79
79
|
onMenuListener: {},
|
|
80
|
+
onCollapseMenuListener: {},
|
|
81
|
+
onExtendMenuListener: {},
|
|
80
82
|
onDragEndListener: {},
|
|
81
83
|
onObserverListener: {},
|
|
82
84
|
onClickListener: {},
|
|
@@ -157,7 +159,8 @@ const Modal = {
|
|
|
157
159
|
};
|
|
158
160
|
options.mode === 'slide-menu-right' ? (options.style.right = '0px') : (options.style.left = '0px');
|
|
159
161
|
const contentIconClass = 'abs center';
|
|
160
|
-
|
|
162
|
+
if (options.class) options.class += ' hide';
|
|
163
|
+
else options.class = 'hide';
|
|
161
164
|
options.dragDisabled = true;
|
|
162
165
|
options.titleClass = 'hide';
|
|
163
166
|
top = '0px';
|
|
@@ -239,7 +242,7 @@ const Modal = {
|
|
|
239
242
|
'body',
|
|
240
243
|
html`
|
|
241
244
|
<div
|
|
242
|
-
class="abs main-body-btn-container"
|
|
245
|
+
class="abs main-body-btn-container hide"
|
|
243
246
|
style="top: ${options.heightTopBar + 50}px; z-index: 9; ${true ||
|
|
244
247
|
(options.mode && options.mode.match('right'))
|
|
245
248
|
? 'right'
|
|
@@ -1384,6 +1387,9 @@ const Modal = {
|
|
|
1384
1387
|
if (options.onCollapseMenu) options.onCollapseMenu();
|
|
1385
1388
|
s(`.sub-menu-title-container-${'modal-menu'}`).classList.add('hide');
|
|
1386
1389
|
s(`.nav-path-container-${'modal-menu'}`).classList.add('hide');
|
|
1390
|
+
Object.keys(this.Data[idModal].onCollapseMenuListener).map((keyListener) =>
|
|
1391
|
+
this.Data[idModal].onCollapseMenuListener[keyListener](),
|
|
1392
|
+
);
|
|
1387
1393
|
} else {
|
|
1388
1394
|
slideMenuWidth = originSlideMenuWidth;
|
|
1389
1395
|
setTimeout(() => {
|
|
@@ -1404,6 +1410,9 @@ const Modal = {
|
|
|
1404
1410
|
if (options.onExtendMenu) options.onExtendMenu();
|
|
1405
1411
|
s(`.sub-menu-title-container-${'modal-menu'}`).classList.remove('hide');
|
|
1406
1412
|
s(`.nav-path-container-${'modal-menu'}`).classList.remove('hide');
|
|
1413
|
+
Object.keys(this.Data[idModal].onExtendMenuListener).map((keyListener) =>
|
|
1414
|
+
this.Data[idModal].onExtendMenuListener[keyListener](),
|
|
1415
|
+
);
|
|
1407
1416
|
}
|
|
1408
1417
|
// btn-bar-center-icon-menu
|
|
1409
1418
|
this.actionBtnCenter();
|
|
@@ -1782,20 +1791,34 @@ const renderMenuLabel = ({ img, text, icon }) => {
|
|
|
1782
1791
|
<div class="abs center main-btn-menu-text">${text}</div>`;
|
|
1783
1792
|
};
|
|
1784
1793
|
|
|
1785
|
-
const renderViewTitle = (
|
|
1786
|
-
|
|
1794
|
+
const renderViewTitle = (
|
|
1795
|
+
options = { icon: '', img: '', text: '', assetFolder: '', 'ui-icons': '', dim, top, topText: '' },
|
|
1796
|
+
) => {
|
|
1797
|
+
if (options.dim === undefined) options.dim = 30;
|
|
1787
1798
|
const { img, text, icon, dim, top } = options;
|
|
1788
1799
|
if (!img && !options['ui-icon']) return html`<span class="view-title-icon">${icon}</span> ${text}`;
|
|
1789
1800
|
return html`<img
|
|
1790
1801
|
class="abs img-btn-square-view-title"
|
|
1791
1802
|
style="${renderCssAttr({
|
|
1792
|
-
style: {
|
|
1803
|
+
style: {
|
|
1804
|
+
width: `${dim}px`,
|
|
1805
|
+
height: `${dim}px`,
|
|
1806
|
+
top: top !== undefined ? `${top}px !important` : undefined,
|
|
1807
|
+
},
|
|
1793
1808
|
})}"
|
|
1794
1809
|
src="${options['ui-icon']
|
|
1795
1810
|
? `${getProxyPath()}assets/${options.assetFolder ? options.assetFolder : 'ui-icons'}/${options['ui-icon']}`
|
|
1796
1811
|
: img}"
|
|
1797
1812
|
/>
|
|
1798
|
-
<div
|
|
1813
|
+
<div
|
|
1814
|
+
class="in text-btn-square-view-title"
|
|
1815
|
+
style="${renderCssAttr({
|
|
1816
|
+
style: {
|
|
1817
|
+
// 'padding-left': `${20 + dim}px`,
|
|
1818
|
+
...(options.topText !== undefined ? { top: options.topText + 'px !important' } : {}),
|
|
1819
|
+
},
|
|
1820
|
+
})}"
|
|
1821
|
+
>
|
|
1799
1822
|
${text}
|
|
1800
1823
|
</div>`;
|
|
1801
1824
|
};
|
|
@@ -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: () => [],
|
|
@@ -244,12 +245,13 @@ const Panel = {
|
|
|
244
245
|
|
|
245
246
|
let render = '';
|
|
246
247
|
let renderForm = html` <div class="in modal stq" style="top: 0px; z-index: 1; padding-bottom: 5px">
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
248
|
+
${await BtnIcon.Render({
|
|
249
|
+
class: `section-mp btn-custom btn-${idPanel}-close`,
|
|
250
|
+
label: html`<i class="fa-solid fa-xmark"></i> ${Translate.Render('close')}`,
|
|
251
|
+
type: 'button',
|
|
252
|
+
})}
|
|
253
|
+
</div>
|
|
254
|
+
${options?.htmlFormHeader ? await options.htmlFormHeader() : ''}`;
|
|
253
255
|
|
|
254
256
|
for (const modelData of formData) {
|
|
255
257
|
if (modelData.disableRender) continue;
|
|
@@ -29,6 +29,8 @@ const PanelForm = {
|
|
|
29
29
|
Elements: {},
|
|
30
30
|
parentIdModal: undefined,
|
|
31
31
|
route: 'home',
|
|
32
|
+
htmlFormHeader: async () => '',
|
|
33
|
+
firsUpdateEvent: async () => {},
|
|
32
34
|
},
|
|
33
35
|
) {
|
|
34
36
|
const { idPanel, heightTopBar, heightBottomBar, defaultUrlImage, Elements } = options;
|
|
@@ -99,6 +101,7 @@ const PanelForm = {
|
|
|
99
101
|
heightTopBar,
|
|
100
102
|
heightBottomBar,
|
|
101
103
|
data,
|
|
104
|
+
htmlFormHeader: options.htmlFormHeader,
|
|
102
105
|
parentIdModal: options.parentIdModal,
|
|
103
106
|
originData: () => PanelForm.Data[idPanel].originData,
|
|
104
107
|
filesData: () => PanelForm.Data[idPanel].filesData,
|
|
@@ -421,8 +424,16 @@ const PanelForm = {
|
|
|
421
424
|
ssr: true,
|
|
422
425
|
})),
|
|
423
426
|
});
|
|
424
|
-
|
|
427
|
+
let delayBlock = false;
|
|
428
|
+
let firsUpdateEvent = false;
|
|
425
429
|
this.Data[idPanel].updatePanel = async () => {
|
|
430
|
+
if (delayBlock) return;
|
|
431
|
+
else {
|
|
432
|
+
delayBlock = true;
|
|
433
|
+
setTimeout(() => {
|
|
434
|
+
delayBlock = false;
|
|
435
|
+
}, 500);
|
|
436
|
+
}
|
|
426
437
|
const cid = getQueryParams().cid ? getQueryParams().cid : '';
|
|
427
438
|
if (options.route === 'home') Modal.homeCid = newInstance(cid);
|
|
428
439
|
htmls(`.${options.parentIdModal ? 'html-' + options.parentIdModal : 'main-body'}`, await renderSrrPanelData());
|
|
@@ -431,23 +442,28 @@ const PanelForm = {
|
|
|
431
442
|
`.${options.parentIdModal ? 'html-' + options.parentIdModal : 'main-body'}`,
|
|
432
443
|
await panelRender({ data: this.Data[idPanel].data }),
|
|
433
444
|
);
|
|
445
|
+
if (!firsUpdateEvent && options.firsUpdateEvent) {
|
|
446
|
+
firsUpdateEvent = true;
|
|
447
|
+
await options.firsUpdateEvent();
|
|
448
|
+
}
|
|
434
449
|
};
|
|
435
450
|
if (options.route)
|
|
436
451
|
listenQueryPathInstance({
|
|
437
452
|
id: options.parentIdModal ? 'html-' + options.parentIdModal : 'main-body',
|
|
438
453
|
routeId: options.route,
|
|
439
454
|
event: async (path) => {
|
|
440
|
-
if (!PanelForm.Data[idPanel].sessionIn)
|
|
455
|
+
// if (!PanelForm.Data[idPanel].sessionIn)
|
|
456
|
+
await this.Data[idPanel].updatePanel();
|
|
441
457
|
},
|
|
442
458
|
});
|
|
443
459
|
|
|
444
460
|
// if (options.route === 'home') setTimeout(this.Data[idPanel].updatePanel);
|
|
445
461
|
setTimeout(() => {
|
|
446
|
-
if (
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
)
|
|
450
|
-
|
|
462
|
+
// if (
|
|
463
|
+
// options.route !== 'home' &&
|
|
464
|
+
// (!PanelForm.Data[idPanel].originData || PanelForm.Data[idPanel].originData.length === 0)
|
|
465
|
+
// )
|
|
466
|
+
this.Data[idPanel].updatePanel();
|
|
451
467
|
});
|
|
452
468
|
|
|
453
469
|
if (options.parentIdModal) {
|
|
@@ -508,6 +508,10 @@ const TranslateCore = {
|
|
|
508
508
|
en: 'Invalid identity document',
|
|
509
509
|
es: 'Documento de identidad inválido',
|
|
510
510
|
};
|
|
511
|
+
Translate.Data['expired-session'] = {
|
|
512
|
+
en: 'Your session has expired. Please log in again.',
|
|
513
|
+
es: 'Su sesión ha expirado. Por favor, inicie sesión de nuevo.',
|
|
514
|
+
};
|
|
511
515
|
},
|
|
512
516
|
};
|
|
513
517
|
|
|
@@ -419,14 +419,6 @@ const isActiveTab = () => document.hasFocus();
|
|
|
419
419
|
const isActiveElement = (classSearch = '') =>
|
|
420
420
|
document.activeElement?.classList?.value?.match(classSearch) ? true : false;
|
|
421
421
|
|
|
422
|
-
const getCurrentTrace = () => {
|
|
423
|
-
try {
|
|
424
|
-
_stack;
|
|
425
|
-
} catch (error) {
|
|
426
|
-
return error.stack.split('is not defined')[1];
|
|
427
|
-
}
|
|
428
|
-
};
|
|
429
|
-
|
|
430
422
|
const isDevInstance = () => location.origin.match('localhost') && location.port;
|
|
431
423
|
|
|
432
424
|
const getDataFromInputFile = async (file) => Array.from(new Uint8Array(await file.arrayBuffer()));
|
|
@@ -460,7 +452,6 @@ export {
|
|
|
460
452
|
isNavigator,
|
|
461
453
|
getTimeZone,
|
|
462
454
|
getAllChildNodes,
|
|
463
|
-
getCurrentTrace,
|
|
464
455
|
isActiveTab,
|
|
465
456
|
isActiveElement,
|
|
466
457
|
isDevInstance,
|
|
@@ -22,41 +22,44 @@ const Worker = {
|
|
|
22
22
|
setTimeout(() => {
|
|
23
23
|
if ('onLine' in navigator && navigator.onLine) window.ononline();
|
|
24
24
|
});
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
25
|
+
if ('serviceWorker' in navigator) {
|
|
26
|
+
navigator.serviceWorker.addEventListener('controllerchange', () => {
|
|
27
|
+
logger.info('The controller of current browsing context has changed.');
|
|
28
|
+
});
|
|
29
|
+
navigator.serviceWorker.ready.then((worker) => {
|
|
30
|
+
logger.info('Ready', worker);
|
|
31
|
+
// event message
|
|
32
|
+
navigator.serviceWorker.addEventListener('message', (event) => {
|
|
33
|
+
logger.info('Received event message', event.data);
|
|
34
|
+
const { status } = event.data;
|
|
34
35
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
36
|
+
switch (status) {
|
|
37
|
+
case 'loader':
|
|
38
|
+
{
|
|
39
|
+
LoadingAnimation.RenderCurrentSrcLoad(event);
|
|
40
|
+
}
|
|
41
|
+
break;
|
|
41
42
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
default:
|
|
44
|
+
break;
|
|
45
|
+
}
|
|
46
|
+
});
|
|
46
47
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
// if (navigator.serviceWorker.controller)
|
|
49
|
+
// navigator.serviceWorker.controller.postMessage({
|
|
50
|
+
// title: 'Hello from Client event message',
|
|
51
|
+
// });
|
|
52
|
+
|
|
53
|
+
// broadcast message
|
|
54
|
+
// const channel = new BroadcastChannel('sw-messages');
|
|
55
|
+
// channel.addEventListener('message', (event) => {
|
|
56
|
+
// logger.info('Received broadcast message', event.data);
|
|
57
|
+
// });
|
|
58
|
+
// channel.postMessage({ title: 'Hello from Client broadcast message' });
|
|
59
|
+
// channel.close();
|
|
60
|
+
});
|
|
61
|
+
}
|
|
51
62
|
|
|
52
|
-
// broadcast message
|
|
53
|
-
// const channel = new BroadcastChannel('sw-messages');
|
|
54
|
-
// channel.addEventListener('message', (event) => {
|
|
55
|
-
// logger.info('Received broadcast message', event.data);
|
|
56
|
-
// });
|
|
57
|
-
// channel.postMessage({ title: 'Hello from Client broadcast message' });
|
|
58
|
-
// channel.close();
|
|
59
|
-
});
|
|
60
63
|
this.RouterInstance = router();
|
|
61
64
|
const isInstall = await this.status();
|
|
62
65
|
if (!isInstall) await this.install();
|