underpost 2.8.6 → 2.8.8
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/.vscode/extensions.json +36 -3
- package/.vscode/settings.json +2 -0
- package/CHANGELOG.md +24 -4
- package/Dockerfile +9 -10
- package/README.md +41 -2
- package/bin/build.js +2 -2
- package/bin/db.js +1 -0
- package/bin/deploy.js +1521 -130
- package/bin/file.js +8 -0
- package/bin/index.js +1 -218
- package/cli.md +530 -0
- package/conf.js +4 -0
- package/docker-compose.yml +1 -1
- package/jsdoc.json +1 -1
- 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/dd-template-development/deployment.yaml +167 -0
- package/manifests/deployment/dd-template-development/proxy.yaml +46 -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/fastapi/initial_data.sh +56 -0
- package/manifests/deployment/kafka/deployment.yaml +69 -0
- package/manifests/deployment/spark/spark-pi-py.yaml +21 -0
- package/manifests/envoy-service-nodeport.yaml +23 -0
- package/manifests/kubeadm-calico-config.yaml +119 -0
- package/manifests/kubelet-config.yaml +65 -0
- package/manifests/lxd/lxd-admin-profile.yaml +17 -0
- package/manifests/lxd/lxd-preseed.yaml +30 -0
- package/manifests/lxd/underpost-setup.sh +163 -0
- package/manifests/maas/lxd-preseed.yaml +32 -0
- package/manifests/maas/maas-setup.sh +82 -0
- package/manifests/mariadb/statefulset.yaml +2 -1
- package/manifests/mariadb/storage-class.yaml +10 -0
- package/manifests/mongodb/kustomization.yaml +1 -1
- package/manifests/mongodb/statefulset.yaml +12 -11
- package/manifests/mongodb/storage-class.yaml +9 -0
- package/manifests/mongodb-4.4/service-deployment.yaml +3 -3
- package/manifests/mysql/kustomization.yaml +7 -0
- package/manifests/mysql/pv-pvc.yaml +27 -0
- package/manifests/mysql/statefulset.yaml +55 -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/postgresql/service.yaml +10 -0
- package/manifests/postgresql/statefulset.yaml +37 -0
- package/manifests/valkey/service.yaml +3 -9
- package/manifests/valkey/statefulset.yaml +12 -13
- package/package.json +3 -9
- package/src/api/default/default.service.js +1 -1
- package/src/api/user/user.service.js +14 -11
- package/src/cli/baremetal.js +60 -0
- package/src/cli/cluster.js +551 -65
- package/src/cli/cron.js +39 -8
- package/src/cli/db.js +20 -10
- package/src/cli/deploy.js +288 -86
- package/src/cli/env.js +10 -4
- package/src/cli/fs.js +21 -9
- package/src/cli/image.js +116 -124
- package/src/cli/index.js +319 -0
- package/src/cli/lxd.js +395 -0
- package/src/cli/monitor.js +236 -0
- package/src/cli/repository.js +14 -8
- 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 -84
- package/src/client/components/core/CommonJs.js +2 -1
- package/src/client/components/core/Css.js +0 -1
- package/src/client/components/core/CssCore.js +10 -2
- package/src/client/components/core/Docs.js +1 -1
- package/src/client/components/core/EventsUI.js +3 -3
- package/src/client/components/core/FileExplorer.js +86 -78
- package/src/client/components/core/JoyStick.js +2 -2
- 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 +14 -8
- 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/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/default/default.management.js +45 -38
- package/src/client/ssr/Render.js +2 -0
- package/src/index.js +34 -2
- package/src/mailer/MailerProvider.js +3 -0
- package/src/runtime/lampp/Dockerfile +65 -0
- package/src/server/client-build.js +13 -0
- package/src/server/conf.js +151 -1
- package/src/server/dns.js +56 -18
- package/src/server/json-schema.js +77 -0
- package/src/server/logger.js +3 -3
- 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 +24 -11
- package/src/server/start.js +122 -0
- package/src/server/valkey.js +27 -13
package/src/cli/repository.js
CHANGED
|
@@ -4,7 +4,7 @@ import { pbcopy, shellExec } from '../server/process.js';
|
|
|
4
4
|
import { actionInitLog, loggerFactory } from '../server/logger.js';
|
|
5
5
|
import fs from 'fs-extra';
|
|
6
6
|
import { getNpmRootPath } from '../server/conf.js';
|
|
7
|
-
import
|
|
7
|
+
import UnderpostStartUp from '../server/start.js';
|
|
8
8
|
|
|
9
9
|
dotenv.config();
|
|
10
10
|
|
|
@@ -12,23 +12,25 @@ const logger = loggerFactory(import.meta);
|
|
|
12
12
|
|
|
13
13
|
class UnderpostRepository {
|
|
14
14
|
static API = {
|
|
15
|
-
clone(gitUri = 'underpostnet/pwa-microservices-template', options = { bare: false }) {
|
|
15
|
+
clone(gitUri = 'underpostnet/pwa-microservices-template', options = { bare: false, g8: false }) {
|
|
16
|
+
const gExtension = options.g8 === true ? '.g8' : '.git';
|
|
16
17
|
const repoName = gitUri.split('/').pop();
|
|
17
18
|
if (fs.existsSync(`./${repoName}`)) fs.removeSync(`./${repoName}`);
|
|
18
19
|
shellExec(
|
|
19
20
|
`git clone ${options?.bare === true ? ` --bare ` : ''}https://${
|
|
20
21
|
process.env.GITHUB_TOKEN ? `${process.env.GITHUB_TOKEN}@` : ''
|
|
21
|
-
}github.com/${gitUri}
|
|
22
|
+
}github.com/${gitUri}${gExtension}`,
|
|
22
23
|
{
|
|
23
24
|
disableLog: true,
|
|
24
25
|
},
|
|
25
26
|
);
|
|
26
27
|
},
|
|
27
|
-
pull(repoPath = './', gitUri = 'underpostnet/pwa-microservices-template') {
|
|
28
|
+
pull(repoPath = './', gitUri = 'underpostnet/pwa-microservices-template', options = { g8: false }) {
|
|
29
|
+
const gExtension = options.g8 === true ? '.g8' : '.git';
|
|
28
30
|
shellExec(
|
|
29
31
|
`cd ${repoPath} && git pull https://${
|
|
30
32
|
process.env.GITHUB_TOKEN ? `${process.env.GITHUB_TOKEN}@` : ''
|
|
31
|
-
}github.com/${gitUri}
|
|
33
|
+
}github.com/${gitUri}${gExtension}`,
|
|
32
34
|
{
|
|
33
35
|
disableLog: true,
|
|
34
36
|
},
|
|
@@ -57,9 +59,10 @@ class UnderpostRepository {
|
|
|
57
59
|
shellExec(`cd ${repoPath} && git commit ${options?.empty ? `--allow-empty ` : ''}-m "${_message}"`);
|
|
58
60
|
},
|
|
59
61
|
|
|
60
|
-
push(repoPath = './', gitUri = 'underpostnet/pwa-microservices-template', options = { f: false }) {
|
|
62
|
+
push(repoPath = './', gitUri = 'underpostnet/pwa-microservices-template', options = { f: false, g8: false }) {
|
|
63
|
+
const gExtension = options.g8 === true ? '.g8' : '.git';
|
|
61
64
|
shellExec(
|
|
62
|
-
`cd ${repoPath} && git push https://${process.env.GITHUB_TOKEN}@github.com/${gitUri}
|
|
65
|
+
`cd ${repoPath} && git push https://${process.env.GITHUB_TOKEN}@github.com/${gitUri}${gExtension}${
|
|
63
66
|
options?.f === true ? ' --force' : ''
|
|
64
67
|
}`,
|
|
65
68
|
{
|
|
@@ -78,7 +81,10 @@ class UnderpostRepository {
|
|
|
78
81
|
return new Promise(async (resolve, reject) => {
|
|
79
82
|
try {
|
|
80
83
|
await logger.setUpInfo();
|
|
81
|
-
if (repositoryName === 'service')
|
|
84
|
+
if (repositoryName === 'service')
|
|
85
|
+
return resolve(
|
|
86
|
+
await UnderpostStartUp.API.listenPortController(UnderpostStartUp.API.listenServerFactory(), ':'),
|
|
87
|
+
);
|
|
82
88
|
else actionInitLog();
|
|
83
89
|
const exeRootPath = `${getNpmRootPath()}/underpost`;
|
|
84
90
|
const destFolder = `./${repositoryName}`;
|
|
@@ -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
|
});
|
|
@@ -200,7 +204,7 @@ const Account = {
|
|
|
200
204
|
disabled: false,
|
|
201
205
|
extension: async () =>
|
|
202
206
|
html`${await BtnIcon.Render({
|
|
203
|
-
class: `wfa btn-input-extension btn-account-update-username`,
|
|
207
|
+
class: `in wfa btn-input-extension btn-account-update-username`,
|
|
204
208
|
type: 'button',
|
|
205
209
|
style: 'text-align: left',
|
|
206
210
|
label: html`${Translate.Render(`update`)}`,
|
|
@@ -219,7 +223,7 @@ const Account = {
|
|
|
219
223
|
extension: !(options && options.disabled && options.disabled.includes('emailConfirm'))
|
|
220
224
|
? async () => html`<div class="in verify-email-status"></div>
|
|
221
225
|
${await BtnIcon.Render({
|
|
222
|
-
class: `wfa btn-input-extension btn-confirm-email`,
|
|
226
|
+
class: `in wfa btn-input-extension btn-confirm-email`,
|
|
223
227
|
type: 'button',
|
|
224
228
|
style: 'text-align: left',
|
|
225
229
|
label: html`<div class="in">
|
|
@@ -242,7 +246,7 @@ const Account = {
|
|
|
242
246
|
disabledEye: true,
|
|
243
247
|
extension: async () =>
|
|
244
248
|
html`${await BtnIcon.Render({
|
|
245
|
-
class: `wfa btn-input-extension btn-account-change-password`,
|
|
249
|
+
class: `in wfa btn-input-extension btn-account-change-password`,
|
|
246
250
|
type: 'button',
|
|
247
251
|
style: 'text-align: left',
|
|
248
252
|
label: html`${Translate.Render(`change-password`)}`,
|
|
@@ -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,13 @@ const CalendarCore = {
|
|
|
513
445
|
|
|
514
446
|
.calendar-buttons-container {
|
|
515
447
|
padding-bottom: 15px;
|
|
516
|
-
top: ${Modal.headerTitleHeight}px;
|
|
517
448
|
height: 60px;
|
|
518
|
-
z-index: 4;
|
|
519
449
|
}
|
|
520
450
|
</style>
|
|
521
451
|
<div class="in calendar-container hide">
|
|
522
|
-
<div class="
|
|
452
|
+
<div class="in modal calendar-buttons-container">
|
|
523
453
|
${await BtnIcon.Render({
|
|
524
|
-
class: `section-mp btn-custom close-calendar-container flr`,
|
|
454
|
+
class: `inl section-mp btn-custom close-calendar-container flr`,
|
|
525
455
|
label: html`<i class="fa-solid fa-xmark"></i> ${Translate.Render('close')}`,
|
|
526
456
|
type: 'button',
|
|
527
457
|
})}
|
|
@@ -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,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;
|
|
@@ -521,6 +524,7 @@ const CssCoreDark = {
|
|
|
521
524
|
margin: 5px 0 0 0;
|
|
522
525
|
padding: 5px;
|
|
523
526
|
font-size: 16px;
|
|
527
|
+
min-height: 40px;
|
|
524
528
|
}
|
|
525
529
|
.btn-input-extension:hover {
|
|
526
530
|
}
|
|
@@ -700,7 +704,8 @@ const CssCoreLight = {
|
|
|
700
704
|
text-align: center;
|
|
701
705
|
background: #eaeaea;
|
|
702
706
|
font-size: 17px;
|
|
703
|
-
height:
|
|
707
|
+
height: 30px;
|
|
708
|
+
padding: 5px 0px 5px 0px;
|
|
704
709
|
}
|
|
705
710
|
::placeholder {
|
|
706
711
|
color: #333;
|
|
@@ -776,6 +781,7 @@ const CssCoreLight = {
|
|
|
776
781
|
width: 260px;
|
|
777
782
|
font-size: 20px;
|
|
778
783
|
padding: 10px;
|
|
784
|
+
min-height: 45px;
|
|
779
785
|
}
|
|
780
786
|
.toggle-form-container {
|
|
781
787
|
border-radius: 5px;
|
|
@@ -800,6 +806,7 @@ const CssCoreLight = {
|
|
|
800
806
|
font-size: 20px;
|
|
801
807
|
padding: 10px;
|
|
802
808
|
text-align: center;
|
|
809
|
+
min-height: 45px;
|
|
803
810
|
}
|
|
804
811
|
.input-container-width {
|
|
805
812
|
cursor: pointer;
|
|
@@ -837,6 +844,7 @@ const CssCoreLight = {
|
|
|
837
844
|
margin: 5px 0 0 0;
|
|
838
845
|
padding: 5px;
|
|
839
846
|
font-size: 16px;
|
|
847
|
+
min-height: 40px;
|
|
840
848
|
}
|
|
841
849
|
.btn-input-extension:hover {
|
|
842
850
|
}
|
|
@@ -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
|
{
|
|
@@ -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
|
|