@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
|
@@ -23636,6 +23636,10 @@ var func = {};
|
|
|
23636
23636
|
func.UI = {};
|
|
23637
23637
|
func.GLB = {};
|
|
23638
23638
|
func.mobile = {};
|
|
23639
|
+
func.runtime = {};
|
|
23640
|
+
func.runtime.session = {};
|
|
23641
|
+
func.runtime.workers = {};
|
|
23642
|
+
func.runtime.ui = {};
|
|
23639
23643
|
glb.IS_STUDIO = null;
|
|
23640
23644
|
|
|
23641
23645
|
var PROJECT_OBJ = {};
|
|
@@ -23649,6 +23653,537 @@ glb.PROTECTED_VARS = ['_NULL', '_THIS', '_FOR_KEY', '_FOR_VAL', '_ROWNO', '_ROWI
|
|
|
23649
23653
|
// glb.newRecord = 999999;
|
|
23650
23654
|
|
|
23651
23655
|
func.common = {};
|
|
23656
|
+
func.runtime.platform = {
|
|
23657
|
+
has_window: function () {
|
|
23658
|
+
return typeof window !== 'undefined';
|
|
23659
|
+
},
|
|
23660
|
+
has_document: function () {
|
|
23661
|
+
return typeof document !== 'undefined';
|
|
23662
|
+
},
|
|
23663
|
+
get_window: function () {
|
|
23664
|
+
if (func.runtime.platform.has_window()) {
|
|
23665
|
+
return window;
|
|
23666
|
+
}
|
|
23667
|
+
return null;
|
|
23668
|
+
},
|
|
23669
|
+
get_document: function () {
|
|
23670
|
+
if (func.runtime.platform.has_document()) {
|
|
23671
|
+
return document;
|
|
23672
|
+
}
|
|
23673
|
+
return null;
|
|
23674
|
+
},
|
|
23675
|
+
get_location: function () {
|
|
23676
|
+
const win = func.runtime.platform.get_window();
|
|
23677
|
+
return win?.location || null;
|
|
23678
|
+
},
|
|
23679
|
+
get_navigator: function () {
|
|
23680
|
+
const win = func.runtime.platform.get_window();
|
|
23681
|
+
if (win?.navigator) {
|
|
23682
|
+
return win.navigator;
|
|
23683
|
+
}
|
|
23684
|
+
if (typeof navigator !== 'undefined') {
|
|
23685
|
+
return navigator;
|
|
23686
|
+
}
|
|
23687
|
+
return null;
|
|
23688
|
+
},
|
|
23689
|
+
is_html_element: function (value) {
|
|
23690
|
+
if (typeof HTMLElement === 'undefined') {
|
|
23691
|
+
return false;
|
|
23692
|
+
}
|
|
23693
|
+
return value instanceof HTMLElement;
|
|
23694
|
+
},
|
|
23695
|
+
get_storage: function (type) {
|
|
23696
|
+
const win = func.runtime.platform.get_window();
|
|
23697
|
+
try {
|
|
23698
|
+
if (!win) {
|
|
23699
|
+
return null;
|
|
23700
|
+
}
|
|
23701
|
+
if (type === 'session') {
|
|
23702
|
+
return win.sessionStorage || null;
|
|
23703
|
+
}
|
|
23704
|
+
return win.localStorage || null;
|
|
23705
|
+
} catch (error) {
|
|
23706
|
+
return null;
|
|
23707
|
+
}
|
|
23708
|
+
},
|
|
23709
|
+
get_storage_item: function (key, type) {
|
|
23710
|
+
const storage = func.runtime.platform.get_storage(type);
|
|
23711
|
+
if (!storage) {
|
|
23712
|
+
return null;
|
|
23713
|
+
}
|
|
23714
|
+
try {
|
|
23715
|
+
return storage.getItem(key);
|
|
23716
|
+
} catch (error) {
|
|
23717
|
+
return null;
|
|
23718
|
+
}
|
|
23719
|
+
},
|
|
23720
|
+
set_storage_item: function (key, value, type) {
|
|
23721
|
+
const storage = func.runtime.platform.get_storage(type);
|
|
23722
|
+
if (!storage) {
|
|
23723
|
+
return false;
|
|
23724
|
+
}
|
|
23725
|
+
try {
|
|
23726
|
+
storage.setItem(key, value);
|
|
23727
|
+
return true;
|
|
23728
|
+
} catch (error) {
|
|
23729
|
+
return false;
|
|
23730
|
+
}
|
|
23731
|
+
},
|
|
23732
|
+
get_url_href: function () {
|
|
23733
|
+
return func.runtime.platform.get_location()?.href || '';
|
|
23734
|
+
},
|
|
23735
|
+
get_url_search: function () {
|
|
23736
|
+
return func.runtime.platform.get_location()?.search || '';
|
|
23737
|
+
},
|
|
23738
|
+
get_url_hash: function () {
|
|
23739
|
+
return func.runtime.platform.get_location()?.hash || '';
|
|
23740
|
+
},
|
|
23741
|
+
get_host: function () {
|
|
23742
|
+
return func.runtime.platform.get_location()?.host || '';
|
|
23743
|
+
},
|
|
23744
|
+
get_hostname: function () {
|
|
23745
|
+
return func.runtime.platform.get_location()?.hostname || '';
|
|
23746
|
+
},
|
|
23747
|
+
get_device_uuid: function () {
|
|
23748
|
+
const win = func.runtime.platform.get_window();
|
|
23749
|
+
return win?.device?.uuid || null;
|
|
23750
|
+
},
|
|
23751
|
+
get_device_name: function () {
|
|
23752
|
+
const win = func.runtime.platform.get_window();
|
|
23753
|
+
return win?.device?.name || null;
|
|
23754
|
+
},
|
|
23755
|
+
get_inner_size: function () {
|
|
23756
|
+
const win = func.runtime.platform.get_window();
|
|
23757
|
+
return {
|
|
23758
|
+
width: win?.innerWidth || 0,
|
|
23759
|
+
height: win?.innerHeight || 0,
|
|
23760
|
+
};
|
|
23761
|
+
},
|
|
23762
|
+
add_window_listener: function (name, handler) {
|
|
23763
|
+
const win = func.runtime.platform.get_window();
|
|
23764
|
+
if (!win?.addEventListener) {
|
|
23765
|
+
return false;
|
|
23766
|
+
}
|
|
23767
|
+
win.addEventListener(name, handler);
|
|
23768
|
+
return true;
|
|
23769
|
+
},
|
|
23770
|
+
dispatch_body_event: function (event) {
|
|
23771
|
+
const doc = func.runtime.platform.get_document();
|
|
23772
|
+
if (!doc?.body?.dispatchEvent) {
|
|
23773
|
+
return false;
|
|
23774
|
+
}
|
|
23775
|
+
doc.body.dispatchEvent(event);
|
|
23776
|
+
return true;
|
|
23777
|
+
},
|
|
23778
|
+
reload_top_window: function () {
|
|
23779
|
+
const win = func.runtime.platform.get_window();
|
|
23780
|
+
if (!win?.top?.location?.reload) {
|
|
23781
|
+
return false;
|
|
23782
|
+
}
|
|
23783
|
+
win.top.location.reload();
|
|
23784
|
+
return true;
|
|
23785
|
+
},
|
|
23786
|
+
get_service_worker: function () {
|
|
23787
|
+
const nav = func.runtime.platform.get_navigator();
|
|
23788
|
+
return nav?.serviceWorker || null;
|
|
23789
|
+
},
|
|
23790
|
+
has_service_worker: function () {
|
|
23791
|
+
return !!func.runtime.platform.get_service_worker();
|
|
23792
|
+
},
|
|
23793
|
+
register_service_worker: function (script_url) {
|
|
23794
|
+
const service_worker = func.runtime.platform.get_service_worker();
|
|
23795
|
+
if (!service_worker?.register) {
|
|
23796
|
+
return Promise.reject(new Error('serviceWorker is not available'));
|
|
23797
|
+
}
|
|
23798
|
+
return service_worker.register(script_url);
|
|
23799
|
+
},
|
|
23800
|
+
add_service_worker_listener: function (name, handler) {
|
|
23801
|
+
const service_worker = func.runtime.platform.get_service_worker();
|
|
23802
|
+
if (!service_worker?.addEventListener) {
|
|
23803
|
+
return false;
|
|
23804
|
+
}
|
|
23805
|
+
service_worker.addEventListener(name, handler);
|
|
23806
|
+
return true;
|
|
23807
|
+
},
|
|
23808
|
+
};
|
|
23809
|
+
func.runtime.env = {
|
|
23810
|
+
get_url_params: function () {
|
|
23811
|
+
const search = func.runtime.platform.get_url_search();
|
|
23812
|
+
return new URLSearchParams(search);
|
|
23813
|
+
},
|
|
23814
|
+
get_url_parameters_object: function () {
|
|
23815
|
+
const search_params = func.runtime.env.get_url_params();
|
|
23816
|
+
const parameters = {};
|
|
23817
|
+
for (const [key, value] of search_params.entries()) {
|
|
23818
|
+
parameters[key] = value;
|
|
23819
|
+
}
|
|
23820
|
+
return parameters;
|
|
23821
|
+
},
|
|
23822
|
+
get_default_session_value: function (key) {
|
|
23823
|
+
switch (key) {
|
|
23824
|
+
case 'domain':
|
|
23825
|
+
return func.runtime.platform.get_host();
|
|
23826
|
+
case 'engine_mode':
|
|
23827
|
+
return 'miniapp';
|
|
23828
|
+
case 'app_id':
|
|
23829
|
+
return 'unknown';
|
|
23830
|
+
default:
|
|
23831
|
+
return null;
|
|
23832
|
+
}
|
|
23833
|
+
},
|
|
23834
|
+
};
|
|
23835
|
+
func.runtime.session.create_tab_id = function () {
|
|
23836
|
+
const session_storage = func.runtime.platform.get_storage('session');
|
|
23837
|
+
const local_storage = func.runtime.platform.get_storage('local');
|
|
23838
|
+
var page_tab_id = session_storage?.getItem('tabID');
|
|
23839
|
+
if (page_tab_id == null) {
|
|
23840
|
+
var local_tab_id = local_storage?.getItem('tabID');
|
|
23841
|
+
page_tab_id = local_tab_id == null ? 1 : Number(local_tab_id) + 1;
|
|
23842
|
+
func.runtime.platform.set_storage_item('tabID', page_tab_id, 'local');
|
|
23843
|
+
func.runtime.platform.set_storage_item('tabID', page_tab_id, 'session');
|
|
23844
|
+
}
|
|
23845
|
+
return page_tab_id;
|
|
23846
|
+
};
|
|
23847
|
+
func.runtime.session.get_fingerprint = function (components, instance_id) {
|
|
23848
|
+
const device_uuid = func.runtime.platform.get_device_uuid();
|
|
23849
|
+
if (func.utils.get_device() && device_uuid) {
|
|
23850
|
+
if (instance_id) {
|
|
23851
|
+
return instance_id + device_uuid;
|
|
23852
|
+
}
|
|
23853
|
+
return device_uuid;
|
|
23854
|
+
}
|
|
23855
|
+
const fingerprint_id = Fingerprint2.x64hash128(
|
|
23856
|
+
components
|
|
23857
|
+
.map(function (pair) {
|
|
23858
|
+
return pair.value;
|
|
23859
|
+
})
|
|
23860
|
+
.join(),
|
|
23861
|
+
31,
|
|
23862
|
+
);
|
|
23863
|
+
|
|
23864
|
+
if (instance_id) {
|
|
23865
|
+
return instance_id + fingerprint_id + func.runtime.session.create_tab_id();
|
|
23866
|
+
}
|
|
23867
|
+
return fingerprint_id;
|
|
23868
|
+
};
|
|
23869
|
+
func.runtime.session.create_state = function (SESSION_ID, options) {
|
|
23870
|
+
const runtime_host = func.runtime.platform.get_host();
|
|
23871
|
+
SESSION_OBJ[SESSION_ID] = {
|
|
23872
|
+
JOB_NO: 1000,
|
|
23873
|
+
opt: options.opt,
|
|
23874
|
+
root_element: options.root_element,
|
|
23875
|
+
worker_type: options.worker_type,
|
|
23876
|
+
api_callback: options.api_callback,
|
|
23877
|
+
CODE_BUNDLE: options.code_bundle,
|
|
23878
|
+
SLIM_BUNDLE: options.slim_bundle,
|
|
23879
|
+
WORKER_OBJ: {
|
|
23880
|
+
jobs: [],
|
|
23881
|
+
num: 1000,
|
|
23882
|
+
stat: null,
|
|
23883
|
+
},
|
|
23884
|
+
DS_GLB: {},
|
|
23885
|
+
SYS_GLOBAL_OBJ_FIREBASE_AUTH_INFO: {
|
|
23886
|
+
token: '',
|
|
23887
|
+
first_name: '',
|
|
23888
|
+
last_name: '',
|
|
23889
|
+
email: '',
|
|
23890
|
+
user_id: '',
|
|
23891
|
+
picture: '',
|
|
23892
|
+
verified_email: '',
|
|
23893
|
+
locale: '',
|
|
23894
|
+
error_code: '',
|
|
23895
|
+
error_msg: '',
|
|
23896
|
+
},
|
|
23897
|
+
SYS_GLOBAL_OBJ_CLIENT_INFO: {
|
|
23898
|
+
fingerprint: '',
|
|
23899
|
+
device: '',
|
|
23900
|
+
user_agent: '',
|
|
23901
|
+
browser_version: '',
|
|
23902
|
+
browser_name: '',
|
|
23903
|
+
engine_version: '',
|
|
23904
|
+
client_ip: '',
|
|
23905
|
+
engine_name: '',
|
|
23906
|
+
os_name: '',
|
|
23907
|
+
os_version: '',
|
|
23908
|
+
device_model: '',
|
|
23909
|
+
device_vendor: '',
|
|
23910
|
+
device_type: '',
|
|
23911
|
+
screen_current_resolution_x: '',
|
|
23912
|
+
screen_current_resolution_y: '',
|
|
23913
|
+
screen_available_resolution_x: '',
|
|
23914
|
+
screen_available_resolution_y: '',
|
|
23915
|
+
language: '',
|
|
23916
|
+
time_zone: '',
|
|
23917
|
+
cpu_architecture: '',
|
|
23918
|
+
uuid: '',
|
|
23919
|
+
},
|
|
23920
|
+
PUSH_NOTIFICATION_GRANTED: null,
|
|
23921
|
+
FIREBASE_TOKEN_ID: null,
|
|
23922
|
+
USR_OBJ: {},
|
|
23923
|
+
debug_js: null,
|
|
23924
|
+
DS_UI_EVENTS_GLB: {},
|
|
23925
|
+
host: runtime_host,
|
|
23926
|
+
req_id: 0,
|
|
23927
|
+
build_info: {},
|
|
23928
|
+
CACHE_REQ: {},
|
|
23929
|
+
url_params: {
|
|
23930
|
+
...func.common.getParametersFromUrl(),
|
|
23931
|
+
...options.url_params,
|
|
23932
|
+
},
|
|
23933
|
+
};
|
|
23934
|
+
func.runtime.workers.ensure_registry(SESSION_ID);
|
|
23935
|
+
return SESSION_OBJ[SESSION_ID];
|
|
23936
|
+
};
|
|
23937
|
+
func.runtime.session.set_default_value = function (_session, key, value) {
|
|
23938
|
+
_session[key] = value || func.runtime.env.get_default_session_value(key);
|
|
23939
|
+
return _session[key];
|
|
23940
|
+
};
|
|
23941
|
+
func.runtime.session.populate_client_info = function (_session, components) {
|
|
23942
|
+
const _client_info = _session.SYS_GLOBAL_OBJ_CLIENT_INFO;
|
|
23943
|
+
const platform = func.runtime.platform;
|
|
23944
|
+
const { engine_mode } = _session;
|
|
23945
|
+
|
|
23946
|
+
_client_info.fingerprint = func.runtime.session.get_fingerprint(components);
|
|
23947
|
+
|
|
23948
|
+
if (engine_mode === 'live_preview') {
|
|
23949
|
+
const inner_size = platform.get_inner_size();
|
|
23950
|
+
_client_info.screen_current_resolution_x = inner_size.width;
|
|
23951
|
+
_client_info.screen_current_resolution_y = inner_size.height;
|
|
23952
|
+
_client_info.screen_available_resolution_x = inner_size.width;
|
|
23953
|
+
_client_info.screen_available_resolution_y = inner_size.height;
|
|
23954
|
+
} else {
|
|
23955
|
+
_client_info.screen_current_resolution_x = components[6].value[0];
|
|
23956
|
+
_client_info.screen_current_resolution_y = components[6].value[1];
|
|
23957
|
+
_client_info.screen_available_resolution_x = components[7].value[0];
|
|
23958
|
+
_client_info.screen_available_resolution_y = components[7].value[1];
|
|
23959
|
+
}
|
|
23960
|
+
|
|
23961
|
+
const client = new ClientJS();
|
|
23962
|
+
_client_info.device = func.utils.get_device();
|
|
23963
|
+
|
|
23964
|
+
const browser_data = client.getBrowserData();
|
|
23965
|
+
_client_info.user_agent = browser_data.ua;
|
|
23966
|
+
_client_info.browser_version = browser_data.browser.name;
|
|
23967
|
+
_client_info.browser_name = browser_data.browser.version;
|
|
23968
|
+
_client_info.engine_version = browser_data.engine.name;
|
|
23969
|
+
_client_info.engine_name = browser_data.engine.version;
|
|
23970
|
+
_client_info.os_name = browser_data.os.name;
|
|
23971
|
+
_client_info.os_version = browser_data.os.version;
|
|
23972
|
+
_client_info.device_model = browser_data.device.name;
|
|
23973
|
+
_client_info.device_vendor = browser_data.device.name;
|
|
23974
|
+
_client_info.device_type = browser_data.device.name;
|
|
23975
|
+
_client_info.language = client.getLanguage();
|
|
23976
|
+
_client_info.time_zone = client.getTimeZone();
|
|
23977
|
+
_client_info.cpu_architecture = browser_data.cpu.architecture;
|
|
23978
|
+
|
|
23979
|
+
if (['android', 'ios', 'windows', 'macos', 'linux', 'live_preview'].includes(engine_mode) && func.utils.get_device()) {
|
|
23980
|
+
_client_info.uuid = platform.get_device_uuid();
|
|
23981
|
+
const device_name = platform.get_device_name();
|
|
23982
|
+
if (device_name) {
|
|
23983
|
+
_client_info.device_name = device_name;
|
|
23984
|
+
}
|
|
23985
|
+
}
|
|
23986
|
+
return _client_info;
|
|
23987
|
+
};
|
|
23988
|
+
func.runtime.workers.ensure_registry = function (SESSION_ID) {
|
|
23989
|
+
if (!WEB_WORKER[SESSION_ID]) {
|
|
23990
|
+
WEB_WORKER[SESSION_ID] = {};
|
|
23991
|
+
}
|
|
23992
|
+
return WEB_WORKER[SESSION_ID];
|
|
23993
|
+
};
|
|
23994
|
+
func.runtime.workers.get_registry_entry = function (SESSION_ID, worker_id) {
|
|
23995
|
+
return func.runtime.workers.ensure_registry(SESSION_ID)?.[worker_id] || null;
|
|
23996
|
+
};
|
|
23997
|
+
func.runtime.workers.set_registry_entry = function (SESSION_ID, worker_id, entry) {
|
|
23998
|
+
const worker_registry = func.runtime.workers.ensure_registry(SESSION_ID);
|
|
23999
|
+
worker_registry[worker_id] = entry;
|
|
24000
|
+
return worker_registry[worker_id];
|
|
24001
|
+
};
|
|
24002
|
+
func.runtime.workers.build_worker_name = function (glb_worker_type, session, prog_obj, worker_id, build_id) {
|
|
24003
|
+
return (
|
|
24004
|
+
`${typeof session.SLIM_BUNDLE === 'undefined' || !session.SLIM_BUNDLE ? '' : 'Slim '}${prog_obj.menuName} worker` +
|
|
24005
|
+
' ' +
|
|
24006
|
+
glb_worker_type +
|
|
24007
|
+
': #' +
|
|
24008
|
+
worker_id.toString() +
|
|
24009
|
+
' ' +
|
|
24010
|
+
(build_id || '') +
|
|
24011
|
+
' ' +
|
|
24012
|
+
session.domain
|
|
24013
|
+
);
|
|
24014
|
+
};
|
|
24015
|
+
func.runtime.workers.is_server_transport = function (session) {
|
|
24016
|
+
return !!(RUNTIME_SERVER_WEBSOCKET && RUNTIME_SERVER_WEBSOCKET_CONNECTED && (!session.opt.app_computing_mode || session.opt.app_computing_mode === 'server'));
|
|
24017
|
+
};
|
|
24018
|
+
func.runtime.workers.send_message = function (SESSION_ID, worker_id, session, msg, process_pid) {
|
|
24019
|
+
const registry_entry = func.runtime.workers.get_registry_entry(SESSION_ID, worker_id);
|
|
24020
|
+
if (!registry_entry?.worker) {
|
|
24021
|
+
return false;
|
|
24022
|
+
}
|
|
24023
|
+
|
|
24024
|
+
if (func.runtime.workers.is_server_transport(session)) {
|
|
24025
|
+
if (process_pid) {
|
|
24026
|
+
msg.process_pid = process_pid;
|
|
24027
|
+
}
|
|
24028
|
+
registry_entry.worker.emit('message', msg);
|
|
24029
|
+
return true;
|
|
24030
|
+
}
|
|
24031
|
+
|
|
24032
|
+
registry_entry.worker.postMessage(msg);
|
|
24033
|
+
return true;
|
|
24034
|
+
};
|
|
24035
|
+
func.runtime.workers.set_promise = function (SESSION_ID, worker_id, promise_queue_id, value) {
|
|
24036
|
+
const registry_entry = func.runtime.workers.get_registry_entry(SESSION_ID, worker_id);
|
|
24037
|
+
if (!registry_entry) {
|
|
24038
|
+
return null;
|
|
24039
|
+
}
|
|
24040
|
+
registry_entry.promise_queue[promise_queue_id] = value;
|
|
24041
|
+
return registry_entry.promise_queue[promise_queue_id];
|
|
24042
|
+
};
|
|
24043
|
+
func.runtime.workers.get_promise = function (SESSION_ID, worker_id, promise_queue_id) {
|
|
24044
|
+
const registry_entry = func.runtime.workers.get_registry_entry(SESSION_ID, worker_id);
|
|
24045
|
+
if (!registry_entry) {
|
|
24046
|
+
return null;
|
|
24047
|
+
}
|
|
24048
|
+
return registry_entry.promise_queue[promise_queue_id];
|
|
24049
|
+
};
|
|
24050
|
+
func.runtime.workers.delete_promise = function (SESSION_ID, worker_id, promise_queue_id) {
|
|
24051
|
+
const registry_entry = func.runtime.workers.get_registry_entry(SESSION_ID, worker_id);
|
|
24052
|
+
if (!registry_entry?.promise_queue) {
|
|
24053
|
+
return false;
|
|
24054
|
+
}
|
|
24055
|
+
delete registry_entry.promise_queue[promise_queue_id];
|
|
24056
|
+
return true;
|
|
24057
|
+
};
|
|
24058
|
+
func.runtime.ui.get_root_element = function (SESSION_ID) {
|
|
24059
|
+
return $(SESSION_OBJ[SESSION_ID].root_element);
|
|
24060
|
+
};
|
|
24061
|
+
func.runtime.ui.show_root_element = function (SESSION_ID) {
|
|
24062
|
+
const $root_element = func.runtime.ui.get_root_element(SESSION_ID);
|
|
24063
|
+
$root_element.show();
|
|
24064
|
+
return $root_element;
|
|
24065
|
+
};
|
|
24066
|
+
func.runtime.ui.ensure_app_shell = function (SESSION_ID, domain) {
|
|
24067
|
+
const $root_element = func.runtime.ui.get_root_element(SESSION_ID);
|
|
24068
|
+
$root_element.css('position', 'relative');
|
|
24069
|
+
|
|
24070
|
+
if (!$root_element.find('.loader').length) {
|
|
24071
|
+
$root_element.append(`
|
|
24072
|
+
|
|
24073
|
+
<style>
|
|
24074
|
+
.loader {
|
|
24075
|
+
position: absolute;
|
|
24076
|
+
background: rgb(0 0 0 / 30%);
|
|
24077
|
+
z-index: 10;
|
|
24078
|
+
overflow-y: auto;
|
|
24079
|
+
top: 0;
|
|
24080
|
+
right: 0;
|
|
24081
|
+
bottom: 0;
|
|
24082
|
+
left: 0;
|
|
24083
|
+
display: flex;
|
|
24084
|
+
flex-direction: column;
|
|
24085
|
+
justify-content: center;
|
|
24086
|
+
align-items: center;
|
|
24087
|
+
}
|
|
24088
|
+
|
|
24089
|
+
.loader .loader_logo {
|
|
24090
|
+
|
|
24091
|
+
width: 43px;
|
|
24092
|
+
height: 43px;
|
|
24093
|
+
border-radius: 50%;
|
|
24094
|
+
background-size: cover;
|
|
24095
|
+
}
|
|
24096
|
+
|
|
24097
|
+
.loader .loader_msg {
|
|
24098
|
+
padding-top: 10px;
|
|
24099
|
+
text-align: center;
|
|
24100
|
+
min-height: 20px;
|
|
24101
|
+
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";
|
|
24102
|
+
}
|
|
24103
|
+
|
|
24104
|
+
.loader .loader_rotate {
|
|
24105
|
+
padding: 20px;
|
|
24106
|
+
border: 2px solid #fff;
|
|
24107
|
+
border-right-color: #898989;
|
|
24108
|
+
border-radius: 22px;
|
|
24109
|
+
-webkit-animation: rotate 0.8s infinite linear;
|
|
24110
|
+
position: absolute;
|
|
24111
|
+
}
|
|
24112
|
+
|
|
24113
|
+
@-webkit-keyframes rotate {
|
|
24114
|
+
100% {
|
|
24115
|
+
-webkit-transform: rotate(360deg);
|
|
24116
|
+
}
|
|
24117
|
+
}
|
|
24118
|
+
</style>
|
|
24119
|
+
|
|
24120
|
+
<div class="loader">
|
|
24121
|
+
<div class="loader_logo">
|
|
24122
|
+
<div class="loader_rotate"></div>
|
|
24123
|
+
</div>
|
|
24124
|
+
<div class="loader_msg"> </div>
|
|
24125
|
+
</div>
|
|
24126
|
+
|
|
24127
|
+
|
|
24128
|
+
<div class="progressLoader"></div>
|
|
24129
|
+
|
|
24130
|
+
`);
|
|
24131
|
+
}
|
|
24132
|
+
|
|
24133
|
+
if (!$root_element.find('#tailwind_toast_controller').length) {
|
|
24134
|
+
$root_element.append(
|
|
24135
|
+
`<div aria-live="assertive"
|
|
24136
|
+
class="fixed inset-0 flex items-end px-4 py-6 pointer-events-none sm:p-6 sm:items-start z-[999]">
|
|
24137
|
+
<div id="tailwind_toast_controller" class="w-full flex flex-col items-center space-y-4 sm:items-end">
|
|
24138
|
+
|
|
24139
|
+
</div>
|
|
24140
|
+
</div>`,
|
|
24141
|
+
);
|
|
24142
|
+
}
|
|
24143
|
+
|
|
24144
|
+
if (!$root_element.find('#progressScreen2').length) {
|
|
24145
|
+
$root_element.append(
|
|
24146
|
+
`
|
|
24147
|
+
<div id="progressScreen2" style="display: none">
|
|
24148
|
+
<div id="progressScreen2_text"></div>
|
|
24149
|
+
</div>`,
|
|
24150
|
+
);
|
|
24151
|
+
}
|
|
24152
|
+
|
|
24153
|
+
const get_url = function (domain, method, path) {
|
|
24154
|
+
return `https://${domain}/${method}${path ? '/' + path : '/'}`;
|
|
24155
|
+
};
|
|
24156
|
+
|
|
24157
|
+
func.utils.load_css_on_demand(get_url(domain, 'dist', 'runtime/css/mobile.css'));
|
|
24158
|
+
return $root_element;
|
|
24159
|
+
};
|
|
24160
|
+
func.runtime.ui.ensure_embed_container = function (SESSION_ID) {
|
|
24161
|
+
const $root_element = func.runtime.ui.get_root_element(SESSION_ID);
|
|
24162
|
+
let $embed_container = $root_element.find(`#embed_${SESSION_ID}`);
|
|
24163
|
+
|
|
24164
|
+
if (!$embed_container.length) {
|
|
24165
|
+
$embed_container = $('<div>')
|
|
24166
|
+
.attr('id', 'embed_' + SESSION_ID)
|
|
24167
|
+
.addClass('xu_embed_div')
|
|
24168
|
+
.data({ xuData: {} })
|
|
24169
|
+
.appendTo($root_element);
|
|
24170
|
+
}
|
|
24171
|
+
|
|
24172
|
+
return $embed_container;
|
|
24173
|
+
};
|
|
24174
|
+
func.runtime.ui.get_embed_container = function (SESSION_ID) {
|
|
24175
|
+
return func.runtime.ui.get_root_element(SESSION_ID).find(`#embed_${SESSION_ID}`);
|
|
24176
|
+
};
|
|
24177
|
+
func.runtime.ui.get_embed_screen_containers = function () {
|
|
24178
|
+
return $('.xu_embed_container');
|
|
24179
|
+
};
|
|
24180
|
+
func.runtime.ui.append_to_body = function ($element) {
|
|
24181
|
+
$element.appendTo('body');
|
|
24182
|
+
return $element;
|
|
24183
|
+
};
|
|
24184
|
+
func.runtime.ui.find_in_root = function (SESSION_ID, selector) {
|
|
24185
|
+
return func.runtime.ui.get_root_element(SESSION_ID).find(selector);
|
|
24186
|
+
};
|
|
23652
24187
|
func.common.find_item_by_key = function (arr, key, val) {
|
|
23653
24188
|
return _.find(arr, function (e) {
|
|
23654
24189
|
return e.data[key] === val;
|
|
@@ -24037,19 +24572,10 @@ func.common.db = async function (SESSION_ID, serviceP, dataP, opt = {}, dsSessio
|
|
|
24037
24572
|
};
|
|
24038
24573
|
|
|
24039
24574
|
func.common.getJsonFromUrl = function () {
|
|
24040
|
-
|
|
24041
|
-
const urlParams = new URLSearchParams(queryString);
|
|
24042
|
-
return urlParams;
|
|
24575
|
+
return func.runtime.env.get_url_params();
|
|
24043
24576
|
};
|
|
24044
24577
|
func.common.getParametersFromUrl = function () {
|
|
24045
|
-
|
|
24046
|
-
const parameters = {};
|
|
24047
|
-
|
|
24048
|
-
for (const [key, value] of searchParams.entries()) {
|
|
24049
|
-
parameters[key] = value;
|
|
24050
|
-
}
|
|
24051
|
-
|
|
24052
|
-
return parameters;
|
|
24578
|
+
return func.runtime.env.get_url_parameters_object();
|
|
24053
24579
|
};
|
|
24054
24580
|
|
|
24055
24581
|
func.common.getObjectFromUrl = function (url, element_attributes_obj, embed_params_obj) {
|
|
@@ -27220,10 +27746,16 @@ func.UI.utils.live_preview_show_selected_element = function (nodeid) {
|
|
|
27220
27746
|
};
|
|
27221
27747
|
|
|
27222
27748
|
func.UI.utils.get_url_attribute = function (SESSION_ID, key) {
|
|
27223
|
-
var ret = glb.URL_PARAMS.get(key);
|
|
27224
|
-
|
|
27225
27749
|
const _session = SESSION_OBJ[SESSION_ID];
|
|
27226
|
-
|
|
27750
|
+
const platform = func.runtime.platform;
|
|
27751
|
+
const url_param = glb.URL_PARAMS?.get?.(key);
|
|
27752
|
+
const root_attribute = $(_session.root_element).attr(key);
|
|
27753
|
+
const option_param = _session.opt?.params?.[key];
|
|
27754
|
+
const option_value = _session.opt?.[key];
|
|
27755
|
+
const cookie_value = typeof $.cookie === 'function' ? $.cookie(key) : null;
|
|
27756
|
+
const storage_value = platform.get_storage_item(key, 'local');
|
|
27757
|
+
|
|
27758
|
+
return url_param || root_attribute || option_param || option_value || cookie_value || storage_value;
|
|
27227
27759
|
};
|
|
27228
27760
|
|
|
27229
27761
|
func.UI.utils.get_root_element_attributes = function (SESSION_ID) {
|
|
@@ -31457,7 +31989,7 @@ func.UI.screen.init = async function (SESSION_ID, prog_id, sourceScreenP, callin
|
|
|
31457
31989
|
case 'popover':
|
|
31458
31990
|
$dialogDiv = $('<div>');
|
|
31459
31991
|
$rootFrame = $('<div>').appendTo($dialogDiv);
|
|
31460
|
-
$dialogDiv
|
|
31992
|
+
func.runtime.ui.append_to_body($dialogDiv);
|
|
31461
31993
|
break;
|
|
31462
31994
|
|
|
31463
31995
|
default:
|
|
@@ -31582,7 +32114,8 @@ func.UI.screen.validate_exit_events = async function (SESSION_ID, div_data_param
|
|
|
31582
32114
|
};
|
|
31583
32115
|
|
|
31584
32116
|
func.UI.screen.call_embed = function (SESSION_ID, prog) {
|
|
31585
|
-
|
|
32117
|
+
func.runtime.ui
|
|
32118
|
+
.get_embed_container(SESSION_ID)
|
|
31586
32119
|
.empty()
|
|
31587
32120
|
.data().xuData.screenInfo = null;
|
|
31588
32121
|
|
|
@@ -31953,7 +32486,7 @@ func.UI.screen.refresh_xu_attributes = async function (SESSION_ID, fields_arr, j
|
|
|
31953
32486
|
return found;
|
|
31954
32487
|
};
|
|
31955
32488
|
|
|
31956
|
-
const $xu_embed_container =
|
|
32489
|
+
const $xu_embed_container = func.runtime.ui.get_embed_screen_containers();
|
|
31957
32490
|
const panels_obj = await func.UI.utils.get_panels_wrapper_from_dom(SESSION_ID, $xu_embed_container, true);
|
|
31958
32491
|
|
|
31959
32492
|
for await (const field_id of fields_arr) {
|
|
@@ -32113,7 +32646,7 @@ func.UI.screen.refresh_screen = async function (SESSION_ID, fields_changed_arr,
|
|
|
32113
32646
|
}
|
|
32114
32647
|
}
|
|
32115
32648
|
|
|
32116
|
-
const panels_obj = await func.UI.utils.get_panels_wrapper_from_dom(SESSION_ID,
|
|
32649
|
+
const panels_obj = await func.UI.utils.get_panels_wrapper_from_dom(SESSION_ID, func.runtime.ui.get_root_element(SESSION_ID), false);
|
|
32117
32650
|
found = false;
|
|
32118
32651
|
for await (const [parent_element_ui_id, panel_val] of Object.entries(panels_obj)) {
|
|
32119
32652
|
// const progDataSource_str = JSON.stringify(panel_val.prog_doc.progDataSource);
|
|
@@ -40859,7 +41392,10 @@ func.UI.main.embed_prog_execute = async function (SESSION_ID, prog) {
|
|
|
40859
41392
|
let screen_ret = await func.utils.get_screen_obj(SESSION_ID, prog);
|
|
40860
41393
|
if (screen_ret) {
|
|
40861
41394
|
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');
|
|
40862
|
-
|
|
41395
|
+
const runtime_document = func.runtime.platform.get_document();
|
|
41396
|
+
if (runtime_document) {
|
|
41397
|
+
runtime_document.title = screen_ret.properties.menuTitle;
|
|
41398
|
+
}
|
|
40863
41399
|
|
|
40864
41400
|
return;
|
|
40865
41401
|
}
|
|
@@ -40871,10 +41407,12 @@ func.UI.main.embed_prog_execute = async function (SESSION_ID, prog) {
|
|
|
40871
41407
|
|
|
40872
41408
|
func.UI.main.embed_loader = async function (SESSION_ID) {
|
|
40873
41409
|
var _session = SESSION_OBJ[SESSION_ID];
|
|
41410
|
+
const platform = func.runtime.platform;
|
|
41411
|
+
const browser_hash = platform.get_url_hash();
|
|
40874
41412
|
var hash = '';
|
|
40875
|
-
if (
|
|
41413
|
+
if (browser_hash) hash = browser_hash.substr(1);
|
|
40876
41414
|
_session.SYS_GLOBAL_STR_BROWSER_HASH_ID = hash;
|
|
40877
|
-
_session.SYS_GLOBAL_STR_BROWSER_TITLE =
|
|
41415
|
+
_session.SYS_GLOBAL_STR_BROWSER_TITLE = platform.get_document()?.title || '';
|
|
40878
41416
|
|
|
40879
41417
|
const init_system_ds = async function () {
|
|
40880
41418
|
if (!['main'].includes(_session.opt.app_computing_mode)) {
|
|
@@ -40934,12 +41472,7 @@ func.UI.main.embed_loader = async function (SESSION_ID) {
|
|
|
40934
41472
|
_session.WORKER_OBJ.fx.init();
|
|
40935
41473
|
};
|
|
40936
41474
|
const create_embed_container = async function () {
|
|
40937
|
-
|
|
40938
|
-
.attr('id', 'embed_' + SESSION_ID)
|
|
40939
|
-
|
|
40940
|
-
.addClass('xu_embed_div')
|
|
40941
|
-
.data({ xuData: {} })
|
|
40942
|
-
.appendTo($(_session.root_element));
|
|
41475
|
+
func.runtime.ui.ensure_embed_container(SESSION_ID);
|
|
40943
41476
|
};
|
|
40944
41477
|
const execute_PENDING_OPEN_URL_EVENTS = async function () {
|
|
40945
41478
|
if (typeof func.events.execute_PENDING_OPEN_URL_EVENTS !== 'undefined' && glb.is_cordova) {
|
|
@@ -41069,7 +41602,7 @@ func.UI.main.embed_loader = async function (SESSION_ID) {
|
|
|
41069
41602
|
|
|
41070
41603
|
await register_run_background_plugins();
|
|
41071
41604
|
|
|
41072
|
-
|
|
41605
|
+
func.runtime.ui.show_root_element(SESSION_ID);
|
|
41073
41606
|
func.UI.component.create_app_root_component(SESSION_ID);
|
|
41074
41607
|
await glb.lifecycle.execute(SESSION_ID, 'beforeInit');
|
|
41075
41608
|
await start_workers();
|
|
@@ -41094,11 +41627,11 @@ func.UI.main.embed_loader = async function (SESSION_ID) {
|
|
|
41094
41627
|
});
|
|
41095
41628
|
|
|
41096
41629
|
await updateOnlineStatus();
|
|
41097
|
-
|
|
41098
|
-
|
|
41630
|
+
platform.add_window_listener('online', updateOnlineStatus);
|
|
41631
|
+
platform.add_window_listener('offline', updateOnlineStatus);
|
|
41099
41632
|
|
|
41100
41633
|
console.log('xuda.ai system ready.');
|
|
41101
|
-
|
|
41634
|
+
platform.dispatch_body_event(glb.system_ready_event);
|
|
41102
41635
|
};
|
|
41103
41636
|
func.UI.main.set_custom_css = function (SESSION_ID, callbackP) {
|
|
41104
41637
|
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');
|
|
@@ -41114,12 +41647,14 @@ $(document).ready(function () {
|
|
|
41114
41647
|
});
|
|
41115
41648
|
|
|
41116
41649
|
function xuda(...args) {
|
|
41650
|
+
const platform = func.runtime.platform;
|
|
41651
|
+
const runtime_location = platform.get_location();
|
|
41117
41652
|
let element = null;
|
|
41118
41653
|
let opt = {};
|
|
41119
41654
|
let callback = null;
|
|
41120
41655
|
|
|
41121
41656
|
for (const arg of args) {
|
|
41122
|
-
if (arg
|
|
41657
|
+
if (platform.is_html_element(arg)) {
|
|
41123
41658
|
// Detect the element (e.g., <div>, <span>, etc.)
|
|
41124
41659
|
element = arg;
|
|
41125
41660
|
} else if (typeof arg === 'object' && arg !== null && !Array.isArray(arg)) {
|
|
@@ -41148,13 +41683,13 @@ function xuda(...args) {
|
|
|
41148
41683
|
if (typeof opt !== 'object') {
|
|
41149
41684
|
return console.error('Xuda Error - opt argument is not an object');
|
|
41150
41685
|
}
|
|
41151
|
-
glb.URL_PARAMS = func.common.getJsonFromUrl(
|
|
41686
|
+
glb.URL_PARAMS = func.common.getJsonFromUrl(platform.get_url_href());
|
|
41152
41687
|
|
|
41153
41688
|
glb.worker_type = 'Worker';
|
|
41154
41689
|
if (opt.debug_js) {
|
|
41155
41690
|
glb.debug_js = true;
|
|
41156
41691
|
|
|
41157
|
-
if ((
|
|
41692
|
+
if ((runtime_location?.host?.includes('localhost') || runtime_location?.host?.includes('127.0.0.1')) && typeof glb.SLIM_BUNDLE === 'undefined' && typeof glb.CODE_BUNDLE === 'undefined') {
|
|
41158
41693
|
glb.worker_type = 'Dev';
|
|
41159
41694
|
} else {
|
|
41160
41695
|
glb.worker_type = 'Debug';
|
|
@@ -41167,91 +41702,7 @@ function xuda(...args) {
|
|
|
41167
41702
|
const _api_callback = callback;
|
|
41168
41703
|
|
|
41169
41704
|
const create_index_html = function () {
|
|
41170
|
-
|
|
41171
|
-
$(root_element).css('position', 'relative');
|
|
41172
|
-
|
|
41173
|
-
$(root_element).append(`
|
|
41174
|
-
|
|
41175
|
-
<style>
|
|
41176
|
-
.loader {
|
|
41177
|
-
position: absolute;
|
|
41178
|
-
background: rgb(0 0 0 / 30%);
|
|
41179
|
-
z-index: 10;
|
|
41180
|
-
overflow-y: auto;
|
|
41181
|
-
top: 0;
|
|
41182
|
-
right: 0;
|
|
41183
|
-
bottom: 0;
|
|
41184
|
-
left: 0;
|
|
41185
|
-
display: flex;
|
|
41186
|
-
flex-direction: column;
|
|
41187
|
-
justify-content: center;
|
|
41188
|
-
align-items: center;
|
|
41189
|
-
}
|
|
41190
|
-
|
|
41191
|
-
.loader .loader_logo {
|
|
41192
|
-
|
|
41193
|
-
width: 43px;
|
|
41194
|
-
height: 43px;
|
|
41195
|
-
border-radius: 50%;
|
|
41196
|
-
background-size: cover;
|
|
41197
|
-
}
|
|
41198
|
-
|
|
41199
|
-
.loader .loader_msg {
|
|
41200
|
-
padding-top: 10px;
|
|
41201
|
-
text-align: center;
|
|
41202
|
-
min-height: 20px;
|
|
41203
|
-
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";
|
|
41204
|
-
}
|
|
41205
|
-
|
|
41206
|
-
.loader .loader_rotate {
|
|
41207
|
-
padding: 20px;
|
|
41208
|
-
border: 2px solid #fff;
|
|
41209
|
-
border-right-color: #898989;
|
|
41210
|
-
border-radius: 22px;
|
|
41211
|
-
-webkit-animation: rotate 0.8s infinite linear;
|
|
41212
|
-
position: absolute;
|
|
41213
|
-
}
|
|
41214
|
-
|
|
41215
|
-
@-webkit-keyframes rotate {
|
|
41216
|
-
100% {
|
|
41217
|
-
-webkit-transform: rotate(360deg);
|
|
41218
|
-
}
|
|
41219
|
-
}
|
|
41220
|
-
</style>
|
|
41221
|
-
|
|
41222
|
-
<div class="loader">
|
|
41223
|
-
<div class="loader_logo">
|
|
41224
|
-
<div class="loader_rotate"></div>
|
|
41225
|
-
</div>
|
|
41226
|
-
<div class="loader_msg"> </div>
|
|
41227
|
-
</div>
|
|
41228
|
-
|
|
41229
|
-
|
|
41230
|
-
<div class="progressLoader"></div>
|
|
41231
|
-
|
|
41232
|
-
`);
|
|
41233
|
-
|
|
41234
|
-
$(root_element).append(
|
|
41235
|
-
`<div aria-live="assertive"
|
|
41236
|
-
class="fixed inset-0 flex items-end px-4 py-6 pointer-events-none sm:p-6 sm:items-start z-[999]">
|
|
41237
|
-
<div id="tailwind_toast_controller" class="w-full flex flex-col items-center space-y-4 sm:items-end">
|
|
41238
|
-
|
|
41239
|
-
</div>
|
|
41240
|
-
</div>`,
|
|
41241
|
-
);
|
|
41242
|
-
|
|
41243
|
-
$(root_element).append(
|
|
41244
|
-
`
|
|
41245
|
-
<div id="progressScreen2" style="display: none">
|
|
41246
|
-
<div id="progressScreen2_text"></div>
|
|
41247
|
-
</div>`,
|
|
41248
|
-
);
|
|
41249
|
-
|
|
41250
|
-
const get_url = function (domain, method, path) {
|
|
41251
|
-
return `https://${domain}/${method}${path ? '/' + path : '/'}`;
|
|
41252
|
-
};
|
|
41253
|
-
|
|
41254
|
-
func.utils.load_css_on_demand(get_url(domain, 'dist', 'runtime/css/mobile.css'));
|
|
41705
|
+
func.runtime.ui.ensure_app_shell(SESSION_ID, _session.domain);
|
|
41255
41706
|
};
|
|
41256
41707
|
const device_ready = async function () {
|
|
41257
41708
|
return new Promise(function (resolve, reject) {
|
|
@@ -41259,7 +41710,7 @@ function xuda(...args) {
|
|
|
41259
41710
|
return resolve();
|
|
41260
41711
|
}
|
|
41261
41712
|
|
|
41262
|
-
|
|
41713
|
+
platform.get_document().addEventListener(
|
|
41263
41714
|
'deviceready',
|
|
41264
41715
|
function () {
|
|
41265
41716
|
glb.is_cordova = true;
|
|
@@ -41277,119 +41728,21 @@ function xuda(...args) {
|
|
|
41277
41728
|
});
|
|
41278
41729
|
};
|
|
41279
41730
|
const get_session_id = function () {
|
|
41280
|
-
|
|
41281
|
-
var iPageTabID = sessionStorage.getItem('tabID');
|
|
41282
|
-
// if it is the first time that this page is loaded
|
|
41283
|
-
if (iPageTabID == null) {
|
|
41284
|
-
var iLocalTabID = localStorage.getItem('tabID');
|
|
41285
|
-
// if tabID is not yet defined in localStorage it is initialized to 1
|
|
41286
|
-
// else tabId counter is increment by 1
|
|
41287
|
-
var iPageTabID = iLocalTabID == null ? 1 : Number(iLocalTabID) + 1;
|
|
41288
|
-
// new computed value are saved in localStorage and in sessionStorage
|
|
41289
|
-
localStorage.setItem('tabID', iPageTabID);
|
|
41290
|
-
sessionStorage.setItem('tabID', iPageTabID);
|
|
41291
|
-
}
|
|
41292
|
-
|
|
41293
|
-
return iPageTabID;
|
|
41294
|
-
}
|
|
41295
|
-
if (func.utils.get_device()) {
|
|
41296
|
-
return _instance_id + window.device.uuid;
|
|
41297
|
-
}
|
|
41298
|
-
var fingerprint_id = Fingerprint2.x64hash128(
|
|
41299
|
-
components
|
|
41300
|
-
.map(function (pair) {
|
|
41301
|
-
return pair.value;
|
|
41302
|
-
})
|
|
41303
|
-
.join(),
|
|
41304
|
-
31,
|
|
41305
|
-
);
|
|
41306
|
-
|
|
41307
|
-
return _instance_id + fingerprint_id + defineTabID();
|
|
41731
|
+
return func.runtime.session.get_fingerprint(components, _instance_id);
|
|
41308
41732
|
};
|
|
41309
41733
|
const get_fingerprint = function () {
|
|
41310
|
-
|
|
41311
|
-
return window.device.uuid;
|
|
41312
|
-
}
|
|
41313
|
-
return Fingerprint2.x64hash128(
|
|
41314
|
-
components
|
|
41315
|
-
.map(function (pair) {
|
|
41316
|
-
return pair.value;
|
|
41317
|
-
})
|
|
41318
|
-
.join(),
|
|
41319
|
-
31,
|
|
41320
|
-
);
|
|
41734
|
+
return func.runtime.session.get_fingerprint(components);
|
|
41321
41735
|
};
|
|
41322
41736
|
const init_SESSION = function () {
|
|
41323
|
-
|
|
41324
|
-
JOB_NO: 1000,
|
|
41325
|
-
|
|
41737
|
+
return func.runtime.session.create_state(SESSION_ID, {
|
|
41326
41738
|
opt,
|
|
41327
41739
|
root_element: $(element)[0],
|
|
41328
41740
|
worker_type: glb.worker_type,
|
|
41329
41741
|
api_callback: _api_callback,
|
|
41330
|
-
|
|
41331
|
-
|
|
41332
|
-
|
|
41333
|
-
|
|
41334
|
-
num: 1000,
|
|
41335
|
-
stat: null,
|
|
41336
|
-
},
|
|
41337
|
-
DS_GLB: {},
|
|
41338
|
-
|
|
41339
|
-
SYS_GLOBAL_OBJ_FIREBASE_AUTH_INFO: {
|
|
41340
|
-
token: '',
|
|
41341
|
-
first_name: '',
|
|
41342
|
-
last_name: '',
|
|
41343
|
-
email: '',
|
|
41344
|
-
user_id: '',
|
|
41345
|
-
picture: '',
|
|
41346
|
-
verified_email: '',
|
|
41347
|
-
locale: '',
|
|
41348
|
-
error_code: '',
|
|
41349
|
-
error_msg: '',
|
|
41350
|
-
},
|
|
41351
|
-
SYS_GLOBAL_OBJ_CLIENT_INFO: {
|
|
41352
|
-
fingerprint: '',
|
|
41353
|
-
device: '',
|
|
41354
|
-
|
|
41355
|
-
user_agent: '',
|
|
41356
|
-
browser_version: '',
|
|
41357
|
-
browser_name: '',
|
|
41358
|
-
engine_version: '',
|
|
41359
|
-
client_ip: '',
|
|
41360
|
-
engine_name: '',
|
|
41361
|
-
os_name: '',
|
|
41362
|
-
os_version: '',
|
|
41363
|
-
device_model: '',
|
|
41364
|
-
device_vendor: '',
|
|
41365
|
-
device_type: '',
|
|
41366
|
-
screen_current_resolution_x: '',
|
|
41367
|
-
screen_current_resolution_y: '',
|
|
41368
|
-
screen_available_resolution_x: '',
|
|
41369
|
-
screen_available_resolution_y: '',
|
|
41370
|
-
language: '',
|
|
41371
|
-
time_zone: '',
|
|
41372
|
-
cpu_architecture: '',
|
|
41373
|
-
uuid: '',
|
|
41374
|
-
},
|
|
41375
|
-
PUSH_NOTIFICATION_GRANTED: null,
|
|
41376
|
-
FIREBASE_TOKEN_ID: null,
|
|
41377
|
-
|
|
41378
|
-
USR_OBJ: {},
|
|
41379
|
-
|
|
41380
|
-
debug_js: null,
|
|
41381
|
-
DS_UI_EVENTS_GLB: {},
|
|
41382
|
-
host: location.host,
|
|
41383
|
-
req_id: 0,
|
|
41384
|
-
build_info: {},
|
|
41385
|
-
CACHE_REQ: {},
|
|
41386
|
-
url_params: {
|
|
41387
|
-
...func.common.getParametersFromUrl(),
|
|
41388
|
-
...opt.url_params,
|
|
41389
|
-
},
|
|
41390
|
-
};
|
|
41391
|
-
WEB_WORKER[SESSION_ID] = {};
|
|
41392
|
-
return SESSION_OBJ[SESSION_ID];
|
|
41742
|
+
code_bundle: glb.CODE_BUNDLE,
|
|
41743
|
+
slim_bundle: glb.SLIM_BUNDLE,
|
|
41744
|
+
url_params: opt.url_params,
|
|
41745
|
+
});
|
|
41393
41746
|
};
|
|
41394
41747
|
const set_SESSION = async function () {
|
|
41395
41748
|
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']) {
|
|
@@ -41397,22 +41750,7 @@ function xuda(...args) {
|
|
|
41397
41750
|
|
|
41398
41751
|
// set defaults
|
|
41399
41752
|
if (!_session[key]) {
|
|
41400
|
-
|
|
41401
|
-
switch (key) {
|
|
41402
|
-
case 'domain':
|
|
41403
|
-
val = window.location.host;
|
|
41404
|
-
break;
|
|
41405
|
-
case 'engine_mode':
|
|
41406
|
-
val = 'miniapp'; //was 'run'
|
|
41407
|
-
break;
|
|
41408
|
-
case 'app_id':
|
|
41409
|
-
val = 'unknown';
|
|
41410
|
-
break;
|
|
41411
|
-
|
|
41412
|
-
default:
|
|
41413
|
-
break;
|
|
41414
|
-
}
|
|
41415
|
-
_session[key] = val;
|
|
41753
|
+
func.runtime.session.set_default_value(_session, key);
|
|
41416
41754
|
}
|
|
41417
41755
|
|
|
41418
41756
|
// set exceptions
|
|
@@ -41528,51 +41866,7 @@ function xuda(...args) {
|
|
|
41528
41866
|
_session.crawler = opt.crawler;
|
|
41529
41867
|
};
|
|
41530
41868
|
const set_SYS_GLOBAL_OBJ_CLIENT_INFO = function () {
|
|
41531
|
-
|
|
41532
|
-
var _client_info = _session.SYS_GLOBAL_OBJ_CLIENT_INFO;
|
|
41533
|
-
|
|
41534
|
-
_client_info.fingerprint = get_fingerprint();
|
|
41535
|
-
|
|
41536
|
-
if (engine_mode === 'live_preview') {
|
|
41537
|
-
_client_info.screen_current_resolution_x = window.innerWidth;
|
|
41538
|
-
_client_info.screen_current_resolution_y = window.innerHeight;
|
|
41539
|
-
_client_info.screen_available_resolution_x = window.innerWidth;
|
|
41540
|
-
_client_info.screen_available_resolution_y = window.innerHeight;
|
|
41541
|
-
} else {
|
|
41542
|
-
_client_info.screen_current_resolution_x = components[6].value[0];
|
|
41543
|
-
_client_info.screen_current_resolution_y = components[6].value[1];
|
|
41544
|
-
_client_info.screen_available_resolution_x = components[7].value[0];
|
|
41545
|
-
_client_info.screen_available_resolution_y = components[7].value[1];
|
|
41546
|
-
}
|
|
41547
|
-
|
|
41548
|
-
const client = new ClientJS();
|
|
41549
|
-
|
|
41550
|
-
_client_info.device = func.utils.get_device();
|
|
41551
|
-
|
|
41552
|
-
const browser_data = client.getBrowserData();
|
|
41553
|
-
|
|
41554
|
-
_client_info.user_agent = browser_data.ua;
|
|
41555
|
-
|
|
41556
|
-
_client_info.browser_version = browser_data.browser.name;
|
|
41557
|
-
_client_info.browser_name = browser_data.browser.version;
|
|
41558
|
-
_client_info.engine_version = browser_data.engine.name;
|
|
41559
|
-
_client_info.engine_name = browser_data.engine.version;
|
|
41560
|
-
_client_info.os_name = browser_data.os.name;
|
|
41561
|
-
_client_info.os_version = browser_data.os.version;
|
|
41562
|
-
_client_info.device_model = browser_data.device.name;
|
|
41563
|
-
_client_info.device_vendor = browser_data.device.name;
|
|
41564
|
-
_client_info.device_type = browser_data.device.name;
|
|
41565
|
-
|
|
41566
|
-
_client_info.language = client.getLanguage();
|
|
41567
|
-
_client_info.time_zone = client.getTimeZone();
|
|
41568
|
-
_client_info.cpu_architecture = browser_data.cpu.architecture;
|
|
41569
|
-
|
|
41570
|
-
if (['android', 'ios', 'windows', 'macos', 'linux', 'live_preview'].includes(engine_mode) && func.utils.get_device()) {
|
|
41571
|
-
_client_info.uuid = window.device.uuid;
|
|
41572
|
-
if (window.device) {
|
|
41573
|
-
_client_info.device_name = window.device.name;
|
|
41574
|
-
}
|
|
41575
|
-
}
|
|
41869
|
+
func.runtime.session.populate_client_info(_session, components);
|
|
41576
41870
|
};
|
|
41577
41871
|
const init_globals = function () {
|
|
41578
41872
|
const { app_id, worker_type } = _session;
|
|
@@ -41741,11 +42035,11 @@ func.index.call_worker = async function (SESSION_ID, obj, params, promiseP) {
|
|
|
41741
42035
|
const set_promise_queue = function (worker_id) {
|
|
41742
42036
|
var t = glb.worker_queue_num++;
|
|
41743
42037
|
try {
|
|
41744
|
-
|
|
42038
|
+
func.runtime.workers.set_promise(SESSION_ID, worker_id, t, {
|
|
41745
42039
|
resolve: promiseP ? promiseP.resolve : resolve,
|
|
41746
42040
|
reject: promiseP ? promiseP.reject : reject,
|
|
41747
42041
|
worker_id,
|
|
41748
|
-
};
|
|
42042
|
+
});
|
|
41749
42043
|
} catch (e) {
|
|
41750
42044
|
console.log(worker_id);
|
|
41751
42045
|
}
|
|
@@ -41836,17 +42130,12 @@ func.index.call_worker = async function (SESSION_ID, obj, params, promiseP) {
|
|
|
41836
42130
|
return resolve();
|
|
41837
42131
|
}
|
|
41838
42132
|
|
|
41839
|
-
|
|
41840
|
-
|
|
41841
|
-
|
|
41842
|
-
let msg_obj = JSON.parse(msg);
|
|
41843
|
-
WEB_WORKER[SESSION_ID][worker_id].worker.emit('message', msg_obj);
|
|
41844
|
-
} else {
|
|
41845
|
-
msg = JSON.stringify(obj, func.utils.clean_stringify_null, '\t');
|
|
41846
|
-
let msg_obj = JSON.parse(msg);
|
|
42133
|
+
msg = JSON.stringify(obj, func.utils.clean_stringify_null, '\t');
|
|
42134
|
+
let msg_obj = JSON.parse(msg);
|
|
42135
|
+
if (!func.runtime.workers.is_server_transport(_session)) {
|
|
41847
42136
|
msg_obj.data = JSON.stringify(msg_obj.data);
|
|
41848
|
-
WEB_WORKER[SESSION_ID][worker_id].worker.postMessage(msg_obj);
|
|
41849
42137
|
}
|
|
42138
|
+
func.runtime.workers.send_message(SESSION_ID, worker_id, _session, msg_obj, WEBSOCKET_PROCESS_PID);
|
|
41850
42139
|
} catch (e) {
|
|
41851
42140
|
console.error(e);
|
|
41852
42141
|
return reject(e);
|
|
@@ -42124,7 +42413,7 @@ func.index.init_document_listeners = function () {
|
|
|
42124
42413
|
if (ret?.session_stat === 3) {
|
|
42125
42414
|
await func.index.delete_pouch();
|
|
42126
42415
|
// window.location.href = `https://${_session.domain}/error?error_code=408`;
|
|
42127
|
-
|
|
42416
|
+
platform.reload_top_window(); //href = `https://${_session.domain}?ts=${Date.now()}`;
|
|
42128
42417
|
}
|
|
42129
42418
|
$('body').removeClass('get_support_request');
|
|
42130
42419
|
$('body').find('.get_support_request_title').remove();
|
|
@@ -42145,9 +42434,10 @@ func.index.init_document_listeners = function () {
|
|
|
42145
42434
|
_session.res_token = ret.res_token;
|
|
42146
42435
|
}, 30000);
|
|
42147
42436
|
|
|
42148
|
-
glb.WINDOW_LOCATION_SEARCH =
|
|
42437
|
+
glb.WINDOW_LOCATION_SEARCH = platform.get_url_search();
|
|
42149
42438
|
};
|
|
42150
42439
|
func.index.checkConnectivity = async function () {
|
|
42440
|
+
const platform = func.runtime.platform;
|
|
42151
42441
|
const endpoints = ['https://xuda.ai/favicon.ico']; //'https://www.cloudflare.com/favicon.ico',
|
|
42152
42442
|
|
|
42153
42443
|
const promises = endpoints.map((url) =>
|
|
@@ -42160,23 +42450,24 @@ func.index.checkConnectivity = async function () {
|
|
|
42160
42450
|
IS_ONLINE = results.some((result) => result === true);
|
|
42161
42451
|
|
|
42162
42452
|
// Add event listeners for online/offline events
|
|
42163
|
-
|
|
42453
|
+
platform.add_window_listener('online', function () {
|
|
42164
42454
|
IS_ONLINE = true;
|
|
42165
42455
|
$('body').trigger('set_db_replication_from_server');
|
|
42166
42456
|
});
|
|
42167
42457
|
|
|
42168
|
-
|
|
42458
|
+
platform.add_window_listener('offline', function () {
|
|
42169
42459
|
IS_ONLINE = false;
|
|
42170
42460
|
});
|
|
42171
42461
|
};
|
|
42172
42462
|
|
|
42173
42463
|
func.index.init_service_workers = function () {
|
|
42174
|
-
|
|
42175
|
-
|
|
42464
|
+
const platform = func.runtime.platform;
|
|
42465
|
+
if (platform.has_service_worker()) {
|
|
42466
|
+
platform.add_service_worker_listener('message', function (event) {
|
|
42176
42467
|
console.log('serviceWorker message:', event);
|
|
42177
42468
|
});
|
|
42178
42469
|
|
|
42179
|
-
|
|
42470
|
+
platform.register_service_worker('xuda-sw.js').then(
|
|
42180
42471
|
function (registration) {
|
|
42181
42472
|
// Registration was successful
|
|
42182
42473
|
console.log('ServiceWorker registration successful with scope: ', registration.scope);
|
|
@@ -42201,7 +42492,8 @@ func.index.delete_pouch = async function (SESSION_ID = Object.keys(SESSION_OBJ)[
|
|
|
42201
42492
|
};
|
|
42202
42493
|
|
|
42203
42494
|
func.index.new_webworker = async function (SESSION_ID, prog_obj, obj) {
|
|
42204
|
-
|
|
42495
|
+
const worker_registry = func.runtime.workers.ensure_registry(SESSION_ID);
|
|
42496
|
+
var worker_id = Object.keys(worker_registry).length + 1;
|
|
42205
42497
|
|
|
42206
42498
|
var _session = SESSION_OBJ[SESSION_ID];
|
|
42207
42499
|
if (!_session.engine_mode === 'docker') {
|
|
@@ -42213,17 +42505,7 @@ func.index.new_webworker = async function (SESSION_ID, prog_obj, obj) {
|
|
|
42213
42505
|
build_id = XUDA_BUILD_ID;
|
|
42214
42506
|
}
|
|
42215
42507
|
|
|
42216
|
-
const worker_name =
|
|
42217
|
-
`${typeof _session.SLIM_BUNDLE === 'undefined' || !_session.SLIM_BUNDLE ? '' : 'Slim '}${prog_obj.menuName} worker` +
|
|
42218
|
-
// (prog_obj.menuName || "xuda.ai worker") +
|
|
42219
|
-
' ' +
|
|
42220
|
-
glb.worker_type +
|
|
42221
|
-
': #' +
|
|
42222
|
-
worker_id.toString() +
|
|
42223
|
-
' ' +
|
|
42224
|
-
(build_id || '') +
|
|
42225
|
-
' ' +
|
|
42226
|
-
_session.domain;
|
|
42508
|
+
const worker_name = func.runtime.workers.build_worker_name(glb.worker_type, _session, prog_obj, worker_id, build_id);
|
|
42227
42509
|
|
|
42228
42510
|
const init_worker_session = function (worker_id) {
|
|
42229
42511
|
var _session = _.cloneDeep(SESSION_OBJ[SESSION_ID]);
|
|
@@ -42282,33 +42564,31 @@ func.index.new_webworker = async function (SESSION_ID, prog_obj, obj) {
|
|
|
42282
42564
|
$.map(_session.DS_GLB, function (val, i) {
|
|
42283
42565
|
ds_arr.push(i);
|
|
42284
42566
|
});
|
|
42285
|
-
|
|
42567
|
+
worker_registry[worker_id].ds_arr = ds_arr;
|
|
42286
42568
|
|
|
42287
42569
|
delete data.SESSION_INFO.DS_UI_EVENTS_GLB; // contains function produce error
|
|
42288
42570
|
|
|
42289
|
-
|
|
42290
|
-
|
|
42291
|
-
|
|
42292
|
-
|
|
42293
|
-
|
|
42294
|
-
});
|
|
42295
|
-
} else {
|
|
42296
|
-
WEB_WORKER[SESSION_ID][worker_id].worker.postMessage({
|
|
42571
|
+
func.runtime.workers.send_message(
|
|
42572
|
+
SESSION_ID,
|
|
42573
|
+
worker_id,
|
|
42574
|
+
_session,
|
|
42575
|
+
{
|
|
42297
42576
|
service: 'init',
|
|
42298
|
-
data: JSON.stringify(data),
|
|
42577
|
+
data: func.runtime.workers.is_server_transport(_session) ? data : JSON.stringify(data),
|
|
42299
42578
|
worker_id: worker_id,
|
|
42300
|
-
}
|
|
42301
|
-
|
|
42579
|
+
},
|
|
42580
|
+
WEBSOCKET_PROCESS_PID,
|
|
42581
|
+
);
|
|
42302
42582
|
};
|
|
42303
42583
|
const create_worker = async function () {
|
|
42304
42584
|
return new Promise((resolve, reject) => {
|
|
42305
42585
|
if (glb.worker_type === 'Dev') {
|
|
42306
|
-
|
|
42586
|
+
func.runtime.workers.set_registry_entry(SESSION_ID, worker_id, {
|
|
42307
42587
|
worker: new Worker('js/xuda_worker.js', {
|
|
42308
42588
|
name: worker_name,
|
|
42309
42589
|
}),
|
|
42310
42590
|
promise_queue: {},
|
|
42311
|
-
};
|
|
42591
|
+
});
|
|
42312
42592
|
} else {
|
|
42313
42593
|
function getWorkerURL(url) {
|
|
42314
42594
|
const content = `importScripts( "${url}" );`;
|
|
@@ -42316,14 +42596,14 @@ func.index.new_webworker = async function (SESSION_ID, prog_obj, obj) {
|
|
|
42316
42596
|
}
|
|
42317
42597
|
const _session = SESSION_OBJ[SESSION_ID];
|
|
42318
42598
|
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')));
|
|
42319
|
-
|
|
42599
|
+
func.runtime.workers.set_registry_entry(SESSION_ID, worker_id, {
|
|
42320
42600
|
worker: new Worker(blob, {
|
|
42321
42601
|
name: worker_name,
|
|
42322
42602
|
}),
|
|
42323
42603
|
promise_queue: {},
|
|
42324
|
-
};
|
|
42604
|
+
});
|
|
42325
42605
|
}
|
|
42326
|
-
|
|
42606
|
+
func.runtime.workers.get_registry_entry(SESSION_ID, worker_id).worker.addEventListener(
|
|
42327
42607
|
'message',
|
|
42328
42608
|
function (e) {
|
|
42329
42609
|
if (e.data.service === 'worker_ready') {
|
|
@@ -42337,12 +42617,12 @@ func.index.new_webworker = async function (SESSION_ID, prog_obj, obj) {
|
|
|
42337
42617
|
};
|
|
42338
42618
|
const create_websocket = async function () {
|
|
42339
42619
|
return new Promise((resolve, reject) => {
|
|
42340
|
-
|
|
42620
|
+
func.runtime.workers.set_registry_entry(SESSION_ID, worker_id, {
|
|
42341
42621
|
worker: RUNTIME_SERVER_WEBSOCKET,
|
|
42342
42622
|
promise_queue: {},
|
|
42343
|
-
};
|
|
42623
|
+
});
|
|
42344
42624
|
|
|
42345
|
-
|
|
42625
|
+
func.runtime.workers.get_registry_entry(SESSION_ID, worker_id).worker.on('message', async (e) => {
|
|
42346
42626
|
if (['deployment_server', 'http_call'].includes(e.source)) return;
|
|
42347
42627
|
worker_functions({ data: e });
|
|
42348
42628
|
});
|
|
@@ -42547,13 +42827,7 @@ func.index.new_webworker = async function (SESSION_ID, prog_obj, obj) {
|
|
|
42547
42827
|
msg.data.session_id = SESSION_ID;
|
|
42548
42828
|
msg.data.data = data;
|
|
42549
42829
|
|
|
42550
|
-
|
|
42551
|
-
msg.process_pid = WEBSOCKET_PROCESS_PID;
|
|
42552
|
-
WEB_WORKER[SESSION_ID][worker_id].worker.emit('message', msg);
|
|
42553
|
-
// WEB_WORKER[SESSION_ID][worker_id].worker.send(JSON.stringify(msg));
|
|
42554
|
-
} else {
|
|
42555
|
-
WEB_WORKER[SESSION_ID][worker_id].worker.postMessage(msg);
|
|
42556
|
-
}
|
|
42830
|
+
func.runtime.workers.send_message(SESSION_ID, worker_id, _session, msg, WEBSOCKET_PROCESS_PID);
|
|
42557
42831
|
_resolve();
|
|
42558
42832
|
},
|
|
42559
42833
|
execute_local_sava_data: async function () {
|
|
@@ -42570,12 +42844,7 @@ func.index.new_webworker = async function (SESSION_ID, prog_obj, obj) {
|
|
|
42570
42844
|
msg.data.session_id = SESSION_ID;
|
|
42571
42845
|
msg.data.data = data;
|
|
42572
42846
|
|
|
42573
|
-
|
|
42574
|
-
msg.process_pid = WEBSOCKET_PROCESS_PID;
|
|
42575
|
-
WEB_WORKER[SESSION_ID][worker_id].worker.emit('message', msg);
|
|
42576
|
-
} else {
|
|
42577
|
-
WEB_WORKER[SESSION_ID][worker_id].worker.postMessage(msg);
|
|
42578
|
-
}
|
|
42847
|
+
func.runtime.workers.send_message(SESSION_ID, worker_id, _session, msg, WEBSOCKET_PROCESS_PID);
|
|
42579
42848
|
_resolve();
|
|
42580
42849
|
},
|
|
42581
42850
|
write_debug_log: function (params) {
|
|
@@ -42658,12 +42927,12 @@ func.index.new_webworker = async function (SESSION_ID, prog_obj, obj) {
|
|
|
42658
42927
|
};
|
|
42659
42928
|
|
|
42660
42929
|
const get_promise_queue = function (t, worker_id) {
|
|
42661
|
-
if (!
|
|
42930
|
+
if (!func.runtime.workers.get_registry_entry(SESSION_ID, worker_id)) {
|
|
42662
42931
|
console.warn('worker job not found');
|
|
42663
42932
|
return;
|
|
42664
42933
|
}
|
|
42665
42934
|
|
|
42666
|
-
return
|
|
42935
|
+
return func.runtime.workers.get_promise(SESSION_ID, worker_id, t);
|
|
42667
42936
|
};
|
|
42668
42937
|
|
|
42669
42938
|
const promise_ret = await get_promise_queue(e.data.promise_queue_id, e.data.worker_id);
|
|
@@ -42672,7 +42941,7 @@ func.index.new_webworker = async function (SESSION_ID, prog_obj, obj) {
|
|
|
42672
42941
|
if (!promise_ret) return resolve();
|
|
42673
42942
|
promise_ret.resolve(params);
|
|
42674
42943
|
setTimeout(function () {
|
|
42675
|
-
|
|
42944
|
+
func.runtime.workers.delete_promise(SESSION_ID, e.data.worker_id, e.data.promise_queue_id);
|
|
42676
42945
|
}, 1000);
|
|
42677
42946
|
};
|
|
42678
42947
|
|