@saltcorn/server 0.9.1-beta.18 → 0.9.1-beta.19
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/package.json +8 -8
- package/public/saltcorn-common.js +17 -14
- package/public/saltcorn.js +6 -0
package/package.json
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@saltcorn/server",
|
|
3
|
-
"version": "0.9.1-beta.
|
|
3
|
+
"version": "0.9.1-beta.19",
|
|
4
4
|
"description": "Server app for Saltcorn, open-source no-code platform",
|
|
5
5
|
"homepage": "https://saltcorn.com",
|
|
6
6
|
"main": "index.js",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"@aws-sdk/client-s3": "^3.451.0",
|
|
10
|
-
"@saltcorn/base-plugin": "0.9.1-beta.
|
|
11
|
-
"@saltcorn/builder": "0.9.1-beta.
|
|
12
|
-
"@saltcorn/data": "0.9.1-beta.
|
|
13
|
-
"@saltcorn/admin-models": "0.9.1-beta.
|
|
14
|
-
"@saltcorn/filemanager": "0.9.1-beta.
|
|
15
|
-
"@saltcorn/markup": "0.9.1-beta.
|
|
16
|
-
"@saltcorn/sbadmin2": "0.9.1-beta.
|
|
10
|
+
"@saltcorn/base-plugin": "0.9.1-beta.19",
|
|
11
|
+
"@saltcorn/builder": "0.9.1-beta.19",
|
|
12
|
+
"@saltcorn/data": "0.9.1-beta.19",
|
|
13
|
+
"@saltcorn/admin-models": "0.9.1-beta.19",
|
|
14
|
+
"@saltcorn/filemanager": "0.9.1-beta.19",
|
|
15
|
+
"@saltcorn/markup": "0.9.1-beta.19",
|
|
16
|
+
"@saltcorn/sbadmin2": "0.9.1-beta.19",
|
|
17
17
|
"@socket.io/cluster-adapter": "^0.2.1",
|
|
18
18
|
"@socket.io/sticky": "^1.0.1",
|
|
19
19
|
"adm-zip": "0.5.10",
|
|
@@ -1083,36 +1083,39 @@ function restore_old_button(btnId) {
|
|
|
1083
1083
|
btn.removeData("old-text");
|
|
1084
1084
|
}
|
|
1085
1085
|
|
|
1086
|
-
function common_done(res, viewname, isWeb = true) {
|
|
1087
|
-
const handle = (element, fn) => {
|
|
1088
|
-
if (Array.isArray(element))
|
|
1089
|
-
|
|
1086
|
+
async function common_done(res, viewname, isWeb = true) {
|
|
1087
|
+
const handle = async (element, fn) => {
|
|
1088
|
+
if (Array.isArray(element))
|
|
1089
|
+
for (const current of element) await fn(current);
|
|
1090
|
+
else await fn(element);
|
|
1090
1091
|
};
|
|
1091
|
-
const eval_it = (s) => {
|
|
1092
|
+
const eval_it = async (s) => {
|
|
1092
1093
|
if (res.row && res.field_names) {
|
|
1093
1094
|
const f = new Function(`viewname, row, {${res.field_names}}`, s);
|
|
1094
|
-
const evalres = f(viewname, res.row, res.row);
|
|
1095
|
-
if (evalres) common_done(evalres, viewname, isWeb);
|
|
1095
|
+
const evalres = await f(viewname, res.row, res.row);
|
|
1096
|
+
if (evalres) await common_done(evalres, viewname, isWeb);
|
|
1096
1097
|
} else {
|
|
1097
1098
|
const f = new Function(`viewname`, s);
|
|
1098
|
-
const evalres = f(viewname);
|
|
1099
|
-
if (evalres) common_done(evalres, viewname, isWeb);
|
|
1099
|
+
const evalres = await f(viewname);
|
|
1100
|
+
if (evalres) await common_done(evalres, viewname, isWeb);
|
|
1100
1101
|
}
|
|
1101
1102
|
};
|
|
1102
|
-
if (res.notify) handle(res.notify, notifyAlert);
|
|
1103
|
+
if (res.notify) await handle(res.notify, notifyAlert);
|
|
1103
1104
|
if (res.error)
|
|
1104
|
-
handle(res.error, (text) =>
|
|
1105
|
+
await handle(res.error, (text) =>
|
|
1106
|
+
notifyAlert({ type: "danger", text: text })
|
|
1107
|
+
);
|
|
1105
1108
|
if (res.notify_success)
|
|
1106
|
-
handle(res.notify_success, (text) =>
|
|
1109
|
+
await handle(res.notify_success, (text) =>
|
|
1107
1110
|
notifyAlert({ type: "success", text: text })
|
|
1108
1111
|
);
|
|
1109
|
-
if (res.eval_js) handle(res.eval_js, eval_it);
|
|
1112
|
+
if (res.eval_js) await handle(res.eval_js, eval_it);
|
|
1110
1113
|
|
|
1111
1114
|
if (res.reload_page) {
|
|
1112
1115
|
(isWeb ? location : parent).reload(); //TODO notify to cookie if reload or goto
|
|
1113
1116
|
}
|
|
1114
1117
|
if (res.download) {
|
|
1115
|
-
handle(res.download, (download) => {
|
|
1118
|
+
await handle(res.download, (download) => {
|
|
1116
1119
|
const dataurl = `data:${
|
|
1117
1120
|
download.mimetype || "application/octet-stream"
|
|
1118
1121
|
};base64,${download.blob}`;
|
package/public/saltcorn.js
CHANGED
|
@@ -280,6 +280,7 @@ function globalErrorCatcher(message, source, lineno, colno, error) {
|
|
|
280
280
|
}
|
|
281
281
|
|
|
282
282
|
function close_saltcorn_modal() {
|
|
283
|
+
$("#scmodal").off("hidden.bs.modal");
|
|
283
284
|
var myModalEl = document.getElementById("scmodal");
|
|
284
285
|
if (!myModalEl) return;
|
|
285
286
|
var modal = bootstrap.Modal.getInstance(myModalEl);
|
|
@@ -396,6 +397,11 @@ function submitWithAjax(e) {
|
|
|
396
397
|
notifyAlert({ type: "danger", text: res.responseJSON.error });
|
|
397
398
|
});
|
|
398
399
|
}
|
|
400
|
+
function saveAndContinueAsync(e) {
|
|
401
|
+
return new Promise((resolve, reject) => {
|
|
402
|
+
saveAndContinue(e, (x) => resolve(x));
|
|
403
|
+
});
|
|
404
|
+
}
|
|
399
405
|
|
|
400
406
|
function saveAndContinue(e, k) {
|
|
401
407
|
var form = $(e).closest("form");
|