@xuda.io/runtime-bundle 1.0.1383 → 1.0.1385
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/js/modules/xuda-studio-checker.min.mjs +1 -1
- package/js/modules/xuda-studio-checker.mjs +15 -13
- package/js/xuda-runtime-bundle.js +72 -58
- package/js/xuda-runtime-bundle.min.js +1 -1
- package/js/xuda-runtime-slim.js +72 -58
- package/js/xuda-runtime-slim.min.es.js +72 -58
- package/js/xuda-runtime-slim.min.js +1 -1
- package/js/xuda-server-bundle.min.mjs +1 -1
- package/js/xuda-server-bundle.mjs +30 -30
- package/js/xuda-worker-bundle.js +30 -30
- package/js/xuda-worker-bundle.min.js +1 -1
- package/package.json +1 -1
|
@@ -27601,6 +27601,7 @@ func.UI.utils.get_panels_wrapper_from_dom = async function (SESSION_ID, $xu_embe
|
|
|
27601
27601
|
|
|
27602
27602
|
func.UI.worker = {};
|
|
27603
27603
|
func.UI.worker.ID = null;
|
|
27604
|
+
func.UI.worker.idle = 0;
|
|
27604
27605
|
func.UI.worker.init = async function (SESSION_ID) {
|
|
27605
27606
|
$.fn.isInViewport = function () {
|
|
27606
27607
|
var elementTop = $(this).offset().top;
|
|
@@ -27614,35 +27615,35 @@ func.UI.worker.init = async function (SESSION_ID) {
|
|
|
27614
27615
|
|
|
27615
27616
|
let last_job_in_queue = 0;
|
|
27616
27617
|
// let run_stat;
|
|
27617
|
-
const job_iterator2 = async function () {
|
|
27618
|
-
|
|
27619
|
-
|
|
27620
|
-
|
|
27621
|
-
|
|
27622
|
-
|
|
27623
|
-
|
|
27624
|
-
|
|
27625
|
-
|
|
27626
|
-
|
|
27627
|
-
|
|
27628
|
-
|
|
27629
|
-
|
|
27630
|
-
|
|
27631
|
-
|
|
27632
|
-
|
|
27633
|
-
|
|
27634
|
-
|
|
27635
|
-
|
|
27636
|
-
|
|
27637
|
-
|
|
27638
|
-
|
|
27639
|
-
|
|
27640
|
-
|
|
27641
|
-
|
|
27618
|
+
// const job_iterator2 = async function () {
|
|
27619
|
+
// let from_job_num_to_run = last_job_in_queue;
|
|
27620
|
+
// last_job_in_queue = UI_WORKER_OBJ.num - from_job_num_to_run;
|
|
27621
|
+
|
|
27622
|
+
// if (typeof UI_WORKER_OBJ.stat === 'undefined' || UI_WORKER_OBJ.stat === 'undefined' || UI_WORKER_OBJ.stat === null) {
|
|
27623
|
+
// // idle
|
|
27624
|
+
// this.attempt = 0;
|
|
27625
|
+
// if (UI_WORKER_OBJ.jobs.length) {
|
|
27626
|
+
// // clearInterval(this._interval);
|
|
27627
|
+
// for await (const [key, val] of Object.entries(UI_WORKER_OBJ.jobs)) {
|
|
27628
|
+
// // if (val.job_num < from_job_num_to_run) continue;
|
|
27629
|
+
// try {
|
|
27630
|
+
// if (val.stat) {
|
|
27631
|
+
// break;
|
|
27632
|
+
// }
|
|
27633
|
+
|
|
27634
|
+
// await func.UI.worker.execute(val.SESSION_ID, val);
|
|
27635
|
+
// // break;
|
|
27636
|
+
// } catch (err) {
|
|
27637
|
+
// console.error(err);
|
|
27638
|
+
// }
|
|
27639
|
+
// }
|
|
27640
|
+
// }
|
|
27641
|
+
// } else {
|
|
27642
|
+
// //busy
|
|
27642
27643
|
|
|
27643
|
-
|
|
27644
|
-
|
|
27645
|
-
};
|
|
27644
|
+
// this.attempt++;
|
|
27645
|
+
// }
|
|
27646
|
+
// };
|
|
27646
27647
|
|
|
27647
27648
|
const job_iterator = async function () {
|
|
27648
27649
|
let from_job_num_to_run = last_job_in_queue;
|
|
@@ -27651,7 +27652,9 @@ func.UI.worker.init = async function (SESSION_ID) {
|
|
|
27651
27652
|
// if (typeof UI_WORKER_OBJ.stat === 'undefined' || UI_WORKER_OBJ.stat === 'undefined' || UI_WORKER_OBJ.stat === null) {
|
|
27652
27653
|
// idle
|
|
27653
27654
|
this.attempt = 0;
|
|
27655
|
+
|
|
27654
27656
|
if (UI_WORKER_OBJ.jobs.length) {
|
|
27657
|
+
func.UI.worker.idle = 0;
|
|
27655
27658
|
let running_job_children_elements = [];
|
|
27656
27659
|
let active_job_children_elements = [];
|
|
27657
27660
|
for await (const [key, val] of Object.entries(UI_WORKER_OBJ.jobs)) {
|
|
@@ -27746,6 +27749,17 @@ func.UI.worker.init = async function (SESSION_ID) {
|
|
|
27746
27749
|
console.error(err);
|
|
27747
27750
|
}
|
|
27748
27751
|
}
|
|
27752
|
+
} else {
|
|
27753
|
+
func.UI.worker.idle++;
|
|
27754
|
+
|
|
27755
|
+
if (func.UI.worker.idle > 1000) {
|
|
27756
|
+
// cleaning pending_to_delete
|
|
27757
|
+
$.each($('body').find('*'), (key, val) => {
|
|
27758
|
+
if ($(val)?.data()?.xuData?.pending_to_delete) {
|
|
27759
|
+
$(val).data().xuData.pending_to_delete = false;
|
|
27760
|
+
}
|
|
27761
|
+
});
|
|
27762
|
+
}
|
|
27749
27763
|
}
|
|
27750
27764
|
// } else {
|
|
27751
27765
|
// //busy
|
|
@@ -29209,6 +29223,36 @@ func.datasource.execute = async function (SESSION_ID, dataSourceSession, IS_DATA
|
|
|
29209
29223
|
_dataSourceFilterModelType,
|
|
29210
29224
|
);
|
|
29211
29225
|
|
|
29226
|
+
if (_dataSourceFilterModelType === 'index' && _ds?.progDataSource?.sortModel) {
|
|
29227
|
+
function sortByKeys(array, sortConfig) {
|
|
29228
|
+
return array.sort((a, b) => {
|
|
29229
|
+
for (let config of sortConfig) {
|
|
29230
|
+
const key = config.field_id;
|
|
29231
|
+
const direction = config.sort_dir === 'desc' ? -1 : 1;
|
|
29232
|
+
|
|
29233
|
+
const valA = a.value[key];
|
|
29234
|
+
const valB = b.value[key];
|
|
29235
|
+
|
|
29236
|
+
// Handle numeric comparison
|
|
29237
|
+
if (typeof valA === 'number' && typeof valB === 'number') {
|
|
29238
|
+
if (valA !== valB) {
|
|
29239
|
+
return (valA - valB) * direction;
|
|
29240
|
+
}
|
|
29241
|
+
}
|
|
29242
|
+
// Handle string comparison
|
|
29243
|
+
else if (typeof valA === 'string' && typeof valB === 'string') {
|
|
29244
|
+
if (valA !== valB) {
|
|
29245
|
+
return valA.localeCompare(valB) * direction;
|
|
29246
|
+
}
|
|
29247
|
+
}
|
|
29248
|
+
}
|
|
29249
|
+
return 0;
|
|
29250
|
+
});
|
|
29251
|
+
}
|
|
29252
|
+
const sorted = sortByKeys(_ds.v.raw_data.rows, _ds.progDataSource.sortModel);
|
|
29253
|
+
_ds.v.raw_data.rows = sorted;
|
|
29254
|
+
}
|
|
29255
|
+
|
|
29212
29256
|
if (_ds?.progDataSource?.dataSourceLimit) {
|
|
29213
29257
|
const ret_rows_found = await func.db.get_query(SESSION_ID, _ds._dataSourceTableId, _ds.v.couchView, dataSourceSession, _ds.viewSourceDesc, 'datasource table', prog_obj.progDataSource.dataSourceReduce, null, null, true, null, null, null, filterModel, _dataSourceFilterModelType);
|
|
29214
29258
|
_ds.rows_found = ret_rows_found?.rows?.[0]?.value || 0;
|
|
@@ -29227,17 +29271,8 @@ func.datasource.execute = async function (SESSION_ID, dataSourceSession, IS_DATA
|
|
|
29227
29271
|
data = [];
|
|
29228
29272
|
}
|
|
29229
29273
|
|
|
29230
|
-
// let _KEY = 0;
|
|
29231
|
-
// for (const _VAL of data) {
|
|
29232
|
-
// _ds.data_feed.rows[_KEY] = { _KEY, _VAL };
|
|
29233
|
-
// _KEY++;
|
|
29234
|
-
// }
|
|
29235
|
-
|
|
29236
29274
|
_ds.rows_found = data?.length || 0;
|
|
29237
29275
|
|
|
29238
|
-
// if (!_ds.v.raw_data) {
|
|
29239
|
-
// _ds.v.raw_data = { rows: [] };
|
|
29240
|
-
// }
|
|
29241
29276
|
let _KEY = 0;
|
|
29242
29277
|
for (const _VAL of data) {
|
|
29243
29278
|
_ds.v.raw_data.rows.push({ id: _KEY, value: { _KEY, _VAL } });
|
|
@@ -29252,13 +29287,7 @@ func.datasource.execute = async function (SESSION_ID, dataSourceSession, IS_DATA
|
|
|
29252
29287
|
data = {};
|
|
29253
29288
|
}
|
|
29254
29289
|
|
|
29255
|
-
// for (let [_KEY, _VAL] of Object.keys(data)) {
|
|
29256
|
-
// _ds.data_feed.rows[_KEY] = { _KEY, _VAL };
|
|
29257
|
-
// }
|
|
29258
29290
|
_ds.rows_found = Object.keys(data)?.length || 0;
|
|
29259
|
-
// if (!_ds.v.raw_data) {
|
|
29260
|
-
// _ds.v.raw_data = { rows: [] };
|
|
29261
|
-
// }
|
|
29262
29291
|
|
|
29263
29292
|
for (let [_KEY, _VAL] of Object.keys(data)) {
|
|
29264
29293
|
_ds.v.raw_data.rows.push({ id: _KEY, value: { _KEY, _VAL } });
|
|
@@ -29273,21 +29302,6 @@ func.datasource.execute = async function (SESSION_ID, dataSourceSession, IS_DATA
|
|
|
29273
29302
|
data = '';
|
|
29274
29303
|
}
|
|
29275
29304
|
|
|
29276
|
-
// if (!_ds.v.raw_data) {
|
|
29277
|
-
// _ds.v.raw_data = { rows: [] };
|
|
29278
|
-
// }
|
|
29279
|
-
|
|
29280
|
-
// let _KEY = 0;
|
|
29281
|
-
// let arr = data.split(",");
|
|
29282
|
-
// for (const _VAL of arr) {
|
|
29283
|
-
// _ds.data_feed.rows[_KEY] = { _KEY, _VAL };
|
|
29284
|
-
// _KEY++;
|
|
29285
|
-
// }
|
|
29286
|
-
// _ds.rows_found = arr?.length || 0;
|
|
29287
|
-
// if (!_ds.v.raw_data) {
|
|
29288
|
-
// _ds.v.raw_data = { rows: [] };
|
|
29289
|
-
// }
|
|
29290
|
-
|
|
29291
29305
|
let _KEY = 0;
|
|
29292
29306
|
let arr = data.split(',');
|
|
29293
29307
|
for (const _VAL of arr) {
|