Skip to content

Commit

Permalink
Update github repo package
Browse files Browse the repository at this point in the history
  • Loading branch information
underpostnet committed Dec 17, 2024
1 parent ad9595a commit 034b850
Show file tree
Hide file tree
Showing 11 changed files with 54 additions and 20 deletions.
2 changes: 1 addition & 1 deletion bin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const globalBinFolder = `${shellExec(`npm root -g`, {

const program = new Command();

const version = '2.7.93';
const version = '2.7.94';

program.name('underpost').description(`underpost.net ci/cd cli ${version}`).version(version);

Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ services:
cpus: '0.25'
memory: 20M
labels: # labels in Compose file instead of Dockerfile
engine.version: '2.7.93'
engine.version: '2.7.94'
networks:
- load-balancer

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"type": "module",
"main": "src/index.js",
"name": "@underpostnet/underpost",
"version": "2.7.93",
"version": "2.7.94",
"description": "pwa api rest template",
"scripts": {
"start": "env-cmd -f .env.production node --max-old-space-size=8192 src/server",
Expand Down
8 changes: 3 additions & 5 deletions src/api/core/core.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@ const CoreService = {
/** @type {import('./core.model.js').CoreModel} */
const Core = DataBaseProvider.instance[`${options.host}${options.path}`].mongoose.models.Core;
if (req.path.startsWith('/sh')) {
shellExec(req.body.sh, { stdout: true, async: true });
return {
status: 'success',
message: 'Command "' + req.body.sh + '" running',
};
if (req.body.print) return shellExec(req.body.sh, { stdout: true });
shellExec(req.body.sh, { async: true });
return 'Command "' + req.body.sh + '" running';
}
return await new Core(req.body).save();
},
Expand Down
2 changes: 1 addition & 1 deletion src/client/components/core/Docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ const Docs = {
icon: html`<i class="fa-brands fa-osi"></i>`,
text: 'Source Docs',
url: function () {
return `${getProxyPath()}docs/engine/2.7.93`;
return `${getProxyPath()}docs/engine/2.7.94`;
},
},
{
Expand Down
8 changes: 4 additions & 4 deletions src/client/components/core/Modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -1535,18 +1535,18 @@ const Modal = {
Responsive.Event['h-ui-hide-' + idModal] = () => {
setTimeout(() => {
if (!s(`.${idModal}`) || !s(`.main-body-btn-ui-close`)) return;
if (s(`.btn-restore-${idModal}`).style.display !== 'none') {
if (s(`.btn-restore-${idModal}`) && s(`.btn-restore-${idModal}`).style.display !== 'none') {
s(`.${idModal}`).style.height = s(`.main-body-btn-ui-close`).classList.contains('hide')
? `${window.innerHeight}px`
: `${
window.innerHeight -
(options.heightTopBar ? options.heightTopBar : heightDefaultTopBar) -
(options.heightBottomBar ? options.heightBottomBar : heightDefaultBottomBar)
}px`;
s(`.${idModal}`).style.top = s(`.main-body-btn-ui-close`).classList.contains('hide')
? `0px`
: `${options.heightTopBar ? options.heightTopBar : heightDefaultTopBar}px`;
}
s(`.${idModal}`).style.top = s(`.main-body-btn-ui-close`).classList.contains('hide')
? `0px`
: `${options.heightTopBar ? options.heightTopBar : heightDefaultTopBar}px`;
});
};
Responsive.Event['h-ui-hide-' + idModal]();
Expand Down
38 changes: 35 additions & 3 deletions src/client/components/core/Scroll.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { borderChar } from './Css.js';
import { Modal } from './Modal.js';
import { append, s } from './VanillaJs.js';

const Scroll = {
Expand All @@ -17,7 +18,7 @@ const Scroll = {
scrollHandler: async function () {
for (const selector in Scroll.data) await Scroll.data[selector].callback(Scroll.getScrollPosition(selector));
},
addEvent: function (selector = '', callback = () => {}) {
addEvent: function (selector = '', callback = (position = 0) => {}) {
Scroll.data[selector].callback = callback;
},
removeEvent: function (selector) {
Expand All @@ -30,6 +31,13 @@ const Scroll = {
behavior: options.behavior || 'smooth',
});
},
topRefreshEvents: {},
addTopRefreshEvent: function (options = { id: '', callback: () => {}, condition: () => {} }) {
this.topRefreshEvents[options.id] = options;
},
removeTopRefreshEvent: function (id = '') {
delete this.topRefreshEvents[id];
},
pullTopRefresh: function () {
append(
'body',
Expand Down Expand Up @@ -68,6 +76,15 @@ const Scroll = {
});

document.addEventListener('touchmove', (e) => {
if (
!Object.keys(Scroll.topRefreshEvents).find((event) => Scroll.topRefreshEvents[event].condition()) ||
(!s(`.btn-bar-center-icon-close`).classList.contains('hide') &&
!s(
`.btn-icon-menu-mode-${Modal.Data['modal-menu'].options.mode !== 'slide-menu-right' ? 'left' : 'right'}`,
).classList.contains('hide'))
)
return;

const touchY = e.touches[0].clientY;
const touchDiff = touchY - touchstartY;

Expand All @@ -87,11 +104,26 @@ const Scroll = {
// console.warn('touchend');
s(`.pull-refresh-icon-container`).style.top = '-60px';
if (reload) {
location.reload();
// console.warn('reload');
for (const event of Object.keys(Scroll.topRefreshEvents))
if (Scroll.topRefreshEvents[event].condition()) Scroll.topRefreshEvents[event].callback();
}
reload = false;
});
Scroll.addTopRefreshEvent({
id: 'main-body',
callback: () => {
location.reload();
},
condition: () => {
return (
s('.main-body') &&
s('.main-body').scrollTop === 0 &&
!Object.keys(Modal.Data).find(
(idModal) => !['modal-menu', 'main-body', 'bottom-bar', 'main-body-top'].includes(idModal),
)
);
},
});
},
};

Expand Down
4 changes: 4 additions & 0 deletions src/client/components/core/Translate.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ const TranslateCore = {
en: 'Enter your WhatsApp number, including your country code.',
es: 'Número de WhatsApp, recuerda colocar el código de tu país',
};
Translate.Data['¿'] = {
en: '',
es: '¿',
};
Translate.Data['color-copy'] = { es: 'color copiado en el portapapeles', en: 'color copied to clipboard' };
Translate.Data['pallet-colors'] = { en: 'pallet colors', es: 'paleta de colores' };
Translate.Data['fullscreen'] = { en: 'Fullscreen', es: 'Pantalla completa' };
Expand Down
2 changes: 1 addition & 1 deletion src/client/ssr/body/CacheControl.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,6 @@ SrrComponent = ({ ttiLoadTimeLimit }) => {
const CacheControl = ${CacheControl};
CacheControl({ ttiLoadTimeLimit: ${ttiLoadTimeLimit ? ttiLoadTimeLimit : 1000 * 70 * 1} });
</script>
<div class="clean-cache-container">v2.7.93</div>
<div class="clean-cache-container">v2.7.94</div>
`;
};
2 changes: 1 addition & 1 deletion src/server/network.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ const saveRuntimeRouter = async () => {
port: networkRouter[_host][_path].port,
apis: networkRouter[_host][_path].apis,
};
const instance = await Instance.findOne({ deployId: body.deployId, port: body.port });
const instance = await Instance.findOne({ deployId: body.deployId, host: _host, path: _path });
if (instance) {
await Instance.findByIdAndUpdate(instance._id, body);
} else {
Expand Down

0 comments on commit 034b850

Please sign in to comment.