underpost 2.7.91 → 2.7.93
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/bin/deploy.js +13 -11
- package/bin/file.js +1 -0
- package/bin/hwt.js +59 -0
- package/bin/index.js +1 -1
- package/conf.js +29 -5
- package/docker-compose.yml +1 -1
- package/package.json +133 -133
- package/src/client/Default.index.js +2 -1
- package/src/client/components/core/404.js +20 -0
- package/src/client/components/core/500.js +20 -0
- package/src/client/{ssr/common → components/core}/Alert.js +13 -11
- package/src/client/components/core/Docs.js +1 -1
- package/src/client/components/core/Modal.js +8 -6
- package/src/client/components/core/Scroll.js +65 -1
- package/src/client/components/core/Translate.js +21 -5
- package/src/client/components/core/VanillaJs.js +4 -1
- package/src/client/components/core/Worker.js +10 -11
- package/src/client/components/default/MenuDefault.js +69 -0
- package/src/client/components/default/RoutesDefault.js +2 -0
- package/src/client/public/default/plantuml/client-conf.svg +1 -1
- package/src/client/public/default/plantuml/client-schema.svg +1 -1
- package/src/client/public/default/plantuml/cron-schema.svg +1 -1
- package/src/client/public/default/plantuml/server-conf.svg +1 -1
- package/src/client/public/default/plantuml/server-schema.svg +1 -1
- package/src/client/public/default/plantuml/ssr-conf.svg +1 -1
- package/src/client/public/default/plantuml/ssr-schema.svg +1 -1
- package/src/client/ssr/Render.js +1 -6
- package/src/client/ssr/body/404.js +73 -0
- package/src/client/ssr/body/500.js +72 -0
- package/src/client/ssr/{components/body → body}/CacheControl.js +1 -1
- package/src/client/ssr/mailer/DefaultRecoverEmail.js +21 -0
- package/src/client/ssr/mailer/DefaultVerifyEmail.js +17 -0
- package/src/client/ssr/offline/NoNetworkConnection.js +67 -0
- package/src/client/ssr/pages/Test.js +198 -0
- package/src/client/sw/default.sw.js +43 -166
- package/src/mailer/EmailRender.js +2 -4
- package/src/mailer/MailerProvider.js +4 -1
- package/src/server/client-build.js +100 -74
- package/src/server/client-formatted.js +2 -4
- package/src/server/conf.js +40 -13
- package/src/server/proxy.js +0 -2
- package/src/server/runtime.js +38 -10
- package/src/client/ssr/common/SsrCore.js +0 -91
- package/src/client/ssr/common/Translate.js +0 -26
- package/src/client/ssr/common/Worker.js +0 -28
- package/src/client/ssr/components/head/PwaDefault.js +0 -60
- /package/src/client/ssr/{components/body → body}/DefaultSplashScreen.js +0 -0
- /package/src/client/ssr/{components/email → email}/DefaultRecoverEmail.js +0 -0
- /package/src/client/ssr/{components/email → email}/DefaultVerifyEmail.js +0 -0
- /package/src/client/ssr/{components/head → head}/Css.js +0 -0
- /package/src/client/ssr/{components/head → head}/DefaultScripts.js +0 -0
- /package/src/client/ssr/{components/head → head}/Production.js +0 -0
- /package/src/client/ssr/{components/head → head}/Pwa.js +0 -0
- /package/src/client/ssr/{components/head → head}/Seo.js +0 -0
package/bin/deploy.js
CHANGED
|
@@ -29,12 +29,12 @@ import {
|
|
|
29
29
|
} from '../src/server/conf.js';
|
|
30
30
|
import { buildClient } from '../src/server/client-build.js';
|
|
31
31
|
import { range, setPad, timer, uniqueArray } from '../src/client/components/core/CommonJs.js';
|
|
32
|
-
import toJsonSchema from 'to-json-schema';
|
|
33
32
|
import simpleGit from 'simple-git';
|
|
34
33
|
import { MongooseDB } from '../src/db/mongo/MongooseDB.js';
|
|
35
34
|
import { Lampp } from '../src/runtime/lampp/Lampp.js';
|
|
36
35
|
import { DefaultConf } from '../conf.js';
|
|
37
36
|
import { JSONweb } from '../src/server/client-formatted.js';
|
|
37
|
+
import ejs from 'easy-json-schema';
|
|
38
38
|
|
|
39
39
|
const logger = loggerFactory(import.meta);
|
|
40
40
|
|
|
@@ -573,29 +573,33 @@ try {
|
|
|
573
573
|
}
|
|
574
574
|
case 'build-uml':
|
|
575
575
|
{
|
|
576
|
-
const
|
|
577
|
-
const path = process.argv[4];
|
|
578
|
-
const folder = `./public/${host}${path}/docs/plantuml`;
|
|
576
|
+
const folder = process.argv[3] ? process.argv[3] : `./src/client/public/default/plantuml`;
|
|
579
577
|
const confData = Config.default;
|
|
580
578
|
|
|
581
579
|
if (!fs.existsSync(folder)) fs.mkdirSync(folder, { recursive: true });
|
|
582
580
|
|
|
583
581
|
for (const typeConf of Object.keys(confData)) {
|
|
584
|
-
{
|
|
582
|
+
logger.info(`generate ${typeConf} instance`);
|
|
583
|
+
try {
|
|
585
584
|
const svg = await plantuml(`
|
|
586
585
|
@startjson
|
|
587
586
|
${JSON.stringify(confData[typeConf])}
|
|
588
587
|
@endjson
|
|
589
588
|
`);
|
|
590
589
|
fs.writeFileSync(`${folder}/${typeConf}-conf.svg`, svg);
|
|
590
|
+
} catch (error) {
|
|
591
|
+
logger.error(error, error.stack);
|
|
591
592
|
}
|
|
592
|
-
{
|
|
593
|
+
logger.info(`generate ${typeConf} schema`);
|
|
594
|
+
try {
|
|
593
595
|
const svg = await plantuml(`
|
|
594
596
|
@startjson
|
|
595
|
-
${JSON.stringify(
|
|
597
|
+
${JSON.stringify(ejs(confData[typeConf]))}
|
|
596
598
|
@endjson
|
|
597
599
|
`);
|
|
598
600
|
fs.writeFileSync(`${folder}/${typeConf}-schema.svg`, svg);
|
|
601
|
+
} catch (error) {
|
|
602
|
+
logger.error(error, error.stack);
|
|
599
603
|
}
|
|
600
604
|
}
|
|
601
605
|
}
|
|
@@ -733,10 +737,8 @@ try {
|
|
|
733
737
|
);
|
|
734
738
|
|
|
735
739
|
fs.writeFileSync(
|
|
736
|
-
`./src/client/ssr/
|
|
737
|
-
fs
|
|
738
|
-
.readFileSync(`./src/client/ssr/components/body/CacheControl.js`, 'utf8')
|
|
739
|
-
.replaceAll(`v${version}`, `v${newVersion}`),
|
|
740
|
+
`./src/client/ssr/body/CacheControl.js`,
|
|
741
|
+
fs.readFileSync(`./src/client/ssr/body/CacheControl.js`, 'utf8').replaceAll(`v${version}`, `v${newVersion}`),
|
|
740
742
|
'utf8',
|
|
741
743
|
);
|
|
742
744
|
|
package/bin/file.js
CHANGED
package/bin/hwt.js
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import fs from 'fs-extra';
|
|
2
|
+
import axios from 'axios';
|
|
3
|
+
import https from 'https';
|
|
4
|
+
|
|
5
|
+
import dotenv from 'dotenv';
|
|
6
|
+
import { shellCd, shellExec } from '../src/server/process.js';
|
|
7
|
+
import { loggerFactory } from '../src/server/logger.js';
|
|
8
|
+
|
|
9
|
+
const logger = loggerFactory(import.meta);
|
|
10
|
+
|
|
11
|
+
const httpsAgent = new https.Agent({
|
|
12
|
+
rejectUnauthorized: false,
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
axios.defaults.httpsAgent = httpsAgent;
|
|
16
|
+
|
|
17
|
+
logger.info('argv', process.argv);
|
|
18
|
+
|
|
19
|
+
const [exe, dir, operator, templateId, publicPath] = process.argv;
|
|
20
|
+
|
|
21
|
+
// engine for 'html-website-templates'
|
|
22
|
+
|
|
23
|
+
try {
|
|
24
|
+
switch (operator) {
|
|
25
|
+
case 'set-base':
|
|
26
|
+
{
|
|
27
|
+
switch (parseInt(templateId)) {
|
|
28
|
+
// Horizontal Scroll One Page Template Website
|
|
29
|
+
case 0:
|
|
30
|
+
{
|
|
31
|
+
fs.writeFile(
|
|
32
|
+
`${publicPath}/index.html`,
|
|
33
|
+
fs
|
|
34
|
+
.readFileSync(`${publicPath}/index.html`, 'utf8')
|
|
35
|
+
.replace(`<ul class="menu">`, `<ul class="menu hidden">`)
|
|
36
|
+
.replaceAll(`<section class="slide fade-6 kenBurns">`, `<section class="fade-6 kenBurns hidden">`)
|
|
37
|
+
.replace(`<section class="fade-6 kenBurns hidden">`, `<section class="slide fade-6 kenBurns">`)
|
|
38
|
+
.replaceAll(
|
|
39
|
+
`<nav class="panel bottom forceMobileView">`,
|
|
40
|
+
`<nav class="panel bottom forceMobileView hidden">`,
|
|
41
|
+
),
|
|
42
|
+
|
|
43
|
+
'utf8',
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
break;
|
|
47
|
+
|
|
48
|
+
default:
|
|
49
|
+
break;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
break;
|
|
53
|
+
|
|
54
|
+
default:
|
|
55
|
+
break;
|
|
56
|
+
}
|
|
57
|
+
} catch (error) {
|
|
58
|
+
logger.error(error, error.stack);
|
|
59
|
+
}
|
package/bin/index.js
CHANGED
package/conf.js
CHANGED
|
@@ -56,6 +56,9 @@ const DefaultConf = {
|
|
|
56
56
|
'Panel',
|
|
57
57
|
'PanelForm',
|
|
58
58
|
'Scroll',
|
|
59
|
+
'Alert',
|
|
60
|
+
'404',
|
|
61
|
+
'500',
|
|
59
62
|
],
|
|
60
63
|
default: [
|
|
61
64
|
'MenuDefault',
|
|
@@ -124,6 +127,8 @@ const DefaultConf = {
|
|
|
124
127
|
client: 'Default',
|
|
125
128
|
ssr: 'Default',
|
|
126
129
|
},
|
|
130
|
+
{ client: 'Default', ssr: 'Default', path: '/404', title: '404 Not Found' },
|
|
131
|
+
{ client: 'Default', ssr: 'Default', path: '/500', title: '500 Server Error' },
|
|
127
132
|
],
|
|
128
133
|
dists: [
|
|
129
134
|
{
|
|
@@ -175,7 +180,29 @@ const DefaultConf = {
|
|
|
175
180
|
ssr: {
|
|
176
181
|
Default: {
|
|
177
182
|
head: ['Seo', 'Pwa', 'Css', 'DefaultScripts', 'Production'],
|
|
178
|
-
body: ['CacheControl', 'DefaultSplashScreen'],
|
|
183
|
+
body: ['CacheControl', 'DefaultSplashScreen', '404', '500'],
|
|
184
|
+
mailer: {
|
|
185
|
+
userVerifyEmail: 'DefaultVerifyEmail',
|
|
186
|
+
userRecoverEmail: 'DefaultRecoverEmail',
|
|
187
|
+
},
|
|
188
|
+
offline: [
|
|
189
|
+
{
|
|
190
|
+
path: '/offline',
|
|
191
|
+
title: 'No Network Connection',
|
|
192
|
+
client: 'NoNetworkConnection',
|
|
193
|
+
head: [],
|
|
194
|
+
body: [],
|
|
195
|
+
},
|
|
196
|
+
],
|
|
197
|
+
pages: [
|
|
198
|
+
{
|
|
199
|
+
path: '/test',
|
|
200
|
+
title: 'Test',
|
|
201
|
+
client: 'Test',
|
|
202
|
+
head: [],
|
|
203
|
+
body: [],
|
|
204
|
+
},
|
|
205
|
+
],
|
|
179
206
|
},
|
|
180
207
|
},
|
|
181
208
|
server: {
|
|
@@ -189,6 +216,7 @@ const DefaultConf = {
|
|
|
189
216
|
iconsBuild: true,
|
|
190
217
|
liteBuild: false,
|
|
191
218
|
docsBuild: false,
|
|
219
|
+
offlineBuild: false,
|
|
192
220
|
ws: 'core',
|
|
193
221
|
peer: true,
|
|
194
222
|
proxy: [80, 443],
|
|
@@ -211,10 +239,6 @@ const DefaultConf = {
|
|
|
211
239
|
pass: '',
|
|
212
240
|
},
|
|
213
241
|
},
|
|
214
|
-
templates: {
|
|
215
|
-
userVerifyEmail: 'DefaultVerifyEmail',
|
|
216
|
-
userRecoverEmail: 'DefaultRecoverEmail',
|
|
217
|
-
},
|
|
218
242
|
},
|
|
219
243
|
},
|
|
220
244
|
},
|
package/docker-compose.yml
CHANGED
package/package.json
CHANGED
|
@@ -1,134 +1,134 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
}
|
|
2
|
+
"type": "module",
|
|
3
|
+
"main": "src/index.js",
|
|
4
|
+
"name": "underpost",
|
|
5
|
+
"version": "2.7.93",
|
|
6
|
+
"description": "pwa api rest template",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"start": "env-cmd -f .env.production node --max-old-space-size=8192 src/server",
|
|
9
|
+
"pm2": "env-cmd -f .env.production pm2 start src/server.js --node-args=\"--max-old-space-size=8192\" --name engine && pm2 logs",
|
|
10
|
+
"ssl": "env-cmd -f .env.production node bin/ssl",
|
|
11
|
+
"pm2-delete": "pm2 delete engine",
|
|
12
|
+
"build": "node bin/deploy build-full-client",
|
|
13
|
+
"build-production": "env-cmd -f .env.production node bin/deploy build-full-client",
|
|
14
|
+
"dev": "env-cmd -f .env.development node src/client.dev --no-warnings",
|
|
15
|
+
"dev-api": "env-cmd -f .env.development nodemon --watch src --ignore src/client src/api",
|
|
16
|
+
"docs": "jsdoc -c jsdoc.json",
|
|
17
|
+
"backup": "node bin/db default.net/ export",
|
|
18
|
+
"install-template": "npm install && npm run build",
|
|
19
|
+
"install-global": "npm install -g pm2 && npm install -g jsdoc && npm install -g prettier && npm install -g env-cmd && npm install -g yarn && npm install -g auto-changelog",
|
|
20
|
+
"install-test": "npm install -g mocha && npm install -g c8 && npm install -g nyc && npm install -g coveralls",
|
|
21
|
+
"install-vs-extensions": "node bin/vs import",
|
|
22
|
+
"preinstall": "npm config set audit false && npm config set loglevel error",
|
|
23
|
+
"restore-preinstall": "npm config set audit true && npm config set loglevel notice",
|
|
24
|
+
"install": "npm run install-global && npm run install-test && npm run restore-preinstall --no-audit --no-warnings",
|
|
25
|
+
"docker:start": "docker-compose up",
|
|
26
|
+
"prettier": "prettier --write .",
|
|
27
|
+
"coveralls": "nyc npm run test --reporter=text-lcov | coveralls -v",
|
|
28
|
+
"test": "env-cmd -f .env.test c8 mocha",
|
|
29
|
+
"update": "npm update -g && npm update && npm audit fix --force && npm audit fix --force",
|
|
30
|
+
"underpost-publish": "npm publish --provenance --access public",
|
|
31
|
+
"underpost-unpublish": "npm unpublish underpost@2.5.x",
|
|
32
|
+
"login": "npm adduser",
|
|
33
|
+
"bin": "npm link --force"
|
|
34
|
+
},
|
|
35
|
+
"bin": {
|
|
36
|
+
"underpost": "bin/index.js"
|
|
37
|
+
},
|
|
38
|
+
"repository": {
|
|
39
|
+
"type": "git",
|
|
40
|
+
"url": "git+https://github.com/underpostnet/pwa-microservices-template.git"
|
|
41
|
+
},
|
|
42
|
+
"keywords": [
|
|
43
|
+
"engine",
|
|
44
|
+
"server",
|
|
45
|
+
"proxy",
|
|
46
|
+
"client"
|
|
47
|
+
],
|
|
48
|
+
"author": "https://github.com/underpostnet",
|
|
49
|
+
"license": "MIT",
|
|
50
|
+
"bugs": {
|
|
51
|
+
"url": "https://github.com/underpostnet/pwa-microservices-template/issues"
|
|
52
|
+
},
|
|
53
|
+
"homepage": "https://github.com/underpostnet/pwa-microservices-template#readme",
|
|
54
|
+
"dependencies": {
|
|
55
|
+
"@fortawesome/fontawesome-free": "^6.4.2",
|
|
56
|
+
"@loadingio/css-spinner": "^2.0.2",
|
|
57
|
+
"@neodrag/vanilla": "^2.0.3",
|
|
58
|
+
"@xenova/transformers": "^2.17.2",
|
|
59
|
+
"adm-zip": "^0.5.10",
|
|
60
|
+
"ag-grid-community": "31.0.0",
|
|
61
|
+
"axios": "^1.5.1",
|
|
62
|
+
"chai": "^5.1.0",
|
|
63
|
+
"cli-progress": "^3.12.0",
|
|
64
|
+
"cli-spinners": "^3.0.0",
|
|
65
|
+
"color": "^4.2.3",
|
|
66
|
+
"colors": "^1.4.0",
|
|
67
|
+
"commander": "^12.1.0",
|
|
68
|
+
"compression": "^1.7.4",
|
|
69
|
+
"copy-paste": "^1.5.3",
|
|
70
|
+
"cors": "^2.8.5",
|
|
71
|
+
"d3": "^7.9.0",
|
|
72
|
+
"deepmerge": "^4.3.1",
|
|
73
|
+
"detect-port": "^1.5.1",
|
|
74
|
+
"dotenv": "^16.3.1",
|
|
75
|
+
"easymde": "^2.18.0",
|
|
76
|
+
"env-cmd": "^10.1.0",
|
|
77
|
+
"eventemitter3": "^5.0.1",
|
|
78
|
+
"express": "^4.18.2",
|
|
79
|
+
"express-fileupload": "^1.4.3",
|
|
80
|
+
"favicons": "^7.2.0",
|
|
81
|
+
"font-awesome-assets": "^0.0.9",
|
|
82
|
+
"fs-extra": "^11.1.1",
|
|
83
|
+
"fullcalendar": "^6.1.15",
|
|
84
|
+
"html-minifier-terser": "^7.2.0",
|
|
85
|
+
"http-proxy-middleware": "^2.0.6",
|
|
86
|
+
"ignore-walk": "^6.0.4",
|
|
87
|
+
"is-admin": "^4.0.0",
|
|
88
|
+
"is-ip": "^5.0.1",
|
|
89
|
+
"jimp": "^0.22.12",
|
|
90
|
+
"joystick-controller": "^1.0.15",
|
|
91
|
+
"json-colorizer": "^2.2.2",
|
|
92
|
+
"jsonwebtoken": "^9.0.2",
|
|
93
|
+
"kill-port-process": "^3.2.0",
|
|
94
|
+
"log-update": "^6.0.0",
|
|
95
|
+
"mariadb": "^3.2.2",
|
|
96
|
+
"marked": "^12.0.2",
|
|
97
|
+
"mongoose": "^8.0.1",
|
|
98
|
+
"morgan": "^1.10.0",
|
|
99
|
+
"nodemailer": "^6.9.9",
|
|
100
|
+
"nodemon": "^3.0.1",
|
|
101
|
+
"pathfinding": "^0.4.18",
|
|
102
|
+
"peer": "^1.0.2",
|
|
103
|
+
"peerjs": "^1.5.2",
|
|
104
|
+
"pixi.js": "7.4.0",
|
|
105
|
+
"prom-client": "^15.1.2",
|
|
106
|
+
"public-ip": "^6.0.1",
|
|
107
|
+
"read": "^2.1.0",
|
|
108
|
+
"sharp": "^0.32.5",
|
|
109
|
+
"shelljs": "^0.8.5",
|
|
110
|
+
"simple-git": "^3.26.0",
|
|
111
|
+
"simple-icons": "^13.9.0",
|
|
112
|
+
"sitemap": "^7.1.1",
|
|
113
|
+
"socket.io": "^4.8.0",
|
|
114
|
+
"sortablejs": "^1.15.0",
|
|
115
|
+
"split-file": "^2.3.0",
|
|
116
|
+
"swagger-ui-express": "^5.0.0",
|
|
117
|
+
"systeminformation": "^5.21.17",
|
|
118
|
+
"uglify-js": "^3.17.4",
|
|
119
|
+
"validator": "^13.11.0",
|
|
120
|
+
"winston": "^3.11.0"
|
|
121
|
+
},
|
|
122
|
+
"devDependencies": {
|
|
123
|
+
"clean-jsdoc-theme": "^4.3.0",
|
|
124
|
+
"mocha": "^10.4.0",
|
|
125
|
+
"plantuml": "^0.0.2",
|
|
126
|
+
"swagger-autogen": "^2.23.7",
|
|
127
|
+
"easy-json-schema": "^0.0.2-beta"
|
|
128
|
+
},
|
|
129
|
+
"publishConfig": {
|
|
130
|
+
"provenance": true,
|
|
131
|
+
"access": "public",
|
|
132
|
+
"registry": "https://registry.npmjs.org/"
|
|
133
|
+
}
|
|
134
|
+
}
|
|
@@ -9,13 +9,13 @@ import { SignUpDefault } from './components/default/SignUpDefault.js';
|
|
|
9
9
|
import { MenuDefault } from './components/default/MenuDefault.js';
|
|
10
10
|
import { RouterDefault } from './components/default/RoutesDefault.js';
|
|
11
11
|
import { TranslateDefault } from './components/default/TranslateDefault.js';
|
|
12
|
-
import { getProxyPath } from './components/core/VanillaJs.js';
|
|
13
12
|
import { Worker } from './components/core/Worker.js';
|
|
14
13
|
import { Keyboard } from './components/core/Keyboard.js';
|
|
15
14
|
import { DefaultParams } from './components/default/CommonDefault.js';
|
|
16
15
|
import { SocketIo } from './components/core/SocketIo.js';
|
|
17
16
|
import { SocketIoDefault } from './components/default/SocketIoDefault.js';
|
|
18
17
|
import { ElementsDefault } from './components/default/ElementsDefault.js';
|
|
18
|
+
import { Scroll } from './components/core/Scroll.js';
|
|
19
19
|
|
|
20
20
|
const htmlMainBody = async () => {
|
|
21
21
|
return html`<span style="color: black; padding: 5px">Hello World!!</span>`;
|
|
@@ -35,6 +35,7 @@ window.onload = () =>
|
|
|
35
35
|
await LogInDefault();
|
|
36
36
|
await LogOutDefault();
|
|
37
37
|
await SignUpDefault();
|
|
38
|
+
await Scroll.pullTopRefresh();
|
|
38
39
|
await Keyboard.Init({ callBackTime: DefaultParams.EVENT_CALLBACK_TIME });
|
|
39
40
|
},
|
|
40
41
|
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Alert } from './Alert.js';
|
|
2
|
+
import { Modal } from './Modal.js';
|
|
3
|
+
import { s } from './VanillaJs.js';
|
|
4
|
+
|
|
5
|
+
const Page404 = {
|
|
6
|
+
Render: async function (options = { idModal: '' }) {
|
|
7
|
+
setTimeout(() => {
|
|
8
|
+
Modal.Data[options.idModal].onObserverListener['404'] = () => {
|
|
9
|
+
if (s(`.container-404-${options.idModal}`))
|
|
10
|
+
s(`.container-404-${options.idModal}`).style.height = `${
|
|
11
|
+
s(`.${options.idModal}`).offsetHeight - Modal.headerTitleHeight
|
|
12
|
+
}px`;
|
|
13
|
+
};
|
|
14
|
+
Modal.Data[options.idModal].onObserverListener['404']();
|
|
15
|
+
});
|
|
16
|
+
return html`<div class="in container-404-${options.idModal}">${await Alert.e404()}</div>`;
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export { Page404 };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Alert } from './Alert.js';
|
|
2
|
+
import { Modal } from './Modal.js';
|
|
3
|
+
import { s } from './VanillaJs.js';
|
|
4
|
+
|
|
5
|
+
const Page500 = {
|
|
6
|
+
Render: async function (options = { idModal: '' }) {
|
|
7
|
+
setTimeout(() => {
|
|
8
|
+
Modal.Data[options.idModal].onObserverListener['500'] = () => {
|
|
9
|
+
if (s(`.container-500-${options.idModal}`))
|
|
10
|
+
s(`.container-500-${options.idModal}`).style.height = `${
|
|
11
|
+
s(`.${options.idModal}`).offsetHeight - Modal.headerTitleHeight
|
|
12
|
+
}px`;
|
|
13
|
+
};
|
|
14
|
+
Modal.Data[options.idModal].onObserverListener['500']();
|
|
15
|
+
});
|
|
16
|
+
return html`<div class="in container-500-${options.idModal}">${await Alert.e500()}</div>`;
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export { Page500 };
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import { Translate } from './Translate.js';
|
|
2
|
+
|
|
3
|
+
const maintenance = async () => {
|
|
2
4
|
const icon = html`<svg xmlns="http://www.w3.org/2000/svg" width="80" height="80" viewBox="0 0 24 24">
|
|
3
5
|
<path
|
|
4
6
|
fill="none"
|
|
@@ -12,11 +14,11 @@ const maintenance = async ({ Translate }) => {
|
|
|
12
14
|
return html` <div class="abs center" style="top: 45%">
|
|
13
15
|
${icon}
|
|
14
16
|
<br />
|
|
15
|
-
<br />${Translate('server-maintenance')}
|
|
17
|
+
<br />${Translate.Render('server-maintenance')}
|
|
16
18
|
</div>`;
|
|
17
19
|
};
|
|
18
20
|
|
|
19
|
-
const noInternet = async (
|
|
21
|
+
const noInternet = async () => {
|
|
20
22
|
const icon = html`<svg xmlns="http://www.w3.org/2000/svg" width="80" height="80" viewBox="0 0 20 20">
|
|
21
23
|
<path
|
|
22
24
|
fill="currentColor"
|
|
@@ -26,11 +28,11 @@ const noInternet = async ({ Translate }) => {
|
|
|
26
28
|
return html` <div class="abs center" style="top: 45%">
|
|
27
29
|
${icon}
|
|
28
30
|
<br />
|
|
29
|
-
<br />${Translate('no-internet-connection')}
|
|
31
|
+
<br />${Translate.Render('no-internet-connection')}
|
|
30
32
|
</div>`;
|
|
31
33
|
};
|
|
32
34
|
|
|
33
|
-
const e404 = async (
|
|
35
|
+
const e404 = async () => {
|
|
34
36
|
const icon = html`
|
|
35
37
|
<svg xmlns="http://www.w3.org/2000/svg" width="80" height="80" viewBox="0 0 24 24">
|
|
36
38
|
<path
|
|
@@ -45,13 +47,13 @@ const e404 = async ({ Translate }) => {
|
|
|
45
47
|
<br />
|
|
46
48
|
<span class="bold">404</span>
|
|
47
49
|
<br />
|
|
48
|
-
<br />${Translate('page-not-found')} <br />
|
|
50
|
+
<br />${Translate.Render('page-not-found')} <br />
|
|
49
51
|
<br />
|
|
50
|
-
<a href="${location.origin}">${Translate('back')}</a>
|
|
52
|
+
<a href="${location.origin}">${Translate.Render('back')}</a>
|
|
51
53
|
</div>`;
|
|
52
54
|
};
|
|
53
55
|
|
|
54
|
-
const e500 = async (
|
|
56
|
+
const e500 = async () => {
|
|
55
57
|
const icon = html`<svg xmlns="http://www.w3.org/2000/svg" width="80" height="80" viewBox="0 0 20 20">
|
|
56
58
|
<path
|
|
57
59
|
fill="currentColor"
|
|
@@ -64,12 +66,12 @@ const e500 = async ({ Translate }) => {
|
|
|
64
66
|
<br />
|
|
65
67
|
<span class="bold">500</span>
|
|
66
68
|
<br />
|
|
67
|
-
<br />${Translate('page-broken')} <br />
|
|
69
|
+
<br />${Translate.Render('page-broken')} <br />
|
|
68
70
|
<br />
|
|
69
|
-
<a href="${location.origin}">${Translate('back')}</a>
|
|
71
|
+
<a href="${location.origin}">${Translate.Render('back')}</a>
|
|
70
72
|
</div>`;
|
|
71
73
|
};
|
|
72
74
|
|
|
73
75
|
const Alert = { maintenance, noInternet, e404, e500 };
|
|
74
76
|
|
|
75
|
-
export { Alert
|
|
77
|
+
export { Alert };
|