@polyvharmony/live-scenes-foundation 1.3.0 → 1.3.2-rc.1
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/CHANGELOG.md +29 -0
- package/ResourceTable.txt +17 -17
- package/oh-package.json5 +1 -1
- package/package.json +1 -1
- package/src/main/ets/common/PLVBasicDataSource.d.ets +19 -19
- package/src/main/ets/common/PLVBasicDataSource.js +75 -75
- package/src/main/ets/common/PLVCallback.d.ets +20 -19
- package/src/main/ets/common/PLVCallback.js +78 -78
- package/src/main/ets/common/PLVCommonEnums.js +16 -16
- package/src/main/ets/common/PLVDeviceUtils.d.ets +4 -4
- package/src/main/ets/common/PLVDeviceUtils.js +9 -9
- package/src/main/ets/common/PLVHashMap.d.ets +2 -2
- package/src/main/ets/common/PLVHashMap.js +2 -2
- package/src/main/ets/common/PLVJSONUtils.d.ets +13 -13
- package/src/main/ets/common/PLVJSONUtils.js +46 -46
- package/src/main/ets/common/PLVNetUtils.d.ets +4 -4
- package/src/main/ets/common/PLVNetUtils.js +24 -24
- package/src/main/ets/common/PLVPreferencesUtils.d.ets +9 -9
- package/src/main/ets/common/PLVPreferencesUtils.js +16 -16
- package/src/main/ets/common/PLVScheduledTask.d.ets +1 -1
- package/src/main/ets/common/PLVScheduledTask.js +9 -9
- package/src/main/ets/common/PLVSimpleBuffer.d.ets +3 -3
- package/src/main/ets/common/PLVSimpleBuffer.js +8 -8
- package/src/main/ets/common/PLVSparseArray.d.ets +6 -6
- package/src/main/ets/common/PLVSparseArray.js +21 -21
- package/src/main/ets/common/PLVTextUtils.d.ets +8 -8
- package/src/main/ets/common/PLVTextUtils.js +44 -44
- package/src/main/ets/common/PLVTimeUtils.d.ets +1 -1
- package/src/main/ets/common/PLVTimeUtils.js +8 -8
- package/src/main/ets/common/PLVToastUtils.d.ets +4 -4
- package/src/main/ets/common/PLVToastUtils.js +7 -7
- package/src/main/ets/common/PLVUACreator.d.ets +1 -1
- package/src/main/ets/common/PLVUACreator.js +6 -6
- package/src/main/ets/common/PLVUtils.d.ets +25 -24
- package/src/main/ets/common/PLVUtils.js +141 -141
- package/src/main/ets/common/PLVWebUtils.d.ets +4 -4
- package/src/main/ets/common/PLVWebUtils.js +46 -47
- package/src/main/ets/common/ui/PLVNodeController.d.ets +11 -9
- package/src/main/ets/common/ui/PLVNodeController.js +48 -47
- package/src/main/ets/modules/log/PLVLogger.d.ets +11 -11
- package/src/main/ets/modules/log/PLVLogger.js +36 -36
- package/src/main/ets/modules/log/PLVXLogFilePrinter.d.ets +2 -2
- package/src/main/ets/modules/log/PLVXLogFilePrinter.js +14 -12
- package/src/main/ets/modules/net/PLVHttpData.d.ets +1 -1
- package/src/main/ets/modules/net/PLVHttpData.js +3 -3
- package/src/main/ets/modules/net/PLVHttpError.d.ets +2 -2
- package/src/main/ets/modules/net/PLVHttpError.js +5 -5
- package/src/main/ets/modules/net/PLVHttpRequest.d.ets +10 -9
- package/src/main/ets/modules/net/PLVHttpRequest.js +89 -88
- package/src/main/ets/modules/net/PLVRequestSetting.d.ets +3 -3
- package/src/main/ets/modules/net/PLVRequestSetting.js +14 -14
- package/src/main/ets/modules/socket/PLVSocketIO.d.ets +20 -20
- package/src/main/ets/modules/socket/PLVSocketIO.js +61 -61
- package/src/main/ets/modules/web/PLVFailureLayout.js +17 -18
- package/src/main/ets/modules/web/PLVLoadingLayout.js +12 -13
- package/src/main/ets/modules/web/PLVNewWindowLayout.js +17 -18
- package/src/main/ets/modules/web/PLVSimpleWeb.js +75 -79
- package/src/main/ets/modules/web/PLVWebController.d.ets +39 -39
- package/src/main/ets/modules/web/PLVWebController.js +106 -106
- package/src/main/module.json +1 -1
|
@@ -9,138 +9,139 @@ import PLVUtils from '../../common/PLVUtils';
|
|
|
9
9
|
import { PLVNetUtils } from '../../common/PLVNetUtils';
|
|
10
10
|
const TAG = '[PLVHttpRequest]';
|
|
11
11
|
export class PLVHttpRequest {
|
|
12
|
-
constructor(
|
|
13
|
-
this.baseURL =
|
|
12
|
+
constructor(w15) {
|
|
13
|
+
this.baseURL = w15;
|
|
14
14
|
}
|
|
15
|
-
ua(
|
|
16
|
-
this.userAgent =
|
|
15
|
+
ua(v15) {
|
|
16
|
+
this.userAgent = v15;
|
|
17
17
|
return this;
|
|
18
18
|
}
|
|
19
|
-
create(
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
19
|
+
create(i15) {
|
|
20
|
+
const j15 = axios.create();
|
|
21
|
+
j15.defaults.timeout = 10000;
|
|
22
|
+
j15.defaults.readTimeout = 10000;
|
|
23
|
+
j15.defaults.connectTimeout = 10000;
|
|
24
|
+
j15.defaults.baseURL = this.baseURL;
|
|
25
|
+
j15.defaults.headers.common['User-Agent'] = this.userAgent;
|
|
26
|
+
const k15 = (i15?.cacheTime === 0 ? PLVHttpRequest.CACHE_TIMEOUT : i15?.cacheTime) ?? PLVHttpRequest.CACHE_TIMEOUT;
|
|
27
|
+
if (i15?.formUrlEncoded) {
|
|
28
|
+
j15.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
28
29
|
}
|
|
29
|
-
let
|
|
30
|
-
|
|
31
|
-
if (
|
|
32
|
-
const
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
|
|
30
|
+
let l15 = '';
|
|
31
|
+
j15.interceptors.request.use((q15) => {
|
|
32
|
+
if (i15?.signKey) {
|
|
33
|
+
const t15 = q15.params ? q15.params : q15.data;
|
|
34
|
+
const u15 = PLVJSONUtils.object2Map(t15);
|
|
35
|
+
u15.delete('log');
|
|
36
|
+
t15['sign'] = PLVRequestSetting.createSign(u15, i15.signKey);
|
|
36
37
|
}
|
|
37
38
|
if (PLVHttpRequest.token) {
|
|
38
|
-
const
|
|
39
|
-
const
|
|
40
|
-
if (
|
|
41
|
-
|
|
42
|
-
|
|
39
|
+
const r15 = q15.params;
|
|
40
|
+
const s15 = q15.data;
|
|
41
|
+
if (r15 && Object.keys(r15).includes('appId')) {
|
|
42
|
+
r15['token'] = PLVHttpRequest.token;
|
|
43
|
+
r15['viewerToken'] = PLVHttpRequest.token;
|
|
43
44
|
}
|
|
44
|
-
if (
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
if (s15 && Object.keys(s15).includes('appId')) {
|
|
46
|
+
s15['token'] = PLVHttpRequest.token;
|
|
47
|
+
s15['viewerToken'] = PLVHttpRequest.token;
|
|
47
48
|
}
|
|
48
49
|
}
|
|
49
|
-
if (
|
|
50
|
-
|
|
50
|
+
if (i15?.useCache) {
|
|
51
|
+
l15 = this.generateCacheKey(q15);
|
|
51
52
|
}
|
|
52
|
-
PLVLogger.info(TAG, `--> ${this.method} ${this.baseURL}${
|
|
53
|
-
PLVLogger.info(TAG, `--> ${PLVNetUtils.formatParams(
|
|
54
|
-
return
|
|
55
|
-
}, (
|
|
56
|
-
return Promise.reject(
|
|
53
|
+
PLVLogger.info(TAG, `--> ${this.method} ${this.baseURL}${i15?.url}${PLVNetUtils.formatParams(q15?.params)}`);
|
|
54
|
+
PLVLogger.info(TAG, `--> ${PLVNetUtils.formatParams(q15?.data)}`);
|
|
55
|
+
return q15;
|
|
56
|
+
}, (p15) => {
|
|
57
|
+
return Promise.reject(p15);
|
|
57
58
|
});
|
|
58
|
-
|
|
59
|
-
PLVLogger.info(TAG, `<-- ${
|
|
60
|
-
PLVLogger.info(TAG, `Header: ${PLVJSONUtils.safeStringify(
|
|
61
|
-
PLVLogger.info(TAG, `Result: ${PLVJSONUtils.safeStringify(
|
|
62
|
-
if (
|
|
63
|
-
const
|
|
64
|
-
if (
|
|
65
|
-
|
|
59
|
+
j15.interceptors.response.use((n15) => {
|
|
60
|
+
PLVLogger.info(TAG, `<-- ${n15.status} ${this.method} ${this.baseURL}${n15.config.url}${PLVNetUtils.formatParams(i15?.params)} (${n15.performanceTiming?.totalTiming}ms)`);
|
|
61
|
+
PLVLogger.info(TAG, `Header: ${PLVJSONUtils.safeStringify(n15.headers)}`);
|
|
62
|
+
PLVLogger.info(TAG, `Result: ${PLVJSONUtils.safeStringify(n15.data)}`);
|
|
63
|
+
if (i15?.aesDecrypted) {
|
|
64
|
+
const o15 = n15.data;
|
|
65
|
+
if (o15) {
|
|
66
|
+
o15['data'] = PLVJSONUtils.safeParse(PLVRequestSetting.decryptDataSync(o15['data']));
|
|
66
67
|
}
|
|
67
68
|
else {
|
|
68
69
|
PLVLogger.printError(TAG, 'response error', new Error('jsonData undefined'));
|
|
69
70
|
}
|
|
70
71
|
}
|
|
71
|
-
if (
|
|
72
|
-
PLVHttpData.fill(
|
|
72
|
+
if (i15?.fillData) {
|
|
73
|
+
PLVHttpData.fill(i15.fillData, n15);
|
|
73
74
|
}
|
|
74
|
-
if (
|
|
75
|
-
PLVHttpRequest.CACHE_DATA_MAP.set(
|
|
75
|
+
if (l15) {
|
|
76
|
+
PLVHttpRequest.CACHE_DATA_MAP.set(l15, n15);
|
|
76
77
|
setTimeout(() => {
|
|
77
|
-
PLVHttpRequest.CACHE_DATA_MAP.remove(
|
|
78
|
-
},
|
|
78
|
+
PLVHttpRequest.CACHE_DATA_MAP.remove(l15);
|
|
79
|
+
}, k15);
|
|
79
80
|
}
|
|
80
|
-
return
|
|
81
|
-
}, (
|
|
82
|
-
return Promise.reject(
|
|
81
|
+
return n15;
|
|
82
|
+
}, (m15) => {
|
|
83
|
+
return Promise.reject(m15);
|
|
83
84
|
});
|
|
84
|
-
return
|
|
85
|
+
return j15;
|
|
85
86
|
}
|
|
86
|
-
request(
|
|
87
|
-
return PLVUtils.safePromise((
|
|
88
|
-
|
|
89
|
-
const
|
|
90
|
-
if (
|
|
91
|
-
for (const
|
|
92
|
-
if (
|
|
93
|
-
|
|
87
|
+
request(b15) {
|
|
88
|
+
return PLVUtils.safePromise((c15, d15) => {
|
|
89
|
+
b15.then((f15) => {
|
|
90
|
+
const g15 = f15.data;
|
|
91
|
+
if (g15) {
|
|
92
|
+
for (const h15 of Object.keys(g15)) {
|
|
93
|
+
if (h15 == 'code' && g15[h15] != 200 + '') {
|
|
94
|
+
d15(new PLVHttpError(new AxiosError(PLVJSONUtils.safeStringify(f15.data || ''), g15[h15], undefined, undefined, f15)));
|
|
94
95
|
return;
|
|
95
96
|
}
|
|
96
97
|
}
|
|
97
98
|
}
|
|
98
|
-
|
|
99
|
-
}).catch((
|
|
100
|
-
|
|
99
|
+
c15(f15);
|
|
100
|
+
}).catch((e15) => {
|
|
101
|
+
d15(new PLVHttpError(e15));
|
|
101
102
|
});
|
|
102
103
|
});
|
|
103
104
|
}
|
|
104
|
-
get(
|
|
105
|
+
get(a15) {
|
|
105
106
|
this.method = 'GET';
|
|
106
|
-
return this.checkCache(
|
|
107
|
+
return this.checkCache(a15) || this.request(this.create(a15).get(a15?.url, a15));
|
|
107
108
|
}
|
|
108
|
-
post(
|
|
109
|
+
post(z14) {
|
|
109
110
|
this.method = 'POST';
|
|
110
|
-
return this.checkCache(
|
|
111
|
+
return this.checkCache(z14) || this.request(this.create(z14).post(z14?.url, z14?.data, z14));
|
|
111
112
|
}
|
|
112
|
-
checkCache(
|
|
113
|
-
if (
|
|
114
|
-
const
|
|
115
|
-
if (PLVHttpRequest.CACHE_DATA_MAP.hasKey(
|
|
116
|
-
PLVLogger.info(TAG, `--> ${this.method} ${this.baseURL}${
|
|
117
|
-
return Promise.resolve(PLVHttpRequest.CACHE_DATA_MAP.get(
|
|
113
|
+
checkCache(x14) {
|
|
114
|
+
if (x14?.useCache) {
|
|
115
|
+
const y14 = this.generateCacheKey(x14);
|
|
116
|
+
if (PLVHttpRequest.CACHE_DATA_MAP.hasKey(y14)) {
|
|
117
|
+
PLVLogger.info(TAG, `--> ${this.method} ${this.baseURL}${x14?.url} use cache`);
|
|
118
|
+
return Promise.resolve(PLVHttpRequest.CACHE_DATA_MAP.get(y14));
|
|
118
119
|
}
|
|
119
120
|
}
|
|
120
121
|
return undefined;
|
|
121
122
|
}
|
|
122
|
-
generateCacheKey(
|
|
123
|
-
let
|
|
124
|
-
const
|
|
125
|
-
const
|
|
126
|
-
const
|
|
127
|
-
if (
|
|
128
|
-
for (const
|
|
129
|
-
if (
|
|
123
|
+
generateCacheKey(q14) {
|
|
124
|
+
let r14 = this.baseURL + '' + q14?.url;
|
|
125
|
+
const s14 = q14?.params;
|
|
126
|
+
const t14 = q14?.data;
|
|
127
|
+
const u14 = (v14) => {
|
|
128
|
+
if (v14) {
|
|
129
|
+
for (const w14 of Object.keys(v14)) {
|
|
130
|
+
if (w14 == 'timestamp' || w14 == 'sign' || w14 == 'token' || w14 == 'viewerToken') {
|
|
130
131
|
continue;
|
|
131
132
|
}
|
|
132
|
-
if (
|
|
133
|
-
|
|
133
|
+
if (w14 == 'appId' && PLVHttpRequest.token) {
|
|
134
|
+
r14 += PLVHttpRequest.token;
|
|
134
135
|
}
|
|
135
136
|
else {
|
|
136
|
-
|
|
137
|
+
r14 += v14[w14];
|
|
137
138
|
}
|
|
138
139
|
}
|
|
139
140
|
}
|
|
140
141
|
};
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
return
|
|
142
|
+
u14(s14);
|
|
143
|
+
u14(t14);
|
|
144
|
+
return r14;
|
|
144
145
|
}
|
|
145
146
|
}
|
|
146
147
|
PLVHttpRequest.CACHE_TIMEOUT = 1000 * 60 * 5;
|
|
@@ -3,7 +3,7 @@ export declare class PLVRequestSetting {
|
|
|
3
3
|
static readonly PLV_SWITCH_API_INNOR = "polyv_switch_api_innor";
|
|
4
4
|
static readonly DECRYPT_KEY_1_SRC = "PolyvApiResponse";
|
|
5
5
|
static readonly DECRYPT_KEY_2_SRC = "PolyvLiveEncrypt";
|
|
6
|
-
static createSign(
|
|
7
|
-
static decryptDataSync(
|
|
8
|
-
static concatParams(
|
|
6
|
+
static createSign(d16: Map<string, Object | undefined>, e16?: string): string;
|
|
7
|
+
static decryptDataSync(b16: string): string;
|
|
8
|
+
static concatParams(x15: Map<string, Object | undefined>): string;
|
|
9
9
|
}
|
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
import buffer from "@ohos.buffer";
|
|
2
2
|
import { CryptoJS } from '@ohos/crypto-js';
|
|
3
3
|
export class PLVRequestSetting {
|
|
4
|
-
static createSign(
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
return
|
|
4
|
+
static createSign(d16, e16) {
|
|
5
|
+
const f16 = e16 + PLVRequestSetting.concatParams(d16) + e16;
|
|
6
|
+
const g16 = CryptoJS.MD5(f16).toString().toUpperCase();
|
|
7
|
+
return g16;
|
|
8
8
|
}
|
|
9
|
-
static decryptDataSync(
|
|
10
|
-
const
|
|
9
|
+
static decryptDataSync(b16) {
|
|
10
|
+
const c16 = CryptoJS.AES.decrypt(buffer.from(b16, 'base64').toString('hex'), CryptoJS.enc.Utf8.parse(PLVRequestSetting.DECRYPT_KEY_1_SRC), {
|
|
11
11
|
format: CryptoJS.format.Hex,
|
|
12
12
|
iv: CryptoJS.enc.Utf8.parse(PLVRequestSetting.DECRYPT_KEY_2_SRC),
|
|
13
13
|
mode: CryptoJS.mode.CBC,
|
|
14
14
|
padding: CryptoJS.pad.Pkcs7
|
|
15
15
|
}).toString(CryptoJS.enc.Utf8);
|
|
16
|
-
return
|
|
16
|
+
return c16;
|
|
17
17
|
}
|
|
18
|
-
static concatParams(
|
|
19
|
-
const
|
|
20
|
-
const
|
|
21
|
-
for (const
|
|
22
|
-
if (!
|
|
18
|
+
static concatParams(x15) {
|
|
19
|
+
const y15 = Array.from(x15.keys()).sort();
|
|
20
|
+
const z15 = [];
|
|
21
|
+
for (const a16 of y15) {
|
|
22
|
+
if (!a16 || !x15.get(a16)) {
|
|
23
23
|
continue;
|
|
24
24
|
}
|
|
25
|
-
|
|
25
|
+
z15.push(a16 + x15.get(a16));
|
|
26
26
|
}
|
|
27
|
-
return
|
|
27
|
+
return z15.join('');
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
PLVRequestSetting.KEY_1 = 'polyv_sdk_api_innor';
|
|
@@ -5,40 +5,40 @@ export declare class PLVSocketIO {
|
|
|
5
5
|
protected onSocketIOStatusListener?: PLVCallback<PLVSocketIOStatus, void>;
|
|
6
6
|
protected isTokenExpired: boolean;
|
|
7
7
|
private set_open_listener;
|
|
8
|
-
protected set_fail_listener(
|
|
9
|
-
protected set_reconnecting_listener(
|
|
8
|
+
protected set_fail_listener(r17: () => void): void;
|
|
9
|
+
protected set_reconnecting_listener(q17: () => void): void;
|
|
10
10
|
private set_reconnect_listener;
|
|
11
|
-
protected set_close_listener(
|
|
12
|
-
protected set_socket_open_listener(
|
|
13
|
-
protected set_socket_close_listener(
|
|
14
|
-
protected connect(
|
|
15
|
-
protected connectWithQuery(
|
|
11
|
+
protected set_close_listener(o17: (reason: string) => void): void;
|
|
12
|
+
protected set_socket_open_listener(n17: (nsp: string) => void): void;
|
|
13
|
+
protected set_socket_close_listener(m17: (nsp: string) => void): void;
|
|
14
|
+
protected connect(l17: string): void;
|
|
15
|
+
protected connectWithQuery(i17: string, j17: string, k17: string): void;
|
|
16
16
|
connected(): boolean;
|
|
17
|
-
disconnect(
|
|
18
|
-
destroy(
|
|
17
|
+
disconnect(h17?: boolean): void;
|
|
18
|
+
destroy(g17?: boolean): void;
|
|
19
19
|
protected clear_con_listeners(): void;
|
|
20
20
|
protected clear_socket_listeners(): void;
|
|
21
|
-
protected set_reconnect_attempts(
|
|
22
|
-
protected set_reconnect_delay(
|
|
23
|
-
protected set_reconnect_delay_max(
|
|
21
|
+
protected set_reconnect_attempts(f17: number): void;
|
|
22
|
+
protected set_reconnect_delay(e17: number): void;
|
|
23
|
+
protected set_reconnect_delay_max(d17: number): void;
|
|
24
24
|
protected set_logs_default(): void;
|
|
25
25
|
protected set_logs_quiet(): void;
|
|
26
26
|
protected set_logs_verbose(): void;
|
|
27
27
|
private close;
|
|
28
28
|
private sync_close;
|
|
29
|
-
protected set_proxy_basic_auth(
|
|
29
|
+
protected set_proxy_basic_auth(a17: string, b17: string, c17: string): void;
|
|
30
30
|
private opened;
|
|
31
31
|
protected get_sessionid(): string;
|
|
32
|
-
protected set_nsp(
|
|
33
|
-
protected on(
|
|
34
|
-
protected once(
|
|
35
|
-
protected off(
|
|
32
|
+
protected set_nsp(z16: string): void;
|
|
33
|
+
protected on(w16: string, x16: (event_json: string) => void): void;
|
|
34
|
+
protected once(u16: string, v16: (event_json: string) => void): void;
|
|
35
|
+
protected off(t16: string): void;
|
|
36
36
|
protected off_all(): void;
|
|
37
37
|
private socket_close;
|
|
38
|
-
protected on_error(
|
|
38
|
+
protected on_error(s16: (message: string) => void): void;
|
|
39
39
|
protected off_error(): void;
|
|
40
|
-
protected emitSkipCheck(
|
|
41
|
-
emit(
|
|
40
|
+
protected emitSkipCheck(o16: string, p16: ESObject, q16?: (emit_callback_json: string) => void): void;
|
|
41
|
+
emit(k16: string, l16: ESObject, m16?: (emit_callback_json: string) => void): boolean;
|
|
42
42
|
private replaceJson;
|
|
43
43
|
}
|
|
44
44
|
export declare enum PLVSocketIOStatus {
|
|
@@ -8,31 +8,31 @@ export class PLVSocketIO {
|
|
|
8
8
|
this.socketIOStatus = PLVSocketIOStatus.IDLE;
|
|
9
9
|
this.isTokenExpired = false;
|
|
10
10
|
}
|
|
11
|
-
set_open_listener(
|
|
12
|
-
this.client.set_open_listener(
|
|
11
|
+
set_open_listener(s17) {
|
|
12
|
+
this.client.set_open_listener(s17);
|
|
13
13
|
}
|
|
14
|
-
set_fail_listener(
|
|
15
|
-
this.client.set_fail_listener(
|
|
14
|
+
set_fail_listener(r17) {
|
|
15
|
+
this.client.set_fail_listener(r17);
|
|
16
16
|
}
|
|
17
|
-
set_reconnecting_listener(
|
|
18
|
-
this.client.set_reconnecting_listener(
|
|
17
|
+
set_reconnecting_listener(q17) {
|
|
18
|
+
this.client.set_reconnecting_listener(q17);
|
|
19
19
|
}
|
|
20
|
-
set_reconnect_listener(
|
|
21
|
-
this.client.set_reconnect_listener(
|
|
20
|
+
set_reconnect_listener(p17) {
|
|
21
|
+
this.client.set_reconnect_listener(p17);
|
|
22
22
|
}
|
|
23
|
-
set_close_listener(
|
|
24
|
-
this.client.set_close_listener(
|
|
23
|
+
set_close_listener(o17) {
|
|
24
|
+
this.client.set_close_listener(o17);
|
|
25
25
|
}
|
|
26
|
-
set_socket_open_listener(
|
|
27
|
-
this.client.set_socket_open_listener(
|
|
26
|
+
set_socket_open_listener(n17) {
|
|
27
|
+
this.client.set_socket_open_listener(n17);
|
|
28
28
|
}
|
|
29
|
-
set_socket_close_listener(
|
|
30
|
-
this.client.set_socket_close_listener(
|
|
29
|
+
set_socket_close_listener(m17) {
|
|
30
|
+
this.client.set_socket_close_listener(m17);
|
|
31
31
|
}
|
|
32
|
-
connect(
|
|
33
|
-
this.connectWithQuery(
|
|
32
|
+
connect(l17) {
|
|
33
|
+
this.connectWithQuery(l17, '', '');
|
|
34
34
|
}
|
|
35
|
-
connectWithQuery(
|
|
35
|
+
connectWithQuery(i17, j17, k17) {
|
|
36
36
|
this.isTokenExpired = false;
|
|
37
37
|
if (this.socketIOStatus == PLVSocketIOStatus.IDLE || this.socketIOStatus == PLVSocketIOStatus.SOCKET_CLOSE) {
|
|
38
38
|
this.socketIOStatus = PLVSocketIOStatus.CONNECT;
|
|
@@ -65,19 +65,19 @@ export class PLVSocketIO {
|
|
|
65
65
|
this.set_close_listener(() => {
|
|
66
66
|
PLVLogger.info(TAG, 'call close');
|
|
67
67
|
});
|
|
68
|
-
this.client.connectWithQuery(
|
|
68
|
+
this.client.connectWithQuery(i17, j17, k17);
|
|
69
69
|
}
|
|
70
70
|
connected() {
|
|
71
71
|
return this.opened() && this.socketIOStatus != PLVSocketIOStatus.SOCKET_CLOSE;
|
|
72
72
|
}
|
|
73
|
-
disconnect(
|
|
74
|
-
if (this.socketIOStatus != PLVSocketIOStatus.SOCKET_CLOSE && !
|
|
73
|
+
disconnect(h17) {
|
|
74
|
+
if (this.socketIOStatus != PLVSocketIOStatus.SOCKET_CLOSE && !h17) {
|
|
75
75
|
this.socket_close();
|
|
76
76
|
}
|
|
77
77
|
this.close();
|
|
78
78
|
}
|
|
79
|
-
destroy(
|
|
80
|
-
this.disconnect(
|
|
79
|
+
destroy(g17) {
|
|
80
|
+
this.disconnect(g17);
|
|
81
81
|
this.clear_con_listeners();
|
|
82
82
|
this.clear_socket_listeners();
|
|
83
83
|
}
|
|
@@ -87,14 +87,14 @@ export class PLVSocketIO {
|
|
|
87
87
|
clear_socket_listeners() {
|
|
88
88
|
this.client.clear_socket_listeners();
|
|
89
89
|
}
|
|
90
|
-
set_reconnect_attempts(
|
|
91
|
-
this.client.set_reconnect_attempts(
|
|
90
|
+
set_reconnect_attempts(f17) {
|
|
91
|
+
this.client.set_reconnect_attempts(f17);
|
|
92
92
|
}
|
|
93
|
-
set_reconnect_delay(
|
|
94
|
-
this.client.set_reconnect_delay(
|
|
93
|
+
set_reconnect_delay(e17) {
|
|
94
|
+
this.client.set_reconnect_delay(e17);
|
|
95
95
|
}
|
|
96
|
-
set_reconnect_delay_max(
|
|
97
|
-
this.client.set_reconnect_delay_max(
|
|
96
|
+
set_reconnect_delay_max(d17) {
|
|
97
|
+
this.client.set_reconnect_delay_max(d17);
|
|
98
98
|
}
|
|
99
99
|
set_logs_default() {
|
|
100
100
|
this.client.set_logs_default();
|
|
@@ -111,8 +111,8 @@ export class PLVSocketIO {
|
|
|
111
111
|
sync_close() {
|
|
112
112
|
this.client.sync_close();
|
|
113
113
|
}
|
|
114
|
-
set_proxy_basic_auth(
|
|
115
|
-
this.client.set_proxy_basic_auth(
|
|
114
|
+
set_proxy_basic_auth(a17, b17, c17) {
|
|
115
|
+
this.client.set_proxy_basic_auth(a17, b17, c17);
|
|
116
116
|
}
|
|
117
117
|
opened() {
|
|
118
118
|
return this.client.opened();
|
|
@@ -120,19 +120,19 @@ export class PLVSocketIO {
|
|
|
120
120
|
get_sessionid() {
|
|
121
121
|
return this.client.get_sessionid();
|
|
122
122
|
}
|
|
123
|
-
set_nsp(
|
|
124
|
-
this.client.set_nsp(
|
|
123
|
+
set_nsp(z16) {
|
|
124
|
+
this.client.set_nsp(z16);
|
|
125
125
|
}
|
|
126
|
-
on(
|
|
127
|
-
this.client.on(
|
|
128
|
-
|
|
126
|
+
on(w16, x16) {
|
|
127
|
+
this.client.on(w16, (y16) => {
|
|
128
|
+
x16(this.replaceJson(y16));
|
|
129
129
|
});
|
|
130
130
|
}
|
|
131
|
-
once(
|
|
132
|
-
this.client.once(
|
|
131
|
+
once(u16, v16) {
|
|
132
|
+
this.client.once(u16, v16);
|
|
133
133
|
}
|
|
134
|
-
off(
|
|
135
|
-
this.client.off(
|
|
134
|
+
off(t16) {
|
|
135
|
+
this.client.off(t16);
|
|
136
136
|
}
|
|
137
137
|
off_all() {
|
|
138
138
|
this.client.off_all();
|
|
@@ -140,42 +140,42 @@ export class PLVSocketIO {
|
|
|
140
140
|
socket_close() {
|
|
141
141
|
this.client.socket_close();
|
|
142
142
|
}
|
|
143
|
-
on_error(
|
|
144
|
-
this.client.on_error(
|
|
143
|
+
on_error(s16) {
|
|
144
|
+
this.client.on_error(s16);
|
|
145
145
|
}
|
|
146
146
|
off_error() {
|
|
147
147
|
this.client.off_error();
|
|
148
148
|
}
|
|
149
|
-
emitSkipCheck(
|
|
150
|
-
this.client.emit(
|
|
151
|
-
|
|
149
|
+
emitSkipCheck(o16, p16, q16) {
|
|
150
|
+
this.client.emit(o16, p16, (r16) => {
|
|
151
|
+
q16?.(this.replaceJson(r16));
|
|
152
152
|
});
|
|
153
153
|
}
|
|
154
|
-
emit(
|
|
155
|
-
PLVLogger.info(TAG, `emit: ${
|
|
154
|
+
emit(k16, l16, m16) {
|
|
155
|
+
PLVLogger.info(TAG, `emit: ${l16}, name: ${k16}, connected: ${this.connected()}`);
|
|
156
156
|
if (this.connected()) {
|
|
157
|
-
this.client.emit(
|
|
158
|
-
|
|
157
|
+
this.client.emit(k16, l16, (n16) => {
|
|
158
|
+
m16?.(this.replaceJson(n16));
|
|
159
159
|
});
|
|
160
160
|
return true;
|
|
161
161
|
}
|
|
162
162
|
return false;
|
|
163
163
|
}
|
|
164
|
-
replaceJson(
|
|
165
|
-
|
|
166
|
-
const
|
|
167
|
-
if (
|
|
168
|
-
|
|
164
|
+
replaceJson(i16) {
|
|
165
|
+
i16 = i16.replace(/^"{/, '{').replace(/}"$/, '}').replace(/"{/, '{');
|
|
166
|
+
const j16 = i16.lastIndexOf('}"');
|
|
167
|
+
if (j16 !== -1) {
|
|
168
|
+
i16 = i16.substring(0, j16) + '}' + i16.substring(j16 + 2);
|
|
169
169
|
}
|
|
170
|
-
return
|
|
170
|
+
return i16;
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
173
|
export var PLVSocketIOStatus;
|
|
174
|
-
(function (
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
174
|
+
(function (h16) {
|
|
175
|
+
h16[h16["IDLE"] = 0] = "IDLE";
|
|
176
|
+
h16[h16["CONNECT"] = 1] = "CONNECT";
|
|
177
|
+
h16[h16["OPEN"] = 2] = "OPEN";
|
|
178
|
+
h16[h16["RECONNECT"] = 3] = "RECONNECT";
|
|
179
|
+
h16[h16["RECONNECT_SUCCESS"] = 4] = "RECONNECT_SUCCESS";
|
|
180
|
+
h16[h16["SOCKET_CLOSE"] = 5] = "SOCKET_CLOSE";
|
|
181
181
|
})(PLVSocketIOStatus || (PLVSocketIOStatus = {}));
|
|
@@ -1,46 +1,45 @@
|
|
|
1
1
|
if (!("finalizeConstruction" in ViewPU.prototype)) {
|
|
2
|
-
Reflect.set(ViewPU.prototype, "finalizeConstruction", () => {
|
|
3
|
-
});
|
|
2
|
+
Reflect.set(ViewPU.prototype, "finalizeConstruction", () => { });
|
|
4
3
|
}
|
|
5
4
|
import PLVCommonConstants from '../../common/PLVCommonConstants';
|
|
6
5
|
export class PLVFailureLayout extends ViewPU {
|
|
7
|
-
constructor(
|
|
8
|
-
super(
|
|
9
|
-
if (typeof
|
|
10
|
-
this.paramsGenerator_ =
|
|
6
|
+
constructor(i18, j18, k18, l18 = -1, m18 = undefined, n18) {
|
|
7
|
+
super(i18, k18, l18, n18);
|
|
8
|
+
if (typeof m18 === "function") {
|
|
9
|
+
this.paramsGenerator_ = m18;
|
|
11
10
|
}
|
|
12
11
|
this.handleReload = undefined;
|
|
13
|
-
this.setInitiallyProvidedValue(
|
|
12
|
+
this.setInitiallyProvidedValue(j18);
|
|
14
13
|
this.finalizeConstruction();
|
|
15
14
|
}
|
|
16
|
-
setInitiallyProvidedValue(
|
|
17
|
-
if (
|
|
18
|
-
this.handleReload =
|
|
15
|
+
setInitiallyProvidedValue(h18) {
|
|
16
|
+
if (h18.handleReload !== undefined) {
|
|
17
|
+
this.handleReload = h18.handleReload;
|
|
19
18
|
}
|
|
20
19
|
}
|
|
21
|
-
updateStateVars(
|
|
20
|
+
updateStateVars(g18) {
|
|
22
21
|
}
|
|
23
|
-
purgeVariableDependenciesOnElmtId(
|
|
22
|
+
purgeVariableDependenciesOnElmtId(f18) {
|
|
24
23
|
}
|
|
25
24
|
aboutToBeDeleted() {
|
|
26
25
|
SubscriberManager.Get().delete(this.id__());
|
|
27
26
|
this.aboutToBeDeletedInternal();
|
|
28
27
|
}
|
|
29
28
|
initialRender() {
|
|
30
|
-
this.observeComponentCreation2((
|
|
29
|
+
this.observeComponentCreation2((d18, e18) => {
|
|
31
30
|
Row.create();
|
|
32
31
|
Row.justifyContent(FlexAlign.Center);
|
|
33
32
|
Row.layoutWeight(1);
|
|
34
33
|
}, Row);
|
|
35
|
-
this.observeComponentCreation2((
|
|
34
|
+
this.observeComponentCreation2((b18, c18) => {
|
|
36
35
|
Column.create();
|
|
37
36
|
}, Column);
|
|
38
|
-
this.observeComponentCreation2((
|
|
37
|
+
this.observeComponentCreation2((z17, a18) => {
|
|
39
38
|
Image.create({ "id": -1, "type": 20000, params: ["app.media.plv_web_ic_failure"], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" });
|
|
40
39
|
Image.width({ "id": -1, "type": 10002, params: ["app.float.plv_web_failure_img_size"], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" });
|
|
41
40
|
Image.height({ "id": -1, "type": 10002, params: ["app.float.plv_web_failure_img_size"], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" });
|
|
42
41
|
}, Image);
|
|
43
|
-
this.observeComponentCreation2((
|
|
42
|
+
this.observeComponentCreation2((x17, y17) => {
|
|
44
43
|
Text.create({ "id": -1, "type": 10003, params: ["app.string.plv_web_load_failed"], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" });
|
|
45
44
|
Text.fontColor({ "id": -1, "type": 10001, params: ["app.color.plv_web_reload_title_color"], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" });
|
|
46
45
|
Text.fontFamily(PLVCommonConstants.HARMONY_HEI_TI_FONT_FAMILY);
|
|
@@ -48,7 +47,7 @@ export class PLVFailureLayout extends ViewPU {
|
|
|
48
47
|
Text.margin({ top: { "id": -1, "type": 10002, params: ["app.float.plv_web_sm_padding_margin"], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" } });
|
|
49
48
|
}, Text);
|
|
50
49
|
Text.pop();
|
|
51
|
-
this.observeComponentCreation2((
|
|
50
|
+
this.observeComponentCreation2((v17, w17) => {
|
|
52
51
|
Row.create();
|
|
53
52
|
Row.height({ "id": -1, "type": 10002, params: ["app.float.plv_web_reload_btn_height"], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" });
|
|
54
53
|
Row.width({ "id": -1, "type": 10002, params: ["app.float.plv_web_reload_btn_width"], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" });
|
|
@@ -58,7 +57,7 @@ export class PLVFailureLayout extends ViewPU {
|
|
|
58
57
|
Row.borderRadius({ "id": -1, "type": 10002, params: ["app.float.plv_web_large_border_radius"], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" });
|
|
59
58
|
Row.onClick(() => this.handleReload?.());
|
|
60
59
|
}, Row);
|
|
61
|
-
this.observeComponentCreation2((
|
|
60
|
+
this.observeComponentCreation2((t17, u17) => {
|
|
62
61
|
Text.create({ "id": -1, "type": 10003, params: ["app.string.plv_web_reload"], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" });
|
|
63
62
|
Text.fontColor({ "id": -1, "type": 10001, params: ["app.color.plv_web_main_red_color"], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" });
|
|
64
63
|
Text.fontFamily(PLVCommonConstants.HARMONY_HEI_TI_FONT_FAMILY);
|