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