underpost 2.8.637 → 2.8.641
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/build.js +1 -1
- package/bin/deploy.js +2 -1
- package/bin/index.js +2 -0
- package/docker-compose.yml +1 -1
- package/package.json +1 -3
- 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 +63 -10
- package/src/cli/image.js +2 -4
- package/src/client/components/core/Account.js +22 -18
- package/src/client/components/core/CalendarCore.js +13 -85
- package/src/client/components/core/CommonJs.js +2 -1
- package/src/client/components/core/EventsUI.js +2 -2
- package/src/client/components/core/FileExplorer.js +86 -78
- package/src/client/components/core/Modal.js +12 -7
- package/src/client/components/core/Panel.js +14 -56
- package/src/client/components/core/PanelForm.js +13 -24
- package/src/client/components/core/Router.js +3 -1
- package/src/client/components/default/RoutesDefault.js +3 -2
- package/src/client/services/default/default.management.js +45 -38
- package/src/index.js +10 -3
- package/src/server/dns.js +9 -1
- package/src/server/json-schema.js +77 -0
- package/src/server/network.js +7 -122
- package/src/server/runtime.js +1 -3
|
@@ -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
|
|
|
@@ -85,6 +85,7 @@ const Modal = {
|
|
|
85
85
|
onExpandUiListener: {},
|
|
86
86
|
onBarUiOpen: {},
|
|
87
87
|
onBarUiClose: {},
|
|
88
|
+
onHome: {},
|
|
88
89
|
query: options.query ? `${window.location.search}` : undefined,
|
|
89
90
|
};
|
|
90
91
|
const setCenterRestore = () => {
|
|
@@ -1010,14 +1011,15 @@ const Modal = {
|
|
|
1010
1011
|
e.preventDefault();
|
|
1011
1012
|
window.history.forward();
|
|
1012
1013
|
});
|
|
1013
|
-
EventsUI.onClick(`.action-btn-home`, () =>
|
|
1014
|
-
|
|
1014
|
+
EventsUI.onClick(`.action-btn-home`, async () => {
|
|
1015
|
+
await Modal.onHomeRouterEvent();
|
|
1016
|
+
Object.keys(this.Data[idModal].onHome).map((keyListener) => this.Data[idModal].onHome[keyListener]());
|
|
1017
|
+
});
|
|
1018
|
+
EventsUI.onClick(`.action-btn-app-icon`, () => Modal.onHomeRouterEvent());
|
|
1015
1019
|
Keyboard.instanceMultiPressKey({
|
|
1016
1020
|
id: 'input-shortcut-global-escape',
|
|
1017
1021
|
keys: ['Escape'],
|
|
1018
1022
|
eventCallBack: () => {
|
|
1019
|
-
// if (s(`.main-btn-home`)) s(`.main-btn-home`).click();
|
|
1020
|
-
|
|
1021
1023
|
if (s(`.btn-close-${this.currentTopModalId}`)) s(`.btn-close-${this.currentTopModalId}`).click();
|
|
1022
1024
|
},
|
|
1023
1025
|
});
|
|
@@ -1343,7 +1345,7 @@ const Modal = {
|
|
|
1343
1345
|
s(`.btn-icon-menu-back`).classList.add('hide');
|
|
1344
1346
|
if (s(`.menu-btn-container-main`)) s(`.menu-btn-container-main`).classList.remove('hide');
|
|
1345
1347
|
};
|
|
1346
|
-
|
|
1348
|
+
this.onHomeRouterEvent = async () => {
|
|
1347
1349
|
for (const keyModal of Object.keys(this.Data)) {
|
|
1348
1350
|
if (
|
|
1349
1351
|
![idModal, 'main-body-top', 'main-body']
|
|
@@ -1357,6 +1359,9 @@ const Modal = {
|
|
|
1357
1359
|
setPath(getProxyPath());
|
|
1358
1360
|
setDocTitle({ ...options.RouterInstance, route: '' });
|
|
1359
1361
|
};
|
|
1362
|
+
s(`.main-btn-home`).onclick = async () => {
|
|
1363
|
+
await this.onHomeRouterEvent();
|
|
1364
|
+
};
|
|
1360
1365
|
EventsUI.onClick(`.btn-icon-menu-back`, backMenuButtonEvent);
|
|
1361
1366
|
EventsUI.onClick(`.btn-icon-menu-mode`, () => {
|
|
1362
1367
|
if (s(`.btn-icon-menu-mode-right`).classList.contains('hide')) {
|
|
@@ -1620,6 +1625,7 @@ const Modal = {
|
|
|
1620
1625
|
...this.Data[idModal],
|
|
1621
1626
|
};
|
|
1622
1627
|
},
|
|
1628
|
+
onHomeRouterEvent: () => {},
|
|
1623
1629
|
currentTopModalId: '',
|
|
1624
1630
|
zIndexSync: function ({ idModal }) {
|
|
1625
1631
|
setTimeout(() => {
|
|
@@ -1731,7 +1737,7 @@ const Modal = {
|
|
|
1731
1737
|
titleClass: 'hide',
|
|
1732
1738
|
style: {
|
|
1733
1739
|
width: '300px',
|
|
1734
|
-
height: '
|
|
1740
|
+
height: '400px',
|
|
1735
1741
|
overflow: 'hidden',
|
|
1736
1742
|
'z-index': '11',
|
|
1737
1743
|
resize: 'none',
|
|
@@ -1765,7 +1771,6 @@ const Modal = {
|
|
|
1765
1771
|
},
|
|
1766
1772
|
headerTitleHeight: 40,
|
|
1767
1773
|
actionBtnCenter: function () {
|
|
1768
|
-
// if (!s(`.btn-close-modal-menu`).classList.contains('hide')) return s(`.main-btn-home`).click();
|
|
1769
1774
|
if (!s(`.btn-close-modal-menu`).classList.contains('hide')) {
|
|
1770
1775
|
return s(`.btn-close-modal-menu`).click();
|
|
1771
1776
|
}
|
|
@@ -55,7 +55,7 @@ const Panel = {
|
|
|
55
55
|
const openPanelForm = () => {
|
|
56
56
|
s(`.${idPanel}-form-body`).classList.remove('hide');
|
|
57
57
|
s(`.btn-${idPanel}-add`).classList.add('hide');
|
|
58
|
-
s(`.${scrollClassContainer}`).style.overflow = 'hidden';
|
|
58
|
+
// s(`.${scrollClassContainer}`).style.overflow = 'hidden';
|
|
59
59
|
if (options.customButtons) {
|
|
60
60
|
let customBtnIndex = -1;
|
|
61
61
|
for (const dataBtn of options.customButtons) {
|
|
@@ -89,12 +89,16 @@ const Panel = {
|
|
|
89
89
|
htmls(`.${idPanel}-cell-col-a-${id}`, render);
|
|
90
90
|
},
|
|
91
91
|
});
|
|
92
|
-
EventsUI.onClick(
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
92
|
+
EventsUI.onClick(
|
|
93
|
+
`.${idPanel}-btn-delete-${id}`,
|
|
94
|
+
async (e) => {
|
|
95
|
+
logger.warn('delete', obj);
|
|
96
|
+
const { status } = await options.on.remove({ e, data: obj });
|
|
97
|
+
if (status === 'error') return;
|
|
98
|
+
if (s(`.${idPanel}-${id}`)) s(`.${idPanel}-${id}`).remove();
|
|
99
|
+
},
|
|
100
|
+
{ context: 'modal' },
|
|
101
|
+
);
|
|
98
102
|
EventsUI.onClick(`.${idPanel}-btn-edit-${id}`, async () => {
|
|
99
103
|
logger.warn('edit', obj);
|
|
100
104
|
if (obj._id) Panel.Tokens[idPanel].editId = obj._id;
|
|
@@ -121,7 +125,7 @@ const Panel = {
|
|
|
121
125
|
if (options.onClick) await options.onClick({ payload });
|
|
122
126
|
};
|
|
123
127
|
});
|
|
124
|
-
|
|
128
|
+
if (s(`.${idPanel}-${id}`)) s(`.${idPanel}-${id}`).remove();
|
|
125
129
|
return html` <div class="in box-shadow ${idPanel} ${idPanel}-${id}">
|
|
126
130
|
<div class="fl ${idPanel}-tools session-fl-log-in ${obj.tools ? '' : 'hide'}">
|
|
127
131
|
${await BtnIcon.Render({
|
|
@@ -244,7 +248,7 @@ const Panel = {
|
|
|
244
248
|
};
|
|
245
249
|
|
|
246
250
|
let render = '';
|
|
247
|
-
let renderForm = html` <div class="in modal
|
|
251
|
+
let renderForm = html` <div class="in modal" style="top: 0px; z-index: 1; padding-bottom: 5px">
|
|
248
252
|
${await BtnIcon.Render({
|
|
249
253
|
class: `inl section-mp btn-custom btn-${idPanel}-close`,
|
|
250
254
|
label: html`<i class="fa-solid fa-xmark"></i> ${Translate.Render('close')}`,
|
|
@@ -417,49 +421,6 @@ const Panel = {
|
|
|
417
421
|
`;
|
|
418
422
|
|
|
419
423
|
setTimeout(async () => {
|
|
420
|
-
const resizeParentModal = () => {
|
|
421
|
-
if (options.parentIdModal) {
|
|
422
|
-
Modal.Data[options.parentIdModal].onObserverListener[`form-panel-${options.parentIdModal}`] = () => {
|
|
423
|
-
if (s(`.${idPanel}-form-container`))
|
|
424
|
-
s(`.${idPanel}-form-container`).style.maxHeight = `${
|
|
425
|
-
s(`.${options.parentIdModal}`).offsetHeight - Modal.headerTitleHeight
|
|
426
|
-
}px`;
|
|
427
|
-
};
|
|
428
|
-
Modal.Data[options.parentIdModal].onObserverListener[`form-panel-${options.parentIdModal}`]();
|
|
429
|
-
} else {
|
|
430
|
-
Responsive.Event[`${idPanel}-responsive`] = () => {
|
|
431
|
-
if (s(`.${idPanel}-form-container`))
|
|
432
|
-
s(`.${idPanel}-form-container`).style.maxHeight =
|
|
433
|
-
options.route === 'home' &&
|
|
434
|
-
s(`.${idPanel}-form-body`) &&
|
|
435
|
-
!s(`.${idPanel}-form-body`).classList.contains('hide') &&
|
|
436
|
-
!s(`.main-body-btn-ui-open`).classList.contains('hide')
|
|
437
|
-
? `${window.innerHeight}px`
|
|
438
|
-
: `${window.innerHeight - heightTopBar - heightBottomBar}px`;
|
|
439
|
-
};
|
|
440
|
-
Responsive.Event[`${idPanel}-responsive`]();
|
|
441
|
-
}
|
|
442
|
-
};
|
|
443
|
-
if (options.route === 'home') {
|
|
444
|
-
Modal.Data['modal-menu'].onBarUiClose[`${idPanel}-responsive`] = () => {
|
|
445
|
-
resizeParentModal();
|
|
446
|
-
};
|
|
447
|
-
|
|
448
|
-
Modal.Data['modal-menu'].onBarUiOpen[`${idPanel}-responsive`] = () => {
|
|
449
|
-
resizeParentModal();
|
|
450
|
-
};
|
|
451
|
-
}
|
|
452
|
-
setTimeout(resizeParentModal);
|
|
453
|
-
if (options.route) {
|
|
454
|
-
RouterEvents[options.parentIdModal] = ({ route }) => {
|
|
455
|
-
if (route === options.route) {
|
|
456
|
-
setTimeout(() => {
|
|
457
|
-
resizeParentModal();
|
|
458
|
-
}, 350);
|
|
459
|
-
}
|
|
460
|
-
};
|
|
461
|
-
}
|
|
462
|
-
|
|
463
424
|
const validators = await Validator.instance(formData);
|
|
464
425
|
|
|
465
426
|
s(`.${idPanel}-form`).onsubmit = (e) => {
|
|
@@ -581,7 +542,6 @@ const Panel = {
|
|
|
581
542
|
padding: 10px;
|
|
582
543
|
cursor: pointer;
|
|
583
544
|
min-height: 400px;
|
|
584
|
-
overflow: hidden;
|
|
585
545
|
}
|
|
586
546
|
.${idPanel}:hover {
|
|
587
547
|
background: #ffffff;
|
|
@@ -651,9 +611,7 @@ const Panel = {
|
|
|
651
611
|
}
|
|
652
612
|
</style>
|
|
653
613
|
<div class="${idPanel}-container">
|
|
654
|
-
<div
|
|
655
|
-
class="stq modal ${idPanel}-form-container ${options.formContainerClass ? options.formContainerClass : ''}"
|
|
656
|
-
>
|
|
614
|
+
<div class="in modal ${idPanel}-form-container ${options.formContainerClass ? options.formContainerClass : ''}">
|
|
657
615
|
<div class="in ${idPanel}-form-header">
|
|
658
616
|
${await BtnIcon.Render({
|
|
659
617
|
class: `inl section-mp btn-custom btn-${idPanel}-add ${
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getCapVariableName,
|
|
1
|
+
import { getCapVariableName, newInstance, random, range, uniqueArray } from './CommonJs.js';
|
|
2
2
|
import { marked } from 'marked';
|
|
3
3
|
import {
|
|
4
4
|
getBlobFromUint8ArrayFile,
|
|
@@ -12,7 +12,6 @@ import { NotificationManager } from './NotificationManager.js';
|
|
|
12
12
|
import { DocumentService } from '../../services/document/document.service.js';
|
|
13
13
|
import { FileService } from '../../services/file/file.service.js';
|
|
14
14
|
import { getSrcFromFileData } from './Input.js';
|
|
15
|
-
import { Auth } from './Auth.js';
|
|
16
15
|
import { imageShimmer, renderCssAttr } from './Css.js';
|
|
17
16
|
import { Translate } from './Translate.js';
|
|
18
17
|
import { Modal } from './Modal.js';
|
|
@@ -383,7 +382,7 @@ const PanelForm = {
|
|
|
383
382
|
};
|
|
384
383
|
const renderSrrPanelData = async () =>
|
|
385
384
|
await panelRender({
|
|
386
|
-
data: range(0,
|
|
385
|
+
data: range(0, 0).map((i) => ({
|
|
387
386
|
id: i,
|
|
388
387
|
title: html`<div class="fl">
|
|
389
388
|
<div
|
|
@@ -424,19 +423,12 @@ const PanelForm = {
|
|
|
424
423
|
ssr: true,
|
|
425
424
|
})),
|
|
426
425
|
});
|
|
427
|
-
let delayBlock = false;
|
|
428
426
|
let firsUpdateEvent = false;
|
|
427
|
+
let lastCid;
|
|
429
428
|
this.Data[idPanel].updatePanel = async () => {
|
|
430
|
-
if (delayBlock) return;
|
|
431
|
-
else {
|
|
432
|
-
delayBlock = true;
|
|
433
|
-
const _currentPath = `${location.pathname}${location.search}`;
|
|
434
|
-
setTimeout(() => {
|
|
435
|
-
delayBlock = false;
|
|
436
|
-
if (`${location.pathname}${location.search}` !== _currentPath) this.Data[idPanel].updatePanel();
|
|
437
|
-
}, 1000);
|
|
438
|
-
}
|
|
439
429
|
const cid = getQueryParams().cid ? getQueryParams().cid : '';
|
|
430
|
+
if (lastCid === cid) return;
|
|
431
|
+
lastCid = cid;
|
|
440
432
|
if (options.route === 'home') Modal.homeCid = newInstance(cid);
|
|
441
433
|
htmls(`.${options.parentIdModal ? 'html-' + options.parentIdModal : 'main-body'}`, await renderSrrPanelData());
|
|
442
434
|
await getPanelData();
|
|
@@ -449,24 +441,21 @@ const PanelForm = {
|
|
|
449
441
|
await options.firsUpdateEvent();
|
|
450
442
|
}
|
|
451
443
|
};
|
|
452
|
-
if (options.route)
|
|
444
|
+
if (options.route) {
|
|
453
445
|
listenQueryPathInstance({
|
|
454
446
|
id: options.parentIdModal ? 'html-' + options.parentIdModal : 'main-body',
|
|
455
447
|
routeId: options.route,
|
|
456
448
|
event: async (path) => {
|
|
457
|
-
// if (!PanelForm.Data[idPanel].sessionIn)
|
|
458
449
|
await this.Data[idPanel].updatePanel();
|
|
459
450
|
},
|
|
460
451
|
});
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
this.Data[idPanel].updatePanel();
|
|
469
|
-
});
|
|
452
|
+
if (!options.parentIdModal)
|
|
453
|
+
Modal.Data['modal-menu'].onHome[idPanel] = async () => {
|
|
454
|
+
lastCid = undefined;
|
|
455
|
+
setQueryPath({ path: options.route, queryPath: '' });
|
|
456
|
+
await this.Data[idPanel].updatePanel();
|
|
457
|
+
};
|
|
458
|
+
}
|
|
470
459
|
|
|
471
460
|
if (options.parentIdModal) {
|
|
472
461
|
htmls(`.html-${options.parentIdModal}`, await renderSrrPanelData());
|
|
@@ -52,7 +52,9 @@ const LoadRouter = function (RouterInstance) {
|
|
|
52
52
|
|
|
53
53
|
const setQueryPath = (options = { path: '', queryPath: '' }, queryKey = 'cid') => {
|
|
54
54
|
const { queryPath, path } = options;
|
|
55
|
-
const newUri = `${getProxyPath()}${path === 'home' ? '' : `${path}/`}${
|
|
55
|
+
const newUri = `${getProxyPath()}${path === 'home' ? '' : `${path}/`}${
|
|
56
|
+
typeof queryPath === 'string' ? `?${queryKey}=${queryPath}` : ''
|
|
57
|
+
}`;
|
|
56
58
|
const currentUri = `${window.location.pathname}${location.search}`;
|
|
57
59
|
if (currentUri !== newUri && currentUri !== `${newUri}/`) setPath(newUri);
|
|
58
60
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { loggerFactory } from '../core/Logger.js';
|
|
2
|
+
import { Modal } from '../core/Modal.js';
|
|
2
3
|
import { getProxyPath, s } from '../core/VanillaJs.js';
|
|
3
4
|
|
|
4
5
|
const logger = loggerFactory(import.meta);
|
|
@@ -10,10 +11,10 @@ const RoutesDefault = () => {
|
|
|
10
11
|
return {
|
|
11
12
|
'/': {
|
|
12
13
|
title: 'Home',
|
|
13
|
-
render: () =>
|
|
14
|
+
render: () => Modal.onHomeRouterEvent(),
|
|
14
15
|
upperCase: false,
|
|
15
16
|
},
|
|
16
|
-
'/home': { title: 'home', render: () =>
|
|
17
|
+
'/home': { title: 'home', render: () => Modal.onHomeRouterEvent() },
|
|
17
18
|
'/settings': { title: 'settings', render: () => s(`.main-btn-settings`).click(), translateTitle: true },
|
|
18
19
|
'/log-in': { title: 'log-in', render: () => s(`.main-btn-log-in`).click(), translateTitle: true },
|
|
19
20
|
'/sign-up': { title: 'sign-up', render: () => s(`.main-btn-sign-up`).click(), translateTitle: true },
|
|
@@ -80,36 +80,40 @@ const DefaultManagement = {
|
|
|
80
80
|
class: `in fll section-mp management-table-btn-mini management-table-btn-remove-${id}-${cellRenderId}`,
|
|
81
81
|
})}`;
|
|
82
82
|
setTimeout(() => {
|
|
83
|
-
EventsUI.onClick(
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
83
|
+
EventsUI.onClick(
|
|
84
|
+
`.management-table-btn-remove-${id}-${cellRenderId}`,
|
|
85
|
+
async () => {
|
|
86
|
+
const confirmResult = await Modal.RenderConfirm({
|
|
87
|
+
html: async () => {
|
|
88
|
+
return html`
|
|
89
|
+
<div class="in section-mp" style="text-align: center">
|
|
90
|
+
${Translate.Render('confirm-delete-item')}
|
|
91
|
+
${Object.keys(params.data).length > 0
|
|
92
|
+
? html`<br />
|
|
93
|
+
"${options.defaultColKeyFocus
|
|
94
|
+
? getValueFromJoinString(params.data, options.defaultColKeyFocus)
|
|
95
|
+
: params.data[Object.keys(params.data)[0]]}"`
|
|
96
|
+
: ''}
|
|
97
|
+
</div>
|
|
98
|
+
`;
|
|
99
|
+
},
|
|
100
|
+
id: `delete-${params.data._id}`,
|
|
101
|
+
});
|
|
102
|
+
if (confirmResult.status !== 'confirm') return;
|
|
103
|
+
let result;
|
|
104
|
+
if (params.data._id) result = await ServiceProvider.delete({ id: params.data._id });
|
|
105
|
+
else result = { status: 'success' };
|
|
104
106
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
107
|
+
NotificationManager.Push({
|
|
108
|
+
html: result.status === 'error' ? result.message : Translate.Render('item-success-delete'),
|
|
109
|
+
status: result.status,
|
|
110
|
+
});
|
|
111
|
+
if (result.status === 'success') {
|
|
112
|
+
AgGrid.grids[gridId].applyTransaction({ remove: [params.data] });
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
{ context: 'modal' },
|
|
116
|
+
);
|
|
113
117
|
});
|
|
114
118
|
}
|
|
115
119
|
|
|
@@ -220,16 +224,19 @@ const DefaultManagement = {
|
|
|
220
224
|
});
|
|
221
225
|
});
|
|
222
226
|
EventsUI.onClick(`.management-table-btn-clean-${id}`, async () => {
|
|
223
|
-
const confirmResult = await Modal.RenderConfirm(
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
<
|
|
228
|
-
|
|
229
|
-
|
|
227
|
+
const confirmResult = await Modal.RenderConfirm(
|
|
228
|
+
{
|
|
229
|
+
html: async () => {
|
|
230
|
+
return html`
|
|
231
|
+
<div class="in section-mp" style="text-align: center;">
|
|
232
|
+
<strong>${Translate.Render('confirm-delete-all-data')}</strong>
|
|
233
|
+
</div>
|
|
234
|
+
`;
|
|
235
|
+
},
|
|
236
|
+
id: `clean-table-${id}`,
|
|
230
237
|
},
|
|
231
|
-
|
|
232
|
-
|
|
238
|
+
{ context: 'modal' },
|
|
239
|
+
);
|
|
233
240
|
if (confirmResult.status === 'cancelled') return;
|
|
234
241
|
const result = await ServiceProvider.delete();
|
|
235
242
|
NotificationManager.Push({
|
package/src/index.js
CHANGED
|
@@ -29,7 +29,7 @@ class Underpost {
|
|
|
29
29
|
* @type {String}
|
|
30
30
|
* @memberof Underpost
|
|
31
31
|
*/
|
|
32
|
-
static version = 'v2.8.
|
|
32
|
+
static version = 'v2.8.641';
|
|
33
33
|
/**
|
|
34
34
|
* Repository cli API
|
|
35
35
|
* @static
|
|
@@ -93,6 +93,13 @@ class Underpost {
|
|
|
93
93
|
* @memberof Underpost
|
|
94
94
|
*/
|
|
95
95
|
static deploy = UnderpostDeploy.API;
|
|
96
|
+
/**
|
|
97
|
+
* Deployment cli NETWORK
|
|
98
|
+
* @static
|
|
99
|
+
* @type {UnderpostDeploy.NETWORK}
|
|
100
|
+
* @memberof Underpost
|
|
101
|
+
*/
|
|
102
|
+
static deployNetwork = UnderpostDeploy.NETWORK;
|
|
96
103
|
/**
|
|
97
104
|
* Cron cli API
|
|
98
105
|
* @static
|
|
@@ -104,14 +111,14 @@ class Underpost {
|
|
|
104
111
|
* File Storage cli API
|
|
105
112
|
* @static
|
|
106
113
|
* @type {UnderpostFileStorage.API}
|
|
107
|
-
* @memberof
|
|
114
|
+
* @memberof Underpost
|
|
108
115
|
*/
|
|
109
116
|
static fs = UnderpostFileStorage.API;
|
|
110
117
|
/**
|
|
111
118
|
* Monitor cli API
|
|
112
119
|
* @static
|
|
113
120
|
* @type {UnderpostMonitor.API}
|
|
114
|
-
* @memberof
|
|
121
|
+
* @memberof Underpost
|
|
115
122
|
*/
|
|
116
123
|
static monitor = UnderpostMonitor.API;
|
|
117
124
|
}
|
package/src/server/dns.js
CHANGED
|
@@ -2,7 +2,7 @@ import axios from 'axios';
|
|
|
2
2
|
import dotenv from 'dotenv';
|
|
3
3
|
import fs from 'fs';
|
|
4
4
|
import validator from 'validator';
|
|
5
|
-
import {
|
|
5
|
+
import { publicIp, publicIpv4, publicIpv6 } from 'public-ip';
|
|
6
6
|
import { loggerFactory } from './logger.js';
|
|
7
7
|
import UnderpostRootEnv from '../cli/env.js';
|
|
8
8
|
|
|
@@ -10,6 +10,14 @@ dotenv.config();
|
|
|
10
10
|
|
|
11
11
|
const logger = loggerFactory(import.meta);
|
|
12
12
|
|
|
13
|
+
const ip = {
|
|
14
|
+
public: {
|
|
15
|
+
get: async () => await publicIp(), // => 'fe80::200:f8ff:fe21:67cf'
|
|
16
|
+
ipv4: async () => await publicIpv4(), // => '46.5.21.123'
|
|
17
|
+
ipv6: async () => await publicIpv6(), // => 'fe80::200:f8ff:fe21:67cf'
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
|
|
13
21
|
class Dns {
|
|
14
22
|
static callback = async function (deployList) {
|
|
15
23
|
// Network topology configuration:
|