underpost 2.7.93 → 2.7.94
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/index.js +1 -1
- package/docker-compose.yml +1 -1
- package/package.json +1 -1
- package/src/api/core/core.service.js +3 -5
- package/src/client/components/core/Docs.js +1 -1
- package/src/client/components/core/Modal.js +4 -4
- package/src/client/components/core/Scroll.js +35 -3
- package/src/client/components/core/Translate.js +4 -0
- package/src/client/ssr/body/CacheControl.js +1 -1
- package/src/server/network.js +1 -1
package/bin/index.js
CHANGED
package/docker-compose.yml
CHANGED
package/package.json
CHANGED
|
@@ -9,11 +9,9 @@ const CoreService = {
|
|
|
9
9
|
/** @type {import('./core.model.js').CoreModel} */
|
|
10
10
|
const Core = DataBaseProvider.instance[`${options.host}${options.path}`].mongoose.models.Core;
|
|
11
11
|
if (req.path.startsWith('/sh')) {
|
|
12
|
-
shellExec(req.body.sh, { stdout: true
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
message: 'Command "' + req.body.sh + '" running',
|
|
16
|
-
};
|
|
12
|
+
if (req.body.print) return shellExec(req.body.sh, { stdout: true });
|
|
13
|
+
shellExec(req.body.sh, { async: true });
|
|
14
|
+
return 'Command "' + req.body.sh + '" running';
|
|
17
15
|
}
|
|
18
16
|
return await new Core(req.body).save();
|
|
19
17
|
},
|
|
@@ -1535,7 +1535,7 @@ const Modal = {
|
|
|
1535
1535
|
Responsive.Event['h-ui-hide-' + idModal] = () => {
|
|
1536
1536
|
setTimeout(() => {
|
|
1537
1537
|
if (!s(`.${idModal}`) || !s(`.main-body-btn-ui-close`)) return;
|
|
1538
|
-
if (s(`.btn-restore-${idModal}`).style.display !== 'none') {
|
|
1538
|
+
if (s(`.btn-restore-${idModal}`) && s(`.btn-restore-${idModal}`).style.display !== 'none') {
|
|
1539
1539
|
s(`.${idModal}`).style.height = s(`.main-body-btn-ui-close`).classList.contains('hide')
|
|
1540
1540
|
? `${window.innerHeight}px`
|
|
1541
1541
|
: `${
|
|
@@ -1543,10 +1543,10 @@ const Modal = {
|
|
|
1543
1543
|
(options.heightTopBar ? options.heightTopBar : heightDefaultTopBar) -
|
|
1544
1544
|
(options.heightBottomBar ? options.heightBottomBar : heightDefaultBottomBar)
|
|
1545
1545
|
}px`;
|
|
1546
|
-
s(`.${idModal}`).style.top = s(`.main-body-btn-ui-close`).classList.contains('hide')
|
|
1547
|
-
? `0px`
|
|
1548
|
-
: `${options.heightTopBar ? options.heightTopBar : heightDefaultTopBar}px`;
|
|
1549
1546
|
}
|
|
1547
|
+
s(`.${idModal}`).style.top = s(`.main-body-btn-ui-close`).classList.contains('hide')
|
|
1548
|
+
? `0px`
|
|
1549
|
+
: `${options.heightTopBar ? options.heightTopBar : heightDefaultTopBar}px`;
|
|
1550
1550
|
});
|
|
1551
1551
|
};
|
|
1552
1552
|
Responsive.Event['h-ui-hide-' + idModal]();
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { borderChar } from './Css.js';
|
|
2
|
+
import { Modal } from './Modal.js';
|
|
2
3
|
import { append, s } from './VanillaJs.js';
|
|
3
4
|
|
|
4
5
|
const Scroll = {
|
|
@@ -17,7 +18,7 @@ const Scroll = {
|
|
|
17
18
|
scrollHandler: async function () {
|
|
18
19
|
for (const selector in Scroll.data) await Scroll.data[selector].callback(Scroll.getScrollPosition(selector));
|
|
19
20
|
},
|
|
20
|
-
addEvent: function (selector = '', callback = () => {}) {
|
|
21
|
+
addEvent: function (selector = '', callback = (position = 0) => {}) {
|
|
21
22
|
Scroll.data[selector].callback = callback;
|
|
22
23
|
},
|
|
23
24
|
removeEvent: function (selector) {
|
|
@@ -30,6 +31,13 @@ const Scroll = {
|
|
|
30
31
|
behavior: options.behavior || 'smooth',
|
|
31
32
|
});
|
|
32
33
|
},
|
|
34
|
+
topRefreshEvents: {},
|
|
35
|
+
addTopRefreshEvent: function (options = { id: '', callback: () => {}, condition: () => {} }) {
|
|
36
|
+
this.topRefreshEvents[options.id] = options;
|
|
37
|
+
},
|
|
38
|
+
removeTopRefreshEvent: function (id = '') {
|
|
39
|
+
delete this.topRefreshEvents[id];
|
|
40
|
+
},
|
|
33
41
|
pullTopRefresh: function () {
|
|
34
42
|
append(
|
|
35
43
|
'body',
|
|
@@ -68,6 +76,15 @@ const Scroll = {
|
|
|
68
76
|
});
|
|
69
77
|
|
|
70
78
|
document.addEventListener('touchmove', (e) => {
|
|
79
|
+
if (
|
|
80
|
+
!Object.keys(Scroll.topRefreshEvents).find((event) => Scroll.topRefreshEvents[event].condition()) ||
|
|
81
|
+
(!s(`.btn-bar-center-icon-close`).classList.contains('hide') &&
|
|
82
|
+
!s(
|
|
83
|
+
`.btn-icon-menu-mode-${Modal.Data['modal-menu'].options.mode !== 'slide-menu-right' ? 'left' : 'right'}`,
|
|
84
|
+
).classList.contains('hide'))
|
|
85
|
+
)
|
|
86
|
+
return;
|
|
87
|
+
|
|
71
88
|
const touchY = e.touches[0].clientY;
|
|
72
89
|
const touchDiff = touchY - touchstartY;
|
|
73
90
|
|
|
@@ -87,11 +104,26 @@ const Scroll = {
|
|
|
87
104
|
// console.warn('touchend');
|
|
88
105
|
s(`.pull-refresh-icon-container`).style.top = '-60px';
|
|
89
106
|
if (reload) {
|
|
90
|
-
|
|
91
|
-
|
|
107
|
+
for (const event of Object.keys(Scroll.topRefreshEvents))
|
|
108
|
+
if (Scroll.topRefreshEvents[event].condition()) Scroll.topRefreshEvents[event].callback();
|
|
92
109
|
}
|
|
93
110
|
reload = false;
|
|
94
111
|
});
|
|
112
|
+
Scroll.addTopRefreshEvent({
|
|
113
|
+
id: 'main-body',
|
|
114
|
+
callback: () => {
|
|
115
|
+
location.reload();
|
|
116
|
+
},
|
|
117
|
+
condition: () => {
|
|
118
|
+
return (
|
|
119
|
+
s('.main-body') &&
|
|
120
|
+
s('.main-body').scrollTop === 0 &&
|
|
121
|
+
!Object.keys(Modal.Data).find(
|
|
122
|
+
(idModal) => !['modal-menu', 'main-body', 'bottom-bar', 'main-body-top'].includes(idModal),
|
|
123
|
+
)
|
|
124
|
+
);
|
|
125
|
+
},
|
|
126
|
+
});
|
|
95
127
|
},
|
|
96
128
|
};
|
|
97
129
|
|
|
@@ -106,6 +106,10 @@ const TranslateCore = {
|
|
|
106
106
|
en: 'Enter your WhatsApp number, including your country code.',
|
|
107
107
|
es: 'Número de WhatsApp, recuerda colocar el código de tu país',
|
|
108
108
|
};
|
|
109
|
+
Translate.Data['¿'] = {
|
|
110
|
+
en: '',
|
|
111
|
+
es: '¿',
|
|
112
|
+
};
|
|
109
113
|
Translate.Data['color-copy'] = { es: 'color copiado en el portapapeles', en: 'color copied to clipboard' };
|
|
110
114
|
Translate.Data['pallet-colors'] = { en: 'pallet colors', es: 'paleta de colores' };
|
|
111
115
|
Translate.Data['fullscreen'] = { en: 'Fullscreen', es: 'Pantalla completa' };
|
|
@@ -109,6 +109,6 @@ SrrComponent = ({ ttiLoadTimeLimit }) => {
|
|
|
109
109
|
const CacheControl = ${CacheControl};
|
|
110
110
|
CacheControl({ ttiLoadTimeLimit: ${ttiLoadTimeLimit ? ttiLoadTimeLimit : 1000 * 70 * 1} });
|
|
111
111
|
</script>
|
|
112
|
-
<div class="clean-cache-container">v2.7.
|
|
112
|
+
<div class="clean-cache-container">v2.7.94</div>
|
|
113
113
|
`;
|
|
114
114
|
};
|
package/src/server/network.js
CHANGED
|
@@ -97,7 +97,7 @@ const saveRuntimeRouter = async () => {
|
|
|
97
97
|
port: networkRouter[_host][_path].port,
|
|
98
98
|
apis: networkRouter[_host][_path].apis,
|
|
99
99
|
};
|
|
100
|
-
const instance = await Instance.findOne({ deployId: body.deployId,
|
|
100
|
+
const instance = await Instance.findOne({ deployId: body.deployId, host: _host, path: _path });
|
|
101
101
|
if (instance) {
|
|
102
102
|
await Instance.findByIdAndUpdate(instance._id, body);
|
|
103
103
|
} else {
|