@xuda.io/runtime-bundle 1.0.1406 → 1.0.1407
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/js/modules/xuda-project-loader-module.esm.js +2 -2
- package/js/modules/xuda-project-loader-module.esm.min.js +1 -1
- package/js/xuda-runtime-bundle.js +621 -352
- package/js/xuda-runtime-bundle.min.js +9 -9
- package/js/xuda-runtime-slim.js +621 -352
- package/js/xuda-runtime-slim.min.es.js +621 -352
- package/js/xuda-runtime-slim.min.js +9 -9
- package/js/xuda-server-bundle.min.mjs +68 -1
- package/js/xuda-server-bundle.mjs +537 -11
- package/js/xuda-worker-bundle.js +537 -11
- package/js/xuda-worker-bundle.min.js +68 -1
- package/js/xuda_common-bundle.js +537 -11
- package/js/xuda_common-bundle.min.js +68 -1
- package/package.json +1 -1
|
@@ -1635,6 +1635,10 @@ var func = {};
|
|
|
1635
1635
|
func.UI = {};
|
|
1636
1636
|
func.GLB = {};
|
|
1637
1637
|
func.mobile = {};
|
|
1638
|
+
func.runtime = {};
|
|
1639
|
+
func.runtime.session = {};
|
|
1640
|
+
func.runtime.workers = {};
|
|
1641
|
+
func.runtime.ui = {};
|
|
1638
1642
|
glb.IS_STUDIO = null;
|
|
1639
1643
|
|
|
1640
1644
|
var PROJECT_OBJ = {};
|
|
@@ -1648,6 +1652,537 @@ glb.PROTECTED_VARS = ['_NULL', '_THIS', '_FOR_KEY', '_FOR_VAL', '_ROWNO', '_ROWI
|
|
|
1648
1652
|
// glb.newRecord = 999999;
|
|
1649
1653
|
|
|
1650
1654
|
func.common = {};
|
|
1655
|
+
func.runtime.platform = {
|
|
1656
|
+
has_window: function () {
|
|
1657
|
+
return typeof window !== 'undefined';
|
|
1658
|
+
},
|
|
1659
|
+
has_document: function () {
|
|
1660
|
+
return typeof document !== 'undefined';
|
|
1661
|
+
},
|
|
1662
|
+
get_window: function () {
|
|
1663
|
+
if (func.runtime.platform.has_window()) {
|
|
1664
|
+
return window;
|
|
1665
|
+
}
|
|
1666
|
+
return null;
|
|
1667
|
+
},
|
|
1668
|
+
get_document: function () {
|
|
1669
|
+
if (func.runtime.platform.has_document()) {
|
|
1670
|
+
return document;
|
|
1671
|
+
}
|
|
1672
|
+
return null;
|
|
1673
|
+
},
|
|
1674
|
+
get_location: function () {
|
|
1675
|
+
const win = func.runtime.platform.get_window();
|
|
1676
|
+
return win?.location || null;
|
|
1677
|
+
},
|
|
1678
|
+
get_navigator: function () {
|
|
1679
|
+
const win = func.runtime.platform.get_window();
|
|
1680
|
+
if (win?.navigator) {
|
|
1681
|
+
return win.navigator;
|
|
1682
|
+
}
|
|
1683
|
+
if (typeof navigator !== 'undefined') {
|
|
1684
|
+
return navigator;
|
|
1685
|
+
}
|
|
1686
|
+
return null;
|
|
1687
|
+
},
|
|
1688
|
+
is_html_element: function (value) {
|
|
1689
|
+
if (typeof HTMLElement === 'undefined') {
|
|
1690
|
+
return false;
|
|
1691
|
+
}
|
|
1692
|
+
return value instanceof HTMLElement;
|
|
1693
|
+
},
|
|
1694
|
+
get_storage: function (type) {
|
|
1695
|
+
const win = func.runtime.platform.get_window();
|
|
1696
|
+
try {
|
|
1697
|
+
if (!win) {
|
|
1698
|
+
return null;
|
|
1699
|
+
}
|
|
1700
|
+
if (type === 'session') {
|
|
1701
|
+
return win.sessionStorage || null;
|
|
1702
|
+
}
|
|
1703
|
+
return win.localStorage || null;
|
|
1704
|
+
} catch (error) {
|
|
1705
|
+
return null;
|
|
1706
|
+
}
|
|
1707
|
+
},
|
|
1708
|
+
get_storage_item: function (key, type) {
|
|
1709
|
+
const storage = func.runtime.platform.get_storage(type);
|
|
1710
|
+
if (!storage) {
|
|
1711
|
+
return null;
|
|
1712
|
+
}
|
|
1713
|
+
try {
|
|
1714
|
+
return storage.getItem(key);
|
|
1715
|
+
} catch (error) {
|
|
1716
|
+
return null;
|
|
1717
|
+
}
|
|
1718
|
+
},
|
|
1719
|
+
set_storage_item: function (key, value, type) {
|
|
1720
|
+
const storage = func.runtime.platform.get_storage(type);
|
|
1721
|
+
if (!storage) {
|
|
1722
|
+
return false;
|
|
1723
|
+
}
|
|
1724
|
+
try {
|
|
1725
|
+
storage.setItem(key, value);
|
|
1726
|
+
return true;
|
|
1727
|
+
} catch (error) {
|
|
1728
|
+
return false;
|
|
1729
|
+
}
|
|
1730
|
+
},
|
|
1731
|
+
get_url_href: function () {
|
|
1732
|
+
return func.runtime.platform.get_location()?.href || '';
|
|
1733
|
+
},
|
|
1734
|
+
get_url_search: function () {
|
|
1735
|
+
return func.runtime.platform.get_location()?.search || '';
|
|
1736
|
+
},
|
|
1737
|
+
get_url_hash: function () {
|
|
1738
|
+
return func.runtime.platform.get_location()?.hash || '';
|
|
1739
|
+
},
|
|
1740
|
+
get_host: function () {
|
|
1741
|
+
return func.runtime.platform.get_location()?.host || '';
|
|
1742
|
+
},
|
|
1743
|
+
get_hostname: function () {
|
|
1744
|
+
return func.runtime.platform.get_location()?.hostname || '';
|
|
1745
|
+
},
|
|
1746
|
+
get_device_uuid: function () {
|
|
1747
|
+
const win = func.runtime.platform.get_window();
|
|
1748
|
+
return win?.device?.uuid || null;
|
|
1749
|
+
},
|
|
1750
|
+
get_device_name: function () {
|
|
1751
|
+
const win = func.runtime.platform.get_window();
|
|
1752
|
+
return win?.device?.name || null;
|
|
1753
|
+
},
|
|
1754
|
+
get_inner_size: function () {
|
|
1755
|
+
const win = func.runtime.platform.get_window();
|
|
1756
|
+
return {
|
|
1757
|
+
width: win?.innerWidth || 0,
|
|
1758
|
+
height: win?.innerHeight || 0,
|
|
1759
|
+
};
|
|
1760
|
+
},
|
|
1761
|
+
add_window_listener: function (name, handler) {
|
|
1762
|
+
const win = func.runtime.platform.get_window();
|
|
1763
|
+
if (!win?.addEventListener) {
|
|
1764
|
+
return false;
|
|
1765
|
+
}
|
|
1766
|
+
win.addEventListener(name, handler);
|
|
1767
|
+
return true;
|
|
1768
|
+
},
|
|
1769
|
+
dispatch_body_event: function (event) {
|
|
1770
|
+
const doc = func.runtime.platform.get_document();
|
|
1771
|
+
if (!doc?.body?.dispatchEvent) {
|
|
1772
|
+
return false;
|
|
1773
|
+
}
|
|
1774
|
+
doc.body.dispatchEvent(event);
|
|
1775
|
+
return true;
|
|
1776
|
+
},
|
|
1777
|
+
reload_top_window: function () {
|
|
1778
|
+
const win = func.runtime.platform.get_window();
|
|
1779
|
+
if (!win?.top?.location?.reload) {
|
|
1780
|
+
return false;
|
|
1781
|
+
}
|
|
1782
|
+
win.top.location.reload();
|
|
1783
|
+
return true;
|
|
1784
|
+
},
|
|
1785
|
+
get_service_worker: function () {
|
|
1786
|
+
const nav = func.runtime.platform.get_navigator();
|
|
1787
|
+
return nav?.serviceWorker || null;
|
|
1788
|
+
},
|
|
1789
|
+
has_service_worker: function () {
|
|
1790
|
+
return !!func.runtime.platform.get_service_worker();
|
|
1791
|
+
},
|
|
1792
|
+
register_service_worker: function (script_url) {
|
|
1793
|
+
const service_worker = func.runtime.platform.get_service_worker();
|
|
1794
|
+
if (!service_worker?.register) {
|
|
1795
|
+
return Promise.reject(new Error('serviceWorker is not available'));
|
|
1796
|
+
}
|
|
1797
|
+
return service_worker.register(script_url);
|
|
1798
|
+
},
|
|
1799
|
+
add_service_worker_listener: function (name, handler) {
|
|
1800
|
+
const service_worker = func.runtime.platform.get_service_worker();
|
|
1801
|
+
if (!service_worker?.addEventListener) {
|
|
1802
|
+
return false;
|
|
1803
|
+
}
|
|
1804
|
+
service_worker.addEventListener(name, handler);
|
|
1805
|
+
return true;
|
|
1806
|
+
},
|
|
1807
|
+
};
|
|
1808
|
+
func.runtime.env = {
|
|
1809
|
+
get_url_params: function () {
|
|
1810
|
+
const search = func.runtime.platform.get_url_search();
|
|
1811
|
+
return new URLSearchParams(search);
|
|
1812
|
+
},
|
|
1813
|
+
get_url_parameters_object: function () {
|
|
1814
|
+
const search_params = func.runtime.env.get_url_params();
|
|
1815
|
+
const parameters = {};
|
|
1816
|
+
for (const [key, value] of search_params.entries()) {
|
|
1817
|
+
parameters[key] = value;
|
|
1818
|
+
}
|
|
1819
|
+
return parameters;
|
|
1820
|
+
},
|
|
1821
|
+
get_default_session_value: function (key) {
|
|
1822
|
+
switch (key) {
|
|
1823
|
+
case 'domain':
|
|
1824
|
+
return func.runtime.platform.get_host();
|
|
1825
|
+
case 'engine_mode':
|
|
1826
|
+
return 'miniapp';
|
|
1827
|
+
case 'app_id':
|
|
1828
|
+
return 'unknown';
|
|
1829
|
+
default:
|
|
1830
|
+
return null;
|
|
1831
|
+
}
|
|
1832
|
+
},
|
|
1833
|
+
};
|
|
1834
|
+
func.runtime.session.create_tab_id = function () {
|
|
1835
|
+
const session_storage = func.runtime.platform.get_storage('session');
|
|
1836
|
+
const local_storage = func.runtime.platform.get_storage('local');
|
|
1837
|
+
var page_tab_id = session_storage?.getItem('tabID');
|
|
1838
|
+
if (page_tab_id == null) {
|
|
1839
|
+
var local_tab_id = local_storage?.getItem('tabID');
|
|
1840
|
+
page_tab_id = local_tab_id == null ? 1 : Number(local_tab_id) + 1;
|
|
1841
|
+
func.runtime.platform.set_storage_item('tabID', page_tab_id, 'local');
|
|
1842
|
+
func.runtime.platform.set_storage_item('tabID', page_tab_id, 'session');
|
|
1843
|
+
}
|
|
1844
|
+
return page_tab_id;
|
|
1845
|
+
};
|
|
1846
|
+
func.runtime.session.get_fingerprint = function (components, instance_id) {
|
|
1847
|
+
const device_uuid = func.runtime.platform.get_device_uuid();
|
|
1848
|
+
if (func.utils.get_device() && device_uuid) {
|
|
1849
|
+
if (instance_id) {
|
|
1850
|
+
return instance_id + device_uuid;
|
|
1851
|
+
}
|
|
1852
|
+
return device_uuid;
|
|
1853
|
+
}
|
|
1854
|
+
const fingerprint_id = Fingerprint2.x64hash128(
|
|
1855
|
+
components
|
|
1856
|
+
.map(function (pair) {
|
|
1857
|
+
return pair.value;
|
|
1858
|
+
})
|
|
1859
|
+
.join(),
|
|
1860
|
+
31,
|
|
1861
|
+
);
|
|
1862
|
+
|
|
1863
|
+
if (instance_id) {
|
|
1864
|
+
return instance_id + fingerprint_id + func.runtime.session.create_tab_id();
|
|
1865
|
+
}
|
|
1866
|
+
return fingerprint_id;
|
|
1867
|
+
};
|
|
1868
|
+
func.runtime.session.create_state = function (SESSION_ID, options) {
|
|
1869
|
+
const runtime_host = func.runtime.platform.get_host();
|
|
1870
|
+
SESSION_OBJ[SESSION_ID] = {
|
|
1871
|
+
JOB_NO: 1000,
|
|
1872
|
+
opt: options.opt,
|
|
1873
|
+
root_element: options.root_element,
|
|
1874
|
+
worker_type: options.worker_type,
|
|
1875
|
+
api_callback: options.api_callback,
|
|
1876
|
+
CODE_BUNDLE: options.code_bundle,
|
|
1877
|
+
SLIM_BUNDLE: options.slim_bundle,
|
|
1878
|
+
WORKER_OBJ: {
|
|
1879
|
+
jobs: [],
|
|
1880
|
+
num: 1000,
|
|
1881
|
+
stat: null,
|
|
1882
|
+
},
|
|
1883
|
+
DS_GLB: {},
|
|
1884
|
+
SYS_GLOBAL_OBJ_FIREBASE_AUTH_INFO: {
|
|
1885
|
+
token: '',
|
|
1886
|
+
first_name: '',
|
|
1887
|
+
last_name: '',
|
|
1888
|
+
email: '',
|
|
1889
|
+
user_id: '',
|
|
1890
|
+
picture: '',
|
|
1891
|
+
verified_email: '',
|
|
1892
|
+
locale: '',
|
|
1893
|
+
error_code: '',
|
|
1894
|
+
error_msg: '',
|
|
1895
|
+
},
|
|
1896
|
+
SYS_GLOBAL_OBJ_CLIENT_INFO: {
|
|
1897
|
+
fingerprint: '',
|
|
1898
|
+
device: '',
|
|
1899
|
+
user_agent: '',
|
|
1900
|
+
browser_version: '',
|
|
1901
|
+
browser_name: '',
|
|
1902
|
+
engine_version: '',
|
|
1903
|
+
client_ip: '',
|
|
1904
|
+
engine_name: '',
|
|
1905
|
+
os_name: '',
|
|
1906
|
+
os_version: '',
|
|
1907
|
+
device_model: '',
|
|
1908
|
+
device_vendor: '',
|
|
1909
|
+
device_type: '',
|
|
1910
|
+
screen_current_resolution_x: '',
|
|
1911
|
+
screen_current_resolution_y: '',
|
|
1912
|
+
screen_available_resolution_x: '',
|
|
1913
|
+
screen_available_resolution_y: '',
|
|
1914
|
+
language: '',
|
|
1915
|
+
time_zone: '',
|
|
1916
|
+
cpu_architecture: '',
|
|
1917
|
+
uuid: '',
|
|
1918
|
+
},
|
|
1919
|
+
PUSH_NOTIFICATION_GRANTED: null,
|
|
1920
|
+
FIREBASE_TOKEN_ID: null,
|
|
1921
|
+
USR_OBJ: {},
|
|
1922
|
+
debug_js: null,
|
|
1923
|
+
DS_UI_EVENTS_GLB: {},
|
|
1924
|
+
host: runtime_host,
|
|
1925
|
+
req_id: 0,
|
|
1926
|
+
build_info: {},
|
|
1927
|
+
CACHE_REQ: {},
|
|
1928
|
+
url_params: {
|
|
1929
|
+
...func.common.getParametersFromUrl(),
|
|
1930
|
+
...options.url_params,
|
|
1931
|
+
},
|
|
1932
|
+
};
|
|
1933
|
+
func.runtime.workers.ensure_registry(SESSION_ID);
|
|
1934
|
+
return SESSION_OBJ[SESSION_ID];
|
|
1935
|
+
};
|
|
1936
|
+
func.runtime.session.set_default_value = function (_session, key, value) {
|
|
1937
|
+
_session[key] = value || func.runtime.env.get_default_session_value(key);
|
|
1938
|
+
return _session[key];
|
|
1939
|
+
};
|
|
1940
|
+
func.runtime.session.populate_client_info = function (_session, components) {
|
|
1941
|
+
const _client_info = _session.SYS_GLOBAL_OBJ_CLIENT_INFO;
|
|
1942
|
+
const platform = func.runtime.platform;
|
|
1943
|
+
const { engine_mode } = _session;
|
|
1944
|
+
|
|
1945
|
+
_client_info.fingerprint = func.runtime.session.get_fingerprint(components);
|
|
1946
|
+
|
|
1947
|
+
if (engine_mode === 'live_preview') {
|
|
1948
|
+
const inner_size = platform.get_inner_size();
|
|
1949
|
+
_client_info.screen_current_resolution_x = inner_size.width;
|
|
1950
|
+
_client_info.screen_current_resolution_y = inner_size.height;
|
|
1951
|
+
_client_info.screen_available_resolution_x = inner_size.width;
|
|
1952
|
+
_client_info.screen_available_resolution_y = inner_size.height;
|
|
1953
|
+
} else {
|
|
1954
|
+
_client_info.screen_current_resolution_x = components[6].value[0];
|
|
1955
|
+
_client_info.screen_current_resolution_y = components[6].value[1];
|
|
1956
|
+
_client_info.screen_available_resolution_x = components[7].value[0];
|
|
1957
|
+
_client_info.screen_available_resolution_y = components[7].value[1];
|
|
1958
|
+
}
|
|
1959
|
+
|
|
1960
|
+
const client = new ClientJS();
|
|
1961
|
+
_client_info.device = func.utils.get_device();
|
|
1962
|
+
|
|
1963
|
+
const browser_data = client.getBrowserData();
|
|
1964
|
+
_client_info.user_agent = browser_data.ua;
|
|
1965
|
+
_client_info.browser_version = browser_data.browser.name;
|
|
1966
|
+
_client_info.browser_name = browser_data.browser.version;
|
|
1967
|
+
_client_info.engine_version = browser_data.engine.name;
|
|
1968
|
+
_client_info.engine_name = browser_data.engine.version;
|
|
1969
|
+
_client_info.os_name = browser_data.os.name;
|
|
1970
|
+
_client_info.os_version = browser_data.os.version;
|
|
1971
|
+
_client_info.device_model = browser_data.device.name;
|
|
1972
|
+
_client_info.device_vendor = browser_data.device.name;
|
|
1973
|
+
_client_info.device_type = browser_data.device.name;
|
|
1974
|
+
_client_info.language = client.getLanguage();
|
|
1975
|
+
_client_info.time_zone = client.getTimeZone();
|
|
1976
|
+
_client_info.cpu_architecture = browser_data.cpu.architecture;
|
|
1977
|
+
|
|
1978
|
+
if (['android', 'ios', 'windows', 'macos', 'linux', 'live_preview'].includes(engine_mode) && func.utils.get_device()) {
|
|
1979
|
+
_client_info.uuid = platform.get_device_uuid();
|
|
1980
|
+
const device_name = platform.get_device_name();
|
|
1981
|
+
if (device_name) {
|
|
1982
|
+
_client_info.device_name = device_name;
|
|
1983
|
+
}
|
|
1984
|
+
}
|
|
1985
|
+
return _client_info;
|
|
1986
|
+
};
|
|
1987
|
+
func.runtime.workers.ensure_registry = function (SESSION_ID) {
|
|
1988
|
+
if (!WEB_WORKER[SESSION_ID]) {
|
|
1989
|
+
WEB_WORKER[SESSION_ID] = {};
|
|
1990
|
+
}
|
|
1991
|
+
return WEB_WORKER[SESSION_ID];
|
|
1992
|
+
};
|
|
1993
|
+
func.runtime.workers.get_registry_entry = function (SESSION_ID, worker_id) {
|
|
1994
|
+
return func.runtime.workers.ensure_registry(SESSION_ID)?.[worker_id] || null;
|
|
1995
|
+
};
|
|
1996
|
+
func.runtime.workers.set_registry_entry = function (SESSION_ID, worker_id, entry) {
|
|
1997
|
+
const worker_registry = func.runtime.workers.ensure_registry(SESSION_ID);
|
|
1998
|
+
worker_registry[worker_id] = entry;
|
|
1999
|
+
return worker_registry[worker_id];
|
|
2000
|
+
};
|
|
2001
|
+
func.runtime.workers.build_worker_name = function (glb_worker_type, session, prog_obj, worker_id, build_id) {
|
|
2002
|
+
return (
|
|
2003
|
+
`${typeof session.SLIM_BUNDLE === 'undefined' || !session.SLIM_BUNDLE ? '' : 'Slim '}${prog_obj.menuName} worker` +
|
|
2004
|
+
' ' +
|
|
2005
|
+
glb_worker_type +
|
|
2006
|
+
': #' +
|
|
2007
|
+
worker_id.toString() +
|
|
2008
|
+
' ' +
|
|
2009
|
+
(build_id || '') +
|
|
2010
|
+
' ' +
|
|
2011
|
+
session.domain
|
|
2012
|
+
);
|
|
2013
|
+
};
|
|
2014
|
+
func.runtime.workers.is_server_transport = function (session) {
|
|
2015
|
+
return !!(RUNTIME_SERVER_WEBSOCKET && RUNTIME_SERVER_WEBSOCKET_CONNECTED && (!session.opt.app_computing_mode || session.opt.app_computing_mode === 'server'));
|
|
2016
|
+
};
|
|
2017
|
+
func.runtime.workers.send_message = function (SESSION_ID, worker_id, session, msg, process_pid) {
|
|
2018
|
+
const registry_entry = func.runtime.workers.get_registry_entry(SESSION_ID, worker_id);
|
|
2019
|
+
if (!registry_entry?.worker) {
|
|
2020
|
+
return false;
|
|
2021
|
+
}
|
|
2022
|
+
|
|
2023
|
+
if (func.runtime.workers.is_server_transport(session)) {
|
|
2024
|
+
if (process_pid) {
|
|
2025
|
+
msg.process_pid = process_pid;
|
|
2026
|
+
}
|
|
2027
|
+
registry_entry.worker.emit('message', msg);
|
|
2028
|
+
return true;
|
|
2029
|
+
}
|
|
2030
|
+
|
|
2031
|
+
registry_entry.worker.postMessage(msg);
|
|
2032
|
+
return true;
|
|
2033
|
+
};
|
|
2034
|
+
func.runtime.workers.set_promise = function (SESSION_ID, worker_id, promise_queue_id, value) {
|
|
2035
|
+
const registry_entry = func.runtime.workers.get_registry_entry(SESSION_ID, worker_id);
|
|
2036
|
+
if (!registry_entry) {
|
|
2037
|
+
return null;
|
|
2038
|
+
}
|
|
2039
|
+
registry_entry.promise_queue[promise_queue_id] = value;
|
|
2040
|
+
return registry_entry.promise_queue[promise_queue_id];
|
|
2041
|
+
};
|
|
2042
|
+
func.runtime.workers.get_promise = function (SESSION_ID, worker_id, promise_queue_id) {
|
|
2043
|
+
const registry_entry = func.runtime.workers.get_registry_entry(SESSION_ID, worker_id);
|
|
2044
|
+
if (!registry_entry) {
|
|
2045
|
+
return null;
|
|
2046
|
+
}
|
|
2047
|
+
return registry_entry.promise_queue[promise_queue_id];
|
|
2048
|
+
};
|
|
2049
|
+
func.runtime.workers.delete_promise = function (SESSION_ID, worker_id, promise_queue_id) {
|
|
2050
|
+
const registry_entry = func.runtime.workers.get_registry_entry(SESSION_ID, worker_id);
|
|
2051
|
+
if (!registry_entry?.promise_queue) {
|
|
2052
|
+
return false;
|
|
2053
|
+
}
|
|
2054
|
+
delete registry_entry.promise_queue[promise_queue_id];
|
|
2055
|
+
return true;
|
|
2056
|
+
};
|
|
2057
|
+
func.runtime.ui.get_root_element = function (SESSION_ID) {
|
|
2058
|
+
return $(SESSION_OBJ[SESSION_ID].root_element);
|
|
2059
|
+
};
|
|
2060
|
+
func.runtime.ui.show_root_element = function (SESSION_ID) {
|
|
2061
|
+
const $root_element = func.runtime.ui.get_root_element(SESSION_ID);
|
|
2062
|
+
$root_element.show();
|
|
2063
|
+
return $root_element;
|
|
2064
|
+
};
|
|
2065
|
+
func.runtime.ui.ensure_app_shell = function (SESSION_ID, domain) {
|
|
2066
|
+
const $root_element = func.runtime.ui.get_root_element(SESSION_ID);
|
|
2067
|
+
$root_element.css('position', 'relative');
|
|
2068
|
+
|
|
2069
|
+
if (!$root_element.find('.loader').length) {
|
|
2070
|
+
$root_element.append(`
|
|
2071
|
+
|
|
2072
|
+
<style>
|
|
2073
|
+
.loader {
|
|
2074
|
+
position: absolute;
|
|
2075
|
+
background: rgb(0 0 0 / 30%);
|
|
2076
|
+
z-index: 10;
|
|
2077
|
+
overflow-y: auto;
|
|
2078
|
+
top: 0;
|
|
2079
|
+
right: 0;
|
|
2080
|
+
bottom: 0;
|
|
2081
|
+
left: 0;
|
|
2082
|
+
display: flex;
|
|
2083
|
+
flex-direction: column;
|
|
2084
|
+
justify-content: center;
|
|
2085
|
+
align-items: center;
|
|
2086
|
+
}
|
|
2087
|
+
|
|
2088
|
+
.loader .loader_logo {
|
|
2089
|
+
|
|
2090
|
+
width: 43px;
|
|
2091
|
+
height: 43px;
|
|
2092
|
+
border-radius: 50%;
|
|
2093
|
+
background-size: cover;
|
|
2094
|
+
}
|
|
2095
|
+
|
|
2096
|
+
.loader .loader_msg {
|
|
2097
|
+
padding-top: 10px;
|
|
2098
|
+
text-align: center;
|
|
2099
|
+
min-height: 20px;
|
|
2100
|
+
font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
|
|
2101
|
+
}
|
|
2102
|
+
|
|
2103
|
+
.loader .loader_rotate {
|
|
2104
|
+
padding: 20px;
|
|
2105
|
+
border: 2px solid #fff;
|
|
2106
|
+
border-right-color: #898989;
|
|
2107
|
+
border-radius: 22px;
|
|
2108
|
+
-webkit-animation: rotate 0.8s infinite linear;
|
|
2109
|
+
position: absolute;
|
|
2110
|
+
}
|
|
2111
|
+
|
|
2112
|
+
@-webkit-keyframes rotate {
|
|
2113
|
+
100% {
|
|
2114
|
+
-webkit-transform: rotate(360deg);
|
|
2115
|
+
}
|
|
2116
|
+
}
|
|
2117
|
+
</style>
|
|
2118
|
+
|
|
2119
|
+
<div class="loader">
|
|
2120
|
+
<div class="loader_logo">
|
|
2121
|
+
<div class="loader_rotate"></div>
|
|
2122
|
+
</div>
|
|
2123
|
+
<div class="loader_msg"> </div>
|
|
2124
|
+
</div>
|
|
2125
|
+
|
|
2126
|
+
|
|
2127
|
+
<div class="progressLoader"></div>
|
|
2128
|
+
|
|
2129
|
+
`);
|
|
2130
|
+
}
|
|
2131
|
+
|
|
2132
|
+
if (!$root_element.find('#tailwind_toast_controller').length) {
|
|
2133
|
+
$root_element.append(
|
|
2134
|
+
`<div aria-live="assertive"
|
|
2135
|
+
class="fixed inset-0 flex items-end px-4 py-6 pointer-events-none sm:p-6 sm:items-start z-[999]">
|
|
2136
|
+
<div id="tailwind_toast_controller" class="w-full flex flex-col items-center space-y-4 sm:items-end">
|
|
2137
|
+
|
|
2138
|
+
</div>
|
|
2139
|
+
</div>`,
|
|
2140
|
+
);
|
|
2141
|
+
}
|
|
2142
|
+
|
|
2143
|
+
if (!$root_element.find('#progressScreen2').length) {
|
|
2144
|
+
$root_element.append(
|
|
2145
|
+
`
|
|
2146
|
+
<div id="progressScreen2" style="display: none">
|
|
2147
|
+
<div id="progressScreen2_text"></div>
|
|
2148
|
+
</div>`,
|
|
2149
|
+
);
|
|
2150
|
+
}
|
|
2151
|
+
|
|
2152
|
+
const get_url = function (domain, method, path) {
|
|
2153
|
+
return `https://${domain}/${method}${path ? '/' + path : '/'}`;
|
|
2154
|
+
};
|
|
2155
|
+
|
|
2156
|
+
func.utils.load_css_on_demand(get_url(domain, 'dist', 'runtime/css/mobile.css'));
|
|
2157
|
+
return $root_element;
|
|
2158
|
+
};
|
|
2159
|
+
func.runtime.ui.ensure_embed_container = function (SESSION_ID) {
|
|
2160
|
+
const $root_element = func.runtime.ui.get_root_element(SESSION_ID);
|
|
2161
|
+
let $embed_container = $root_element.find(`#embed_${SESSION_ID}`);
|
|
2162
|
+
|
|
2163
|
+
if (!$embed_container.length) {
|
|
2164
|
+
$embed_container = $('<div>')
|
|
2165
|
+
.attr('id', 'embed_' + SESSION_ID)
|
|
2166
|
+
.addClass('xu_embed_div')
|
|
2167
|
+
.data({ xuData: {} })
|
|
2168
|
+
.appendTo($root_element);
|
|
2169
|
+
}
|
|
2170
|
+
|
|
2171
|
+
return $embed_container;
|
|
2172
|
+
};
|
|
2173
|
+
func.runtime.ui.get_embed_container = function (SESSION_ID) {
|
|
2174
|
+
return func.runtime.ui.get_root_element(SESSION_ID).find(`#embed_${SESSION_ID}`);
|
|
2175
|
+
};
|
|
2176
|
+
func.runtime.ui.get_embed_screen_containers = function () {
|
|
2177
|
+
return $('.xu_embed_container');
|
|
2178
|
+
};
|
|
2179
|
+
func.runtime.ui.append_to_body = function ($element) {
|
|
2180
|
+
$element.appendTo('body');
|
|
2181
|
+
return $element;
|
|
2182
|
+
};
|
|
2183
|
+
func.runtime.ui.find_in_root = function (SESSION_ID, selector) {
|
|
2184
|
+
return func.runtime.ui.get_root_element(SESSION_ID).find(selector);
|
|
2185
|
+
};
|
|
1651
2186
|
func.common.find_item_by_key = function (arr, key, val) {
|
|
1652
2187
|
return _.find(arr, function (e) {
|
|
1653
2188
|
return e.data[key] === val;
|
|
@@ -2036,19 +2571,10 @@ func.common.db = async function (SESSION_ID, serviceP, dataP, opt = {}, dsSessio
|
|
|
2036
2571
|
};
|
|
2037
2572
|
|
|
2038
2573
|
func.common.getJsonFromUrl = function () {
|
|
2039
|
-
|
|
2040
|
-
const urlParams = new URLSearchParams(queryString);
|
|
2041
|
-
return urlParams;
|
|
2574
|
+
return func.runtime.env.get_url_params();
|
|
2042
2575
|
};
|
|
2043
2576
|
func.common.getParametersFromUrl = function () {
|
|
2044
|
-
|
|
2045
|
-
const parameters = {};
|
|
2046
|
-
|
|
2047
|
-
for (const [key, value] of searchParams.entries()) {
|
|
2048
|
-
parameters[key] = value;
|
|
2049
|
-
}
|
|
2050
|
-
|
|
2051
|
-
return parameters;
|
|
2577
|
+
return func.runtime.env.get_url_parameters_object();
|
|
2052
2578
|
};
|
|
2053
2579
|
|
|
2054
2580
|
func.common.getObjectFromUrl = function (url, element_attributes_obj, embed_params_obj) {
|
|
@@ -8089,10 +8615,16 @@ func.UI.utils.live_preview_show_selected_element = function (nodeid) {
|
|
|
8089
8615
|
};
|
|
8090
8616
|
|
|
8091
8617
|
func.UI.utils.get_url_attribute = function (SESSION_ID, key) {
|
|
8092
|
-
var ret = glb.URL_PARAMS.get(key);
|
|
8093
|
-
|
|
8094
8618
|
const _session = SESSION_OBJ[SESSION_ID];
|
|
8095
|
-
|
|
8619
|
+
const platform = func.runtime.platform;
|
|
8620
|
+
const url_param = glb.URL_PARAMS?.get?.(key);
|
|
8621
|
+
const root_attribute = $(_session.root_element).attr(key);
|
|
8622
|
+
const option_param = _session.opt?.params?.[key];
|
|
8623
|
+
const option_value = _session.opt?.[key];
|
|
8624
|
+
const cookie_value = typeof $.cookie === 'function' ? $.cookie(key) : null;
|
|
8625
|
+
const storage_value = platform.get_storage_item(key, 'local');
|
|
8626
|
+
|
|
8627
|
+
return url_param || root_attribute || option_param || option_value || cookie_value || storage_value;
|
|
8096
8628
|
};
|
|
8097
8629
|
|
|
8098
8630
|
func.UI.utils.get_root_element_attributes = function (SESSION_ID) {
|
|
@@ -9456,7 +9988,7 @@ func.UI.screen.init = async function (SESSION_ID, prog_id, sourceScreenP, callin
|
|
|
9456
9988
|
case 'popover':
|
|
9457
9989
|
$dialogDiv = $('<div>');
|
|
9458
9990
|
$rootFrame = $('<div>').appendTo($dialogDiv);
|
|
9459
|
-
$dialogDiv
|
|
9991
|
+
func.runtime.ui.append_to_body($dialogDiv);
|
|
9460
9992
|
break;
|
|
9461
9993
|
|
|
9462
9994
|
default:
|
|
@@ -9581,7 +10113,8 @@ func.UI.screen.validate_exit_events = async function (SESSION_ID, div_data_param
|
|
|
9581
10113
|
};
|
|
9582
10114
|
|
|
9583
10115
|
func.UI.screen.call_embed = function (SESSION_ID, prog) {
|
|
9584
|
-
|
|
10116
|
+
func.runtime.ui
|
|
10117
|
+
.get_embed_container(SESSION_ID)
|
|
9585
10118
|
.empty()
|
|
9586
10119
|
.data().xuData.screenInfo = null;
|
|
9587
10120
|
|
|
@@ -9952,7 +10485,7 @@ func.UI.screen.refresh_xu_attributes = async function (SESSION_ID, fields_arr, j
|
|
|
9952
10485
|
return found;
|
|
9953
10486
|
};
|
|
9954
10487
|
|
|
9955
|
-
const $xu_embed_container =
|
|
10488
|
+
const $xu_embed_container = func.runtime.ui.get_embed_screen_containers();
|
|
9956
10489
|
const panels_obj = await func.UI.utils.get_panels_wrapper_from_dom(SESSION_ID, $xu_embed_container, true);
|
|
9957
10490
|
|
|
9958
10491
|
for await (const field_id of fields_arr) {
|
|
@@ -10112,7 +10645,7 @@ func.UI.screen.refresh_screen = async function (SESSION_ID, fields_changed_arr,
|
|
|
10112
10645
|
}
|
|
10113
10646
|
}
|
|
10114
10647
|
|
|
10115
|
-
const panels_obj = await func.UI.utils.get_panels_wrapper_from_dom(SESSION_ID,
|
|
10648
|
+
const panels_obj = await func.UI.utils.get_panels_wrapper_from_dom(SESSION_ID, func.runtime.ui.get_root_element(SESSION_ID), false);
|
|
10116
10649
|
found = false;
|
|
10117
10650
|
for await (const [parent_element_ui_id, panel_val] of Object.entries(panels_obj)) {
|
|
10118
10651
|
// const progDataSource_str = JSON.stringify(panel_val.prog_doc.progDataSource);
|
|
@@ -18373,7 +18906,10 @@ func.UI.main.embed_prog_execute = async function (SESSION_ID, prog) {
|
|
|
18373
18906
|
let screen_ret = await func.utils.get_screen_obj(SESSION_ID, prog);
|
|
18374
18907
|
if (screen_ret) {
|
|
18375
18908
|
let ret_init = await func.UI.screen.init(SESSION_ID, prog, null, null, $('#embed_' + SESSION_ID), null, null, null, null, get_params_obj(), 'call_embed');
|
|
18376
|
-
|
|
18909
|
+
const runtime_document = func.runtime.platform.get_document();
|
|
18910
|
+
if (runtime_document) {
|
|
18911
|
+
runtime_document.title = screen_ret.properties.menuTitle;
|
|
18912
|
+
}
|
|
18377
18913
|
|
|
18378
18914
|
return;
|
|
18379
18915
|
}
|
|
@@ -18385,10 +18921,12 @@ func.UI.main.embed_prog_execute = async function (SESSION_ID, prog) {
|
|
|
18385
18921
|
|
|
18386
18922
|
func.UI.main.embed_loader = async function (SESSION_ID) {
|
|
18387
18923
|
var _session = SESSION_OBJ[SESSION_ID];
|
|
18924
|
+
const platform = func.runtime.platform;
|
|
18925
|
+
const browser_hash = platform.get_url_hash();
|
|
18388
18926
|
var hash = '';
|
|
18389
|
-
if (
|
|
18927
|
+
if (browser_hash) hash = browser_hash.substr(1);
|
|
18390
18928
|
_session.SYS_GLOBAL_STR_BROWSER_HASH_ID = hash;
|
|
18391
|
-
_session.SYS_GLOBAL_STR_BROWSER_TITLE =
|
|
18929
|
+
_session.SYS_GLOBAL_STR_BROWSER_TITLE = platform.get_document()?.title || '';
|
|
18392
18930
|
|
|
18393
18931
|
const init_system_ds = async function () {
|
|
18394
18932
|
if (!['main'].includes(_session.opt.app_computing_mode)) {
|
|
@@ -18448,12 +18986,7 @@ func.UI.main.embed_loader = async function (SESSION_ID) {
|
|
|
18448
18986
|
_session.WORKER_OBJ.fx.init();
|
|
18449
18987
|
};
|
|
18450
18988
|
const create_embed_container = async function () {
|
|
18451
|
-
|
|
18452
|
-
.attr('id', 'embed_' + SESSION_ID)
|
|
18453
|
-
|
|
18454
|
-
.addClass('xu_embed_div')
|
|
18455
|
-
.data({ xuData: {} })
|
|
18456
|
-
.appendTo($(_session.root_element));
|
|
18989
|
+
func.runtime.ui.ensure_embed_container(SESSION_ID);
|
|
18457
18990
|
};
|
|
18458
18991
|
const execute_PENDING_OPEN_URL_EVENTS = async function () {
|
|
18459
18992
|
if (typeof func.events.execute_PENDING_OPEN_URL_EVENTS !== 'undefined' && glb.is_cordova) {
|
|
@@ -18583,7 +19116,7 @@ func.UI.main.embed_loader = async function (SESSION_ID) {
|
|
|
18583
19116
|
|
|
18584
19117
|
await register_run_background_plugins();
|
|
18585
19118
|
|
|
18586
|
-
|
|
19119
|
+
func.runtime.ui.show_root_element(SESSION_ID);
|
|
18587
19120
|
func.UI.component.create_app_root_component(SESSION_ID);
|
|
18588
19121
|
await glb.lifecycle.execute(SESSION_ID, 'beforeInit');
|
|
18589
19122
|
await start_workers();
|
|
@@ -18608,11 +19141,11 @@ func.UI.main.embed_loader = async function (SESSION_ID) {
|
|
|
18608
19141
|
});
|
|
18609
19142
|
|
|
18610
19143
|
await updateOnlineStatus();
|
|
18611
|
-
|
|
18612
|
-
|
|
19144
|
+
platform.add_window_listener('online', updateOnlineStatus);
|
|
19145
|
+
platform.add_window_listener('offline', updateOnlineStatus);
|
|
18613
19146
|
|
|
18614
19147
|
console.log('xuda.ai system ready.');
|
|
18615
|
-
|
|
19148
|
+
platform.dispatch_body_event(glb.system_ready_event);
|
|
18616
19149
|
};
|
|
18617
19150
|
func.UI.main.set_custom_css = function (SESSION_ID, callbackP) {
|
|
18618
19151
|
if (SESSION_OBJ[SESSION_ID].DS_GLB[0].data_system?.['SYS_GLOBAL_STR_SITE_CSS']) $("<style type='text/css'> " + SESSION_OBJ[SESSION_ID].DS_GLB[0].data_system['SYS_GLOBAL_STR_SITE_CSS'] + ' </style>').appendTo('head');
|
|
@@ -18628,12 +19161,14 @@ $(document).ready(function () {
|
|
|
18628
19161
|
});
|
|
18629
19162
|
|
|
18630
19163
|
function xuda(...args) {
|
|
19164
|
+
const platform = func.runtime.platform;
|
|
19165
|
+
const runtime_location = platform.get_location();
|
|
18631
19166
|
let element = null;
|
|
18632
19167
|
let opt = {};
|
|
18633
19168
|
let callback = null;
|
|
18634
19169
|
|
|
18635
19170
|
for (const arg of args) {
|
|
18636
|
-
if (arg
|
|
19171
|
+
if (platform.is_html_element(arg)) {
|
|
18637
19172
|
// Detect the element (e.g., <div>, <span>, etc.)
|
|
18638
19173
|
element = arg;
|
|
18639
19174
|
} else if (typeof arg === 'object' && arg !== null && !Array.isArray(arg)) {
|
|
@@ -18662,13 +19197,13 @@ function xuda(...args) {
|
|
|
18662
19197
|
if (typeof opt !== 'object') {
|
|
18663
19198
|
return console.error('Xuda Error - opt argument is not an object');
|
|
18664
19199
|
}
|
|
18665
|
-
glb.URL_PARAMS = func.common.getJsonFromUrl(
|
|
19200
|
+
glb.URL_PARAMS = func.common.getJsonFromUrl(platform.get_url_href());
|
|
18666
19201
|
|
|
18667
19202
|
glb.worker_type = 'Worker';
|
|
18668
19203
|
if (opt.debug_js) {
|
|
18669
19204
|
glb.debug_js = true;
|
|
18670
19205
|
|
|
18671
|
-
if ((
|
|
19206
|
+
if ((runtime_location?.host?.includes('localhost') || runtime_location?.host?.includes('127.0.0.1')) && typeof glb.SLIM_BUNDLE === 'undefined' && typeof glb.CODE_BUNDLE === 'undefined') {
|
|
18672
19207
|
glb.worker_type = 'Dev';
|
|
18673
19208
|
} else {
|
|
18674
19209
|
glb.worker_type = 'Debug';
|
|
@@ -18681,91 +19216,7 @@ function xuda(...args) {
|
|
|
18681
19216
|
const _api_callback = callback;
|
|
18682
19217
|
|
|
18683
19218
|
const create_index_html = function () {
|
|
18684
|
-
|
|
18685
|
-
$(root_element).css('position', 'relative');
|
|
18686
|
-
|
|
18687
|
-
$(root_element).append(`
|
|
18688
|
-
|
|
18689
|
-
<style>
|
|
18690
|
-
.loader {
|
|
18691
|
-
position: absolute;
|
|
18692
|
-
background: rgb(0 0 0 / 30%);
|
|
18693
|
-
z-index: 10;
|
|
18694
|
-
overflow-y: auto;
|
|
18695
|
-
top: 0;
|
|
18696
|
-
right: 0;
|
|
18697
|
-
bottom: 0;
|
|
18698
|
-
left: 0;
|
|
18699
|
-
display: flex;
|
|
18700
|
-
flex-direction: column;
|
|
18701
|
-
justify-content: center;
|
|
18702
|
-
align-items: center;
|
|
18703
|
-
}
|
|
18704
|
-
|
|
18705
|
-
.loader .loader_logo {
|
|
18706
|
-
|
|
18707
|
-
width: 43px;
|
|
18708
|
-
height: 43px;
|
|
18709
|
-
border-radius: 50%;
|
|
18710
|
-
background-size: cover;
|
|
18711
|
-
}
|
|
18712
|
-
|
|
18713
|
-
.loader .loader_msg {
|
|
18714
|
-
padding-top: 10px;
|
|
18715
|
-
text-align: center;
|
|
18716
|
-
min-height: 20px;
|
|
18717
|
-
font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
|
|
18718
|
-
}
|
|
18719
|
-
|
|
18720
|
-
.loader .loader_rotate {
|
|
18721
|
-
padding: 20px;
|
|
18722
|
-
border: 2px solid #fff;
|
|
18723
|
-
border-right-color: #898989;
|
|
18724
|
-
border-radius: 22px;
|
|
18725
|
-
-webkit-animation: rotate 0.8s infinite linear;
|
|
18726
|
-
position: absolute;
|
|
18727
|
-
}
|
|
18728
|
-
|
|
18729
|
-
@-webkit-keyframes rotate {
|
|
18730
|
-
100% {
|
|
18731
|
-
-webkit-transform: rotate(360deg);
|
|
18732
|
-
}
|
|
18733
|
-
}
|
|
18734
|
-
</style>
|
|
18735
|
-
|
|
18736
|
-
<div class="loader">
|
|
18737
|
-
<div class="loader_logo">
|
|
18738
|
-
<div class="loader_rotate"></div>
|
|
18739
|
-
</div>
|
|
18740
|
-
<div class="loader_msg"> </div>
|
|
18741
|
-
</div>
|
|
18742
|
-
|
|
18743
|
-
|
|
18744
|
-
<div class="progressLoader"></div>
|
|
18745
|
-
|
|
18746
|
-
`);
|
|
18747
|
-
|
|
18748
|
-
$(root_element).append(
|
|
18749
|
-
`<div aria-live="assertive"
|
|
18750
|
-
class="fixed inset-0 flex items-end px-4 py-6 pointer-events-none sm:p-6 sm:items-start z-[999]">
|
|
18751
|
-
<div id="tailwind_toast_controller" class="w-full flex flex-col items-center space-y-4 sm:items-end">
|
|
18752
|
-
|
|
18753
|
-
</div>
|
|
18754
|
-
</div>`,
|
|
18755
|
-
);
|
|
18756
|
-
|
|
18757
|
-
$(root_element).append(
|
|
18758
|
-
`
|
|
18759
|
-
<div id="progressScreen2" style="display: none">
|
|
18760
|
-
<div id="progressScreen2_text"></div>
|
|
18761
|
-
</div>`,
|
|
18762
|
-
);
|
|
18763
|
-
|
|
18764
|
-
const get_url = function (domain, method, path) {
|
|
18765
|
-
return `https://${domain}/${method}${path ? '/' + path : '/'}`;
|
|
18766
|
-
};
|
|
18767
|
-
|
|
18768
|
-
func.utils.load_css_on_demand(get_url(domain, 'dist', 'runtime/css/mobile.css'));
|
|
19219
|
+
func.runtime.ui.ensure_app_shell(SESSION_ID, _session.domain);
|
|
18769
19220
|
};
|
|
18770
19221
|
const device_ready = async function () {
|
|
18771
19222
|
return new Promise(function (resolve, reject) {
|
|
@@ -18773,7 +19224,7 @@ function xuda(...args) {
|
|
|
18773
19224
|
return resolve();
|
|
18774
19225
|
}
|
|
18775
19226
|
|
|
18776
|
-
|
|
19227
|
+
platform.get_document().addEventListener(
|
|
18777
19228
|
'deviceready',
|
|
18778
19229
|
function () {
|
|
18779
19230
|
glb.is_cordova = true;
|
|
@@ -18791,119 +19242,21 @@ function xuda(...args) {
|
|
|
18791
19242
|
});
|
|
18792
19243
|
};
|
|
18793
19244
|
const get_session_id = function () {
|
|
18794
|
-
|
|
18795
|
-
var iPageTabID = sessionStorage.getItem('tabID');
|
|
18796
|
-
// if it is the first time that this page is loaded
|
|
18797
|
-
if (iPageTabID == null) {
|
|
18798
|
-
var iLocalTabID = localStorage.getItem('tabID');
|
|
18799
|
-
// if tabID is not yet defined in localStorage it is initialized to 1
|
|
18800
|
-
// else tabId counter is increment by 1
|
|
18801
|
-
var iPageTabID = iLocalTabID == null ? 1 : Number(iLocalTabID) + 1;
|
|
18802
|
-
// new computed value are saved in localStorage and in sessionStorage
|
|
18803
|
-
localStorage.setItem('tabID', iPageTabID);
|
|
18804
|
-
sessionStorage.setItem('tabID', iPageTabID);
|
|
18805
|
-
}
|
|
18806
|
-
|
|
18807
|
-
return iPageTabID;
|
|
18808
|
-
}
|
|
18809
|
-
if (func.utils.get_device()) {
|
|
18810
|
-
return _instance_id + window.device.uuid;
|
|
18811
|
-
}
|
|
18812
|
-
var fingerprint_id = Fingerprint2.x64hash128(
|
|
18813
|
-
components
|
|
18814
|
-
.map(function (pair) {
|
|
18815
|
-
return pair.value;
|
|
18816
|
-
})
|
|
18817
|
-
.join(),
|
|
18818
|
-
31,
|
|
18819
|
-
);
|
|
18820
|
-
|
|
18821
|
-
return _instance_id + fingerprint_id + defineTabID();
|
|
19245
|
+
return func.runtime.session.get_fingerprint(components, _instance_id);
|
|
18822
19246
|
};
|
|
18823
19247
|
const get_fingerprint = function () {
|
|
18824
|
-
|
|
18825
|
-
return window.device.uuid;
|
|
18826
|
-
}
|
|
18827
|
-
return Fingerprint2.x64hash128(
|
|
18828
|
-
components
|
|
18829
|
-
.map(function (pair) {
|
|
18830
|
-
return pair.value;
|
|
18831
|
-
})
|
|
18832
|
-
.join(),
|
|
18833
|
-
31,
|
|
18834
|
-
);
|
|
19248
|
+
return func.runtime.session.get_fingerprint(components);
|
|
18835
19249
|
};
|
|
18836
19250
|
const init_SESSION = function () {
|
|
18837
|
-
|
|
18838
|
-
JOB_NO: 1000,
|
|
18839
|
-
|
|
19251
|
+
return func.runtime.session.create_state(SESSION_ID, {
|
|
18840
19252
|
opt,
|
|
18841
19253
|
root_element: $(element)[0],
|
|
18842
19254
|
worker_type: glb.worker_type,
|
|
18843
19255
|
api_callback: _api_callback,
|
|
18844
|
-
|
|
18845
|
-
|
|
18846
|
-
|
|
18847
|
-
|
|
18848
|
-
num: 1000,
|
|
18849
|
-
stat: null,
|
|
18850
|
-
},
|
|
18851
|
-
DS_GLB: {},
|
|
18852
|
-
|
|
18853
|
-
SYS_GLOBAL_OBJ_FIREBASE_AUTH_INFO: {
|
|
18854
|
-
token: '',
|
|
18855
|
-
first_name: '',
|
|
18856
|
-
last_name: '',
|
|
18857
|
-
email: '',
|
|
18858
|
-
user_id: '',
|
|
18859
|
-
picture: '',
|
|
18860
|
-
verified_email: '',
|
|
18861
|
-
locale: '',
|
|
18862
|
-
error_code: '',
|
|
18863
|
-
error_msg: '',
|
|
18864
|
-
},
|
|
18865
|
-
SYS_GLOBAL_OBJ_CLIENT_INFO: {
|
|
18866
|
-
fingerprint: '',
|
|
18867
|
-
device: '',
|
|
18868
|
-
|
|
18869
|
-
user_agent: '',
|
|
18870
|
-
browser_version: '',
|
|
18871
|
-
browser_name: '',
|
|
18872
|
-
engine_version: '',
|
|
18873
|
-
client_ip: '',
|
|
18874
|
-
engine_name: '',
|
|
18875
|
-
os_name: '',
|
|
18876
|
-
os_version: '',
|
|
18877
|
-
device_model: '',
|
|
18878
|
-
device_vendor: '',
|
|
18879
|
-
device_type: '',
|
|
18880
|
-
screen_current_resolution_x: '',
|
|
18881
|
-
screen_current_resolution_y: '',
|
|
18882
|
-
screen_available_resolution_x: '',
|
|
18883
|
-
screen_available_resolution_y: '',
|
|
18884
|
-
language: '',
|
|
18885
|
-
time_zone: '',
|
|
18886
|
-
cpu_architecture: '',
|
|
18887
|
-
uuid: '',
|
|
18888
|
-
},
|
|
18889
|
-
PUSH_NOTIFICATION_GRANTED: null,
|
|
18890
|
-
FIREBASE_TOKEN_ID: null,
|
|
18891
|
-
|
|
18892
|
-
USR_OBJ: {},
|
|
18893
|
-
|
|
18894
|
-
debug_js: null,
|
|
18895
|
-
DS_UI_EVENTS_GLB: {},
|
|
18896
|
-
host: location.host,
|
|
18897
|
-
req_id: 0,
|
|
18898
|
-
build_info: {},
|
|
18899
|
-
CACHE_REQ: {},
|
|
18900
|
-
url_params: {
|
|
18901
|
-
...func.common.getParametersFromUrl(),
|
|
18902
|
-
...opt.url_params,
|
|
18903
|
-
},
|
|
18904
|
-
};
|
|
18905
|
-
WEB_WORKER[SESSION_ID] = {};
|
|
18906
|
-
return SESSION_OBJ[SESSION_ID];
|
|
19256
|
+
code_bundle: glb.CODE_BUNDLE,
|
|
19257
|
+
slim_bundle: glb.SLIM_BUNDLE,
|
|
19258
|
+
url_params: opt.url_params,
|
|
19259
|
+
});
|
|
18907
19260
|
};
|
|
18908
19261
|
const set_SESSION = async function () {
|
|
18909
19262
|
for await (const key of ['gtp_token', 'app_token', 'prog_id', 'domain', 'engine_mode', 'crawler', 'app_id', 'route_id', 'menu_id', 'local_live_preview', 'project_data']) {
|
|
@@ -18911,22 +19264,7 @@ function xuda(...args) {
|
|
|
18911
19264
|
|
|
18912
19265
|
// set defaults
|
|
18913
19266
|
if (!_session[key]) {
|
|
18914
|
-
|
|
18915
|
-
switch (key) {
|
|
18916
|
-
case 'domain':
|
|
18917
|
-
val = window.location.host;
|
|
18918
|
-
break;
|
|
18919
|
-
case 'engine_mode':
|
|
18920
|
-
val = 'miniapp'; //was 'run'
|
|
18921
|
-
break;
|
|
18922
|
-
case 'app_id':
|
|
18923
|
-
val = 'unknown';
|
|
18924
|
-
break;
|
|
18925
|
-
|
|
18926
|
-
default:
|
|
18927
|
-
break;
|
|
18928
|
-
}
|
|
18929
|
-
_session[key] = val;
|
|
19267
|
+
func.runtime.session.set_default_value(_session, key);
|
|
18930
19268
|
}
|
|
18931
19269
|
|
|
18932
19270
|
// set exceptions
|
|
@@ -19042,51 +19380,7 @@ function xuda(...args) {
|
|
|
19042
19380
|
_session.crawler = opt.crawler;
|
|
19043
19381
|
};
|
|
19044
19382
|
const set_SYS_GLOBAL_OBJ_CLIENT_INFO = function () {
|
|
19045
|
-
|
|
19046
|
-
var _client_info = _session.SYS_GLOBAL_OBJ_CLIENT_INFO;
|
|
19047
|
-
|
|
19048
|
-
_client_info.fingerprint = get_fingerprint();
|
|
19049
|
-
|
|
19050
|
-
if (engine_mode === 'live_preview') {
|
|
19051
|
-
_client_info.screen_current_resolution_x = window.innerWidth;
|
|
19052
|
-
_client_info.screen_current_resolution_y = window.innerHeight;
|
|
19053
|
-
_client_info.screen_available_resolution_x = window.innerWidth;
|
|
19054
|
-
_client_info.screen_available_resolution_y = window.innerHeight;
|
|
19055
|
-
} else {
|
|
19056
|
-
_client_info.screen_current_resolution_x = components[6].value[0];
|
|
19057
|
-
_client_info.screen_current_resolution_y = components[6].value[1];
|
|
19058
|
-
_client_info.screen_available_resolution_x = components[7].value[0];
|
|
19059
|
-
_client_info.screen_available_resolution_y = components[7].value[1];
|
|
19060
|
-
}
|
|
19061
|
-
|
|
19062
|
-
const client = new ClientJS();
|
|
19063
|
-
|
|
19064
|
-
_client_info.device = func.utils.get_device();
|
|
19065
|
-
|
|
19066
|
-
const browser_data = client.getBrowserData();
|
|
19067
|
-
|
|
19068
|
-
_client_info.user_agent = browser_data.ua;
|
|
19069
|
-
|
|
19070
|
-
_client_info.browser_version = browser_data.browser.name;
|
|
19071
|
-
_client_info.browser_name = browser_data.browser.version;
|
|
19072
|
-
_client_info.engine_version = browser_data.engine.name;
|
|
19073
|
-
_client_info.engine_name = browser_data.engine.version;
|
|
19074
|
-
_client_info.os_name = browser_data.os.name;
|
|
19075
|
-
_client_info.os_version = browser_data.os.version;
|
|
19076
|
-
_client_info.device_model = browser_data.device.name;
|
|
19077
|
-
_client_info.device_vendor = browser_data.device.name;
|
|
19078
|
-
_client_info.device_type = browser_data.device.name;
|
|
19079
|
-
|
|
19080
|
-
_client_info.language = client.getLanguage();
|
|
19081
|
-
_client_info.time_zone = client.getTimeZone();
|
|
19082
|
-
_client_info.cpu_architecture = browser_data.cpu.architecture;
|
|
19083
|
-
|
|
19084
|
-
if (['android', 'ios', 'windows', 'macos', 'linux', 'live_preview'].includes(engine_mode) && func.utils.get_device()) {
|
|
19085
|
-
_client_info.uuid = window.device.uuid;
|
|
19086
|
-
if (window.device) {
|
|
19087
|
-
_client_info.device_name = window.device.name;
|
|
19088
|
-
}
|
|
19089
|
-
}
|
|
19383
|
+
func.runtime.session.populate_client_info(_session, components);
|
|
19090
19384
|
};
|
|
19091
19385
|
const init_globals = function () {
|
|
19092
19386
|
const { app_id, worker_type } = _session;
|
|
@@ -19255,11 +19549,11 @@ func.index.call_worker = async function (SESSION_ID, obj, params, promiseP) {
|
|
|
19255
19549
|
const set_promise_queue = function (worker_id) {
|
|
19256
19550
|
var t = glb.worker_queue_num++;
|
|
19257
19551
|
try {
|
|
19258
|
-
|
|
19552
|
+
func.runtime.workers.set_promise(SESSION_ID, worker_id, t, {
|
|
19259
19553
|
resolve: promiseP ? promiseP.resolve : resolve,
|
|
19260
19554
|
reject: promiseP ? promiseP.reject : reject,
|
|
19261
19555
|
worker_id,
|
|
19262
|
-
};
|
|
19556
|
+
});
|
|
19263
19557
|
} catch (e) {
|
|
19264
19558
|
console.log(worker_id);
|
|
19265
19559
|
}
|
|
@@ -19350,17 +19644,12 @@ func.index.call_worker = async function (SESSION_ID, obj, params, promiseP) {
|
|
|
19350
19644
|
return resolve();
|
|
19351
19645
|
}
|
|
19352
19646
|
|
|
19353
|
-
|
|
19354
|
-
|
|
19355
|
-
|
|
19356
|
-
let msg_obj = JSON.parse(msg);
|
|
19357
|
-
WEB_WORKER[SESSION_ID][worker_id].worker.emit('message', msg_obj);
|
|
19358
|
-
} else {
|
|
19359
|
-
msg = JSON.stringify(obj, func.utils.clean_stringify_null, '\t');
|
|
19360
|
-
let msg_obj = JSON.parse(msg);
|
|
19647
|
+
msg = JSON.stringify(obj, func.utils.clean_stringify_null, '\t');
|
|
19648
|
+
let msg_obj = JSON.parse(msg);
|
|
19649
|
+
if (!func.runtime.workers.is_server_transport(_session)) {
|
|
19361
19650
|
msg_obj.data = JSON.stringify(msg_obj.data);
|
|
19362
|
-
WEB_WORKER[SESSION_ID][worker_id].worker.postMessage(msg_obj);
|
|
19363
19651
|
}
|
|
19652
|
+
func.runtime.workers.send_message(SESSION_ID, worker_id, _session, msg_obj, WEBSOCKET_PROCESS_PID);
|
|
19364
19653
|
} catch (e) {
|
|
19365
19654
|
console.error(e);
|
|
19366
19655
|
return reject(e);
|
|
@@ -19638,7 +19927,7 @@ func.index.init_document_listeners = function () {
|
|
|
19638
19927
|
if (ret?.session_stat === 3) {
|
|
19639
19928
|
await func.index.delete_pouch();
|
|
19640
19929
|
// window.location.href = `https://${_session.domain}/error?error_code=408`;
|
|
19641
|
-
|
|
19930
|
+
platform.reload_top_window(); //href = `https://${_session.domain}?ts=${Date.now()}`;
|
|
19642
19931
|
}
|
|
19643
19932
|
$('body').removeClass('get_support_request');
|
|
19644
19933
|
$('body').find('.get_support_request_title').remove();
|
|
@@ -19659,9 +19948,10 @@ func.index.init_document_listeners = function () {
|
|
|
19659
19948
|
_session.res_token = ret.res_token;
|
|
19660
19949
|
}, 30000);
|
|
19661
19950
|
|
|
19662
|
-
glb.WINDOW_LOCATION_SEARCH =
|
|
19951
|
+
glb.WINDOW_LOCATION_SEARCH = platform.get_url_search();
|
|
19663
19952
|
};
|
|
19664
19953
|
func.index.checkConnectivity = async function () {
|
|
19954
|
+
const platform = func.runtime.platform;
|
|
19665
19955
|
const endpoints = ['https://xuda.ai/favicon.ico']; //'https://www.cloudflare.com/favicon.ico',
|
|
19666
19956
|
|
|
19667
19957
|
const promises = endpoints.map((url) =>
|
|
@@ -19674,23 +19964,24 @@ func.index.checkConnectivity = async function () {
|
|
|
19674
19964
|
IS_ONLINE = results.some((result) => result === true);
|
|
19675
19965
|
|
|
19676
19966
|
// Add event listeners for online/offline events
|
|
19677
|
-
|
|
19967
|
+
platform.add_window_listener('online', function () {
|
|
19678
19968
|
IS_ONLINE = true;
|
|
19679
19969
|
$('body').trigger('set_db_replication_from_server');
|
|
19680
19970
|
});
|
|
19681
19971
|
|
|
19682
|
-
|
|
19972
|
+
platform.add_window_listener('offline', function () {
|
|
19683
19973
|
IS_ONLINE = false;
|
|
19684
19974
|
});
|
|
19685
19975
|
};
|
|
19686
19976
|
|
|
19687
19977
|
func.index.init_service_workers = function () {
|
|
19688
|
-
|
|
19689
|
-
|
|
19978
|
+
const platform = func.runtime.platform;
|
|
19979
|
+
if (platform.has_service_worker()) {
|
|
19980
|
+
platform.add_service_worker_listener('message', function (event) {
|
|
19690
19981
|
console.log('serviceWorker message:', event);
|
|
19691
19982
|
});
|
|
19692
19983
|
|
|
19693
|
-
|
|
19984
|
+
platform.register_service_worker('xuda-sw.js').then(
|
|
19694
19985
|
function (registration) {
|
|
19695
19986
|
// Registration was successful
|
|
19696
19987
|
console.log('ServiceWorker registration successful with scope: ', registration.scope);
|
|
@@ -19715,7 +20006,8 @@ func.index.delete_pouch = async function (SESSION_ID = Object.keys(SESSION_OBJ)[
|
|
|
19715
20006
|
};
|
|
19716
20007
|
|
|
19717
20008
|
func.index.new_webworker = async function (SESSION_ID, prog_obj, obj) {
|
|
19718
|
-
|
|
20009
|
+
const worker_registry = func.runtime.workers.ensure_registry(SESSION_ID);
|
|
20010
|
+
var worker_id = Object.keys(worker_registry).length + 1;
|
|
19719
20011
|
|
|
19720
20012
|
var _session = SESSION_OBJ[SESSION_ID];
|
|
19721
20013
|
if (!_session.engine_mode === 'docker') {
|
|
@@ -19727,17 +20019,7 @@ func.index.new_webworker = async function (SESSION_ID, prog_obj, obj) {
|
|
|
19727
20019
|
build_id = XUDA_BUILD_ID;
|
|
19728
20020
|
}
|
|
19729
20021
|
|
|
19730
|
-
const worker_name =
|
|
19731
|
-
`${typeof _session.SLIM_BUNDLE === 'undefined' || !_session.SLIM_BUNDLE ? '' : 'Slim '}${prog_obj.menuName} worker` +
|
|
19732
|
-
// (prog_obj.menuName || "xuda.ai worker") +
|
|
19733
|
-
' ' +
|
|
19734
|
-
glb.worker_type +
|
|
19735
|
-
': #' +
|
|
19736
|
-
worker_id.toString() +
|
|
19737
|
-
' ' +
|
|
19738
|
-
(build_id || '') +
|
|
19739
|
-
' ' +
|
|
19740
|
-
_session.domain;
|
|
20022
|
+
const worker_name = func.runtime.workers.build_worker_name(glb.worker_type, _session, prog_obj, worker_id, build_id);
|
|
19741
20023
|
|
|
19742
20024
|
const init_worker_session = function (worker_id) {
|
|
19743
20025
|
var _session = _.cloneDeep(SESSION_OBJ[SESSION_ID]);
|
|
@@ -19796,33 +20078,31 @@ func.index.new_webworker = async function (SESSION_ID, prog_obj, obj) {
|
|
|
19796
20078
|
$.map(_session.DS_GLB, function (val, i) {
|
|
19797
20079
|
ds_arr.push(i);
|
|
19798
20080
|
});
|
|
19799
|
-
|
|
20081
|
+
worker_registry[worker_id].ds_arr = ds_arr;
|
|
19800
20082
|
|
|
19801
20083
|
delete data.SESSION_INFO.DS_UI_EVENTS_GLB; // contains function produce error
|
|
19802
20084
|
|
|
19803
|
-
|
|
19804
|
-
|
|
19805
|
-
|
|
19806
|
-
|
|
19807
|
-
|
|
19808
|
-
});
|
|
19809
|
-
} else {
|
|
19810
|
-
WEB_WORKER[SESSION_ID][worker_id].worker.postMessage({
|
|
20085
|
+
func.runtime.workers.send_message(
|
|
20086
|
+
SESSION_ID,
|
|
20087
|
+
worker_id,
|
|
20088
|
+
_session,
|
|
20089
|
+
{
|
|
19811
20090
|
service: 'init',
|
|
19812
|
-
data: JSON.stringify(data),
|
|
20091
|
+
data: func.runtime.workers.is_server_transport(_session) ? data : JSON.stringify(data),
|
|
19813
20092
|
worker_id: worker_id,
|
|
19814
|
-
}
|
|
19815
|
-
|
|
20093
|
+
},
|
|
20094
|
+
WEBSOCKET_PROCESS_PID,
|
|
20095
|
+
);
|
|
19816
20096
|
};
|
|
19817
20097
|
const create_worker = async function () {
|
|
19818
20098
|
return new Promise((resolve, reject) => {
|
|
19819
20099
|
if (glb.worker_type === 'Dev') {
|
|
19820
|
-
|
|
20100
|
+
func.runtime.workers.set_registry_entry(SESSION_ID, worker_id, {
|
|
19821
20101
|
worker: new Worker('js/xuda_worker.js', {
|
|
19822
20102
|
name: worker_name,
|
|
19823
20103
|
}),
|
|
19824
20104
|
promise_queue: {},
|
|
19825
|
-
};
|
|
20105
|
+
});
|
|
19826
20106
|
} else {
|
|
19827
20107
|
function getWorkerURL(url) {
|
|
19828
20108
|
const content = `importScripts( "${url}" );`;
|
|
@@ -19830,14 +20110,14 @@ func.index.new_webworker = async function (SESSION_ID, prog_obj, obj) {
|
|
|
19830
20110
|
}
|
|
19831
20111
|
const _session = SESSION_OBJ[SESSION_ID];
|
|
19832
20112
|
let blob = getWorkerURL(func.common.get_url(SESSION_ID, 'dist', func.utils.get_resource_filename(['live_preview', 'miniapp'].includes(_session.engine_mode) ? '' : _session?.opt?.app_build_id, 'runtime/js/xuda_worker.js')));
|
|
19833
|
-
|
|
20113
|
+
func.runtime.workers.set_registry_entry(SESSION_ID, worker_id, {
|
|
19834
20114
|
worker: new Worker(blob, {
|
|
19835
20115
|
name: worker_name,
|
|
19836
20116
|
}),
|
|
19837
20117
|
promise_queue: {},
|
|
19838
|
-
};
|
|
20118
|
+
});
|
|
19839
20119
|
}
|
|
19840
|
-
|
|
20120
|
+
func.runtime.workers.get_registry_entry(SESSION_ID, worker_id).worker.addEventListener(
|
|
19841
20121
|
'message',
|
|
19842
20122
|
function (e) {
|
|
19843
20123
|
if (e.data.service === 'worker_ready') {
|
|
@@ -19851,12 +20131,12 @@ func.index.new_webworker = async function (SESSION_ID, prog_obj, obj) {
|
|
|
19851
20131
|
};
|
|
19852
20132
|
const create_websocket = async function () {
|
|
19853
20133
|
return new Promise((resolve, reject) => {
|
|
19854
|
-
|
|
20134
|
+
func.runtime.workers.set_registry_entry(SESSION_ID, worker_id, {
|
|
19855
20135
|
worker: RUNTIME_SERVER_WEBSOCKET,
|
|
19856
20136
|
promise_queue: {},
|
|
19857
|
-
};
|
|
20137
|
+
});
|
|
19858
20138
|
|
|
19859
|
-
|
|
20139
|
+
func.runtime.workers.get_registry_entry(SESSION_ID, worker_id).worker.on('message', async (e) => {
|
|
19860
20140
|
if (['deployment_server', 'http_call'].includes(e.source)) return;
|
|
19861
20141
|
worker_functions({ data: e });
|
|
19862
20142
|
});
|
|
@@ -20061,13 +20341,7 @@ func.index.new_webworker = async function (SESSION_ID, prog_obj, obj) {
|
|
|
20061
20341
|
msg.data.session_id = SESSION_ID;
|
|
20062
20342
|
msg.data.data = data;
|
|
20063
20343
|
|
|
20064
|
-
|
|
20065
|
-
msg.process_pid = WEBSOCKET_PROCESS_PID;
|
|
20066
|
-
WEB_WORKER[SESSION_ID][worker_id].worker.emit('message', msg);
|
|
20067
|
-
// WEB_WORKER[SESSION_ID][worker_id].worker.send(JSON.stringify(msg));
|
|
20068
|
-
} else {
|
|
20069
|
-
WEB_WORKER[SESSION_ID][worker_id].worker.postMessage(msg);
|
|
20070
|
-
}
|
|
20344
|
+
func.runtime.workers.send_message(SESSION_ID, worker_id, _session, msg, WEBSOCKET_PROCESS_PID);
|
|
20071
20345
|
_resolve();
|
|
20072
20346
|
},
|
|
20073
20347
|
execute_local_sava_data: async function () {
|
|
@@ -20084,12 +20358,7 @@ func.index.new_webworker = async function (SESSION_ID, prog_obj, obj) {
|
|
|
20084
20358
|
msg.data.session_id = SESSION_ID;
|
|
20085
20359
|
msg.data.data = data;
|
|
20086
20360
|
|
|
20087
|
-
|
|
20088
|
-
msg.process_pid = WEBSOCKET_PROCESS_PID;
|
|
20089
|
-
WEB_WORKER[SESSION_ID][worker_id].worker.emit('message', msg);
|
|
20090
|
-
} else {
|
|
20091
|
-
WEB_WORKER[SESSION_ID][worker_id].worker.postMessage(msg);
|
|
20092
|
-
}
|
|
20361
|
+
func.runtime.workers.send_message(SESSION_ID, worker_id, _session, msg, WEBSOCKET_PROCESS_PID);
|
|
20093
20362
|
_resolve();
|
|
20094
20363
|
},
|
|
20095
20364
|
write_debug_log: function (params) {
|
|
@@ -20172,12 +20441,12 @@ func.index.new_webworker = async function (SESSION_ID, prog_obj, obj) {
|
|
|
20172
20441
|
};
|
|
20173
20442
|
|
|
20174
20443
|
const get_promise_queue = function (t, worker_id) {
|
|
20175
|
-
if (!
|
|
20444
|
+
if (!func.runtime.workers.get_registry_entry(SESSION_ID, worker_id)) {
|
|
20176
20445
|
console.warn('worker job not found');
|
|
20177
20446
|
return;
|
|
20178
20447
|
}
|
|
20179
20448
|
|
|
20180
|
-
return
|
|
20449
|
+
return func.runtime.workers.get_promise(SESSION_ID, worker_id, t);
|
|
20181
20450
|
};
|
|
20182
20451
|
|
|
20183
20452
|
const promise_ret = await get_promise_queue(e.data.promise_queue_id, e.data.worker_id);
|
|
@@ -20186,7 +20455,7 @@ func.index.new_webworker = async function (SESSION_ID, prog_obj, obj) {
|
|
|
20186
20455
|
if (!promise_ret) return resolve();
|
|
20187
20456
|
promise_ret.resolve(params);
|
|
20188
20457
|
setTimeout(function () {
|
|
20189
|
-
|
|
20458
|
+
func.runtime.workers.delete_promise(SESSION_ID, e.data.worker_id, e.data.promise_queue_id);
|
|
20190
20459
|
}, 1000);
|
|
20191
20460
|
};
|
|
20192
20461
|
|