underpost 2.8.62 → 2.8.64
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/Dockerfile +9 -10
- package/bin/build.js +2 -2
- package/bin/deploy.js +1 -1
- package/bin/index.js +21 -7
- package/docker-compose.yml +1 -1
- package/package.json +1 -1
- package/src/api/default/default.service.js +1 -1
- package/src/api/user/user.service.js +1 -1
- package/src/cli/cron.js +39 -8
- package/src/cli/deploy.js +83 -42
- package/src/cli/fs.js +7 -6
- package/src/cli/image.js +81 -75
- package/src/cli/monitor.js +92 -0
- package/src/client/components/core/Account.js +25 -21
- package/src/client/components/core/Blockchain.js +1 -1
- package/src/client/components/core/CalendarCore.js +14 -83
- package/src/client/components/core/CommonJs.js +2 -1
- package/src/client/components/core/CssCore.js +8 -2
- package/src/client/components/core/Docs.js +1 -1
- package/src/client/components/core/EventsUI.js +2 -2
- package/src/client/components/core/FileExplorer.js +86 -78
- package/src/client/components/core/LoadingAnimation.js +1 -17
- 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 +12 -7
- package/src/client/components/core/Panel.js +19 -61
- package/src/client/components/core/PanelForm.js +13 -22
- package/src/client/components/core/Recover.js +3 -3
- 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/default/default.management.js +45 -38
- package/src/client/ssr/Render.js +2 -0
- package/src/index.js +17 -2
- package/src/runtime/lampp/Dockerfile +65 -0
- package/src/server/conf.js +45 -1
- package/src/server/dns.js +9 -1
- package/src/server/network.js +7 -122
- package/src/server/runtime.js +1 -3
package/src/cli/image.js
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import fs from 'fs-extra';
|
|
2
|
-
import Underpost from '../index.js';
|
|
3
2
|
import { shellCd, shellExec } from '../server/process.js';
|
|
4
3
|
import dotenv from 'dotenv';
|
|
5
|
-
import { getNpmRootPath } from '../server/conf.js';
|
|
6
|
-
import { timer } from '../client/components/core/CommonJs.js';
|
|
7
|
-
import UnderpostRootEnv from './env.js';
|
|
4
|
+
import { awaitDeployMonitor, getNpmRootPath } from '../server/conf.js';
|
|
8
5
|
import { loggerFactory } from '../server/logger.js';
|
|
6
|
+
import UnderpostMonitor from './monitor.js';
|
|
9
7
|
|
|
10
8
|
dotenv.config();
|
|
11
9
|
|
|
@@ -18,41 +16,49 @@ class UnderpostImage {
|
|
|
18
16
|
shellExec(`sudo podman pull docker.io/library/debian:buster`);
|
|
19
17
|
},
|
|
20
18
|
build(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
19
|
+
options = {
|
|
20
|
+
path: '',
|
|
21
|
+
imageName: '',
|
|
22
|
+
imagePath: '',
|
|
23
|
+
dockerfileName: '',
|
|
24
|
+
podmanSave: false,
|
|
25
|
+
kindLoad: false,
|
|
26
|
+
secrets: false,
|
|
27
|
+
secretsPath: '',
|
|
28
|
+
noCache: false,
|
|
29
|
+
},
|
|
25
30
|
) {
|
|
26
|
-
const
|
|
27
|
-
options
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
if (!fs.existsSync(`${path}${imagesStoragePath}`))
|
|
34
|
-
fs.mkdirSync(`${path}${imagesStoragePath}`, { recursive: true });
|
|
35
|
-
const tarFile = `.${imagesStoragePath}/${imgName.replace(':', '_')}.tar`;
|
|
36
|
-
|
|
37
|
-
let secrets = ' ';
|
|
31
|
+
const { path, imageName, imagePath, dockerfileName, podmanSave, secrets, secretsPath, kindLoad, noCache } =
|
|
32
|
+
options;
|
|
33
|
+
const podManImg = `localhost/${imageName}`;
|
|
34
|
+
if (imagePath && typeof imagePath === 'string' && !fs.existsSync(imagePath))
|
|
35
|
+
fs.mkdirSync(imagePath, { recursive: true });
|
|
36
|
+
const tarFile = `${imagePath}/${imageName.replace(':', '_')}.tar`;
|
|
37
|
+
let secretsInput = ' ';
|
|
38
38
|
let secretDockerInput = '';
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
39
|
+
let cache = '';
|
|
40
|
+
if (secrets === true) {
|
|
41
|
+
const envObj = dotenv.parse(
|
|
42
|
+
fs.readFileSync(
|
|
43
|
+
secretsPath && typeof secretsPath === 'string' ? secretsPath : `${getNpmRootPath()}/underpost/.env`,
|
|
44
|
+
'utf8',
|
|
45
|
+
),
|
|
46
|
+
);
|
|
47
|
+
for (const key of Object.keys(envObj)) {
|
|
48
|
+
secretsInput += ` && export ${key}="${envObj[key]}" `; // $(cat gitlab-token.txt)
|
|
49
|
+
secretDockerInput += ` --secret id=${key},env=${key} \ `;
|
|
50
|
+
}
|
|
46
51
|
}
|
|
47
|
-
|
|
48
|
-
if (
|
|
52
|
+
if (noCache === true) cache += ' --rm --no-cache';
|
|
53
|
+
if (path && typeof path === 'string')
|
|
49
54
|
shellExec(
|
|
50
|
-
`cd ${path}${
|
|
55
|
+
`cd ${path}${secretsInput}&& sudo podman build -f ./${
|
|
56
|
+
dockerfileName && typeof dockerfileName === 'string' ? dockerfileName : 'Dockerfile'
|
|
57
|
+
} -t ${imageName} --pull=never --cap-add=CAP_AUDIT_WRITE${cache}${secretDockerInput}`,
|
|
51
58
|
);
|
|
52
|
-
|
|
53
|
-
if (
|
|
54
|
-
|
|
55
|
-
shellExec(`cd ${path} && sudo kind load image-archive ${tarFile}`);
|
|
59
|
+
|
|
60
|
+
if (podmanSave === true) shellExec(`podman save -o ${tarFile} ${podManImg}`);
|
|
61
|
+
if (kindLoad === true) shellExec(`sudo kind load image-archive ${tarFile}`);
|
|
56
62
|
},
|
|
57
63
|
async script(deployId = 'default', env = 'development', options = { run: false, build: false }) {
|
|
58
64
|
if (options.build === true) {
|
|
@@ -63,63 +69,63 @@ class UnderpostImage {
|
|
|
63
69
|
shellExec(`cd ${buildBasePath}/engine && underpost clone underpostnet/${repoName}-private`);
|
|
64
70
|
shellExec(`cd ${buildBasePath}/engine && sudo mv ./${repoName}-private ./engine-private`);
|
|
65
71
|
shellCd(`${buildBasePath}/engine`);
|
|
66
|
-
shellExec(`
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
72
|
+
shellExec(`npm install`);
|
|
73
|
+
shellExec(`node bin/deploy conf ${deployId} ${env}`);
|
|
74
|
+
if (fs.existsSync('./engine-private/itc-scripts')) {
|
|
75
|
+
const itcScripts = await fs.readdir('./engine-private/itc-scripts');
|
|
76
|
+
for (const itcScript of itcScripts)
|
|
77
|
+
if (itcScript.match(deployId)) shellExec(`node ./engine-private/itc-scripts/${itcScript}`);
|
|
78
|
+
}
|
|
79
|
+
switch (deployId) {
|
|
80
|
+
default:
|
|
74
81
|
{
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
82
|
+
{
|
|
83
|
+
const originPath = `./src/db/mongo/MongooseDB.js`;
|
|
84
|
+
fs.writeFileSync(
|
|
85
|
+
originPath,
|
|
86
|
+
fs.readFileSync(originPath, 'utf8').replaceAll(
|
|
87
|
+
`connect: async (host, name) => {`,
|
|
88
|
+
`connect: async (host, name) => {
|
|
81
89
|
host = 'mongodb://mongodb-0.mongodb-service:27017';
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
90
|
+
`,
|
|
91
|
+
),
|
|
92
|
+
'utf8',
|
|
93
|
+
);
|
|
94
|
+
}
|
|
87
95
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
96
|
+
{
|
|
97
|
+
const originPath = `./src/server/valkey.js`;
|
|
98
|
+
fs.writeFileSync(
|
|
99
|
+
originPath,
|
|
100
|
+
fs.readFileSync(originPath, 'utf8').replaceAll(
|
|
101
|
+
` // port: 6379,
|
|
94
102
|
// host: 'service-valkey.default.svc.cluster.local',`,
|
|
95
|
-
|
|
103
|
+
` port: 6379,
|
|
96
104
|
host: 'service-valkey.default.svc.cluster.local',`,
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
105
|
+
),
|
|
106
|
+
'utf8',
|
|
107
|
+
);
|
|
108
|
+
}
|
|
100
109
|
}
|
|
101
|
-
|
|
102
|
-
|
|
110
|
+
break;
|
|
111
|
+
}
|
|
112
|
+
shellExec(`node bin/deploy build-full-client ${deployId}`);
|
|
103
113
|
}
|
|
104
|
-
shellExec(`node bin/deploy conf ${deployId} ${env}`);
|
|
105
|
-
shellExec(`node bin/deploy build-full-client ${deployId}`);
|
|
106
114
|
if (options.run === true) {
|
|
107
115
|
const runCmd = env === 'production' ? 'run prod-img' : 'run dev-img';
|
|
108
116
|
if (fs.existsSync(`./engine-private/replica`)) {
|
|
109
117
|
const replicas = await fs.readdir(`./engine-private/replica`);
|
|
110
118
|
for (const replica of replicas) {
|
|
119
|
+
if (!replica.match(deployId)) continue;
|
|
111
120
|
shellExec(`node bin/deploy conf ${replica} ${env}`);
|
|
112
121
|
shellExec(`npm ${runCmd} deploy deploy-id:${replica}`, { async: true });
|
|
113
|
-
|
|
114
|
-
const monitor = async () => {
|
|
115
|
-
await timer(1000);
|
|
116
|
-
if (fs.existsSync(`./tmp/await-deploy`)) return await monitor();
|
|
117
|
-
};
|
|
118
|
-
await monitor();
|
|
122
|
+
await awaitDeployMonitor(true);
|
|
119
123
|
}
|
|
120
|
-
shellExec(`node bin/deploy conf ${deployId} ${env}`);
|
|
121
124
|
}
|
|
122
|
-
shellExec(`
|
|
125
|
+
shellExec(`node bin/deploy conf ${deployId} ${env}`);
|
|
126
|
+
shellExec(`npm ${runCmd} deploy deploy-id:${deployId}`, { async: true });
|
|
127
|
+
await awaitDeployMonitor(true);
|
|
128
|
+
await UnderpostMonitor.API.callback(deployId, env, { itc: true });
|
|
123
129
|
}
|
|
124
130
|
},
|
|
125
131
|
},
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { loadReplicas, pathPortAssignmentFactory } from '../server/conf.js';
|
|
2
|
+
import { loggerFactory } from '../server/logger.js';
|
|
3
|
+
import UnderpostDeploy from './deploy.js';
|
|
4
|
+
import axios from 'axios';
|
|
5
|
+
import UnderpostRootEnv from './env.js';
|
|
6
|
+
import fs from 'fs-extra';
|
|
7
|
+
|
|
8
|
+
const logger = loggerFactory(import.meta);
|
|
9
|
+
|
|
10
|
+
class UnderpostMonitor {
|
|
11
|
+
static API = {
|
|
12
|
+
async callback(deployId, env = 'development', options = { now: false, single: false, msInterval: '' }) {
|
|
13
|
+
const router = await UnderpostDeploy.API.routerFactory(deployId, env);
|
|
14
|
+
|
|
15
|
+
const confServer = loadReplicas(
|
|
16
|
+
JSON.parse(fs.readFileSync(`./engine-private/conf/${deployId}/conf.server.json`, 'utf8')),
|
|
17
|
+
'proxy',
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
const pathPortAssignmentData = pathPortAssignmentFactory(router, confServer);
|
|
21
|
+
|
|
22
|
+
logger.info('', pathPortAssignmentData);
|
|
23
|
+
|
|
24
|
+
const errorPayloads = [];
|
|
25
|
+
const maxAttempts = Object.keys(pathPortAssignmentData)
|
|
26
|
+
.map((host) => pathPortAssignmentData[host].length)
|
|
27
|
+
.reduce((accumulator, value) => accumulator + value, 0);
|
|
28
|
+
|
|
29
|
+
const monitor = async (reject) => {
|
|
30
|
+
logger.info('Check server health');
|
|
31
|
+
for (const host of Object.keys(pathPortAssignmentData)) {
|
|
32
|
+
for (const instance of pathPortAssignmentData[host]) {
|
|
33
|
+
const { port, path } = instance;
|
|
34
|
+
if (path.match('peer') || path.match('socket')) continue;
|
|
35
|
+
const urlTest = `http://localhost:${port}${path}`;
|
|
36
|
+
// logger.info('Test instance', urlTest);
|
|
37
|
+
await axios.get(urlTest, { timeout: 10000 }).catch((error) => {
|
|
38
|
+
// console.log(error);
|
|
39
|
+
const errorPayload = {
|
|
40
|
+
urlTest,
|
|
41
|
+
host,
|
|
42
|
+
port,
|
|
43
|
+
path,
|
|
44
|
+
name: error.name,
|
|
45
|
+
status: error.status,
|
|
46
|
+
code: error.code,
|
|
47
|
+
errors: error.errors,
|
|
48
|
+
};
|
|
49
|
+
if (errorPayload.status !== 404) {
|
|
50
|
+
errorPayloads.push(errorPayload);
|
|
51
|
+
if (errorPayloads.length >= maxAttempts) {
|
|
52
|
+
const message = JSON.stringify(errorPayloads, null, 4);
|
|
53
|
+
if (reject) reject(message);
|
|
54
|
+
else throw new Error(message);
|
|
55
|
+
}
|
|
56
|
+
logger.error('Error accumulator', errorPayloads.length);
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
if (options.now === true) await monitor();
|
|
63
|
+
if (options.single === true) return;
|
|
64
|
+
let optionsMsTimeout = parseInt(options.msInterval);
|
|
65
|
+
if (isNaN(optionsMsTimeout)) optionsMsTimeout = 30000;
|
|
66
|
+
const monitorCallBack = (resolve, reject) => {
|
|
67
|
+
const envMsTimeout = UnderpostRootEnv.API.get('monitor-ms');
|
|
68
|
+
setTimeout(
|
|
69
|
+
async () => {
|
|
70
|
+
switch (UnderpostRootEnv.API.get('monitor-input')) {
|
|
71
|
+
case 'pause':
|
|
72
|
+
monitorCallBack(resolve, reject);
|
|
73
|
+
return;
|
|
74
|
+
case 'restart':
|
|
75
|
+
return reject();
|
|
76
|
+
case 'stop':
|
|
77
|
+
return resolve();
|
|
78
|
+
default:
|
|
79
|
+
await monitor(reject);
|
|
80
|
+
monitorCallBack(resolve, reject);
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
!isNaN(envMsTimeout) ? envMsTimeout : optionsMsTimeout,
|
|
85
|
+
);
|
|
86
|
+
};
|
|
87
|
+
return await new Promise((...args) => monitorCallBack(...args));
|
|
88
|
+
},
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export default UnderpostMonitor;
|
|
@@ -151,23 +151,27 @@ const Account = {
|
|
|
151
151
|
// s(`.btn-close-modal-account`).click();
|
|
152
152
|
s(`.main-btn-recover`).click();
|
|
153
153
|
};
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
154
|
+
EventsUI.onClick(
|
|
155
|
+
`.btn-account-delete-confirm`,
|
|
156
|
+
async (e) => {
|
|
157
|
+
e.preventDefault();
|
|
158
|
+
const confirmResult = await Modal.RenderConfirm({
|
|
159
|
+
html: async () => {
|
|
160
|
+
return html`
|
|
161
|
+
<div class="in section-mp" style="text-align: center">
|
|
162
|
+
${Translate.Render('confirm-delete-account')}
|
|
163
|
+
</div>
|
|
164
|
+
`;
|
|
165
|
+
},
|
|
166
|
+
id: 'delete-account-modal',
|
|
167
|
+
});
|
|
168
|
+
if (confirmResult.status === 'cancelled') return;
|
|
169
|
+
s(`.btn-account-delete-confirm`).classList.add('hide');
|
|
170
|
+
s(`.btn-account-delete`).classList.remove('hide');
|
|
171
|
+
s(`.btn-account-delete`).click();
|
|
172
|
+
},
|
|
173
|
+
{ context: 'modal' },
|
|
174
|
+
);
|
|
171
175
|
EventsUI.onClick(`.btn-account-delete`, async (e) => {
|
|
172
176
|
e.preventDefault();
|
|
173
177
|
const result = await UserService.delete({ id: user._id });
|
|
@@ -178,7 +182,7 @@ const Account = {
|
|
|
178
182
|
s(`.btn-account-delete-confirm`).classList.remove('hide');
|
|
179
183
|
s(`.btn-account-delete`).classList.add('hide');
|
|
180
184
|
if (result.status === 'success') {
|
|
181
|
-
|
|
185
|
+
Modal.onHomeRouterEvent();
|
|
182
186
|
await Auth.sessionOut();
|
|
183
187
|
}
|
|
184
188
|
});
|
|
@@ -252,7 +256,7 @@ const Account = {
|
|
|
252
256
|
${options?.bottomRender ? await options.bottomRender() : ``}
|
|
253
257
|
<div class="in hide">
|
|
254
258
|
${await BtnIcon.Render({
|
|
255
|
-
class: 'section-mp form-button btn-account',
|
|
259
|
+
class: 'in section-mp form-button btn-account',
|
|
256
260
|
label: Translate.Render('update'),
|
|
257
261
|
type: 'submit',
|
|
258
262
|
})}
|
|
@@ -260,13 +264,13 @@ const Account = {
|
|
|
260
264
|
</form>
|
|
261
265
|
<div class="in">
|
|
262
266
|
${await BtnIcon.Render({
|
|
263
|
-
class: 'section-mp form-button btn-account-delete hide',
|
|
267
|
+
class: 'in section-mp form-button btn-account-delete hide',
|
|
264
268
|
label: html` ${Translate.Render(`delete-account`)}`,
|
|
265
269
|
type: 'button',
|
|
266
270
|
style: 'color: #5f5f5f',
|
|
267
271
|
})}
|
|
268
272
|
${await BtnIcon.Render({
|
|
269
|
-
class: 'section-mp form-button btn-account-delete-confirm',
|
|
273
|
+
class: 'in section-mp form-button btn-account-delete-confirm',
|
|
270
274
|
label: html` ${Translate.Render(`delete-account`)}`,
|
|
271
275
|
type: 'button',
|
|
272
276
|
style: 'color: #5f5f5f',
|
|
@@ -25,7 +25,7 @@ const BlockChainManagement = {
|
|
|
25
25
|
placeholder: true,
|
|
26
26
|
})}
|
|
27
27
|
${await BtnIcon.Render({
|
|
28
|
-
class: `section-mp btn-custom btn-upload-blockchain`,
|
|
28
|
+
class: `inl section-mp btn-custom btn-upload-blockchain`,
|
|
29
29
|
label: html`<i class="fas fa-plus"></i> ${Translate.Render(`create`)}`,
|
|
30
30
|
})}
|
|
31
31
|
</div>
|
|
@@ -40,18 +40,6 @@ const CalendarCore = {
|
|
|
40
40
|
|
|
41
41
|
const titleIcon = html`<i class="fas fa-calendar-alt"></i>`;
|
|
42
42
|
|
|
43
|
-
const getSrrData = () => {
|
|
44
|
-
this.Data[options.idModal].data = range(0, 5).map((i) => {
|
|
45
|
-
return {
|
|
46
|
-
id: `event-${i}`,
|
|
47
|
-
description: `Event ${s4()}${s4()}${s4()}`,
|
|
48
|
-
start: new Date().toTimeString(),
|
|
49
|
-
end: new Date().toTimeString(),
|
|
50
|
-
};
|
|
51
|
-
});
|
|
52
|
-
};
|
|
53
|
-
getSrrData();
|
|
54
|
-
|
|
55
43
|
const getPanelData = async () => {
|
|
56
44
|
const result = await EventSchedulerService.get({
|
|
57
45
|
id: `${getQueryParams().cid ? getQueryParams().cid : Auth.getToken() ? 'creatorUser' : ''}`,
|
|
@@ -235,35 +223,9 @@ const CalendarCore = {
|
|
|
235
223
|
];
|
|
236
224
|
|
|
237
225
|
setTimeout(() => {
|
|
238
|
-
const resizeModal = () => {
|
|
239
|
-
Modal.Data[options.idModal].onObserverListener[options.idModal] = () => {
|
|
240
|
-
if (s(`.main-body-calendar-${options.idModal}`))
|
|
241
|
-
s(`.main-body-calendar-${options.idModal}`).style.height = `${
|
|
242
|
-
s(`.${options.idModal}`).offsetHeight - Modal.headerTitleHeight
|
|
243
|
-
}px`;
|
|
244
|
-
};
|
|
245
|
-
Modal.Data[options.idModal].onObserverListener[options.idModal]();
|
|
246
|
-
};
|
|
247
|
-
setTimeout(resizeModal);
|
|
248
|
-
RouterEvents[`${options.idModal}-main-body`] = ({ route }) => {
|
|
249
|
-
if (route === 'calendar') {
|
|
250
|
-
setTimeout(() => {
|
|
251
|
-
resizeModal();
|
|
252
|
-
}, 400);
|
|
253
|
-
}
|
|
254
|
-
};
|
|
255
|
-
|
|
256
226
|
s(`.close-calendar-container`).onclick = () => {
|
|
257
227
|
s(`.calendar-container`).classList.add('hide');
|
|
258
228
|
s(`.main-body-calendar-${options.idModal}`).classList.remove('hide');
|
|
259
|
-
htmls(
|
|
260
|
-
`.style-calendar`,
|
|
261
|
-
html`<style>
|
|
262
|
-
.modal-calendar {
|
|
263
|
-
overflow: hidden;
|
|
264
|
-
}
|
|
265
|
-
</style>`,
|
|
266
|
-
);
|
|
267
229
|
};
|
|
268
230
|
});
|
|
269
231
|
|
|
@@ -305,14 +267,6 @@ const CalendarCore = {
|
|
|
305
267
|
// renderCalendar();
|
|
306
268
|
CalendarCore.Data[options.idModal].calendar.setOption('height', 700);
|
|
307
269
|
Translate.Event['fullcalendar-lang']();
|
|
308
|
-
htmls(
|
|
309
|
-
`.style-calendar`,
|
|
310
|
-
html`<style>
|
|
311
|
-
.modal-calendar {
|
|
312
|
-
overflow: auto;
|
|
313
|
-
}
|
|
314
|
-
</style>`,
|
|
315
|
-
);
|
|
316
270
|
},
|
|
317
271
|
},
|
|
318
272
|
],
|
|
@@ -404,16 +358,11 @@ const CalendarCore = {
|
|
|
404
358
|
<div class="in" style="margin-bottom: 100px"></div>`;
|
|
405
359
|
};
|
|
406
360
|
|
|
407
|
-
let
|
|
361
|
+
let lastCid;
|
|
408
362
|
this.Data[options.idModal].updatePanel = async () => {
|
|
409
|
-
if (delayBlock) return;
|
|
410
|
-
else {
|
|
411
|
-
delayBlock = true;
|
|
412
|
-
setTimeout(() => {
|
|
413
|
-
delayBlock = false;
|
|
414
|
-
}, 500);
|
|
415
|
-
}
|
|
416
363
|
const cid = getQueryParams().cid ? getQueryParams().cid : '';
|
|
364
|
+
if (lastCid === cid) return;
|
|
365
|
+
lastCid = cid;
|
|
417
366
|
if (options.route === 'home') Modal.homeCid = newInstance(cid);
|
|
418
367
|
if (s(`.main-body-calendar-${options.idModal}`)) {
|
|
419
368
|
// if (Auth.getToken())
|
|
@@ -423,39 +372,22 @@ const CalendarCore = {
|
|
|
423
372
|
}
|
|
424
373
|
};
|
|
425
374
|
|
|
426
|
-
if (options.route)
|
|
375
|
+
if (options.route) {
|
|
427
376
|
listenQueryPathInstance({
|
|
428
377
|
id: options.parentIdModal ? 'html-' + options.parentIdModal : 'main-body',
|
|
429
378
|
routeId: options.route,
|
|
430
379
|
event: async (path) => {
|
|
431
|
-
|
|
432
|
-
CalendarCore.Data[options.idModal].updatePanel();
|
|
433
|
-
});
|
|
380
|
+
CalendarCore.Data[options.idModal].updatePanel();
|
|
434
381
|
},
|
|
435
382
|
});
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
383
|
+
if (!options.parentIdModal)
|
|
384
|
+
Modal.Data['modal-menu'].onHome[idPanel] = async () => {
|
|
385
|
+
lastCid = undefined;
|
|
386
|
+
setQueryPath({ path: options.route, queryPath: '' });
|
|
387
|
+
await this.Data[idPanel].updatePanel();
|
|
388
|
+
};
|
|
389
|
+
}
|
|
442
390
|
return html`
|
|
443
|
-
<style>
|
|
444
|
-
.main-body-calendar-${options.idModal} {
|
|
445
|
-
overflow: auto;
|
|
446
|
-
}
|
|
447
|
-
.${idPanel}-form {
|
|
448
|
-
max-width: 750px !important;
|
|
449
|
-
}
|
|
450
|
-
</style>
|
|
451
|
-
<div class="style-calendar">
|
|
452
|
-
<style>
|
|
453
|
-
.modal-calendar {
|
|
454
|
-
overflow: hidden;
|
|
455
|
-
}
|
|
456
|
-
</style>
|
|
457
|
-
</div>
|
|
458
|
-
|
|
459
391
|
<div class="in main-body-calendar-${options.idModal}">${await panelRender()}</div>
|
|
460
392
|
<style>
|
|
461
393
|
.calendar-container {
|
|
@@ -513,15 +445,14 @@ const CalendarCore = {
|
|
|
513
445
|
|
|
514
446
|
.calendar-buttons-container {
|
|
515
447
|
padding-bottom: 15px;
|
|
516
|
-
top: ${Modal.headerTitleHeight}px;
|
|
517
448
|
height: 60px;
|
|
518
449
|
z-index: 4;
|
|
519
450
|
}
|
|
520
451
|
</style>
|
|
521
452
|
<div class="in calendar-container hide">
|
|
522
|
-
<div class="
|
|
453
|
+
<div class="in modal calendar-buttons-container">
|
|
523
454
|
${await BtnIcon.Render({
|
|
524
|
-
class: `section-mp btn-custom close-calendar-container flr`,
|
|
455
|
+
class: `inl section-mp btn-custom close-calendar-container flr`,
|
|
525
456
|
label: html`<i class="fa-solid fa-xmark"></i> ${Translate.Render('close')}`,
|
|
526
457
|
type: 'button',
|
|
527
458
|
})}
|
|
@@ -396,7 +396,8 @@ const CssCoreDark = {
|
|
|
396
396
|
text-align: center;
|
|
397
397
|
background: #1a1a1a;
|
|
398
398
|
font-size: 17px;
|
|
399
|
-
height:
|
|
399
|
+
height: 30px;
|
|
400
|
+
padding: 5px 0px 5px 0px;
|
|
400
401
|
}
|
|
401
402
|
::placeholder {
|
|
402
403
|
color: #c6c4c4;
|
|
@@ -471,6 +472,7 @@ const CssCoreDark = {
|
|
|
471
472
|
width: 260px;
|
|
472
473
|
font-size: 20px;
|
|
473
474
|
padding: 10px;
|
|
475
|
+
min-height: 45px;
|
|
474
476
|
}
|
|
475
477
|
.toggle-form-container {
|
|
476
478
|
border: 2px solid #313131;
|
|
@@ -494,6 +496,7 @@ const CssCoreDark = {
|
|
|
494
496
|
font-size: 20px;
|
|
495
497
|
padding: 10px;
|
|
496
498
|
text-align: center;
|
|
499
|
+
min-height: 45px;
|
|
497
500
|
}
|
|
498
501
|
.drop-zone-file-explorer {
|
|
499
502
|
min-height: 300px;
|
|
@@ -700,7 +703,8 @@ const CssCoreLight = {
|
|
|
700
703
|
text-align: center;
|
|
701
704
|
background: #eaeaea;
|
|
702
705
|
font-size: 17px;
|
|
703
|
-
height:
|
|
706
|
+
height: 30px;
|
|
707
|
+
padding: 5px 0px 5px 0px;
|
|
704
708
|
}
|
|
705
709
|
::placeholder {
|
|
706
710
|
color: #333;
|
|
@@ -776,6 +780,7 @@ const CssCoreLight = {
|
|
|
776
780
|
width: 260px;
|
|
777
781
|
font-size: 20px;
|
|
778
782
|
padding: 10px;
|
|
783
|
+
min-height: 45px;
|
|
779
784
|
}
|
|
780
785
|
.toggle-form-container {
|
|
781
786
|
border-radius: 5px;
|
|
@@ -800,6 +805,7 @@ const CssCoreLight = {
|
|
|
800
805
|
font-size: 20px;
|
|
801
806
|
padding: 10px;
|
|
802
807
|
text-align: center;
|
|
808
|
+
min-height: 45px;
|
|
803
809
|
}
|
|
804
810
|
.input-container-width {
|
|
805
811
|
cursor: pointer;
|
|
@@ -79,7 +79,7 @@ const Docs = {
|
|
|
79
79
|
icon: html`<i class="fa-brands fa-osi"></i>`,
|
|
80
80
|
text: 'Source Docs',
|
|
81
81
|
url: function () {
|
|
82
|
-
return `${getProxyPath()}docs/engine/${window.renderPayload.version}`;
|
|
82
|
+
return `${getProxyPath()}docs/engine/${window.renderPayload.version.replace('v', '')}`;
|
|
83
83
|
},
|
|
84
84
|
},
|
|
85
85
|
{
|
|
@@ -16,7 +16,7 @@ const EventsUI = {
|
|
|
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;
|