@xuda.io/xuda-worker-bundle 1.3.1362 → 1.3.1364
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/index.js +726 -1308
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1409,218 +1409,7 @@ func.common.get_data_from_websocket = async function (
|
|
|
1409
1409
|
});
|
|
1410
1410
|
};
|
|
1411
1411
|
|
|
1412
|
-
|
|
1413
|
-
// var CONNECTION_ATTEMPTS = 0;
|
|
1414
|
-
glb.APP_INFO = {};
|
|
1415
|
-
// var vars = {};
|
|
1416
|
-
// var USERS_CACHE = {};
|
|
1417
|
-
var SYSTEM_READY = null;
|
|
1418
|
-
// var CPI_WEBSOCKET;
|
|
1419
|
-
var GLB_JS_SCRIPTS_LOADED = [];
|
|
1420
|
-
|
|
1421
|
-
var STUDIO_WEBSOCKET = null;
|
|
1422
|
-
var STUDIO_WEBSOCKET_CONNECTION_ID = null;
|
|
1423
|
-
var STUDIO_PEER = null;
|
|
1424
|
-
var STUDIO_PEER_CONN_SEND_METHOD = null;
|
|
1425
|
-
var STUDIO_PEER_CONN_ID = null;
|
|
1426
|
-
var SUPPORT_PEER = null;
|
|
1427
|
-
var SUPPORT_PEER_CONN = null;
|
|
1428
|
-
var STUDIO_PEER_CONN_MSG_QUEUE = [];
|
|
1429
|
-
|
|
1430
|
-
var CLIENT_ACTIVITY_TS;
|
|
1431
|
-
|
|
1432
|
-
glb.REFERENCE_LESS_FUNCTIONS = [
|
|
1433
|
-
"update",
|
|
1434
|
-
"raise_event",
|
|
1435
|
-
"call_library",
|
|
1436
|
-
"invoke_action",
|
|
1437
|
-
"loader_on",
|
|
1438
|
-
"loader_off",
|
|
1439
|
-
"emit_event",
|
|
1440
|
-
"delay",
|
|
1441
|
-
"execute_evaluate_javascript",
|
|
1442
|
-
"execute_native_javascript",
|
|
1443
|
-
];
|
|
1444
|
-
|
|
1445
|
-
var CACHE_PROG_UI = {};
|
|
1446
|
-
|
|
1447
|
-
var ALERT_IS_ACTIVE = false;
|
|
1448
|
-
glb.WORKER_ATTEMPTS_NOT_RESPONDING = 200000;
|
|
1449
|
-
|
|
1450
|
-
glb.WORKER_TIMEOUT = 600000;
|
|
1451
|
-
glb.WORKER_PAUSE = false;
|
|
1452
|
-
// glb.EMAIL_SEND_RECEIVE_STATUS = {};
|
|
1453
|
-
var DATASOURCE_INTERVALS = {};
|
|
1454
|
-
var APP_MODAL_OBJ = {};
|
|
1455
|
-
var CURRENT_APP_POPOVER = null;
|
|
1456
|
-
var ELEMENT_CLICK_EVENT = null;
|
|
1457
|
-
var posX = 0; //cursor x
|
|
1458
|
-
var posY = 0; //cursor x
|
|
1459
|
-
var LOADER_ACTIVE = false;
|
|
1460
|
-
var LOADER_TEXT = "";
|
|
1461
|
-
var REFRESHER_IN_PROGRESS = false;
|
|
1462
|
-
|
|
1463
|
-
glb.screen_num = 0;
|
|
1464
|
-
var RESPONSE_FROM_STUDIO_QUEUE = {};
|
|
1465
|
-
|
|
1466
|
-
var SCREEN_BLOCKER_OBJ = {};
|
|
1467
|
-
var IS_PROGRESS_SCREEN_OPEN = null;
|
|
1468
|
-
// var UI_ENGINE_OBJ = null;
|
|
1469
|
-
|
|
1470
|
-
var UI_WORKER_OBJ = { jobs: [], num: 9000 };
|
|
1471
|
-
|
|
1472
|
-
glb.html5_events_handler = [
|
|
1473
|
-
"onabort",
|
|
1474
|
-
"onafterprint",
|
|
1475
|
-
"onautocomplete",
|
|
1476
|
-
"onautocompleteerror",
|
|
1477
|
-
"onbeforeprint",
|
|
1478
|
-
"onbeforeunload",
|
|
1479
|
-
"onblur",
|
|
1480
|
-
"oncancel",
|
|
1481
|
-
"oncanplay",
|
|
1482
|
-
"oncanplaythrough",
|
|
1483
|
-
"onchange",
|
|
1484
|
-
"onclick",
|
|
1485
|
-
"onclose",
|
|
1486
|
-
"oncontextmenu",
|
|
1487
|
-
"oncopy",
|
|
1488
|
-
"oncuechange",
|
|
1489
|
-
"oncut",
|
|
1490
|
-
"ondblclick",
|
|
1491
|
-
"ondrag",
|
|
1492
|
-
"ondragend",
|
|
1493
|
-
"ondragenter",
|
|
1494
|
-
"ondragexit",
|
|
1495
|
-
"ondragleave",
|
|
1496
|
-
"ondragover",
|
|
1497
|
-
"ondragstart",
|
|
1498
|
-
"ondrop",
|
|
1499
|
-
"ondurationchange",
|
|
1500
|
-
"onemptied",
|
|
1501
|
-
"onended",
|
|
1502
|
-
"onerror",
|
|
1503
|
-
"onfocus",
|
|
1504
|
-
"onhashchange",
|
|
1505
|
-
"oninput",
|
|
1506
|
-
"oninvalid",
|
|
1507
|
-
"onkeydown",
|
|
1508
|
-
"onkeypress",
|
|
1509
|
-
"onkeyup",
|
|
1510
|
-
"onload",
|
|
1511
|
-
"onloadeddata",
|
|
1512
|
-
"onloadedmetadata",
|
|
1513
|
-
"onloadstart",
|
|
1514
|
-
"onmessage",
|
|
1515
|
-
"onmousedown",
|
|
1516
|
-
"onmouseenter",
|
|
1517
|
-
"onmouseleave",
|
|
1518
|
-
"onmousemove",
|
|
1519
|
-
"onmouseout",
|
|
1520
|
-
"onmouseover",
|
|
1521
|
-
"onmouseup",
|
|
1522
|
-
"onmousewheel",
|
|
1523
|
-
"onoffline",
|
|
1524
|
-
"ononline",
|
|
1525
|
-
"onpagehide",
|
|
1526
|
-
"onpageshow",
|
|
1527
|
-
"onpaste",
|
|
1528
|
-
"onpause",
|
|
1529
|
-
"onplay",
|
|
1530
|
-
"onplaying",
|
|
1531
|
-
"onpopstate",
|
|
1532
|
-
"onprogress",
|
|
1533
|
-
"onratechange",
|
|
1534
|
-
"onreset",
|
|
1535
|
-
"onresize",
|
|
1536
|
-
"onscroll",
|
|
1537
|
-
"onsearch",
|
|
1538
|
-
"onseeked",
|
|
1539
|
-
"onseeking",
|
|
1540
|
-
"onselect",
|
|
1541
|
-
"onshow",
|
|
1542
|
-
"onsort",
|
|
1543
|
-
"onstalled",
|
|
1544
|
-
"onstorage",
|
|
1545
|
-
"onsubmit",
|
|
1546
|
-
"onsuspend",
|
|
1547
|
-
"ontimeupdate",
|
|
1548
|
-
"ontoggle",
|
|
1549
|
-
"onunload",
|
|
1550
|
-
"onvolumechange",
|
|
1551
|
-
"onwaiting",
|
|
1552
|
-
];
|
|
1553
|
-
|
|
1554
|
-
glb.lifecycle = {
|
|
1555
|
-
plugins: {},
|
|
1556
|
-
// queue: [],
|
|
1557
|
-
fn_arr: [
|
|
1558
|
-
"beforeInit",
|
|
1559
|
-
"initialized",
|
|
1560
|
-
"systemReady",
|
|
1561
|
-
"beforeMounted",
|
|
1562
|
-
"mounted",
|
|
1563
|
-
],
|
|
1564
|
-
// add(type, fn, params) {
|
|
1565
|
-
// this.queue.push({ type, fn, params });
|
|
1566
|
-
// },
|
|
1567
|
-
execute: async function (SESSION_ID, event) {
|
|
1568
|
-
const _session = SESSION_OBJ[SESSION_ID];
|
|
1569
|
-
|
|
1570
|
-
const xu_api = await func.common.get_module(
|
|
1571
|
-
SESSION_ID,
|
|
1572
|
-
"xuda-api-library.mjs",
|
|
1573
|
-
{
|
|
1574
|
-
func,
|
|
1575
|
-
glb,
|
|
1576
|
-
SESSION_OBJ,
|
|
1577
|
-
SESSION_ID,
|
|
1578
|
-
APP_OBJ,
|
|
1579
|
-
dsSession: func.utils.get_last_datasource_no(),
|
|
1580
|
-
}
|
|
1581
|
-
);
|
|
1582
|
-
|
|
1583
|
-
var params = {
|
|
1584
|
-
SESSION_ID,
|
|
1585
|
-
session_data: _session,
|
|
1586
|
-
app_obj: APP_OBJ[_session.app_id],
|
|
1587
|
-
xu_api,
|
|
1588
|
-
};
|
|
1589
|
-
|
|
1590
|
-
for await (const [plugin_name, val] of Object.entries(
|
|
1591
|
-
glb.lifecycle.plugins
|
|
1592
|
-
)) {
|
|
1593
|
-
if (val?.plugin_script?.[event]) {
|
|
1594
|
-
params.setup_data = val.setup_data;
|
|
1595
|
-
await val.plugin_script[event](params);
|
|
1596
|
-
}
|
|
1597
|
-
}
|
|
1598
|
-
},
|
|
1599
|
-
};
|
|
1600
|
-
|
|
1601
|
-
glb.run_xu_before = [
|
|
1602
|
-
"xu-cdn",
|
|
1603
|
-
"xu-style",
|
|
1604
|
-
"xu-render",
|
|
1605
|
-
"xu-for-key",
|
|
1606
|
-
"xu-for-val",
|
|
1607
|
-
// "xu-ui-plugin",
|
|
1608
|
-
// "programParameters",
|
|
1609
|
-
];
|
|
1610
|
-
glb.run_xu_after = ["xu-class", "xu-script", "xu-ui-plugin"];
|
|
1611
|
-
glb.attr_abbreviations_arr = [
|
|
1612
|
-
"xu-click",
|
|
1613
|
-
"xu-dblclick",
|
|
1614
|
-
"xu-contextmenu",
|
|
1615
|
-
"xu-focus",
|
|
1616
|
-
"xu-keyup",
|
|
1617
|
-
"xu-change",
|
|
1618
|
-
"xu-blur",
|
|
1619
|
-
"xu-init",
|
|
1620
|
-
];
|
|
1621
|
-
glb.solid_attributes = ["disabled"];
|
|
1622
|
-
|
|
1623
|
-
func.datasource = {};
|
|
1412
|
+
func.datasource = {};
|
|
1624
1413
|
func.datasource.create = async function (
|
|
1625
1414
|
SESSION_ID,
|
|
1626
1415
|
prog_id,
|
|
@@ -5632,51 +5421,26 @@ func.datasource.get_args_property_value = async function (SESSION_ID, dsSession,
|
|
|
5632
5421
|
func.utils = {};
|
|
5633
5422
|
|
|
5634
5423
|
func.utils.debug = {};
|
|
5635
|
-
func.utils.debug.watch = async function (
|
|
5636
|
-
SESSION_ID,
|
|
5637
|
-
key,
|
|
5638
|
-
type,
|
|
5639
|
-
info,
|
|
5640
|
-
result,
|
|
5641
|
-
condition,
|
|
5642
|
-
not_executed
|
|
5643
|
-
) {
|
|
5424
|
+
func.utils.debug.watch = async function (SESSION_ID, key, type, info, result, condition, not_executed) {
|
|
5644
5425
|
if (!glb.DEBUG_MODE) return;
|
|
5645
5426
|
|
|
5646
|
-
const debug_utils = await func.common.get_module(
|
|
5647
|
-
SESSION_ID,
|
|
5648
|
-
"xuda-debug-utils-module.mjs"
|
|
5649
|
-
);
|
|
5427
|
+
const debug_utils = await func.common.get_module(SESSION_ID, 'xuda-debug-utils-module.mjs');
|
|
5650
5428
|
|
|
5651
|
-
debug_utils.watch(
|
|
5652
|
-
SESSION_ID,
|
|
5653
|
-
key,
|
|
5654
|
-
type,
|
|
5655
|
-
info,
|
|
5656
|
-
result,
|
|
5657
|
-
condition,
|
|
5658
|
-
not_executed
|
|
5659
|
-
);
|
|
5429
|
+
debug_utils.watch(SESSION_ID, key, type, info, result, condition, not_executed);
|
|
5660
5430
|
};
|
|
5661
5431
|
func.utils.debug.log = async function (SESSION_ID, node_idP, jsonP) {
|
|
5662
|
-
if (typeof IS_PROCESS_SERVER !==
|
|
5432
|
+
if (typeof IS_PROCESS_SERVER !== 'undefined') return;
|
|
5663
5433
|
|
|
5664
5434
|
if (!glb.DEBUG_MODE && !glb.TRACE_ON) return;
|
|
5665
5435
|
|
|
5666
|
-
const debug_utils = await func.common.get_module(
|
|
5667
|
-
SESSION_ID,
|
|
5668
|
-
"xuda-debug-utils-module.mjs"
|
|
5669
|
-
);
|
|
5436
|
+
const debug_utils = await func.common.get_module(SESSION_ID, 'xuda-debug-utils-module.mjs');
|
|
5670
5437
|
|
|
5671
5438
|
debug_utils.log(SESSION_ID, node_idP, jsonP);
|
|
5672
5439
|
};
|
|
5673
5440
|
func.utils.debug.write = async function (SESSION_ID, logP, callbackP) {
|
|
5674
5441
|
if (!glb.DEBUG_MODE) return;
|
|
5675
5442
|
|
|
5676
|
-
const debug_utils = await func.common.get_module(
|
|
5677
|
-
SESSION_ID,
|
|
5678
|
-
"xuda-debug-utils-module.mjs"
|
|
5679
|
-
);
|
|
5443
|
+
const debug_utils = await func.common.get_module(SESSION_ID, 'xuda-debug-utils-module.mjs');
|
|
5680
5444
|
|
|
5681
5445
|
debug_utils.write(SESSION_ID, logP, callbackP);
|
|
5682
5446
|
};
|
|
@@ -5684,16 +5448,13 @@ func.utils.debug.write = async function (SESSION_ID, logP, callbackP) {
|
|
|
5684
5448
|
func.utils.debug.read_command = async function (data) {
|
|
5685
5449
|
if (!glb.DEBUG_MODE) return;
|
|
5686
5450
|
|
|
5687
|
-
const debug_utils = await func.common.get_module(
|
|
5688
|
-
SESSION_ID,
|
|
5689
|
-
"xuda-debug-utils-module.mjs"
|
|
5690
|
-
);
|
|
5451
|
+
const debug_utils = await func.common.get_module(SESSION_ID, 'xuda-debug-utils-module.mjs');
|
|
5691
5452
|
|
|
5692
5453
|
debug_utils.read_command(data);
|
|
5693
5454
|
};
|
|
5694
5455
|
func.utils.DOCS_OBJ = {};
|
|
5695
5456
|
func.utils.DOCS_OBJ.get = async function (SESSION_ID, idP) {
|
|
5696
|
-
if (!idP || idP ===
|
|
5457
|
+
if (!idP || idP === '0') return;
|
|
5697
5458
|
|
|
5698
5459
|
var _session = SESSION_OBJ[SESSION_ID];
|
|
5699
5460
|
const _app_id = _session.app_id;
|
|
@@ -5706,7 +5467,7 @@ func.utils.DOCS_OBJ.get = async function (SESSION_ID, idP) {
|
|
|
5706
5467
|
}
|
|
5707
5468
|
|
|
5708
5469
|
if (_session.project_data) {
|
|
5709
|
-
if (idP ===
|
|
5470
|
+
if (idP === 'system') {
|
|
5710
5471
|
if (_session.project_data.globals) {
|
|
5711
5472
|
DOCS_OBJ[_app_id][idP] = _session.project_data.globals;
|
|
5712
5473
|
} else {
|
|
@@ -5720,13 +5481,10 @@ func.utils.DOCS_OBJ.get = async function (SESSION_ID, idP) {
|
|
|
5720
5481
|
}
|
|
5721
5482
|
}
|
|
5722
5483
|
|
|
5723
|
-
if (typeof _session.SLIM_BUNDLE ===
|
|
5724
|
-
const module = await func.common.get_module(
|
|
5725
|
-
SESSION_ID,
|
|
5726
|
-
`xuda-progs-loader-module.mjs`
|
|
5727
|
-
);
|
|
5484
|
+
if (typeof _session.SLIM_BUNDLE === 'undefined' || !_session.SLIM_BUNDLE) {
|
|
5485
|
+
const module = await func.common.get_module(SESSION_ID, `xuda-progs-loader-module.mjs`);
|
|
5728
5486
|
|
|
5729
|
-
if (idP !==
|
|
5487
|
+
if (idP !== 'system') {
|
|
5730
5488
|
DOCS_OBJ[_app_id][idP] = await module.DOCS_OBJ_get(SESSION_ID, idP);
|
|
5731
5489
|
if (DOCS_OBJ[_app_id][idP] && _.isEmpty(DOCS_OBJ[_app_id][idP])) {
|
|
5732
5490
|
await func.utils.remove_cached_objects(SESSION_ID);
|
|
@@ -5736,17 +5494,10 @@ func.utils.DOCS_OBJ.get = async function (SESSION_ID, idP) {
|
|
|
5736
5494
|
return DOCS_OBJ[_app_id][idP];
|
|
5737
5495
|
}
|
|
5738
5496
|
|
|
5739
|
-
DOCS_OBJ[_app_id][idP] = await module.DOCS_OBJ_get(
|
|
5740
|
-
SESSION_ID,
|
|
5741
|
-
"global_" + (APP_OBJ[_app_id].app_replicate || _app_id)
|
|
5742
|
-
);
|
|
5497
|
+
DOCS_OBJ[_app_id][idP] = await module.DOCS_OBJ_get(SESSION_ID, 'global_' + (APP_OBJ[_app_id].app_replicate || _app_id));
|
|
5743
5498
|
if (APP_OBJ[_app_id].app_imported_projects) {
|
|
5744
|
-
for await (const imported_app_id of APP_OBJ[_app_id]
|
|
5745
|
-
.
|
|
5746
|
-
var view_ret = await module.DOCS_OBJ_get(
|
|
5747
|
-
SESSION_ID,
|
|
5748
|
-
"global_" + imported_app_id
|
|
5749
|
-
);
|
|
5499
|
+
for await (const imported_app_id of APP_OBJ[_app_id].app_imported_projects) {
|
|
5500
|
+
var view_ret = await module.DOCS_OBJ_get(SESSION_ID, 'global_' + imported_app_id);
|
|
5750
5501
|
DOCS_OBJ[_app_id][idP] = _.merge(DOCS_OBJ[_app_id][idP], view_ret);
|
|
5751
5502
|
}
|
|
5752
5503
|
}
|
|
@@ -5797,10 +5548,10 @@ func.utils.get_dateTime = async function (SESSION_ID, typeP, dateP) {
|
|
|
5797
5548
|
var _session = SESSION_OBJ[SESSION_ID];
|
|
5798
5549
|
|
|
5799
5550
|
const response = await fetch(`https://${_session.domain}/cpi/get_utc_ts`, {
|
|
5800
|
-
method:
|
|
5551
|
+
method: 'POST',
|
|
5801
5552
|
headers: {
|
|
5802
|
-
Accept:
|
|
5803
|
-
|
|
5553
|
+
Accept: 'application/json',
|
|
5554
|
+
'Content-Type': 'application/json',
|
|
5804
5555
|
},
|
|
5805
5556
|
body: JSON.stringify({}),
|
|
5806
5557
|
});
|
|
@@ -5829,47 +5580,32 @@ func.utils.get_dateTime = async function (SESSION_ID, typeP, dateP) {
|
|
|
5829
5580
|
let ts = await get_server_ts();
|
|
5830
5581
|
sysDate = new Date(ts);
|
|
5831
5582
|
}
|
|
5832
|
-
var day = _.padStart(sysDate.getDate(), 2,
|
|
5833
|
-
var month = _.padStart(sysDate.getMonth() + 1, 2,
|
|
5583
|
+
var day = _.padStart(sysDate.getDate(), 2, '0');
|
|
5584
|
+
var month = _.padStart(sysDate.getMonth() + 1, 2, '0');
|
|
5834
5585
|
var year = sysDate.getFullYear();
|
|
5835
|
-
var week = _.padStart(getWeekNumber(sysDate), 2,
|
|
5836
|
-
var hour = _.padStart(sysDate.getHours(), 2,
|
|
5837
|
-
var minute = _.padStart(sysDate.getMinutes(), 2,
|
|
5838
|
-
var second = _.padStart(sysDate.getSeconds(), 2,
|
|
5839
|
-
if (typeP ===
|
|
5840
|
-
if (typeP ===
|
|
5841
|
-
|
|
5842
|
-
if (typeP ===
|
|
5843
|
-
if (typeP ===
|
|
5844
|
-
if (typeP ===
|
|
5845
|
-
if (typeP ===
|
|
5846
|
-
if (typeP === "SYS_TIME_SHORT") return hour + ":" + minute;
|
|
5586
|
+
var week = _.padStart(getWeekNumber(sysDate), 2, '0');
|
|
5587
|
+
var hour = _.padStart(sysDate.getHours(), 2, '0');
|
|
5588
|
+
var minute = _.padStart(sysDate.getMinutes(), 2, '0');
|
|
5589
|
+
var second = _.padStart(sysDate.getSeconds(), 2, '0');
|
|
5590
|
+
if (typeP === 'SYS_DATE') return year + '-' + month + '-' + day;
|
|
5591
|
+
if (typeP === 'SYS_DATE_TIME') return year + '-' + month + '-' + day + 'T' + hour + ':' + minute;
|
|
5592
|
+
if (typeP === 'SYS_DATE_VALUE') return sysDate.valueOf();
|
|
5593
|
+
if (typeP === 'SYS_DATE_WEEK_YEAR') return year + 'W' + week;
|
|
5594
|
+
if (typeP === 'SYS_DATE_MONTH_YEAR') return year + '-' + month;
|
|
5595
|
+
if (typeP === 'SYS_TIME') return hour + ':' + minute + ':' + second;
|
|
5596
|
+
if (typeP === 'SYS_TIME_SHORT') return hour + ':' + minute;
|
|
5847
5597
|
};
|
|
5848
5598
|
func.utils.is_onscreen_event = function (functionP) {
|
|
5849
|
-
const arr = [
|
|
5850
|
-
"invoke_action",
|
|
5851
|
-
"cache_refresh",
|
|
5852
|
-
"call_popover",
|
|
5853
|
-
"call_modal",
|
|
5854
|
-
"call_page",
|
|
5855
|
-
"loader_on",
|
|
5856
|
-
"loader_off",
|
|
5857
|
-
"emit_event",
|
|
5858
|
-
];
|
|
5599
|
+
const arr = ['invoke_action', 'cache_refresh', 'call_popover', 'call_modal', 'call_page', 'loader_on', 'loader_off', 'emit_event'];
|
|
5859
5600
|
|
|
5860
5601
|
return arr.includes(functionP);
|
|
5861
5602
|
};
|
|
5862
5603
|
|
|
5863
5604
|
func.utils.get_screen_obj = async function (SESSION_ID, id) {
|
|
5864
5605
|
const prog_obj = await func.utils.VIEWS_OBJ.get(SESSION_ID, id);
|
|
5865
|
-
if (!prog_obj) return console.error(
|
|
5606
|
+
if (!prog_obj) return console.error('prog not found: ' + id);
|
|
5866
5607
|
|
|
5867
|
-
if (
|
|
5868
|
-
prog_obj.properties.menuType === "screen" ||
|
|
5869
|
-
prog_obj.properties.menuType === "api" ||
|
|
5870
|
-
glb.FUNCTION_NODES_ARR.includes(prog_obj.properties.menuType) ||
|
|
5871
|
-
glb.MOBILE_ARR.includes(prog_obj.properties.menuType)
|
|
5872
|
-
) {
|
|
5608
|
+
if (prog_obj.properties.menuType === 'screen' || prog_obj.properties.menuType === 'api' || glb.FUNCTION_NODES_ARR.includes(prog_obj.properties.menuType) || glb.MOBILE_ARR.includes(prog_obj.properties.menuType)) {
|
|
5873
5609
|
return prog_obj;
|
|
5874
5610
|
}
|
|
5875
5611
|
return;
|
|
@@ -5878,7 +5614,7 @@ func.utils.get_screen_obj = async function (SESSION_ID, id) {
|
|
|
5878
5614
|
func.utils.clean_returned_datasource = function (SESSION_ID, DS) {
|
|
5879
5615
|
const clean_object_functions = function (obj) {
|
|
5880
5616
|
for (const [key, val] of Object.entries(obj)) {
|
|
5881
|
-
if (typeof val ===
|
|
5617
|
+
if (typeof val === 'function') {
|
|
5882
5618
|
delete obj[key];
|
|
5883
5619
|
}
|
|
5884
5620
|
}
|
|
@@ -5894,9 +5630,7 @@ func.utils.clean_returned_datasource = function (SESSION_ID, DS) {
|
|
|
5894
5630
|
try {
|
|
5895
5631
|
clean_object_functions(obj);
|
|
5896
5632
|
|
|
5897
|
-
obj = JSON.parse(
|
|
5898
|
-
JSON.stringify(obj, func.utils.clean_stringify_null, "\t")
|
|
5899
|
-
);
|
|
5633
|
+
obj = JSON.parse(JSON.stringify(obj, func.utils.clean_stringify_null, '\t'));
|
|
5900
5634
|
} catch (e) {
|
|
5901
5635
|
console.error(e);
|
|
5902
5636
|
}
|
|
@@ -5909,13 +5643,13 @@ func.utils.clean_returned_datasource = function (SESSION_ID, DS) {
|
|
|
5909
5643
|
|
|
5910
5644
|
const clean_empty_objects = function () {
|
|
5911
5645
|
for (const [key, val] of Object.entries(obj)) {
|
|
5912
|
-
if (typeof val ===
|
|
5646
|
+
if (typeof val === 'object' && !Array.isArray(val) && _.isEmpty(val)) {
|
|
5913
5647
|
delete obj[key];
|
|
5914
5648
|
}
|
|
5915
5649
|
}
|
|
5916
5650
|
|
|
5917
5651
|
for (const [key, val] of Object.entries(obj)) {
|
|
5918
|
-
if (typeof val ===
|
|
5652
|
+
if (typeof val === 'object' && Array.isArray(val) && !val.length) {
|
|
5919
5653
|
delete obj[key];
|
|
5920
5654
|
}
|
|
5921
5655
|
}
|
|
@@ -5933,7 +5667,7 @@ func.utils.clean_returned_datasource = function (SESSION_ID, DS) {
|
|
|
5933
5667
|
return obj;
|
|
5934
5668
|
};
|
|
5935
5669
|
func.utils.post_back_to_client = function (SESSION_ID, service, id, data) {
|
|
5936
|
-
if (typeof IS_PROCESS_SERVER !==
|
|
5670
|
+
if (typeof IS_PROCESS_SERVER !== 'undefined') return;
|
|
5937
5671
|
worker_post_message({
|
|
5938
5672
|
fx_to_execute: service,
|
|
5939
5673
|
params: data,
|
|
@@ -5951,35 +5685,24 @@ func.utils.job_worker = function (session_id) {
|
|
|
5951
5685
|
var attempt = 0;
|
|
5952
5686
|
|
|
5953
5687
|
const lock = function (dsP) {
|
|
5954
|
-
if (
|
|
5955
|
-
!_session.WORKER_OBJ.jobs[_session.WORKER_OBJ.stat] ||
|
|
5956
|
-
_session.WORKER_OBJ.jobs[_session.WORKER_OBJ.stat].typeP ===
|
|
5957
|
-
"system_interval" ||
|
|
5958
|
-
_session.WORKER_OBJ.jobs[_session.WORKER_OBJ.stat].typeP ===
|
|
5959
|
-
"system event"
|
|
5960
|
-
) {
|
|
5688
|
+
if (!_session.WORKER_OBJ.jobs[_session.WORKER_OBJ.stat] || _session.WORKER_OBJ.jobs[_session.WORKER_OBJ.stat].typeP === 'system_interval' || _session.WORKER_OBJ.jobs[_session.WORKER_OBJ.stat].typeP === 'system event') {
|
|
5961
5689
|
return;
|
|
5962
5690
|
}
|
|
5963
5691
|
if (glb.IS_WORKER) {
|
|
5964
|
-
func.utils.post_back_to_client(
|
|
5965
|
-
SESSION_ID,
|
|
5966
|
-
"screen_blocker_on",
|
|
5967
|
-
_session.worker_id,
|
|
5968
|
-
null
|
|
5969
|
-
);
|
|
5692
|
+
func.utils.post_back_to_client(SESSION_ID, 'screen_blocker_on', _session.worker_id, null);
|
|
5970
5693
|
} else {
|
|
5971
|
-
func.UI.utils.screen_blocker(true,
|
|
5694
|
+
func.UI.utils.screen_blocker(true, 'Worker', dsP);
|
|
5972
5695
|
}
|
|
5973
5696
|
};
|
|
5974
5697
|
const unlock = function () {
|
|
5975
5698
|
if (glb.IS_WORKER) {
|
|
5976
5699
|
} else {
|
|
5977
|
-
func.UI.utils.screen_blocker(false,
|
|
5700
|
+
func.UI.utils.screen_blocker(false, 'Worker');
|
|
5978
5701
|
}
|
|
5979
5702
|
};
|
|
5980
5703
|
const not_responding = function () {
|
|
5981
5704
|
is_not_responding = true;
|
|
5982
|
-
func.UI.utils.progressScreen.hide(
|
|
5705
|
+
func.UI.utils.progressScreen.hide('Working, Please wait..');
|
|
5983
5706
|
setTimeout(function () {
|
|
5984
5707
|
if (!is_not_responding) return;
|
|
5985
5708
|
|
|
@@ -5993,7 +5716,7 @@ func.utils.job_worker = function (session_id) {
|
|
|
5993
5716
|
is_progressScreen_on = false;
|
|
5994
5717
|
is_not_responding = false;
|
|
5995
5718
|
|
|
5996
|
-
func.UI.utils.progressScreen.hide(
|
|
5719
|
+
func.UI.utils.progressScreen.hide('Working, Please wait..');
|
|
5997
5720
|
} else if (attempt > 300 && is_not_responding) {
|
|
5998
5721
|
is_not_responding = false;
|
|
5999
5722
|
busy();
|
|
@@ -6007,29 +5730,15 @@ func.utils.job_worker = function (session_id) {
|
|
|
6007
5730
|
};
|
|
6008
5731
|
const busy = function () {
|
|
6009
5732
|
if (glb.IS_WORKER) return;
|
|
6010
|
-
func.utils.debug_report(
|
|
6011
|
-
SESSION_ID,
|
|
6012
|
-
"utils.worker.busy",
|
|
6013
|
-
"worker processing more then 10 second",
|
|
6014
|
-
"W",
|
|
6015
|
-
"",
|
|
6016
|
-
_session.WORKER_OBJ.jobs
|
|
6017
|
-
);
|
|
5733
|
+
func.utils.debug_report(SESSION_ID, 'utils.worker.busy', 'worker processing more then 10 second', 'W', '', _session.WORKER_OBJ.jobs);
|
|
6018
5734
|
|
|
6019
5735
|
is_progressScreen_on = true;
|
|
6020
5736
|
};
|
|
6021
5737
|
const reset = function () {
|
|
6022
|
-
func.utils.debug_report(
|
|
6023
|
-
SESSION_ID,
|
|
6024
|
-
"utils.worker.reset",
|
|
6025
|
-
"worker not responding",
|
|
6026
|
-
"E",
|
|
6027
|
-
"",
|
|
6028
|
-
_session.WORKER_OBJ.jobs
|
|
6029
|
-
);
|
|
5738
|
+
func.utils.debug_report(SESSION_ID, 'utils.worker.reset', 'worker not responding', 'E', '', _session.WORKER_OBJ.jobs);
|
|
6030
5739
|
_session.WORKER_OBJ.jobs = [];
|
|
6031
5740
|
_session.WORKER_OBJ.stat = null;
|
|
6032
|
-
$(
|
|
5741
|
+
$('.screen_blocker').remove();
|
|
6033
5742
|
};
|
|
6034
5743
|
return {
|
|
6035
5744
|
_interval: null,
|
|
@@ -6039,11 +5748,7 @@ func.utils.job_worker = function (session_id) {
|
|
|
6039
5748
|
this._interval = setInterval(async function () {
|
|
6040
5749
|
var _session = SESSION_OBJ[SESSION_ID];
|
|
6041
5750
|
if (!_session?.WORKER_OBJ) return;
|
|
6042
|
-
if (
|
|
6043
|
-
typeof _session.WORKER_OBJ.stat === "undefined" ||
|
|
6044
|
-
_session.WORKER_OBJ.stat === "undefined" ||
|
|
6045
|
-
_session.WORKER_OBJ.stat === null
|
|
6046
|
-
) {
|
|
5751
|
+
if (typeof _session.WORKER_OBJ.stat === 'undefined' || _session.WORKER_OBJ.stat === 'undefined' || _session.WORKER_OBJ.stat === null) {
|
|
6047
5752
|
// idle
|
|
6048
5753
|
|
|
6049
5754
|
// if (_this._was_busy) {
|
|
@@ -6061,17 +5766,12 @@ func.utils.job_worker = function (session_id) {
|
|
|
6061
5766
|
// }
|
|
6062
5767
|
unlock();
|
|
6063
5768
|
if (_session.WORKER_OBJ.jobs.length) {
|
|
6064
|
-
for await (const [key, val] of Object.entries(
|
|
6065
|
-
_session.WORKER_OBJ.jobs
|
|
6066
|
-
)) {
|
|
5769
|
+
for await (const [key, val] of Object.entries(_session.WORKER_OBJ.jobs)) {
|
|
6067
5770
|
if (val.stat) {
|
|
6068
5771
|
break;
|
|
6069
5772
|
}
|
|
6070
5773
|
// if (!_session.WORKER_OBJ.stat) {
|
|
6071
|
-
if (
|
|
6072
|
-
!_session.WORKER_OBJ.jobs[Number(key)] ||
|
|
6073
|
-
val.job_num === 9999999
|
|
6074
|
-
) {
|
|
5774
|
+
if (!_session.WORKER_OBJ.jobs[Number(key)] || val.job_num === 9999999) {
|
|
6075
5775
|
continue;
|
|
6076
5776
|
}
|
|
6077
5777
|
if (val.dsSessionP && !_session.DS_GLB[val.dsSessionP]) {
|
|
@@ -6106,8 +5806,8 @@ func.utils.job_worker = function (session_id) {
|
|
|
6106
5806
|
val.prog_id,
|
|
6107
5807
|
val.nodeId,
|
|
6108
5808
|
val.parentDataSourceNo,
|
|
6109
|
-
|
|
6110
|
-
val.$container
|
|
5809
|
+
'', //dismissed val.$div creating bug in alter ui
|
|
5810
|
+
val.$container,
|
|
6111
5811
|
);
|
|
6112
5812
|
}
|
|
6113
5813
|
_this._was_busy = true;
|
|
@@ -6115,12 +5815,7 @@ func.utils.job_worker = function (session_id) {
|
|
|
6115
5815
|
// idle
|
|
6116
5816
|
if (_this._was_busy) {
|
|
6117
5817
|
if (glb.IS_WORKER) {
|
|
6118
|
-
func.utils.post_back_to_client(
|
|
6119
|
-
SESSION_ID,
|
|
6120
|
-
"worker_busy_off",
|
|
6121
|
-
_session.worker_id,
|
|
6122
|
-
null
|
|
6123
|
-
);
|
|
5818
|
+
func.utils.post_back_to_client(SESSION_ID, 'worker_busy_off', _session.worker_id, null);
|
|
6124
5819
|
} else {
|
|
6125
5820
|
func.UI.utils.indicator.worker.normal();
|
|
6126
5821
|
}
|
|
@@ -6134,27 +5829,18 @@ func.utils.job_worker = function (session_id) {
|
|
|
6134
5829
|
//busy
|
|
6135
5830
|
_this._was_busy = true;
|
|
6136
5831
|
if (glb.IS_WORKER) {
|
|
6137
|
-
func.utils.post_back_to_client(
|
|
6138
|
-
SESSION_ID,
|
|
6139
|
-
"worker_busy_on",
|
|
6140
|
-
_session.worker_id,
|
|
6141
|
-
null
|
|
6142
|
-
);
|
|
5832
|
+
func.utils.post_back_to_client(SESSION_ID, 'worker_busy_on', _session.worker_id, null);
|
|
6143
5833
|
} else {
|
|
6144
5834
|
func.UI.utils.indicator.worker.busy();
|
|
6145
5835
|
}
|
|
6146
5836
|
if (glb.WORKER_PAUSE) return;
|
|
6147
5837
|
attempt++;
|
|
6148
5838
|
if (!is_progressScreen_on && attempt > glb.WORKER_TIMEOUT) busy();
|
|
6149
|
-
if (
|
|
6150
|
-
!is_not_responding &&
|
|
6151
|
-
attempt >= glb.WORKER_ATTEMPTS_NOT_RESPONDING
|
|
6152
|
-
) {
|
|
5839
|
+
if (!is_not_responding && attempt >= glb.WORKER_ATTEMPTS_NOT_RESPONDING) {
|
|
6153
5840
|
not_responding();
|
|
6154
5841
|
}
|
|
6155
5842
|
var ds = null;
|
|
6156
|
-
if (_session.WORKER_OBJ.jobs[0])
|
|
6157
|
-
ds = _session.WORKER_OBJ.jobs[0].dsSessionP;
|
|
5843
|
+
if (_session.WORKER_OBJ.jobs[0]) ds = _session.WORKER_OBJ.jobs[0].dsSessionP;
|
|
6158
5844
|
lock(ds);
|
|
6159
5845
|
}
|
|
6160
5846
|
}, 1);
|
|
@@ -6168,7 +5854,7 @@ func.utils.job_worker = function (session_id) {
|
|
|
6168
5854
|
func.utils.base64MimeType = function (encoded) {
|
|
6169
5855
|
var result = null;
|
|
6170
5856
|
|
|
6171
|
-
if (typeof encoded !==
|
|
5857
|
+
if (typeof encoded !== 'string') {
|
|
6172
5858
|
return result;
|
|
6173
5859
|
}
|
|
6174
5860
|
|
|
@@ -6182,9 +5868,8 @@ func.utils.base64MimeType = function (encoded) {
|
|
|
6182
5868
|
};
|
|
6183
5869
|
|
|
6184
5870
|
func.utils.makeid = function (length) {
|
|
6185
|
-
var result =
|
|
6186
|
-
var characters =
|
|
6187
|
-
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
|
5871
|
+
var result = '';
|
|
5872
|
+
var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
|
|
6188
5873
|
var charactersLength = characters.length;
|
|
6189
5874
|
for (var i = 0; i < length; i++) {
|
|
6190
5875
|
result += characters.charAt(Math.floor(Math.random() * charactersLength));
|
|
@@ -6199,7 +5884,7 @@ func.utils.get_device = function () {
|
|
|
6199
5884
|
device = window.cordova.platformId;
|
|
6200
5885
|
}
|
|
6201
5886
|
} catch (e) {
|
|
6202
|
-
console.error(
|
|
5887
|
+
console.error('error using ui element in server side request');
|
|
6203
5888
|
}
|
|
6204
5889
|
return device;
|
|
6205
5890
|
};
|
|
@@ -6213,12 +5898,9 @@ func.utils.ws_worker.functions = {
|
|
|
6213
5898
|
APP_OBJ[data.app_id] = data.APP_OBJ;
|
|
6214
5899
|
PROJECT_OBJ[data.app_id] = data.PROJECT_OBJ;
|
|
6215
5900
|
|
|
6216
|
-
if (data.SESSION_INFO.engine_mode ===
|
|
5901
|
+
if (data.SESSION_INFO.engine_mode === 'live_preview') {
|
|
6217
5902
|
DOCS_OBJ[data.app_id] = data.DOCS_OBJ;
|
|
6218
|
-
} else if (
|
|
6219
|
-
typeof IS_DOCKER === "undefined" &&
|
|
6220
|
-
typeof IS_PROCESS_SERVER === "undefined"
|
|
6221
|
-
) {
|
|
5903
|
+
} else if (typeof IS_DOCKER === 'undefined' && typeof IS_PROCESS_SERVER === 'undefined') {
|
|
6222
5904
|
if (!DOCS_OBJ[data.app_id]) {
|
|
6223
5905
|
DOCS_OBJ[data.app_id] = {};
|
|
6224
5906
|
}
|
|
@@ -6246,11 +5928,8 @@ func.utils.ws_worker.functions = {
|
|
|
6246
5928
|
_session.dataSourceSessionGlobal = Number(key);
|
|
6247
5929
|
}
|
|
6248
5930
|
}
|
|
6249
|
-
if (typeof _session.SLIM_BUNDLE ===
|
|
6250
|
-
const db_adapter = await func.common.get_module(
|
|
6251
|
-
SESSION_ID,
|
|
6252
|
-
"xuda-db-adapter-module.mjs"
|
|
6253
|
-
);
|
|
5931
|
+
if (typeof _session.SLIM_BUNDLE === 'undefined' || !_session.SLIM_BUNDLE) {
|
|
5932
|
+
const db_adapter = await func.common.get_module(SESSION_ID, 'xuda-db-adapter-module.mjs');
|
|
6254
5933
|
|
|
6255
5934
|
func.db = db_adapter._db;
|
|
6256
5935
|
}
|
|
@@ -6258,20 +5937,17 @@ func.utils.ws_worker.functions = {
|
|
|
6258
5937
|
_session.WORKER_OBJ.fx = new func.utils.job_worker(SESSION_ID);
|
|
6259
5938
|
_session.WORKER_OBJ.fx.init();
|
|
6260
5939
|
|
|
6261
|
-
if (_session.app_id ===
|
|
5940
|
+
if (_session.app_id === 'unknown') {
|
|
6262
5941
|
worker_post_message({
|
|
6263
|
-
fx_to_execute:
|
|
5942
|
+
fx_to_execute: 'init_done',
|
|
6264
5943
|
worker_id: ws_worker_id,
|
|
6265
5944
|
session_id: SESSION_ID,
|
|
6266
5945
|
});
|
|
6267
5946
|
} else {
|
|
6268
|
-
const module = await func.common.get_module(
|
|
6269
|
-
SESSION_ID,
|
|
6270
|
-
`xuda-progs-loader-module.mjs`
|
|
6271
|
-
);
|
|
5947
|
+
const module = await func.common.get_module(SESSION_ID, `xuda-progs-loader-module.mjs`);
|
|
6272
5948
|
await module.load_objects_cache(SESSION_ID);
|
|
6273
5949
|
worker_post_message({
|
|
6274
|
-
fx_to_execute:
|
|
5950
|
+
fx_to_execute: 'init_done',
|
|
6275
5951
|
worker_id: ws_worker_id,
|
|
6276
5952
|
session_id: SESSION_ID,
|
|
6277
5953
|
});
|
|
@@ -6287,14 +5963,9 @@ func.utils.ws_worker.functions = {
|
|
|
6287
5963
|
args.SESSION_ID = SESSION_ID;
|
|
6288
5964
|
|
|
6289
5965
|
if (show_log) {
|
|
6290
|
-
console.log(
|
|
6291
|
-
"DATASOURCE EXECUTING SESSION_ID: " + SESSION_ID,
|
|
6292
|
-
APP_OBJ[_session.app_id].app_name
|
|
6293
|
-
);
|
|
5966
|
+
console.log('DATASOURCE EXECUTING SESSION_ID: ' + SESSION_ID, APP_OBJ[_session.app_id].app_name);
|
|
6294
5967
|
}
|
|
6295
|
-
if (
|
|
6296
|
-
Number(params.dataSourceSessionGlobal) > _session.dataSourceSessionGlobal
|
|
6297
|
-
) {
|
|
5968
|
+
if (Number(params.dataSourceSessionGlobal) > _session.dataSourceSessionGlobal) {
|
|
6298
5969
|
_session.dataSourceSessionGlobal = Number(params.dataSourceSessionGlobal);
|
|
6299
5970
|
}
|
|
6300
5971
|
|
|
@@ -6316,18 +5987,10 @@ func.utils.ws_worker.functions = {
|
|
|
6316
5987
|
args.parameters_obj_inP,
|
|
6317
5988
|
args.static_refreshP,
|
|
6318
5989
|
args.run_atP,
|
|
6319
|
-
args.worker_id
|
|
5990
|
+
args.worker_id,
|
|
6320
5991
|
);
|
|
6321
5992
|
|
|
6322
|
-
if (show_log)
|
|
6323
|
-
console.log(
|
|
6324
|
-
"DATASOURCE EXECUTION DONE " +
|
|
6325
|
-
ret.dsSessionP +
|
|
6326
|
-
" " +
|
|
6327
|
-
_session.DS_GLB[ret.dsSessionP]?.tree_obj?.menuName ||
|
|
6328
|
-
"" + " SESSION_ID: " + SESSION_ID,
|
|
6329
|
-
APP_OBJ[_session.app_id].app_name
|
|
6330
|
-
);
|
|
5993
|
+
if (show_log) console.log('DATASOURCE EXECUTION DONE ' + ret.dsSessionP + ' ' + _session.DS_GLB[ret.dsSessionP]?.tree_obj?.menuName || '' + ' SESSION_ID: ' + SESSION_ID, APP_OBJ[_session.app_id].app_name);
|
|
6331
5994
|
var obj = func.utils.clean_returned_datasource(SESSION_ID, ret.dsSessionP);
|
|
6332
5995
|
obj.dataSourceSessionGlobal = _session.dataSourceSessionGlobal;
|
|
6333
5996
|
|
|
@@ -6343,19 +6006,11 @@ func.utils.ws_worker.functions = {
|
|
|
6343
6006
|
datasource_delete: function (params, promise_queue_id) {
|
|
6344
6007
|
var SESSION_ID = params.session_id;
|
|
6345
6008
|
var _session = SESSION_OBJ[SESSION_ID];
|
|
6346
|
-
if (
|
|
6347
|
-
DATASOURCE_INTERVALS[SESSION_ID] &&
|
|
6348
|
-
DATASOURCE_INTERVALS[SESSION_ID][params.dssession]
|
|
6349
|
-
) {
|
|
6009
|
+
if (DATASOURCE_INTERVALS[SESSION_ID] && DATASOURCE_INTERVALS[SESSION_ID][params.dssession]) {
|
|
6350
6010
|
DATASOURCE_INTERVALS[SESSION_ID][params.dssession].clear();
|
|
6351
6011
|
}
|
|
6352
6012
|
delete _session.DS_GLB[params.dssession];
|
|
6353
|
-
if (show_log)
|
|
6354
|
-
console.log(
|
|
6355
|
-
"DATASOURCE DELETE SESSION_ID: " + SESSION_ID,
|
|
6356
|
-
APP_OBJ[_session.app_id].app_name,
|
|
6357
|
-
params.dssession
|
|
6358
|
-
);
|
|
6013
|
+
if (show_log) console.log('DATASOURCE DELETE SESSION_ID: ' + SESSION_ID, APP_OBJ[_session.app_id].app_name, params.dssession);
|
|
6359
6014
|
// debugger;
|
|
6360
6015
|
worker_post_message({
|
|
6361
6016
|
promise_queue_id,
|
|
@@ -6365,10 +6020,7 @@ func.utils.ws_worker.functions = {
|
|
|
6365
6020
|
service: params.service,
|
|
6366
6021
|
});
|
|
6367
6022
|
},
|
|
6368
|
-
update_datasource_changes_from_client: async function (
|
|
6369
|
-
params,
|
|
6370
|
-
promise_queue_id
|
|
6371
|
-
) {
|
|
6023
|
+
update_datasource_changes_from_client: async function (params, promise_queue_id) {
|
|
6372
6024
|
if (_.isEmpty(SESSION_OBJ)) return;
|
|
6373
6025
|
var SESSION_ID = params.session_id;
|
|
6374
6026
|
var _session = SESSION_OBJ[SESSION_ID];
|
|
@@ -6378,12 +6030,7 @@ func.utils.ws_worker.functions = {
|
|
|
6378
6030
|
_session.dataSourceSessionGlobal = -1;
|
|
6379
6031
|
_session.DS_GLB = {};
|
|
6380
6032
|
}
|
|
6381
|
-
if (show_log)
|
|
6382
|
-
console.log(
|
|
6383
|
-
"DATASOURCE UPDATE SESSION_ID: " + SESSION_ID,
|
|
6384
|
-
APP_OBJ[_session.app_id].app_name,
|
|
6385
|
-
params.dssession
|
|
6386
|
-
);
|
|
6033
|
+
if (show_log) console.log('DATASOURCE UPDATE SESSION_ID: ' + SESSION_ID, APP_OBJ[_session.app_id].app_name, params.dssession);
|
|
6387
6034
|
|
|
6388
6035
|
await func.datasource.update(SESSION_ID, params.datasource_changes, true);
|
|
6389
6036
|
|
|
@@ -6403,33 +6050,15 @@ func.utils.ws_worker.functions = {
|
|
|
6403
6050
|
var ds = _session.DS_GLB[params.dssession];
|
|
6404
6051
|
var type = params.return_to_data_source_type;
|
|
6405
6052
|
var args = ds.args;
|
|
6406
|
-
if (show_log)
|
|
6407
|
-
|
|
6408
|
-
|
|
6409
|
-
params.dssession +
|
|
6410
|
-
" SESSION_ID: " +
|
|
6411
|
-
SESSION_ID,
|
|
6412
|
-
APP_OBJ[_session.app_id].app_name
|
|
6413
|
-
);
|
|
6414
|
-
_session.DS_GLB[params.dssession].v.onscreen_events_active =
|
|
6415
|
-
params.onscreen_events_active;
|
|
6416
|
-
if (params.viewEventExec_arr)
|
|
6417
|
-
_session.DS_GLB[params.dssession].viewEventExec_arr = JSON.parse(
|
|
6418
|
-
params.viewEventExec_arr
|
|
6419
|
-
);
|
|
6053
|
+
if (show_log) console.log('DATASOURCE RETURN TO DATASOURCE ' + params.dssession + ' SESSION_ID: ' + SESSION_ID, APP_OBJ[_session.app_id].app_name);
|
|
6054
|
+
_session.DS_GLB[params.dssession].v.onscreen_events_active = params.onscreen_events_active;
|
|
6055
|
+
if (params.viewEventExec_arr) _session.DS_GLB[params.dssession].viewEventExec_arr = JSON.parse(params.viewEventExec_arr);
|
|
6420
6056
|
var done = function (SESSION_ID, DS) {
|
|
6421
|
-
if (show_log)
|
|
6422
|
-
console.log(
|
|
6423
|
-
"DATASOURCE RETURN TO DATASOURCE DONE " +
|
|
6424
|
-
DS +
|
|
6425
|
-
" SESSION_ID: " +
|
|
6426
|
-
SESSION_ID,
|
|
6427
|
-
APP_OBJ[_session.app_id].app_name
|
|
6428
|
-
);
|
|
6057
|
+
if (show_log) console.log('DATASOURCE RETURN TO DATASOURCE DONE ' + DS + ' SESSION_ID: ' + SESSION_ID, APP_OBJ[_session.app_id].app_name);
|
|
6429
6058
|
var obj = func.utils.clean_returned_datasource(SESSION_ID, DS);
|
|
6430
6059
|
obj.dataSourceSessionGlobal = _session.dataSourceSessionGlobal;
|
|
6431
6060
|
worker_post_message({
|
|
6432
|
-
fx_to_execute:
|
|
6061
|
+
fx_to_execute: 'post_datasource',
|
|
6433
6062
|
params: {
|
|
6434
6063
|
ds_obj: obj,
|
|
6435
6064
|
dsSessionP: params.dssession,
|
|
@@ -6448,47 +6077,23 @@ func.utils.ws_worker.functions = {
|
|
|
6448
6077
|
var _session = SESSION_OBJ[SESSION_ID];
|
|
6449
6078
|
var ds = _session.DS_GLB[params.dssession];
|
|
6450
6079
|
|
|
6451
|
-
if (show_log)
|
|
6452
|
-
console.log(
|
|
6453
|
-
"UPDATE CHANGE EVENT DONE TO DATASOURCE " +
|
|
6454
|
-
params.dssession +
|
|
6455
|
-
" SESSION_ID: " +
|
|
6456
|
-
SESSION_ID,
|
|
6457
|
-
APP_OBJ[_session.app_id].app_name
|
|
6458
|
-
);
|
|
6080
|
+
if (show_log) console.log('UPDATE CHANGE EVENT DONE TO DATASOURCE ' + params.dssession + ' SESSION_ID: ' + SESSION_ID, APP_OBJ[_session.app_id].app_name);
|
|
6459
6081
|
ds.eventChangesResults_done = true;
|
|
6460
6082
|
},
|
|
6461
6083
|
return_from_db_query: function (params) {
|
|
6462
6084
|
var SESSION_ID = params.session_id;
|
|
6463
6085
|
var _session = SESSION_OBJ[SESSION_ID];
|
|
6464
6086
|
var id = params.id;
|
|
6465
|
-
if (show_log)
|
|
6466
|
-
console.log(
|
|
6467
|
-
"RETURN FROM DB_QUERY " +
|
|
6468
|
-
params.dssession +
|
|
6469
|
-
" SESSION_ID: " +
|
|
6470
|
-
SESSION_ID,
|
|
6471
|
-
APP_OBJ[_session.app_id].app_name
|
|
6472
|
-
);
|
|
6087
|
+
if (show_log) console.log('RETURN FROM DB_QUERY ' + params.dssession + ' SESSION_ID: ' + SESSION_ID, APP_OBJ[_session.app_id].app_name);
|
|
6473
6088
|
debugger;
|
|
6474
|
-
var callback = func.utils.get_callback_queue(
|
|
6475
|
-
SESSION_ID,
|
|
6476
|
-
params.callback_id
|
|
6477
|
-
);
|
|
6089
|
+
var callback = func.utils.get_callback_queue(SESSION_ID, params.callback_id);
|
|
6478
6090
|
if (callback) callback(params.data);
|
|
6479
6091
|
},
|
|
6480
6092
|
return_from_sava_data: function (params) {
|
|
6481
6093
|
var SESSION_ID = params.session_id;
|
|
6482
6094
|
var _session = SESSION_OBJ[SESSION_ID];
|
|
6483
6095
|
var id = params.id;
|
|
6484
|
-
if (show_log)
|
|
6485
|
-
console.log(
|
|
6486
|
-
"RETURN FROM SAVE_DATA " +
|
|
6487
|
-
params.dssession +
|
|
6488
|
-
" SESSION_ID: " +
|
|
6489
|
-
SESSION_ID,
|
|
6490
|
-
APP_OBJ[_session.app_id].app_name
|
|
6491
|
-
);
|
|
6096
|
+
if (show_log) console.log('RETURN FROM SAVE_DATA ' + params.dssession + ' SESSION_ID: ' + SESSION_ID, APP_OBJ[_session.app_id].app_name);
|
|
6492
6097
|
func.utils.get_callback_queue(SESSION_ID, params.callback_id)();
|
|
6493
6098
|
},
|
|
6494
6099
|
update_debug_info: function (params) {
|
|
@@ -6508,8 +6113,7 @@ func.utils.ws_worker.functions = {
|
|
|
6508
6113
|
get_dataSourceSessionGlobal: function (params) {
|
|
6509
6114
|
var SESSION_ID = params.session_id;
|
|
6510
6115
|
SESSION_OBJ[SESSION_ID].dataSourceSessionGlobal++;
|
|
6511
|
-
let new_dataSourceSessionGlobal =
|
|
6512
|
-
SESSION_OBJ[SESSION_ID].dataSourceSessionGlobal;
|
|
6116
|
+
let new_dataSourceSessionGlobal = SESSION_OBJ[SESSION_ID].dataSourceSessionGlobal;
|
|
6513
6117
|
return { new_dataSourceSessionGlobal };
|
|
6514
6118
|
},
|
|
6515
6119
|
create_webworker_globals: function (params) {
|
|
@@ -6522,7 +6126,7 @@ func.utils.ws_worker.functions = {
|
|
|
6522
6126
|
const event = new CustomEvent(eventName, { detail });
|
|
6523
6127
|
self.dispatchEvent(event);
|
|
6524
6128
|
}
|
|
6525
|
-
emitCustomEvent(
|
|
6129
|
+
emitCustomEvent('live_preview_get_obj_response_worker_' + params._id, {
|
|
6526
6130
|
data: params,
|
|
6527
6131
|
});
|
|
6528
6132
|
},
|
|
@@ -6532,7 +6136,7 @@ func.utils.ws_worker.functions = {
|
|
|
6532
6136
|
const event = new CustomEvent(eventName, { detail });
|
|
6533
6137
|
self.dispatchEvent(event);
|
|
6534
6138
|
}
|
|
6535
|
-
emitCustomEvent(
|
|
6139
|
+
emitCustomEvent('get_doc_obj_from_build_worker_' + params._id, {
|
|
6536
6140
|
data: params,
|
|
6537
6141
|
});
|
|
6538
6142
|
},
|
|
@@ -6542,7 +6146,7 @@ func.utils.ws_worker.functions = {
|
|
|
6542
6146
|
const event = new CustomEvent(eventName, { detail });
|
|
6543
6147
|
self.dispatchEvent(event);
|
|
6544
6148
|
}
|
|
6545
|
-
emitCustomEvent(
|
|
6149
|
+
emitCustomEvent('get_ws_data_worker_' + params.websocket_queue_num, {
|
|
6546
6150
|
data: params.data,
|
|
6547
6151
|
});
|
|
6548
6152
|
},
|
|
@@ -6550,37 +6154,16 @@ func.utils.ws_worker.functions = {
|
|
|
6550
6154
|
var SESSION_ID = params.session_id;
|
|
6551
6155
|
|
|
6552
6156
|
try {
|
|
6553
|
-
const do_heartbeat = async function (
|
|
6554
|
-
app_replicate,
|
|
6555
|
-
app_id,
|
|
6556
|
-
token_id,
|
|
6557
|
-
fingerprint,
|
|
6558
|
-
device_name,
|
|
6559
|
-
stat
|
|
6560
|
-
) {
|
|
6157
|
+
const do_heartbeat = async function (app_replicate, app_id, token_id, fingerprint, device_name, stat) {
|
|
6561
6158
|
try {
|
|
6562
6159
|
module.exports.close_expired_device_log_sessions(app_id);
|
|
6563
6160
|
|
|
6564
|
-
return await update_device(
|
|
6565
|
-
app_replicate,
|
|
6566
|
-
app_id,
|
|
6567
|
-
token_id,
|
|
6568
|
-
fingerprint,
|
|
6569
|
-
device_name,
|
|
6570
|
-
stat
|
|
6571
|
-
);
|
|
6161
|
+
return await update_device(app_replicate, app_id, token_id, fingerprint, device_name, stat);
|
|
6572
6162
|
} catch (err) {
|
|
6573
6163
|
return { code: -400, data: err.message };
|
|
6574
6164
|
}
|
|
6575
6165
|
};
|
|
6576
|
-
let ret = await do_heartbeat(
|
|
6577
|
-
params.app_replicate,
|
|
6578
|
-
params.app_id,
|
|
6579
|
-
params.gtp_token || req.body.app_token,
|
|
6580
|
-
params.fingerprint,
|
|
6581
|
-
params.device_name,
|
|
6582
|
-
params.stat
|
|
6583
|
-
);
|
|
6166
|
+
let ret = await do_heartbeat(params.app_replicate, params.app_id, params.gtp_token || req.body.app_token, params.fingerprint, params.device_name, params.stat);
|
|
6584
6167
|
|
|
6585
6168
|
// session_status: ret_session.data.stat
|
|
6586
6169
|
if (params.token) {
|
|
@@ -6600,7 +6183,7 @@ func.utils.ws_worker.functions = {
|
|
|
6600
6183
|
const event = new CustomEvent(eventName, { detail });
|
|
6601
6184
|
self.dispatchEvent(event);
|
|
6602
6185
|
}
|
|
6603
|
-
emitCustomEvent(
|
|
6186
|
+
emitCustomEvent('rpi_request_response_worker_' + params.table_id, {
|
|
6604
6187
|
data: params.data,
|
|
6605
6188
|
});
|
|
6606
6189
|
},
|
|
@@ -6619,8 +6202,7 @@ func.utils.set_callback_queue = function (SESSION_ID, func) {
|
|
|
6619
6202
|
func.utils.get_callback_queue = function (SESSION_ID, t) {
|
|
6620
6203
|
var func = WEB_WORKER_CALLBACK_QUEUE[SESSION_ID][t];
|
|
6621
6204
|
setTimeout(function () {
|
|
6622
|
-
if (WEB_WORKER_CALLBACK_QUEUE[SESSION_ID][t])
|
|
6623
|
-
delete WEB_WORKER_CALLBACK_QUEUE[SESSION_ID][t];
|
|
6205
|
+
if (WEB_WORKER_CALLBACK_QUEUE[SESSION_ID][t]) delete WEB_WORKER_CALLBACK_QUEUE[SESSION_ID][t];
|
|
6624
6206
|
}, 1000);
|
|
6625
6207
|
return func;
|
|
6626
6208
|
};
|
|
@@ -6636,7 +6218,7 @@ func.utils.clean_stringify_null = function (key, value) {
|
|
|
6636
6218
|
func.utils.load_js_on_demand = async function (js_src, type) {
|
|
6637
6219
|
const get_script = function (callback) {
|
|
6638
6220
|
function getScript(scriptUrl, callback) {
|
|
6639
|
-
const script = document.createElement(
|
|
6221
|
+
const script = document.createElement('script');
|
|
6640
6222
|
script.src = scriptUrl;
|
|
6641
6223
|
if (type) script.type = type;
|
|
6642
6224
|
script.onload = callback;
|
|
@@ -6680,27 +6262,20 @@ func.utils.load_css_on_demand = function (css_href) {
|
|
|
6680
6262
|
if (isCssLoaded(css_href)) {
|
|
6681
6263
|
return;
|
|
6682
6264
|
}
|
|
6683
|
-
return $(
|
|
6684
|
-
rel:
|
|
6685
|
-
type:
|
|
6265
|
+
return $('<link/>', {
|
|
6266
|
+
rel: 'stylesheet',
|
|
6267
|
+
type: 'text/css',
|
|
6686
6268
|
href: css_href,
|
|
6687
|
-
}).prependTo(
|
|
6269
|
+
}).prependTo('head');
|
|
6688
6270
|
};
|
|
6689
6271
|
|
|
6690
6272
|
func.utils.remove_js_css_file = function (filename, filetype) {
|
|
6691
|
-
var targetelement =
|
|
6692
|
-
|
|
6693
|
-
var targetattr =
|
|
6694
|
-
filetype == "js" ? "src" : filetype == "css" ? "href" : "none"; //determine corresponding attribute to test for
|
|
6273
|
+
var targetelement = filetype == 'js' ? 'script' : filetype == 'css' ? 'link' : 'none'; //determine element type to create nodelist from
|
|
6274
|
+
var targetattr = filetype == 'js' ? 'src' : filetype == 'css' ? 'href' : 'none'; //determine corresponding attribute to test for
|
|
6695
6275
|
var allsuspects = document.getElementsByTagName(targetelement);
|
|
6696
6276
|
for (var i = allsuspects.length; i >= 0; i--) {
|
|
6697
6277
|
//search backwards within node list for matching elements to remove
|
|
6698
|
-
if (
|
|
6699
|
-
allsuspects[i] &&
|
|
6700
|
-
allsuspects[i].getAttribute(targetattr) != null &&
|
|
6701
|
-
allsuspects[i].getAttribute(targetattr).indexOf(filename) != -1
|
|
6702
|
-
)
|
|
6703
|
-
allsuspects[i].parentNode.removeChild(allsuspects[i]); //remove element by calling parentNode.removeChild()
|
|
6278
|
+
if (allsuspects[i] && allsuspects[i].getAttribute(targetattr) != null && allsuspects[i].getAttribute(targetattr).indexOf(filename) != -1) allsuspects[i].parentNode.removeChild(allsuspects[i]); //remove element by calling parentNode.removeChild()
|
|
6704
6279
|
}
|
|
6705
6280
|
};
|
|
6706
6281
|
|
|
@@ -6708,11 +6283,7 @@ func.utils.replace_studio_drive_url = function (SESSION_ID, val) {
|
|
|
6708
6283
|
var _session = SESSION_OBJ[SESSION_ID];
|
|
6709
6284
|
if (!_session.is_deployment) return val;
|
|
6710
6285
|
try {
|
|
6711
|
-
return val.replaceAll(
|
|
6712
|
-
`https://xuda.io/studio-drive/${APP_OBJ[_session.app_id].app_replicate}`,
|
|
6713
|
-
`https://${_session.domain}/studio-drive/${APP_OBJ[_session.app_id].app_replicate
|
|
6714
|
-
}`
|
|
6715
|
-
);
|
|
6286
|
+
return val.replaceAll(`https://xuda.io/studio-drive/${APP_OBJ[_session.app_id].app_replicate}`, `https://${_session.domain}/studio-drive/${APP_OBJ[_session.app_id].app_replicate}`);
|
|
6716
6287
|
} catch (err) {
|
|
6717
6288
|
return val;
|
|
6718
6289
|
}
|
|
@@ -6725,8 +6296,7 @@ func.utils.get_drive_url = function (SESSION_ID, val, wrap) {
|
|
|
6725
6296
|
function replaceFiletoURL(fileString) {
|
|
6726
6297
|
const _app = APP_OBJ[_session.app_id];
|
|
6727
6298
|
|
|
6728
|
-
let url = `https://${_session.domain}/workspace-drive/${_app.is_deployment ? _app.app_datacenter_id : _app.app_id_reference
|
|
6729
|
-
}/`;
|
|
6299
|
+
let url = `https://${_session.domain}/workspace-drive/${_app.is_deployment ? _app.app_datacenter_id : _app.app_id_reference}/`;
|
|
6730
6300
|
|
|
6731
6301
|
let FILE_REPLACE_URL = `${url}${val}`;
|
|
6732
6302
|
|
|
@@ -6735,10 +6305,9 @@ func.utils.get_drive_url = function (SESSION_ID, val, wrap) {
|
|
|
6735
6305
|
FILE_REPLACE_URL += `?app_token=${_session.app_token}`;
|
|
6736
6306
|
}
|
|
6737
6307
|
|
|
6738
|
-
let match = `drv_${_app.app_replicate || _session.app_id
|
|
6739
|
-
}_[0-9a-f\\-]+\\.[a-zA-Z0-9]+`;
|
|
6308
|
+
let match = `drv_${_app.app_replicate || _session.app_id}_[0-9a-f\\-]+\\.[a-zA-Z0-9]+`;
|
|
6740
6309
|
|
|
6741
|
-
let pat = new RegExp(match,
|
|
6310
|
+
let pat = new RegExp(match, 'g');
|
|
6742
6311
|
let URLString = fileString.replace(pat, function (match, idx) {
|
|
6743
6312
|
// debugger;
|
|
6744
6313
|
const hasURLbefore = fileString.substring(idx - url.length, idx) === url;
|
|
@@ -6747,15 +6316,15 @@ func.utils.get_drive_url = function (SESSION_ID, val, wrap) {
|
|
|
6747
6316
|
return match;
|
|
6748
6317
|
}
|
|
6749
6318
|
|
|
6750
|
-
return FILE_REPLACE_URL.replace(
|
|
6319
|
+
return FILE_REPLACE_URL.replace('{val}', match);
|
|
6751
6320
|
});
|
|
6752
6321
|
|
|
6753
6322
|
return URLString;
|
|
6754
6323
|
}
|
|
6755
6324
|
|
|
6756
|
-
if (typeof val ===
|
|
6757
|
-
if (typeof val ===
|
|
6758
|
-
if (val.includes(
|
|
6325
|
+
if (typeof val === 'string' || typeof val === 'object') {
|
|
6326
|
+
if (typeof val === 'string') {
|
|
6327
|
+
if (val.includes('.') && val.includes('drv_') && val.length > 30) {
|
|
6759
6328
|
var ret = replaceFiletoURL(val);
|
|
6760
6329
|
if (wrap) {
|
|
6761
6330
|
return { value: '"' + ret + '"', changed: true };
|
|
@@ -6767,9 +6336,9 @@ func.utils.get_drive_url = function (SESSION_ID, val, wrap) {
|
|
|
6767
6336
|
}
|
|
6768
6337
|
}
|
|
6769
6338
|
|
|
6770
|
-
if (typeof val ===
|
|
6339
|
+
if (typeof val === 'object') {
|
|
6771
6340
|
let str = JSON.stringify(val);
|
|
6772
|
-
if (str.includes(
|
|
6341
|
+
if (str.includes('.') && str.includes('drv_') && str.length > 30) {
|
|
6773
6342
|
let new_val = replaceFiletoURL(str);
|
|
6774
6343
|
|
|
6775
6344
|
return { value: new_val, changed: true };
|
|
@@ -6782,19 +6351,12 @@ func.utils.get_drive_url = function (SESSION_ID, val, wrap) {
|
|
|
6782
6351
|
}
|
|
6783
6352
|
};
|
|
6784
6353
|
|
|
6785
|
-
func.utils.debug_report = async function (
|
|
6786
|
-
SESSION_ID,
|
|
6787
|
-
sourceP,
|
|
6788
|
-
msgP,
|
|
6789
|
-
typeP,
|
|
6790
|
-
errP,
|
|
6791
|
-
objP
|
|
6792
|
-
) {
|
|
6354
|
+
func.utils.debug_report = async function (SESSION_ID, sourceP, msgP, typeP, errP, objP) {
|
|
6793
6355
|
var _session = SESSION_OBJ[SESSION_ID];
|
|
6794
6356
|
var details = [sourceP];
|
|
6795
6357
|
if (errP) details.push(errP);
|
|
6796
6358
|
if (objP) details.push(objP);
|
|
6797
|
-
if (!typeP || typeP ===
|
|
6359
|
+
if (!typeP || typeP === 'E') {
|
|
6798
6360
|
setTimeout(() => {
|
|
6799
6361
|
// if (
|
|
6800
6362
|
// typeof IS_DOCKER === "undefined" &&
|
|
@@ -6817,44 +6379,26 @@ func.utils.debug_report = async function (
|
|
|
6817
6379
|
// msgP,
|
|
6818
6380
|
// sourceP //arguments.callee.caller.toString()- deprecated es6
|
|
6819
6381
|
// );
|
|
6820
|
-
console.error(
|
|
6382
|
+
console.error('XUDA', 'ERROR', sourceP, msgP, details);
|
|
6821
6383
|
|
|
6822
|
-
if (
|
|
6823
|
-
|
|
6824
|
-
typeof IS_DOCKER !== "undefined" ||
|
|
6825
|
-
typeof IS_PROCESS_SERVER !== "undefined"
|
|
6826
|
-
) {
|
|
6827
|
-
return __.rpi.write_log(
|
|
6828
|
-
SESSION_OBJ[SESSION_ID].app_id,
|
|
6829
|
-
"error",
|
|
6830
|
-
"worker",
|
|
6831
|
-
"runtime",
|
|
6832
|
-
msgP,
|
|
6833
|
-
null,
|
|
6834
|
-
objP,
|
|
6835
|
-
sourceP
|
|
6836
|
-
);
|
|
6384
|
+
if (typeof IS_API_SERVER !== 'undefined' || typeof IS_DOCKER !== 'undefined' || typeof IS_PROCESS_SERVER !== 'undefined') {
|
|
6385
|
+
return __.rpi.write_log(SESSION_OBJ[SESSION_ID].app_id, 'error', 'worker', 'runtime', msgP, null, objP, sourceP);
|
|
6837
6386
|
}
|
|
6838
6387
|
|
|
6839
6388
|
if (glb.IS_WORKER) {
|
|
6840
6389
|
let obj = {
|
|
6841
|
-
service:
|
|
6390
|
+
service: 'write_log',
|
|
6842
6391
|
data: msgP,
|
|
6843
|
-
log_type:
|
|
6392
|
+
log_type: 'error',
|
|
6844
6393
|
id: STUDIO_WEBSOCKET_CONNECTION_ID,
|
|
6845
6394
|
uid: _session.USR_OBJ._id,
|
|
6846
|
-
source:
|
|
6395
|
+
source: 'runtime',
|
|
6847
6396
|
app_id: _session.app_id,
|
|
6848
6397
|
gtp_token: _session.gtp_token,
|
|
6849
6398
|
app_token: _session.app_token,
|
|
6850
6399
|
};
|
|
6851
6400
|
|
|
6852
|
-
return func.utils.post_back_to_client(
|
|
6853
|
-
SESSION_ID,
|
|
6854
|
-
"write_log",
|
|
6855
|
-
_session.worker_id,
|
|
6856
|
-
obj
|
|
6857
|
-
);
|
|
6401
|
+
return func.utils.post_back_to_client(SESSION_ID, 'write_log', _session.worker_id, obj);
|
|
6858
6402
|
}
|
|
6859
6403
|
|
|
6860
6404
|
// // temp inactive cause to loop
|
|
@@ -6867,64 +6411,47 @@ func.utils.debug_report = async function (
|
|
|
6867
6411
|
// });
|
|
6868
6412
|
// }
|
|
6869
6413
|
}
|
|
6870
|
-
if (typeP ===
|
|
6871
|
-
if (typeP ===
|
|
6414
|
+
if (typeP === 'W') console.warn('XUDA', 'WARNING', msgP, details);
|
|
6415
|
+
if (typeP === 'I') console.log('XUDA', 'INFO', msgP, details);
|
|
6872
6416
|
};
|
|
6873
6417
|
|
|
6874
6418
|
func.utils.request_error = function (SESSION_ID, type, e) {
|
|
6875
6419
|
var _session = SESSION_OBJ[SESSION_ID];
|
|
6876
6420
|
console.error(type, e);
|
|
6877
|
-
if (typeof IS_PROCESS_SERVER !==
|
|
6421
|
+
if (typeof IS_PROCESS_SERVER !== 'undefined') return;
|
|
6878
6422
|
if (!glb.IS_WORKER) {
|
|
6879
|
-
func.utils.debug_report(SESSION_ID, type, e,
|
|
6423
|
+
func.utils.debug_report(SESSION_ID, type, e, 'E');
|
|
6880
6424
|
setTimeout(function () {
|
|
6881
6425
|
if (!glb.debug_js) {
|
|
6882
6426
|
// location.reload();
|
|
6883
|
-
console.warn(
|
|
6427
|
+
console.warn('** reload request');
|
|
6884
6428
|
}
|
|
6885
6429
|
}, 2000);
|
|
6886
6430
|
} else {
|
|
6887
|
-
func.utils.post_back_to_client(
|
|
6888
|
-
SESSION_ID,
|
|
6889
|
-
"ajax_error",
|
|
6890
|
-
_session.worker_id,
|
|
6891
|
-
null
|
|
6892
|
-
);
|
|
6431
|
+
func.utils.post_back_to_client(SESSION_ID, 'ajax_error', _session.worker_id, null);
|
|
6893
6432
|
}
|
|
6894
6433
|
};
|
|
6895
6434
|
|
|
6896
6435
|
func.utils.alerts = {};
|
|
6897
|
-
func.utils.alerts.invoke = async function (
|
|
6898
|
-
SESSION_ID,
|
|
6899
|
-
typeP,
|
|
6900
|
-
paramsP,
|
|
6901
|
-
sourceP,
|
|
6902
|
-
dsSessionP,
|
|
6903
|
-
msgP
|
|
6904
|
-
) {
|
|
6436
|
+
func.utils.alerts.invoke = async function (SESSION_ID, typeP, paramsP, sourceP, dsSessionP, msgP) {
|
|
6905
6437
|
try {
|
|
6906
6438
|
var _session = SESSION_OBJ[SESSION_ID];
|
|
6907
6439
|
if (ALERT_IS_ACTIVE) return;
|
|
6908
6440
|
ALERT_IS_ACTIVE = true;
|
|
6909
6441
|
var title;
|
|
6910
|
-
var message =
|
|
6911
|
-
var alert_type =
|
|
6442
|
+
var message = '';
|
|
6443
|
+
var alert_type = 'console';
|
|
6912
6444
|
var alertDisplay;
|
|
6913
6445
|
var expRet = {};
|
|
6914
6446
|
var _ds = _session.DS_GLB[dsSessionP];
|
|
6915
|
-
var type =
|
|
6447
|
+
var type = '';
|
|
6916
6448
|
var createLog;
|
|
6917
6449
|
|
|
6918
6450
|
const get_alert_properties = async function (value, fx) {
|
|
6919
|
-
var ret = value ||
|
|
6451
|
+
var ret = value || '';
|
|
6920
6452
|
|
|
6921
6453
|
if (fx) {
|
|
6922
|
-
const exp_ret = await func.expression.get(
|
|
6923
|
-
SESSION_ID,
|
|
6924
|
-
fx,
|
|
6925
|
-
dsSessionP,
|
|
6926
|
-
"alert"
|
|
6927
|
-
);
|
|
6454
|
+
const exp_ret = await func.expression.get(SESSION_ID, fx, dsSessionP, 'alert');
|
|
6928
6455
|
ret = exp_ret.result;
|
|
6929
6456
|
}
|
|
6930
6457
|
|
|
@@ -6932,58 +6459,30 @@ func.utils.alerts.invoke = async function (
|
|
|
6932
6459
|
};
|
|
6933
6460
|
|
|
6934
6461
|
switch (typeP) {
|
|
6935
|
-
case
|
|
6936
|
-
type =
|
|
6462
|
+
case 'alert':
|
|
6463
|
+
type = 'User defined alert';
|
|
6937
6464
|
|
|
6938
|
-
title = await get_alert_properties(
|
|
6939
|
-
|
|
6940
|
-
|
|
6941
|
-
);
|
|
6942
|
-
alert_type = await get_alert_properties(
|
|
6943
|
-
paramsP.alertType,
|
|
6944
|
-
paramsP.alertTypeFx
|
|
6945
|
-
);
|
|
6946
|
-
message = await get_alert_properties(
|
|
6947
|
-
paramsP.alertBody,
|
|
6948
|
-
paramsP.alertBodyFx
|
|
6949
|
-
);
|
|
6950
|
-
alertDisplay = await get_alert_properties(
|
|
6951
|
-
paramsP.alertDisplay,
|
|
6952
|
-
paramsP.alertDisplayFx
|
|
6953
|
-
);
|
|
6465
|
+
title = await get_alert_properties(paramsP.alertTitle, paramsP.alertTitleFx);
|
|
6466
|
+
alert_type = await get_alert_properties(paramsP.alertType, paramsP.alertTypeFx);
|
|
6467
|
+
message = await get_alert_properties(paramsP.alertBody, paramsP.alertBodyFx);
|
|
6468
|
+
alertDisplay = await get_alert_properties(paramsP.alertDisplay, paramsP.alertDisplayFx);
|
|
6954
6469
|
createLog = paramsP.createLog;
|
|
6955
6470
|
break;
|
|
6956
6471
|
|
|
6957
|
-
case
|
|
6958
|
-
type =
|
|
6472
|
+
case 'call_alert':
|
|
6473
|
+
type = 'User defined call alert';
|
|
6959
6474
|
let prop = await func.utils.TREE_OBJ.get(SESSION_ID, paramsP.prog);
|
|
6960
6475
|
if (!prop) {
|
|
6961
|
-
console.log(
|
|
6962
|
-
"events.execute",
|
|
6963
|
-
"Missing details for alert message object: " + paramsP.prog,
|
|
6964
|
-
"W"
|
|
6965
|
-
);
|
|
6476
|
+
console.log('events.execute', 'Missing details for alert message object: ' + paramsP.prog, 'W');
|
|
6966
6477
|
}
|
|
6967
6478
|
// user defined
|
|
6968
6479
|
|
|
6969
6480
|
let ret = await func.utils.VIEWS_OBJ.get(SESSION_ID, paramsP.prog);
|
|
6970
6481
|
if (ret?.alertData) {
|
|
6971
|
-
title = await get_alert_properties(
|
|
6972
|
-
|
|
6973
|
-
|
|
6974
|
-
);
|
|
6975
|
-
alert_type = await get_alert_properties(
|
|
6976
|
-
ret.alertData.alertType,
|
|
6977
|
-
ret.alertData.alertTypeFx
|
|
6978
|
-
);
|
|
6979
|
-
message = await get_alert_properties(
|
|
6980
|
-
ret.alertData.alertBody,
|
|
6981
|
-
ret.alertData.alertBodyFx
|
|
6982
|
-
);
|
|
6983
|
-
alertDisplay = await get_alert_properties(
|
|
6984
|
-
ret.alertData.alertDisplay,
|
|
6985
|
-
ret.alertData.alertDisplayFx
|
|
6986
|
-
);
|
|
6482
|
+
title = await get_alert_properties(ret.alertData.alertTitle, ret.alertData.alertTitleFx);
|
|
6483
|
+
alert_type = await get_alert_properties(ret.alertData.alertType, ret.alertData.alertTypeFx);
|
|
6484
|
+
message = await get_alert_properties(ret.alertData.alertBody, ret.alertData.alertBodyFx);
|
|
6485
|
+
alertDisplay = await get_alert_properties(ret.alertData.alertDisplay, ret.alertData.alertDisplayFx);
|
|
6987
6486
|
createLog = ret.alertData.createLog;
|
|
6988
6487
|
}
|
|
6989
6488
|
|
|
@@ -6991,43 +6490,31 @@ func.utils.alerts.invoke = async function (
|
|
|
6991
6490
|
title = prop.menuTitle;
|
|
6992
6491
|
}
|
|
6993
6492
|
if (!alert_type) {
|
|
6994
|
-
alert_type =
|
|
6493
|
+
alert_type = 'console';
|
|
6995
6494
|
}
|
|
6996
6495
|
|
|
6997
6496
|
if (!alertDisplay) {
|
|
6998
|
-
alertDisplay =
|
|
6497
|
+
alertDisplay = 'modal';
|
|
6999
6498
|
} //window alert by definition
|
|
7000
6499
|
|
|
7001
6500
|
break;
|
|
7002
6501
|
|
|
7003
|
-
case
|
|
7004
|
-
type =
|
|
6502
|
+
case 'system_msg': {
|
|
6503
|
+
type = 'System alert';
|
|
7005
6504
|
const sys_alerts_obj = func.utils.get_system_error_msg();
|
|
7006
6505
|
if (sys_alerts_obj[paramsP]) {
|
|
7007
6506
|
title = sys_alerts_obj[paramsP].subject;
|
|
7008
6507
|
alert_type = sys_alerts_obj[paramsP].alert_type;
|
|
7009
6508
|
alertDisplay = sys_alerts_obj[paramsP].alertDisplay;
|
|
7010
6509
|
|
|
7011
|
-
expRet = await func.expression.get(
|
|
7012
|
-
SESSION_ID,
|
|
7013
|
-
sys_alerts_obj[paramsP].msg,
|
|
7014
|
-
dsSessionP,
|
|
7015
|
-
"alert"
|
|
7016
|
-
);
|
|
6510
|
+
expRet = await func.expression.get(SESSION_ID, sys_alerts_obj[paramsP].msg, dsSessionP, 'alert');
|
|
7017
6511
|
message = func.expression.remove_quotes(expRet.result);
|
|
7018
6512
|
|
|
7019
6513
|
if (msgP) message = msgP;
|
|
7020
6514
|
|
|
7021
|
-
if (alert_type ===
|
|
7022
|
-
if (_ds) _ds.error = title +
|
|
7023
|
-
func.utils.debug_report(
|
|
7024
|
-
SESSION_ID,
|
|
7025
|
-
sourceP,
|
|
7026
|
-
title + " " + sourceP,
|
|
7027
|
-
"E",
|
|
7028
|
-
"",
|
|
7029
|
-
_ds
|
|
7030
|
-
);
|
|
6515
|
+
if (alert_type === 'error') {
|
|
6516
|
+
if (_ds) _ds.error = title + ' ' + sourceP;
|
|
6517
|
+
func.utils.debug_report(SESSION_ID, sourceP, title + ' ' + sourceP, 'E', '', _ds);
|
|
7031
6518
|
}
|
|
7032
6519
|
}
|
|
7033
6520
|
break;
|
|
@@ -7054,12 +6541,7 @@ func.utils.alerts.invoke = async function (
|
|
|
7054
6541
|
|
|
7055
6542
|
// if (typeof IS_PROCESS_SERVER !== "undefined") return;
|
|
7056
6543
|
ALERT_IS_ACTIVE = false;
|
|
7057
|
-
return func.utils.post_back_to_client(
|
|
7058
|
-
SESSION_ID,
|
|
7059
|
-
"alert",
|
|
7060
|
-
_session.worker_id,
|
|
7061
|
-
[SESSION_ID, alert_type, alertDisplay, message, title]
|
|
7062
|
-
);
|
|
6544
|
+
return func.utils.post_back_to_client(SESSION_ID, 'alert', _session.worker_id, [SESSION_ID, alert_type, alertDisplay, message, title]);
|
|
7063
6545
|
}
|
|
7064
6546
|
// const sys_alerts_obj = func.utils.get_system_error_msg();
|
|
7065
6547
|
// if (sys_alerts_obj[paramsP]) {
|
|
@@ -7077,61 +6559,37 @@ func.utils.alerts.invoke = async function (
|
|
|
7077
6559
|
|
|
7078
6560
|
ALERT_IS_ACTIVE = false;
|
|
7079
6561
|
|
|
7080
|
-
func.utils.alerts.execute(
|
|
7081
|
-
SESSION_ID,
|
|
7082
|
-
alert_type,
|
|
7083
|
-
alertDisplay,
|
|
7084
|
-
message,
|
|
7085
|
-
title,
|
|
7086
|
-
type
|
|
7087
|
-
);
|
|
6562
|
+
func.utils.alerts.execute(SESSION_ID, alert_type, alertDisplay, message, title, type);
|
|
7088
6563
|
if (createLog) {
|
|
7089
6564
|
func.utils.write_log(SESSION_ID, title, message, alert_type);
|
|
7090
6565
|
}
|
|
7091
6566
|
};
|
|
7092
|
-
func.utils.alerts.execute = function (
|
|
7093
|
-
SESSION_ID,
|
|
7094
|
-
alert_type,
|
|
7095
|
-
alertDisplay,
|
|
7096
|
-
message,
|
|
7097
|
-
title,
|
|
7098
|
-
type
|
|
7099
|
-
) {
|
|
6567
|
+
func.utils.alerts.execute = function (SESSION_ID, alert_type, alertDisplay, message, title, type) {
|
|
7100
6568
|
if (!UI_FRAMEWORK_INSTALLED) {
|
|
7101
6569
|
ALERT_IS_ACTIVE = false;
|
|
7102
|
-
if (alertDisplay !==
|
|
7103
|
-
return alert(title +
|
|
6570
|
+
if (alertDisplay !== 'console') {
|
|
6571
|
+
return alert(title + '\n \n' + message);
|
|
7104
6572
|
}
|
|
7105
|
-
return console[alert_type ===
|
|
7106
|
-
alert_type,
|
|
7107
|
-
title,
|
|
7108
|
-
message
|
|
7109
|
-
);
|
|
6573
|
+
return console[alert_type === 'error' ? 'error' : 'log'](alert_type, title, message);
|
|
7110
6574
|
}
|
|
7111
6575
|
|
|
7112
6576
|
switch (alertDisplay) {
|
|
7113
|
-
case
|
|
7114
|
-
console[
|
|
7115
|
-
alert_type === "success"
|
|
7116
|
-
? "log"
|
|
7117
|
-
: alert_type === "warning"
|
|
7118
|
-
? "warn"
|
|
7119
|
-
: alert_type
|
|
7120
|
-
](alert_type, title, message);
|
|
6577
|
+
case 'console':
|
|
6578
|
+
console[alert_type === 'success' ? 'log' : alert_type === 'warning' ? 'warn' : alert_type](alert_type, title, message);
|
|
7121
6579
|
ALERT_IS_ACTIVE = false;
|
|
7122
6580
|
break;
|
|
7123
6581
|
|
|
7124
|
-
case
|
|
6582
|
+
case 'modal':
|
|
7125
6583
|
func.utils.alerts.popup(title, message, alert_type);
|
|
7126
6584
|
break;
|
|
7127
6585
|
|
|
7128
|
-
case
|
|
6586
|
+
case 'toast':
|
|
7129
6587
|
func.utils.alerts.toast(SESSION_ID, title, message, alert_type);
|
|
7130
6588
|
ALERT_IS_ACTIVE = false;
|
|
7131
6589
|
break;
|
|
7132
6590
|
|
|
7133
|
-
case
|
|
7134
|
-
alert(title +
|
|
6591
|
+
case 'browser':
|
|
6592
|
+
alert(title + '\n \n' + message);
|
|
7135
6593
|
ALERT_IS_ACTIVE = false;
|
|
7136
6594
|
default:
|
|
7137
6595
|
console.log(alert_type, title, message);
|
|
@@ -7142,16 +6600,7 @@ func.utils.alerts.execute = function (
|
|
|
7142
6600
|
func.utils.alerts.toast = function (SESSION_ID, title, message, alert_type) {
|
|
7143
6601
|
if (!UI_FRAMEWORK_PLUGIN.toast) return;
|
|
7144
6602
|
const toast = new UI_FRAMEWORK_PLUGIN.toast();
|
|
7145
|
-
toast.create(
|
|
7146
|
-
alert_type,
|
|
7147
|
-
message,
|
|
7148
|
-
title,
|
|
7149
|
-
func.common.get_url(
|
|
7150
|
-
SESSION_ID,
|
|
7151
|
-
"dist",
|
|
7152
|
-
`runtime/images/${alert_type}_alert_ico.svg`
|
|
7153
|
-
)
|
|
7154
|
-
);
|
|
6603
|
+
toast.create(alert_type, message, title, func.common.get_url(SESSION_ID, 'dist', `runtime/images/${alert_type}_alert_ico.svg`));
|
|
7155
6604
|
ALERT_IS_ACTIVE = false;
|
|
7156
6605
|
};
|
|
7157
6606
|
func.utils.alerts.popup = function (title, message, alert_type) {
|
|
@@ -7159,8 +6608,8 @@ func.utils.alerts.popup = function (title, message, alert_type) {
|
|
|
7159
6608
|
|
|
7160
6609
|
var buttons = [
|
|
7161
6610
|
{
|
|
7162
|
-
text:
|
|
7163
|
-
role:
|
|
6611
|
+
text: 'Ok',
|
|
6612
|
+
role: 'cancel',
|
|
7164
6613
|
// cssClass: "primary",
|
|
7165
6614
|
handler: () => {
|
|
7166
6615
|
ALERT_IS_ACTIVE = false;
|
|
@@ -7173,536 +6622,536 @@ func.utils.alerts.popup = function (title, message, alert_type) {
|
|
|
7173
6622
|
|
|
7174
6623
|
func.utils.get_system_error_msg = function () {
|
|
7175
6624
|
var m = {};
|
|
7176
|
-
m[
|
|
7177
|
-
alert_type:
|
|
7178
|
-
alertDisplay:
|
|
7179
|
-
subject:
|
|
7180
|
-
msg:
|
|
7181
|
-
};
|
|
7182
|
-
m[
|
|
7183
|
-
alert_type:
|
|
7184
|
-
alertDisplay:
|
|
7185
|
-
subject:
|
|
7186
|
-
msg:
|
|
7187
|
-
};
|
|
7188
|
-
m[
|
|
7189
|
-
alert_type:
|
|
7190
|
-
alertDisplay:
|
|
7191
|
-
subject:
|
|
7192
|
-
msg:
|
|
7193
|
-
};
|
|
7194
|
-
m[
|
|
7195
|
-
alert_type:
|
|
7196
|
-
alertDisplay:
|
|
7197
|
-
subject:
|
|
7198
|
-
msg:
|
|
7199
|
-
};
|
|
7200
|
-
m[
|
|
7201
|
-
alert_type:
|
|
7202
|
-
alertDisplay:
|
|
7203
|
-
subject:
|
|
7204
|
-
msg:
|
|
7205
|
-
};
|
|
7206
|
-
m[
|
|
7207
|
-
alert_type:
|
|
7208
|
-
alertDisplay:
|
|
7209
|
-
subject:
|
|
7210
|
-
msg:
|
|
7211
|
-
};
|
|
7212
|
-
m[
|
|
7213
|
-
alert_type:
|
|
7214
|
-
alertDisplay:
|
|
7215
|
-
subject:
|
|
7216
|
-
msg:
|
|
7217
|
-
};
|
|
7218
|
-
m[
|
|
7219
|
-
alert_type:
|
|
7220
|
-
alertDisplay:
|
|
7221
|
-
subject:
|
|
7222
|
-
msg:
|
|
7223
|
-
};
|
|
7224
|
-
m[
|
|
7225
|
-
alert_type:
|
|
7226
|
-
alertDisplay:
|
|
7227
|
-
subject:
|
|
7228
|
-
msg:
|
|
7229
|
-
};
|
|
7230
|
-
m[
|
|
7231
|
-
alert_type:
|
|
7232
|
-
alertDisplay:
|
|
7233
|
-
subject:
|
|
7234
|
-
msg:
|
|
7235
|
-
};
|
|
7236
|
-
m[
|
|
7237
|
-
alert_type:
|
|
7238
|
-
alertDisplay:
|
|
7239
|
-
subject:
|
|
7240
|
-
msg:
|
|
7241
|
-
};
|
|
7242
|
-
m[
|
|
7243
|
-
alert_type:
|
|
7244
|
-
alertDisplay:
|
|
7245
|
-
subject:
|
|
7246
|
-
msg:
|
|
7247
|
-
};
|
|
7248
|
-
m[
|
|
7249
|
-
alert_type:
|
|
7250
|
-
alertDisplay:
|
|
7251
|
-
subject:
|
|
7252
|
-
msg:
|
|
7253
|
-
};
|
|
7254
|
-
m[
|
|
7255
|
-
alert_type:
|
|
7256
|
-
alertDisplay:
|
|
7257
|
-
subject:
|
|
7258
|
-
msg:
|
|
7259
|
-
};
|
|
7260
|
-
m[
|
|
7261
|
-
alert_type:
|
|
7262
|
-
alertDisplay:
|
|
7263
|
-
subject:
|
|
7264
|
-
msg:
|
|
7265
|
-
};
|
|
7266
|
-
m[
|
|
7267
|
-
alert_type:
|
|
7268
|
-
alertDisplay:
|
|
7269
|
-
subject:
|
|
7270
|
-
msg:
|
|
7271
|
-
};
|
|
7272
|
-
m[
|
|
7273
|
-
alert_type:
|
|
7274
|
-
alertDisplay:
|
|
7275
|
-
subject:
|
|
7276
|
-
msg:
|
|
7277
|
-
};
|
|
7278
|
-
m[
|
|
7279
|
-
alert_type:
|
|
7280
|
-
alertDisplay:
|
|
7281
|
-
subject:
|
|
7282
|
-
msg:
|
|
7283
|
-
};
|
|
7284
|
-
m[
|
|
7285
|
-
alert_type:
|
|
7286
|
-
alertDisplay:
|
|
7287
|
-
subject:
|
|
7288
|
-
msg:
|
|
7289
|
-
};
|
|
7290
|
-
m[
|
|
7291
|
-
alert_type:
|
|
7292
|
-
alertDisplay:
|
|
7293
|
-
subject:
|
|
7294
|
-
msg:
|
|
7295
|
-
};
|
|
7296
|
-
m[
|
|
7297
|
-
alert_type:
|
|
7298
|
-
alertDisplay:
|
|
7299
|
-
subject:
|
|
7300
|
-
msg:
|
|
7301
|
-
};
|
|
7302
|
-
m[
|
|
7303
|
-
alert_type:
|
|
7304
|
-
alertDisplay:
|
|
7305
|
-
subject:
|
|
7306
|
-
msg:
|
|
7307
|
-
};
|
|
7308
|
-
m[
|
|
7309
|
-
alert_type:
|
|
7310
|
-
alertDisplay:
|
|
7311
|
-
subject:
|
|
7312
|
-
msg:
|
|
7313
|
-
};
|
|
7314
|
-
m[
|
|
7315
|
-
alert_type:
|
|
7316
|
-
alertDisplay:
|
|
7317
|
-
subject:
|
|
7318
|
-
msg:
|
|
7319
|
-
};
|
|
7320
|
-
m[
|
|
7321
|
-
alert_type:
|
|
7322
|
-
alertDisplay:
|
|
7323
|
-
subject:
|
|
7324
|
-
msg:
|
|
7325
|
-
};
|
|
7326
|
-
m[
|
|
7327
|
-
alert_type:
|
|
7328
|
-
alertDisplay:
|
|
7329
|
-
subject:
|
|
7330
|
-
msg:
|
|
7331
|
-
};
|
|
7332
|
-
m[
|
|
7333
|
-
alert_type:
|
|
7334
|
-
alertDisplay:
|
|
7335
|
-
subject:
|
|
7336
|
-
msg:
|
|
7337
|
-
};
|
|
7338
|
-
m[
|
|
7339
|
-
alert_type:
|
|
7340
|
-
alertDisplay:
|
|
7341
|
-
subject:
|
|
7342
|
-
msg:
|
|
7343
|
-
};
|
|
7344
|
-
m[
|
|
7345
|
-
alert_type:
|
|
7346
|
-
alertDisplay:
|
|
7347
|
-
subject:
|
|
7348
|
-
msg:
|
|
7349
|
-
};
|
|
7350
|
-
m[
|
|
7351
|
-
alert_type:
|
|
7352
|
-
alertDisplay:
|
|
7353
|
-
subject:
|
|
7354
|
-
msg:
|
|
7355
|
-
};
|
|
7356
|
-
m[
|
|
7357
|
-
alert_type:
|
|
7358
|
-
alertDisplay:
|
|
7359
|
-
subject:
|
|
7360
|
-
msg:
|
|
7361
|
-
};
|
|
7362
|
-
|
|
7363
|
-
m[
|
|
7364
|
-
alert_type:
|
|
7365
|
-
alertDisplay:
|
|
7366
|
-
subject:
|
|
6625
|
+
m['SYS_MSG_0101'] = {
|
|
6626
|
+
alert_type: 'success',
|
|
6627
|
+
alertDisplay: 'toast',
|
|
6628
|
+
subject: 'Save Success',
|
|
6629
|
+
msg: 'Settings successfully saved',
|
|
6630
|
+
};
|
|
6631
|
+
m['SYS_MSG_0102'] = {
|
|
6632
|
+
alert_type: 'error',
|
|
6633
|
+
alertDisplay: 'toast',
|
|
6634
|
+
subject: 'Save Failed CouchDB',
|
|
6635
|
+
msg: 'Data fail save to database',
|
|
6636
|
+
};
|
|
6637
|
+
m['SYS_MSG_0103'] = {
|
|
6638
|
+
alert_type: 'error',
|
|
6639
|
+
alertDisplay: 'toast',
|
|
6640
|
+
subject: 'Save Failed Table Empty',
|
|
6641
|
+
msg: 'Table empty, no fields declared',
|
|
6642
|
+
};
|
|
6643
|
+
m['SYS_MSG_0104'] = {
|
|
6644
|
+
alert_type: 'error',
|
|
6645
|
+
alertDisplay: 'toast',
|
|
6646
|
+
subject: 'Save Failed Missing Primary Index',
|
|
6647
|
+
msg: 'Update failed, table missing Primary index',
|
|
6648
|
+
};
|
|
6649
|
+
m['SYS_MSG_0105'] = {
|
|
6650
|
+
alert_type: 'error',
|
|
6651
|
+
alertDisplay: 'toast',
|
|
6652
|
+
subject: 'Save Failed Table Missing',
|
|
6653
|
+
msg: 'Table repository missing',
|
|
6654
|
+
};
|
|
6655
|
+
m['SYS_MSG_0106'] = {
|
|
6656
|
+
alert_type: 'error',
|
|
6657
|
+
alertDisplay: 'toast',
|
|
6658
|
+
subject: 'Save Failed Record Not Exist',
|
|
6659
|
+
msg: 'Save update failed record not exist',
|
|
6660
|
+
};
|
|
6661
|
+
m['SYS_MSG_0107'] = {
|
|
6662
|
+
alert_type: 'error',
|
|
6663
|
+
alertDisplay: 'modal',
|
|
6664
|
+
subject: 'Save Failed Unique Key',
|
|
6665
|
+
msg: 'Save Failed, record already exist',
|
|
6666
|
+
};
|
|
6667
|
+
m['SYS_MSG_0108'] = {
|
|
6668
|
+
alert_type: 'error',
|
|
6669
|
+
alertDisplay: 'modal',
|
|
6670
|
+
subject: 'Error reading document',
|
|
6671
|
+
msg: 'Save Failed, record not found',
|
|
6672
|
+
};
|
|
6673
|
+
m['SYS_MSG_0110'] = {
|
|
6674
|
+
alert_type: 'warning',
|
|
6675
|
+
alertDisplay: 'toast',
|
|
6676
|
+
subject: 'Record Changed',
|
|
6677
|
+
msg: 'Record changed by other user, reload to get the latest changes',
|
|
6678
|
+
};
|
|
6679
|
+
m['SYS_MSG_0120'] = {
|
|
6680
|
+
alert_type: 'error',
|
|
6681
|
+
alertDisplay: 'modal',
|
|
6682
|
+
subject: 'Create Mode Denied',
|
|
6683
|
+
msg: 'Create mode not allowed for this program',
|
|
6684
|
+
};
|
|
6685
|
+
m['SYS_MSG_0122'] = {
|
|
6686
|
+
alert_type: 'error',
|
|
6687
|
+
alertDisplay: 'modal',
|
|
6688
|
+
subject: 'Modify Mode Denied',
|
|
6689
|
+
msg: 'Modify mode not allowed for this program',
|
|
6690
|
+
};
|
|
6691
|
+
m['SYS_MSG_0124'] = {
|
|
6692
|
+
alert_type: 'error',
|
|
6693
|
+
alertDisplay: 'modal',
|
|
6694
|
+
subject: 'Delete Mode Denied',
|
|
6695
|
+
msg: 'Delete mode not allowed for this program',
|
|
6696
|
+
};
|
|
6697
|
+
m['SYS_MSG_0126'] = {
|
|
6698
|
+
alert_type: 'error',
|
|
6699
|
+
alertDisplay: 'modal',
|
|
6700
|
+
subject: 'Program Read Only',
|
|
6701
|
+
msg: 'Program set to Read Only',
|
|
6702
|
+
};
|
|
6703
|
+
m['SYS_MSG_0130'] = {
|
|
6704
|
+
alert_type: 'error',
|
|
6705
|
+
alertDisplay: 'modal',
|
|
6706
|
+
subject: 'Error Reduce',
|
|
6707
|
+
msg: 'Select Index to Reduce',
|
|
6708
|
+
};
|
|
6709
|
+
m['SYS_MSG_0201'] = {
|
|
6710
|
+
alert_type: 'error',
|
|
6711
|
+
alertDisplay: 'toast',
|
|
6712
|
+
subject: 'Failed to change GUI Property',
|
|
6713
|
+
msg: 'Failed to change GUI element property, GUI element missing',
|
|
6714
|
+
};
|
|
6715
|
+
m['SYS_MSG_0310'] = {
|
|
6716
|
+
alert_type: 'error',
|
|
6717
|
+
alertDisplay: 'toast',
|
|
6718
|
+
subject: 'Missing Reference Parameters Out',
|
|
6719
|
+
msg: 'Parameter out not exist in dataset',
|
|
6720
|
+
};
|
|
6721
|
+
m['SYS_MSG_0400'] = {
|
|
6722
|
+
alert_type: 'error',
|
|
6723
|
+
alertDisplay: 'modal',
|
|
6724
|
+
subject: 'Delete Widget Folder Denied',
|
|
6725
|
+
msg: 'The selected folder contains data, Please clean or move content to another folder',
|
|
6726
|
+
};
|
|
6727
|
+
m['SYS_MSG_0410'] = {
|
|
6728
|
+
alert_type: 'error',
|
|
6729
|
+
alertDisplay: 'toast',
|
|
6730
|
+
subject: 'Recipient Error',
|
|
6731
|
+
msg: 'Check recipient data',
|
|
6732
|
+
};
|
|
6733
|
+
m['SYS_MSG_0412'] = {
|
|
6734
|
+
alert_type: 'error',
|
|
6735
|
+
alertDisplay: 'modal',
|
|
6736
|
+
subject: 'Recipient Empty',
|
|
6737
|
+
msg: 'No recipients entered or selected',
|
|
6738
|
+
};
|
|
6739
|
+
m['SYS_MSG_0414'] = {
|
|
6740
|
+
alert_type: 'error',
|
|
6741
|
+
alertDisplay: 'modal',
|
|
6742
|
+
subject: 'Data Save Error',
|
|
6743
|
+
msg: 'Widget has no content',
|
|
6744
|
+
};
|
|
6745
|
+
m['SYS_MSG_0416'] = {
|
|
6746
|
+
alert_type: 'error',
|
|
6747
|
+
alertDisplay: 'modal',
|
|
6748
|
+
subject: 'Required Field',
|
|
6749
|
+
msg: 'Edit url field is empty',
|
|
6750
|
+
};
|
|
6751
|
+
m['SYS_MSG_0418'] = {
|
|
6752
|
+
alert_type: 'error',
|
|
6753
|
+
alertDisplay: 'modal',
|
|
6754
|
+
subject: 'Required Field',
|
|
6755
|
+
msg: 'Publish url field is empty',
|
|
6756
|
+
};
|
|
6757
|
+
m['SYS_MSG_0420'] = {
|
|
6758
|
+
alert_type: 'error',
|
|
6759
|
+
alertDisplay: 'modal',
|
|
6760
|
+
subject: 'Connection Error',
|
|
6761
|
+
msg: 'Cannot connect to mailbox',
|
|
6762
|
+
};
|
|
6763
|
+
m['SYS_MSG_0422'] = {
|
|
6764
|
+
alert_type: 'success',
|
|
6765
|
+
alertDisplay: 'modal',
|
|
6766
|
+
subject: 'Connection Ok',
|
|
6767
|
+
msg: 'Connection Ok :)',
|
|
6768
|
+
};
|
|
6769
|
+
m['SYS_MSG_0424'] = {
|
|
6770
|
+
alert_type: 'error',
|
|
6771
|
+
alertDisplay: 'modal',
|
|
6772
|
+
subject: 'Connection Failed',
|
|
6773
|
+
msg: 'Connection to POP3 failed',
|
|
6774
|
+
};
|
|
6775
|
+
m['SYS_MSG_0426'] = {
|
|
6776
|
+
alert_type: 'error',
|
|
6777
|
+
alertDisplay: 'modal',
|
|
6778
|
+
subject: 'Connection Failed',
|
|
6779
|
+
msg: 'SMTP Connection error, Test Email was not sent',
|
|
6780
|
+
};
|
|
6781
|
+
m['SYS_MSG_0430'] = {
|
|
6782
|
+
alert_type: 'error',
|
|
6783
|
+
alertDisplay: 'toast',
|
|
6784
|
+
subject: 'Email Account Error',
|
|
6785
|
+
msg: 'No email account found, Right Click Tree -> Settings->Manage Accounts -> Right click for menu options',
|
|
6786
|
+
};
|
|
6787
|
+
m['SYS_MSG_0440'] = {
|
|
6788
|
+
alert_type: 'error',
|
|
6789
|
+
alertDisplay: 'modal',
|
|
6790
|
+
subject: 'Widget Initiation Error',
|
|
6791
|
+
msg: 'Missing information for Link Type or Link Name',
|
|
6792
|
+
};
|
|
6793
|
+
m['SYS_MSG_0442'] = {
|
|
6794
|
+
alert_type: 'error',
|
|
6795
|
+
alertDisplay: 'modal',
|
|
6796
|
+
subject: 'Error Init Widget',
|
|
6797
|
+
msg: 'Missing record Id on Create Mode',
|
|
6798
|
+
};
|
|
6799
|
+
m['SYS_MSG_0450'] = {
|
|
6800
|
+
alert_type: 'error',
|
|
6801
|
+
alertDisplay: 'modal',
|
|
6802
|
+
subject: 'Validation Failed',
|
|
6803
|
+
msg: 'Fix fields highlight in Red',
|
|
6804
|
+
};
|
|
6805
|
+
m['SYS_MSG_0501'] = {
|
|
6806
|
+
alert_type: 'error',
|
|
6807
|
+
alertDisplay: 'modal',
|
|
6808
|
+
subject: 'Mandatory Alert Save',
|
|
6809
|
+
msg: 'Save action failed, Mandatory fields missing',
|
|
6810
|
+
};
|
|
6811
|
+
|
|
6812
|
+
m['SYS_MSG_0550'] = {
|
|
6813
|
+
alert_type: 'error',
|
|
6814
|
+
alertDisplay: 'toast',
|
|
6815
|
+
subject: 'Illegal input number',
|
|
7367
6816
|
msg: "@SYS_GLOBAL_OBJ_ACTIVE_FIELD_INFO.nameform +' only allow numbers!'",
|
|
7368
6817
|
};
|
|
7369
|
-
m[
|
|
7370
|
-
alert_type:
|
|
7371
|
-
alertDisplay:
|
|
7372
|
-
subject:
|
|
7373
|
-
msg:
|
|
7374
|
-
};
|
|
7375
|
-
m[
|
|
7376
|
-
alert_type:
|
|
7377
|
-
alertDisplay:
|
|
7378
|
-
subject:
|
|
7379
|
-
msg:
|
|
7380
|
-
};
|
|
7381
|
-
m[
|
|
7382
|
-
alert_type:
|
|
7383
|
-
alertDisplay:
|
|
7384
|
-
subject:
|
|
7385
|
-
msg:
|
|
7386
|
-
};
|
|
7387
|
-
m[
|
|
7388
|
-
alert_type:
|
|
7389
|
-
alertDisplay:
|
|
7390
|
-
subject:
|
|
7391
|
-
msg:
|
|
7392
|
-
};
|
|
7393
|
-
m[
|
|
7394
|
-
alert_type:
|
|
7395
|
-
alertDisplay:
|
|
7396
|
-
subject:
|
|
6818
|
+
m['SYS_MSG_0610'] = {
|
|
6819
|
+
alert_type: 'error',
|
|
6820
|
+
alertDisplay: 'toast',
|
|
6821
|
+
subject: 'Form Field Conflict',
|
|
6822
|
+
msg: 'Field declared more than once for the form',
|
|
6823
|
+
};
|
|
6824
|
+
m['SYS_MSG_0612'] = {
|
|
6825
|
+
alert_type: 'error',
|
|
6826
|
+
alertDisplay: 'toast',
|
|
6827
|
+
subject: 'Mask Error - Missing Definition',
|
|
6828
|
+
msg: 'Missing mask definition',
|
|
6829
|
+
};
|
|
6830
|
+
m['SYS_MSG_0614'] = {
|
|
6831
|
+
alert_type: 'error',
|
|
6832
|
+
alertDisplay: 'toast',
|
|
6833
|
+
subject: 'Mask Error - Wrong Definition',
|
|
6834
|
+
msg: 'Wrong mask definition',
|
|
6835
|
+
};
|
|
6836
|
+
m['SYS_MSG_0616'] = {
|
|
6837
|
+
alert_type: 'error',
|
|
6838
|
+
alertDisplay: 'toast',
|
|
6839
|
+
subject: 'Mask Error - Size Parser',
|
|
6840
|
+
msg: 'Size parser error',
|
|
6841
|
+
};
|
|
6842
|
+
m['SYS_MSG_0618'] = {
|
|
6843
|
+
alert_type: 'error',
|
|
6844
|
+
alertDisplay: 'toast',
|
|
6845
|
+
subject: 'Mask Error - Illegal Z switch',
|
|
7397
6846
|
msg: "Illegal 'Z' in string mask",
|
|
7398
6847
|
};
|
|
7399
|
-
m[
|
|
7400
|
-
alert_type:
|
|
7401
|
-
alertDisplay:
|
|
7402
|
-
subject:
|
|
6848
|
+
m['SYS_MSG_0620'] = {
|
|
6849
|
+
alert_type: 'error',
|
|
6850
|
+
alertDisplay: 'toast',
|
|
6851
|
+
subject: 'Mask Error - Illegal N switch',
|
|
7403
6852
|
msg: "Illegal 'N' in string mask",
|
|
7404
6853
|
};
|
|
7405
|
-
m[
|
|
7406
|
-
alert_type:
|
|
7407
|
-
alertDisplay:
|
|
7408
|
-
subject:
|
|
6854
|
+
m['SYS_MSG_0622'] = {
|
|
6855
|
+
alert_type: 'error',
|
|
6856
|
+
alertDisplay: 'toast',
|
|
6857
|
+
subject: 'Mask Error - Illegal + switch',
|
|
7409
6858
|
msg: "Illegal '+' in string mask",
|
|
7410
6859
|
};
|
|
7411
|
-
m[
|
|
7412
|
-
alert_type:
|
|
7413
|
-
alertDisplay:
|
|
7414
|
-
subject:
|
|
6860
|
+
m['SYS_MSG_0624'] = {
|
|
6861
|
+
alert_type: 'error',
|
|
6862
|
+
alertDisplay: 'toast',
|
|
6863
|
+
subject: 'Mask Error - Illegal - switch',
|
|
7415
6864
|
msg: "Illegal '-' in string mask",
|
|
7416
6865
|
};
|
|
7417
|
-
m[
|
|
7418
|
-
alert_type:
|
|
7419
|
-
alertDisplay:
|
|
7420
|
-
subject:
|
|
6866
|
+
m['SYS_MSG_0626'] = {
|
|
6867
|
+
alert_type: 'error',
|
|
6868
|
+
alertDisplay: 'toast',
|
|
6869
|
+
subject: 'Mask Error - Illegal C switch',
|
|
7421
6870
|
msg: "Illegal 'C' in string mask",
|
|
7422
6871
|
};
|
|
7423
|
-
m[
|
|
7424
|
-
alert_type:
|
|
7425
|
-
alertDisplay:
|
|
7426
|
-
subject:
|
|
7427
|
-
msg:
|
|
7428
|
-
};
|
|
7429
|
-
m[
|
|
7430
|
-
alert_type:
|
|
7431
|
-
alertDisplay:
|
|
7432
|
-
subject:
|
|
7433
|
-
msg:
|
|
7434
|
-
};
|
|
7435
|
-
m[
|
|
7436
|
-
alert_type:
|
|
7437
|
-
alertDisplay:
|
|
7438
|
-
subject:
|
|
7439
|
-
msg:
|
|
7440
|
-
};
|
|
7441
|
-
m[
|
|
7442
|
-
alert_type:
|
|
7443
|
-
alertDisplay:
|
|
7444
|
-
subject:
|
|
7445
|
-
msg:
|
|
7446
|
-
};
|
|
7447
|
-
m[
|
|
7448
|
-
alert_type:
|
|
7449
|
-
alertDisplay:
|
|
7450
|
-
subject:
|
|
7451
|
-
msg:
|
|
7452
|
-
};
|
|
7453
|
-
m[
|
|
7454
|
-
alert_type:
|
|
7455
|
-
alertDisplay:
|
|
7456
|
-
subject:
|
|
7457
|
-
msg:
|
|
7458
|
-
};
|
|
7459
|
-
m[
|
|
7460
|
-
alert_type:
|
|
7461
|
-
alertDisplay:
|
|
7462
|
-
subject:
|
|
7463
|
-
msg:
|
|
7464
|
-
};
|
|
7465
|
-
m[
|
|
7466
|
-
alert_type:
|
|
7467
|
-
alertDisplay:
|
|
7468
|
-
subject:
|
|
7469
|
-
msg:
|
|
7470
|
-
};
|
|
7471
|
-
m[
|
|
7472
|
-
alert_type:
|
|
7473
|
-
alertDisplay:
|
|
7474
|
-
subject:
|
|
7475
|
-
msg:
|
|
7476
|
-
};
|
|
7477
|
-
m[
|
|
7478
|
-
alert_type:
|
|
7479
|
-
alertDisplay:
|
|
7480
|
-
subject:
|
|
7481
|
-
msg:
|
|
7482
|
-
};
|
|
7483
|
-
m[
|
|
7484
|
-
alert_type:
|
|
7485
|
-
alertDisplay:
|
|
7486
|
-
subject:
|
|
7487
|
-
msg:
|
|
7488
|
-
};
|
|
7489
|
-
m[
|
|
7490
|
-
alert_type:
|
|
7491
|
-
alertDisplay:
|
|
7492
|
-
subject:
|
|
7493
|
-
msg:
|
|
7494
|
-
};
|
|
7495
|
-
m[
|
|
7496
|
-
alert_type:
|
|
7497
|
-
alertDisplay:
|
|
7498
|
-
subject:
|
|
7499
|
-
msg:
|
|
7500
|
-
};
|
|
7501
|
-
m[
|
|
7502
|
-
alert_type:
|
|
7503
|
-
alertDisplay:
|
|
7504
|
-
subject:
|
|
7505
|
-
msg:
|
|
7506
|
-
};
|
|
7507
|
-
m[
|
|
7508
|
-
alert_type:
|
|
7509
|
-
alertDisplay:
|
|
7510
|
-
subject:
|
|
7511
|
-
msg:
|
|
7512
|
-
};
|
|
7513
|
-
m[
|
|
7514
|
-
alert_type:
|
|
7515
|
-
alertDisplay:
|
|
7516
|
-
subject:
|
|
7517
|
-
msg:
|
|
7518
|
-
};
|
|
7519
|
-
m[
|
|
7520
|
-
alert_type:
|
|
7521
|
-
alertDisplay:
|
|
7522
|
-
subject:
|
|
7523
|
-
msg:
|
|
7524
|
-
};
|
|
7525
|
-
m[
|
|
7526
|
-
alert_type:
|
|
7527
|
-
alertDisplay:
|
|
7528
|
-
subject:
|
|
7529
|
-
msg:
|
|
7530
|
-
};
|
|
7531
|
-
m[
|
|
7532
|
-
alert_type:
|
|
7533
|
-
alertDisplay:
|
|
7534
|
-
subject:
|
|
7535
|
-
msg:
|
|
7536
|
-
};
|
|
7537
|
-
m[
|
|
7538
|
-
alert_type:
|
|
7539
|
-
alertDisplay:
|
|
7540
|
-
subject:
|
|
7541
|
-
msg:
|
|
7542
|
-
};
|
|
7543
|
-
m[
|
|
7544
|
-
alert_type:
|
|
7545
|
-
alertDisplay:
|
|
7546
|
-
subject:
|
|
7547
|
-
msg:
|
|
7548
|
-
};
|
|
7549
|
-
m[
|
|
7550
|
-
alert_type:
|
|
7551
|
-
alertDisplay:
|
|
7552
|
-
subject:
|
|
7553
|
-
msg:
|
|
7554
|
-
};
|
|
7555
|
-
m[
|
|
7556
|
-
alert_type:
|
|
7557
|
-
alertDisplay:
|
|
7558
|
-
subject:
|
|
7559
|
-
msg:
|
|
7560
|
-
};
|
|
7561
|
-
m[
|
|
7562
|
-
alert_type:
|
|
7563
|
-
alertDisplay:
|
|
7564
|
-
subject:
|
|
7565
|
-
msg:
|
|
7566
|
-
};
|
|
7567
|
-
m[
|
|
7568
|
-
alert_type:
|
|
7569
|
-
alertDisplay:
|
|
7570
|
-
subject:
|
|
7571
|
-
msg:
|
|
7572
|
-
};
|
|
7573
|
-
m[
|
|
7574
|
-
alert_type:
|
|
7575
|
-
alertDisplay:
|
|
7576
|
-
subject:
|
|
7577
|
-
msg:
|
|
7578
|
-
};
|
|
7579
|
-
m[
|
|
7580
|
-
alert_type:
|
|
7581
|
-
alertDisplay:
|
|
7582
|
-
subject:
|
|
7583
|
-
msg:
|
|
7584
|
-
};
|
|
7585
|
-
m[
|
|
7586
|
-
alert_type:
|
|
7587
|
-
alertDisplay:
|
|
7588
|
-
subject:
|
|
7589
|
-
msg:
|
|
7590
|
-
};
|
|
7591
|
-
m[
|
|
7592
|
-
alert_type:
|
|
7593
|
-
alertDisplay:
|
|
7594
|
-
subject:
|
|
7595
|
-
msg:
|
|
7596
|
-
};
|
|
7597
|
-
m[
|
|
7598
|
-
alert_type:
|
|
7599
|
-
alertDisplay:
|
|
7600
|
-
subject:
|
|
7601
|
-
msg:
|
|
7602
|
-
};
|
|
7603
|
-
m[
|
|
7604
|
-
alert_type:
|
|
7605
|
-
alertDisplay:
|
|
7606
|
-
subject:
|
|
7607
|
-
msg:
|
|
7608
|
-
};
|
|
7609
|
-
m[
|
|
7610
|
-
alert_type:
|
|
7611
|
-
alertDisplay:
|
|
7612
|
-
subject:
|
|
7613
|
-
msg:
|
|
7614
|
-
};
|
|
7615
|
-
m[
|
|
7616
|
-
alert_type:
|
|
7617
|
-
alertDisplay:
|
|
7618
|
-
subject:
|
|
7619
|
-
msg:
|
|
7620
|
-
};
|
|
7621
|
-
m[
|
|
7622
|
-
alert_type:
|
|
7623
|
-
alertDisplay:
|
|
7624
|
-
subject:
|
|
7625
|
-
msg:
|
|
7626
|
-
};
|
|
7627
|
-
m[
|
|
7628
|
-
alert_type:
|
|
7629
|
-
alertDisplay:
|
|
7630
|
-
subject:
|
|
7631
|
-
msg:
|
|
7632
|
-
};
|
|
7633
|
-
m[
|
|
7634
|
-
alert_type:
|
|
7635
|
-
alertDisplay:
|
|
7636
|
-
subject:
|
|
7637
|
-
msg:
|
|
7638
|
-
};
|
|
7639
|
-
m[
|
|
7640
|
-
alert_type:
|
|
7641
|
-
alertDisplay:
|
|
7642
|
-
subject:
|
|
7643
|
-
msg:
|
|
7644
|
-
};
|
|
7645
|
-
m[
|
|
7646
|
-
alert_type:
|
|
7647
|
-
alertDisplay:
|
|
7648
|
-
subject:
|
|
7649
|
-
msg:
|
|
7650
|
-
};
|
|
7651
|
-
m[
|
|
7652
|
-
alert_type:
|
|
7653
|
-
alertDisplay:
|
|
7654
|
-
subject:
|
|
7655
|
-
msg:
|
|
7656
|
-
};
|
|
7657
|
-
m[
|
|
7658
|
-
alert_type:
|
|
7659
|
-
alertDisplay:
|
|
7660
|
-
subject:
|
|
7661
|
-
msg:
|
|
7662
|
-
};
|
|
7663
|
-
m[
|
|
7664
|
-
alert_type:
|
|
7665
|
-
alertDisplay:
|
|
7666
|
-
subject:
|
|
7667
|
-
msg:
|
|
7668
|
-
};
|
|
7669
|
-
m[
|
|
7670
|
-
alert_type:
|
|
7671
|
-
alertDisplay:
|
|
7672
|
-
subject:
|
|
7673
|
-
msg:
|
|
7674
|
-
};
|
|
7675
|
-
|
|
7676
|
-
m[
|
|
7677
|
-
alert_type:
|
|
7678
|
-
alertDisplay:
|
|
7679
|
-
subject:
|
|
7680
|
-
msg:
|
|
7681
|
-
};
|
|
7682
|
-
m[
|
|
7683
|
-
alert_type:
|
|
7684
|
-
alertDisplay:
|
|
7685
|
-
subject:
|
|
7686
|
-
msg:
|
|
7687
|
-
};
|
|
7688
|
-
|
|
7689
|
-
m[
|
|
7690
|
-
alert_type:
|
|
7691
|
-
alertDisplay:
|
|
7692
|
-
subject:
|
|
7693
|
-
msg:
|
|
7694
|
-
};
|
|
7695
|
-
m[
|
|
7696
|
-
alert_type:
|
|
7697
|
-
alertDisplay:
|
|
7698
|
-
subject:
|
|
7699
|
-
msg:
|
|
7700
|
-
};
|
|
7701
|
-
m[
|
|
7702
|
-
alert_type:
|
|
7703
|
-
alertDisplay:
|
|
7704
|
-
subject:
|
|
7705
|
-
msg:
|
|
6872
|
+
m['SYS_MSG_0628'] = {
|
|
6873
|
+
alert_type: 'error',
|
|
6874
|
+
alertDisplay: 'toast',
|
|
6875
|
+
subject: 'Mask Error - Invalid switch',
|
|
6876
|
+
msg: 'Invalid switch in string mask',
|
|
6877
|
+
};
|
|
6878
|
+
m['SYS_MSG_0630'] = {
|
|
6879
|
+
alert_type: 'error',
|
|
6880
|
+
alertDisplay: 'toast',
|
|
6881
|
+
subject: 'Mask Error - Missing DOM Element',
|
|
6882
|
+
msg: 'Missing DOM element',
|
|
6883
|
+
};
|
|
6884
|
+
m['SYS_MSG_0632'] = {
|
|
6885
|
+
alert_type: 'error',
|
|
6886
|
+
alertDisplay: 'toast',
|
|
6887
|
+
subject: 'Mask Error - Too Big',
|
|
6888
|
+
msg: 'Size to big, max: 15.5',
|
|
6889
|
+
};
|
|
6890
|
+
m['SYS_MSG_0700'] = {
|
|
6891
|
+
alert_type: 'warning',
|
|
6892
|
+
alertDisplay: 'console',
|
|
6893
|
+
subject: 'Table Warning - Empty',
|
|
6894
|
+
msg: 'Table has no content',
|
|
6895
|
+
};
|
|
6896
|
+
m['SYS_MSG_0702'] = {
|
|
6897
|
+
alert_type: 'error',
|
|
6898
|
+
alertDisplay: 'console',
|
|
6899
|
+
subject: 'Table Error - No Fields',
|
|
6900
|
+
msg: 'Table missing fields content',
|
|
6901
|
+
};
|
|
6902
|
+
m['SYS_MSG_0704'] = {
|
|
6903
|
+
alert_type: 'warning',
|
|
6904
|
+
alertDisplay: 'console',
|
|
6905
|
+
subject: 'Table Warning - Not In Use',
|
|
6906
|
+
msg: 'Table not in use by any object',
|
|
6907
|
+
};
|
|
6908
|
+
m['SYS_MSG_0706'] = {
|
|
6909
|
+
alert_type: 'error',
|
|
6910
|
+
alertDisplay: 'console',
|
|
6911
|
+
subject: 'Table Error - No Primary Index',
|
|
6912
|
+
msg: 'Table must have at least one index',
|
|
6913
|
+
};
|
|
6914
|
+
m['SYS_MSG_0708'] = {
|
|
6915
|
+
alert_type: 'error',
|
|
6916
|
+
alertDisplay: 'console',
|
|
6917
|
+
subject: 'Table Error - Bad Index Name',
|
|
6918
|
+
msg: 'Index name is invalid or cannot contain any of non word characters',
|
|
6919
|
+
};
|
|
6920
|
+
m['SYS_MSG_0710'] = {
|
|
6921
|
+
alert_type: 'error',
|
|
6922
|
+
alertDisplay: 'console',
|
|
6923
|
+
subject: 'Table Error - Empty Index',
|
|
6924
|
+
msg: 'Index has no keys',
|
|
6925
|
+
};
|
|
6926
|
+
m['SYS_MSG_0712'] = {
|
|
6927
|
+
alert_type: 'error',
|
|
6928
|
+
alertDisplay: 'console',
|
|
6929
|
+
subject: 'Table Error - Key Not Exist',
|
|
6930
|
+
msg: 'Key not exist in the table fields repository',
|
|
6931
|
+
};
|
|
6932
|
+
m['SYS_MSG_0714'] = {
|
|
6933
|
+
alert_type: 'error',
|
|
6934
|
+
alertDisplay: 'console',
|
|
6935
|
+
subject: 'Table Error - Duplicate Fields',
|
|
6936
|
+
msg: 'Duplicate fields in the table fields repository',
|
|
6937
|
+
};
|
|
6938
|
+
m['SYS_MSG_0716'] = {
|
|
6939
|
+
alert_type: 'error',
|
|
6940
|
+
alertDisplay: 'console',
|
|
6941
|
+
subject: 'Table Error - Bad Field Name',
|
|
6942
|
+
msg: 'Field name is invalid or cannot contain any of non word characters',
|
|
6943
|
+
};
|
|
6944
|
+
m['SYS_MSG_0718'] = {
|
|
6945
|
+
alert_type: 'error',
|
|
6946
|
+
alertDisplay: 'console',
|
|
6947
|
+
subject: 'Table Error - Integrity Broken',
|
|
6948
|
+
msg: 'Field broken from its properties, edit the field and save',
|
|
6949
|
+
};
|
|
6950
|
+
m['SYS_MSG_0720'] = {
|
|
6951
|
+
alert_type: 'error',
|
|
6952
|
+
alertDisplay: 'console',
|
|
6953
|
+
subject: 'Table Error - Model Not Exist',
|
|
6954
|
+
msg: 'Model assigned to the field not exist',
|
|
6955
|
+
};
|
|
6956
|
+
m['SYS_MSG_0722'] = {
|
|
6957
|
+
alert_type: 'warning',
|
|
6958
|
+
alertDisplay: 'console',
|
|
6959
|
+
subject: 'Object Warning - Not In Use',
|
|
6960
|
+
msg: 'Object not in use or not call by any object',
|
|
6961
|
+
};
|
|
6962
|
+
m['SYS_MSG_0724'] = {
|
|
6963
|
+
alert_type: 'error',
|
|
6964
|
+
alertDisplay: 'console',
|
|
6965
|
+
subject: 'Object Error - Table Not Exist',
|
|
6966
|
+
msg: 'Table assigned in object datasource not exist',
|
|
6967
|
+
};
|
|
6968
|
+
m['SYS_MSG_0726'] = {
|
|
6969
|
+
alert_type: 'error',
|
|
6970
|
+
alertDisplay: 'console',
|
|
6971
|
+
subject: 'Object Error - Index Keys Mismatch',
|
|
6972
|
+
msg: 'Table index has different structure',
|
|
6973
|
+
};
|
|
6974
|
+
m['SYS_MSG_0728'] = {
|
|
6975
|
+
alert_type: 'error',
|
|
6976
|
+
alertDisplay: 'console',
|
|
6977
|
+
subject: 'Object Error - Index Key From Empty',
|
|
6978
|
+
msg: 'Index key From must have a value',
|
|
6979
|
+
};
|
|
6980
|
+
m['SYS_MSG_0730'] = {
|
|
6981
|
+
alert_type: 'error',
|
|
6982
|
+
alertDisplay: 'console',
|
|
6983
|
+
subject: 'Object Error - Index Key From Reference',
|
|
6984
|
+
msg: 'Field reference not exist in any dataset or parameters',
|
|
6985
|
+
};
|
|
6986
|
+
m['SYS_MSG_0732'] = {
|
|
6987
|
+
alert_type: 'error',
|
|
6988
|
+
alertDisplay: 'console',
|
|
6989
|
+
subject: 'Object Error - Index Key To Empty',
|
|
6990
|
+
msg: 'Index key To must have a value',
|
|
6991
|
+
};
|
|
6992
|
+
m['SYS_MSG_0734'] = {
|
|
6993
|
+
alert_type: 'error',
|
|
6994
|
+
alertDisplay: 'console',
|
|
6995
|
+
subject: 'Object Error - Index Key To Reference',
|
|
6996
|
+
msg: 'Field reference not exist in any dataset or parameters',
|
|
6997
|
+
};
|
|
6998
|
+
m['SYS_MSG_0736'] = {
|
|
6999
|
+
alert_type: 'error',
|
|
7000
|
+
alertDisplay: 'console',
|
|
7001
|
+
subject: 'Object Error - Index Locate From Reference',
|
|
7002
|
+
msg: 'Field reference not exist in any dataset or parameters',
|
|
7003
|
+
};
|
|
7004
|
+
m['SYS_MSG_0738'] = {
|
|
7005
|
+
alert_type: 'error',
|
|
7006
|
+
alertDisplay: 'console',
|
|
7007
|
+
subject: 'Object Error - Index Locate To Reference',
|
|
7008
|
+
msg: 'Field reference not exist in any dataset or parameters',
|
|
7009
|
+
};
|
|
7010
|
+
m['SYS_MSG_0740'] = {
|
|
7011
|
+
alert_type: 'error',
|
|
7012
|
+
alertDisplay: 'console',
|
|
7013
|
+
subject: 'Object Error - Index Empty',
|
|
7014
|
+
msg: 'Index empty - no keys defined',
|
|
7015
|
+
};
|
|
7016
|
+
m['SYS_MSG_0742'] = {
|
|
7017
|
+
alert_type: 'error',
|
|
7018
|
+
alertDisplay: 'console',
|
|
7019
|
+
subject: 'Object Error - Index Reference',
|
|
7020
|
+
msg: 'Table index reference error',
|
|
7021
|
+
};
|
|
7022
|
+
m['SYS_MSG_0744'] = {
|
|
7023
|
+
alert_type: 'error',
|
|
7024
|
+
alertDisplay: 'console',
|
|
7025
|
+
subject: 'Object Error - Duplicate Fields',
|
|
7026
|
+
msg: 'Duplicate fields in the dataset fields repository',
|
|
7027
|
+
};
|
|
7028
|
+
m['SYS_MSG_0746'] = {
|
|
7029
|
+
alert_type: 'error',
|
|
7030
|
+
alertDisplay: 'console',
|
|
7031
|
+
subject: 'Object Error - Field reference error',
|
|
7032
|
+
msg: 'Field not exist in datasource table fields repository',
|
|
7033
|
+
};
|
|
7034
|
+
m['SYS_MSG_0748'] = {
|
|
7035
|
+
alert_type: 'error',
|
|
7036
|
+
alertDisplay: 'console',
|
|
7037
|
+
subject: 'Object Error - Mismatch Reference Type',
|
|
7038
|
+
msg: 'Mismatch in calling reference type',
|
|
7039
|
+
};
|
|
7040
|
+
m['SYS_MSG_0750'] = {
|
|
7041
|
+
alert_type: 'error',
|
|
7042
|
+
alertDisplay: 'console',
|
|
7043
|
+
subject: 'Object Error - Reference Broken',
|
|
7044
|
+
msg: 'Reference broken calling object not exist',
|
|
7045
|
+
};
|
|
7046
|
+
m['SYS_MSG_0752'] = {
|
|
7047
|
+
alert_type: 'error',
|
|
7048
|
+
alertDisplay: 'console',
|
|
7049
|
+
subject: 'Object Error - Empty Reference',
|
|
7050
|
+
msg: 'Reference empty',
|
|
7051
|
+
};
|
|
7052
|
+
m['SYS_MSG_0754'] = {
|
|
7053
|
+
alert_type: 'error',
|
|
7054
|
+
alertDisplay: 'console',
|
|
7055
|
+
subject: 'Object Error - Action Not Exist',
|
|
7056
|
+
msg: 'Action not exist',
|
|
7057
|
+
};
|
|
7058
|
+
m['SYS_MSG_0756'] = {
|
|
7059
|
+
alert_type: 'error',
|
|
7060
|
+
alertDisplay: 'console',
|
|
7061
|
+
subject: 'Object Error - Empty Event Reference',
|
|
7062
|
+
msg: 'Empty event reference',
|
|
7063
|
+
};
|
|
7064
|
+
m['SYS_MSG_0758'] = {
|
|
7065
|
+
alert_type: 'error',
|
|
7066
|
+
alertDisplay: 'console',
|
|
7067
|
+
subject: 'Object Error - Bad Field Name',
|
|
7068
|
+
msg: 'Field name is invalid or cannot contain any of non word characters',
|
|
7069
|
+
};
|
|
7070
|
+
m['SYS_MSG_0760'] = {
|
|
7071
|
+
alert_type: 'error',
|
|
7072
|
+
alertDisplay: 'console',
|
|
7073
|
+
subject: 'Object Error - Integrity Broken',
|
|
7074
|
+
msg: 'Field broken from its properties, edit the object and save',
|
|
7075
|
+
};
|
|
7076
|
+
m['SYS_MSG_0762'] = {
|
|
7077
|
+
alert_type: 'error',
|
|
7078
|
+
alertDisplay: 'console',
|
|
7079
|
+
subject: 'Object Error - Model Not Exist',
|
|
7080
|
+
msg: 'Model assigned to the field not exist',
|
|
7081
|
+
};
|
|
7082
|
+
m['SYS_MSG_0764'] = {
|
|
7083
|
+
alert_type: 'error',
|
|
7084
|
+
alertDisplay: 'console',
|
|
7085
|
+
subject: 'Object Error - Empty Dataset',
|
|
7086
|
+
msg: 'Dataset empty from fields',
|
|
7087
|
+
};
|
|
7088
|
+
m['SYS_MSG_0766'] = {
|
|
7089
|
+
alert_type: 'error',
|
|
7090
|
+
alertDisplay: 'console',
|
|
7091
|
+
subject: 'Object Error - Field Type Mismatch',
|
|
7092
|
+
msg: 'Field type not match to the underlined table field definition',
|
|
7093
|
+
};
|
|
7094
|
+
m['SYS_MSG_0768'] = {
|
|
7095
|
+
alert_type: 'error',
|
|
7096
|
+
alertDisplay: 'console',
|
|
7097
|
+
subject: 'Object Error - Field Mask Mismatch',
|
|
7098
|
+
msg: 'Field masks not match to the underlined table field definition',
|
|
7099
|
+
};
|
|
7100
|
+
m['SYS_MSG_0770'] = {
|
|
7101
|
+
alert_type: 'error',
|
|
7102
|
+
alertDisplay: 'console',
|
|
7103
|
+
subject: 'Object Error - Bad Event Name',
|
|
7104
|
+
msg: 'Event name is invalid or cannot contain any of non word characters',
|
|
7105
|
+
};
|
|
7106
|
+
m['SYS_MSG_0772'] = {
|
|
7107
|
+
alert_type: 'error',
|
|
7108
|
+
alertDisplay: 'console',
|
|
7109
|
+
subject: 'Object Error - UI Field Not Exist',
|
|
7110
|
+
msg: 'UI Field not exist in the dataset repository',
|
|
7111
|
+
};
|
|
7112
|
+
m['SYS_MSG_0774'] = {
|
|
7113
|
+
alert_type: 'error',
|
|
7114
|
+
alertDisplay: 'console',
|
|
7115
|
+
subject: 'Object Error - UI Field Reference Broken',
|
|
7116
|
+
msg: 'UI Field reference broken',
|
|
7117
|
+
};
|
|
7118
|
+
m['SYS_MSG_0780'] = {
|
|
7119
|
+
alert_type: 'error',
|
|
7120
|
+
alertDisplay: 'toast',
|
|
7121
|
+
subject: 'UI element error',
|
|
7122
|
+
msg: 'UI element not exist',
|
|
7123
|
+
};
|
|
7124
|
+
|
|
7125
|
+
m['SYS_MSG_1210'] = {
|
|
7126
|
+
alert_type: 'error',
|
|
7127
|
+
alertDisplay: 'modal',
|
|
7128
|
+
subject: 'Program error',
|
|
7129
|
+
msg: 'Program not exist',
|
|
7130
|
+
};
|
|
7131
|
+
m['SYS_MSG_1220'] = {
|
|
7132
|
+
alert_type: 'error',
|
|
7133
|
+
alertDisplay: 'modal',
|
|
7134
|
+
subject: 'Program error',
|
|
7135
|
+
msg: 'Non grid output defined',
|
|
7136
|
+
};
|
|
7137
|
+
|
|
7138
|
+
m['SYS_MSG_1240'] = {
|
|
7139
|
+
alert_type: 'error',
|
|
7140
|
+
alertDisplay: 'toast',
|
|
7141
|
+
subject: 'Debug error',
|
|
7142
|
+
msg: '',
|
|
7143
|
+
};
|
|
7144
|
+
m['SYS_MSG_1250'] = {
|
|
7145
|
+
alert_type: 'error',
|
|
7146
|
+
alertDisplay: 'toast',
|
|
7147
|
+
subject: 'Debug log error',
|
|
7148
|
+
msg: '',
|
|
7149
|
+
};
|
|
7150
|
+
m['SYS_MSG_1260'] = {
|
|
7151
|
+
alert_type: 'error',
|
|
7152
|
+
alertDisplay: 'toast',
|
|
7153
|
+
subject: 'Session Expired',
|
|
7154
|
+
msg: 'Renew token session in Studio',
|
|
7706
7155
|
};
|
|
7707
7156
|
return m;
|
|
7708
7157
|
};
|
|
@@ -7718,15 +7167,15 @@ func.utils.find_key_in_ViewUITreeObj = function (arr, key, val) {
|
|
|
7718
7167
|
func.utils.get_plugin_setup = function (SESSION_ID, plugin_name) {
|
|
7719
7168
|
const report_error = function (descP, warn) {
|
|
7720
7169
|
func.utils.debug.log(SESSION_ID, plugin_name, {
|
|
7721
|
-
module:
|
|
7722
|
-
action:
|
|
7723
|
-
source:
|
|
7170
|
+
module: 'plugin',
|
|
7171
|
+
action: 'Init',
|
|
7172
|
+
source: 'get_plugin_setup',
|
|
7724
7173
|
prop: descP,
|
|
7725
7174
|
details: descP,
|
|
7726
7175
|
result: null,
|
|
7727
7176
|
error: warn ? false : true,
|
|
7728
7177
|
fields: null,
|
|
7729
|
-
type:
|
|
7178
|
+
type: 'plugin',
|
|
7730
7179
|
});
|
|
7731
7180
|
};
|
|
7732
7181
|
|
|
@@ -7739,28 +7188,25 @@ func.utils.get_plugin_setup = function (SESSION_ID, plugin_name) {
|
|
|
7739
7188
|
return resolve(ret.data);
|
|
7740
7189
|
} catch (err) {
|
|
7741
7190
|
// cache not found
|
|
7742
|
-
const json = await func.common.db(SESSION_ID,
|
|
7191
|
+
const json = await func.common.db(SESSION_ID, 'get_plugin_setup', {
|
|
7743
7192
|
plugin_name,
|
|
7744
7193
|
});
|
|
7745
7194
|
if (json.code < 0) {
|
|
7746
|
-
report_error(
|
|
7747
|
-
"Error: " + json.data,
|
|
7748
|
-
json.error_type === "W" ? true : false
|
|
7749
|
-
);
|
|
7195
|
+
report_error('Error: ' + json.data, json.error_type === 'W' ? true : false);
|
|
7750
7196
|
}
|
|
7751
7197
|
resolve(json);
|
|
7752
7198
|
|
|
7753
7199
|
var doc = {
|
|
7754
7200
|
_id: `cache_plugin_setup_${plugin_name}`,
|
|
7755
7201
|
data: json,
|
|
7756
|
-
docType:
|
|
7202
|
+
docType: 'cache_plugin',
|
|
7757
7203
|
};
|
|
7758
7204
|
db.put(doc);
|
|
7759
7205
|
}
|
|
7760
7206
|
} catch (e) {
|
|
7761
7207
|
console.error(e);
|
|
7762
7208
|
|
|
7763
|
-
report_error(
|
|
7209
|
+
report_error('Error: ' + e.msg, e.error_type === 'W' ? true : false);
|
|
7764
7210
|
resolve(e.msg);
|
|
7765
7211
|
}
|
|
7766
7212
|
});
|
|
@@ -7768,7 +7214,7 @@ func.utils.get_plugin_setup = function (SESSION_ID, plugin_name) {
|
|
|
7768
7214
|
|
|
7769
7215
|
func.utils.connect_pouchdb = async function (SESSION_ID) {
|
|
7770
7216
|
const app_id = SESSION_OBJ[SESSION_ID].app_id;
|
|
7771
|
-
return new PouchDB(
|
|
7217
|
+
return new PouchDB('xuda_rt_' + app_id);
|
|
7772
7218
|
};
|
|
7773
7219
|
|
|
7774
7220
|
// func.utils.validate_pouchdb = async function (SESSION_ID) {
|
|
@@ -7798,15 +7244,15 @@ func.utils.call_plugin_api = function (SESSION_ID, plugin_nameP, dataP) {
|
|
|
7798
7244
|
|
|
7799
7245
|
const report_error = function (descP, warn) {
|
|
7800
7246
|
func.utils.debug.log(SESSION_ID, plugin_nameP, {
|
|
7801
|
-
module:
|
|
7802
|
-
action:
|
|
7803
|
-
source:
|
|
7247
|
+
module: 'plugin',
|
|
7248
|
+
action: 'Init',
|
|
7249
|
+
source: 'call_plugin_api',
|
|
7804
7250
|
prop: descP,
|
|
7805
7251
|
details: descP,
|
|
7806
7252
|
result: null,
|
|
7807
7253
|
error: warn ? false : true,
|
|
7808
7254
|
fields: null,
|
|
7809
|
-
type:
|
|
7255
|
+
type: 'plugin',
|
|
7810
7256
|
});
|
|
7811
7257
|
};
|
|
7812
7258
|
return new Promise(async (resolve) => {
|
|
@@ -7821,10 +7267,10 @@ func.utils.call_plugin_api = function (SESSION_ID, plugin_nameP, dataP) {
|
|
|
7821
7267
|
data = _.assignIn(data, dataP);
|
|
7822
7268
|
|
|
7823
7269
|
fetch(`https://xuda.io/ppi/${plugin_nameP}`, {
|
|
7824
|
-
method:
|
|
7270
|
+
method: 'POST',
|
|
7825
7271
|
headers: {
|
|
7826
|
-
Accept:
|
|
7827
|
-
|
|
7272
|
+
Accept: 'application/json',
|
|
7273
|
+
'Content-Type': 'application/json',
|
|
7828
7274
|
},
|
|
7829
7275
|
body: JSON.stringify(data),
|
|
7830
7276
|
})
|
|
@@ -7838,10 +7284,7 @@ func.utils.call_plugin_api = function (SESSION_ID, plugin_nameP, dataP) {
|
|
|
7838
7284
|
})
|
|
7839
7285
|
.then((json) => {
|
|
7840
7286
|
if (json.code < 0) {
|
|
7841
|
-
report_error(
|
|
7842
|
-
"Error: " + json.data,
|
|
7843
|
-
json.error_type === "W" ? true : false
|
|
7844
|
-
);
|
|
7287
|
+
report_error('Error: ' + json.data, json.error_type === 'W' ? true : false);
|
|
7845
7288
|
}
|
|
7846
7289
|
resolve(json.data);
|
|
7847
7290
|
|
|
@@ -7853,25 +7296,21 @@ func.utils.call_plugin_api = function (SESSION_ID, plugin_nameP, dataP) {
|
|
|
7853
7296
|
// db.put(doc);
|
|
7854
7297
|
})
|
|
7855
7298
|
.catch((err) => {
|
|
7856
|
-
report_error(
|
|
7299
|
+
report_error('Error: ' + err.message);
|
|
7857
7300
|
resolve(err.message);
|
|
7858
7301
|
});
|
|
7859
7302
|
// }
|
|
7860
7303
|
});
|
|
7861
7304
|
};
|
|
7862
7305
|
|
|
7863
|
-
func.utils.get_plugin_resource = function (
|
|
7864
|
-
SESSION_ID,
|
|
7865
|
-
plugin_name,
|
|
7866
|
-
plugin_resource
|
|
7867
|
-
) {
|
|
7306
|
+
func.utils.get_plugin_resource = function (SESSION_ID, plugin_name, plugin_resource) {
|
|
7868
7307
|
var _session = SESSION_OBJ[SESSION_ID];
|
|
7869
7308
|
|
|
7870
7309
|
const get_path = function (resource) {
|
|
7871
|
-
if (_session.worker_type ===
|
|
7310
|
+
if (_session.worker_type === 'Dev') {
|
|
7872
7311
|
return `../../plugins/${plugin_name}/${resource}`;
|
|
7873
7312
|
}
|
|
7874
|
-
if (typeof IS_PROCESS_SERVER !==
|
|
7313
|
+
if (typeof IS_PROCESS_SERVER !== 'undefined') {
|
|
7875
7314
|
return `${_conf.plugins_drive_path}/${_session.app_id}/node_modules/${plugin_name}/${resource}`;
|
|
7876
7315
|
} else {
|
|
7877
7316
|
// return `./node_modules/${plugin_name}/${resource}?app_id=${_session.app_id}`;
|
|
@@ -7916,24 +7355,20 @@ func.utils.get_plugin_resource = function (
|
|
|
7916
7355
|
};
|
|
7917
7356
|
|
|
7918
7357
|
func.utils.remove_cached_objects = async function (SESSION_ID) {
|
|
7919
|
-
if (
|
|
7920
|
-
typeof IS_DOCKER !== "undefined" ||
|
|
7921
|
-
typeof IS_PROCESS_SERVER !== "undefined"
|
|
7922
|
-
)
|
|
7923
|
-
return;
|
|
7358
|
+
if (typeof IS_DOCKER !== 'undefined' || typeof IS_PROCESS_SERVER !== 'undefined') return;
|
|
7924
7359
|
try {
|
|
7925
7360
|
const db = await func.utils.connect_pouchdb(SESSION_ID);
|
|
7926
7361
|
|
|
7927
7362
|
let opt = {
|
|
7928
7363
|
$or: [
|
|
7929
7364
|
{
|
|
7930
|
-
docType:
|
|
7365
|
+
docType: 'cache_objects',
|
|
7931
7366
|
},
|
|
7932
7367
|
{
|
|
7933
|
-
docType:
|
|
7368
|
+
docType: 'cache_plugin',
|
|
7934
7369
|
},
|
|
7935
7370
|
{
|
|
7936
|
-
docType:
|
|
7371
|
+
docType: 'cache_app',
|
|
7937
7372
|
},
|
|
7938
7373
|
],
|
|
7939
7374
|
};
|
|
@@ -7947,15 +7382,11 @@ func.utils.remove_cached_objects = async function (SESSION_ID) {
|
|
|
7947
7382
|
}
|
|
7948
7383
|
};
|
|
7949
7384
|
|
|
7950
|
-
func.utils.get_plugin_npm_cdn = async function (
|
|
7951
|
-
SESSION_ID,
|
|
7952
|
-
plugin_name,
|
|
7953
|
-
resource
|
|
7954
|
-
) {
|
|
7385
|
+
func.utils.get_plugin_npm_cdn = async function (SESSION_ID, plugin_name, resource) {
|
|
7955
7386
|
const _session = SESSION_OBJ[SESSION_ID];
|
|
7956
7387
|
|
|
7957
7388
|
const get_path = function (resource) {
|
|
7958
|
-
if (_session.worker_type ===
|
|
7389
|
+
if (_session.worker_type === 'Dev') {
|
|
7959
7390
|
return `../../plugins/${plugin_name}/${resource}`;
|
|
7960
7391
|
}
|
|
7961
7392
|
|
|
@@ -7965,24 +7396,13 @@ func.utils.get_plugin_npm_cdn = async function (
|
|
|
7965
7396
|
return get_path(resource);
|
|
7966
7397
|
};
|
|
7967
7398
|
|
|
7968
|
-
func.utils.write_log = async function (
|
|
7969
|
-
SESSION_ID,
|
|
7970
|
-
method = "",
|
|
7971
|
-
msg = "",
|
|
7972
|
-
log_type = "error",
|
|
7973
|
-
source = "runtime",
|
|
7974
|
-
details
|
|
7975
|
-
) {
|
|
7399
|
+
func.utils.write_log = async function (SESSION_ID, method = '', msg = '', log_type = 'error', source = 'runtime', details) {
|
|
7976
7400
|
const _session = SESSION_OBJ[SESSION_ID];
|
|
7977
|
-
if (
|
|
7978
|
-
typeof IS_API_SERVER !== "undefined" ||
|
|
7979
|
-
typeof IS_DOCKER !== "undefined" ||
|
|
7980
|
-
typeof IS_PROCESS_SERVER !== "undefined"
|
|
7981
|
-
) {
|
|
7401
|
+
if (typeof IS_API_SERVER !== 'undefined' || typeof IS_DOCKER !== 'undefined' || typeof IS_PROCESS_SERVER !== 'undefined') {
|
|
7982
7402
|
return __.rpi.write_log(_session.app_id, log_type, source, msg, details);
|
|
7983
7403
|
}
|
|
7984
7404
|
|
|
7985
|
-
await func.common.db(SESSION_ID,
|
|
7405
|
+
await func.common.db(SESSION_ID, 'write_log', {
|
|
7986
7406
|
msg,
|
|
7987
7407
|
log_type,
|
|
7988
7408
|
source,
|
|
@@ -8000,26 +7420,24 @@ func.utils.get_resource_filename = function (build, filename) {
|
|
|
8000
7420
|
|
|
8001
7421
|
func.utils.set_SYS_GLOBAL_OBJ_WIDGET_INFO = async function (SESSION_ID, docP) {
|
|
8002
7422
|
var obj = _.clone(docP);
|
|
8003
|
-
obj.date = await func.utils.get_dateTime(SESSION_ID,
|
|
8004
|
-
obj.time = await func.utils.get_dateTime(SESSION_ID,
|
|
7423
|
+
obj.date = await func.utils.get_dateTime(SESSION_ID, 'SYS_DATE', docP.date);
|
|
7424
|
+
obj.time = await func.utils.get_dateTime(SESSION_ID, 'SYS_TIME', docP.date);
|
|
8005
7425
|
|
|
8006
7426
|
var datasource_changes = {
|
|
8007
7427
|
[0]: {
|
|
8008
|
-
[
|
|
8009
|
-
[
|
|
7428
|
+
['data_system']: {
|
|
7429
|
+
['SYS_GLOBAL_OBJ_WIDGET_INFO']: obj,
|
|
8010
7430
|
},
|
|
8011
7431
|
},
|
|
8012
7432
|
};
|
|
8013
7433
|
await func.datasource.update(SESSION_ID, datasource_changes);
|
|
8014
7434
|
};
|
|
8015
7435
|
|
|
8016
|
-
|
|
8017
|
-
|
|
8018
|
-
|
|
8019
|
-
const filtered = Object.values(SESSION_OBJ[SESSION_ID].DS_GLB).filter(e => e.tree_obj.menuType !== 'api')
|
|
7436
|
+
func.utils.get_last_datasource_no = function (SESSION_ID) {
|
|
7437
|
+
const filtered = Object.values(SESSION_OBJ[SESSION_ID].DS_GLB).filter((e) => e.tree_obj.menuType !== 'api');
|
|
8020
7438
|
|
|
8021
7439
|
return filtered.at(-1).dssession;
|
|
8022
|
-
}
|
|
7440
|
+
};
|
|
8023
7441
|
func.events = {};
|
|
8024
7442
|
func.events.validate = async function (
|
|
8025
7443
|
SESSION_ID,
|