uni-oaview 1.8.1 → 1.9.0
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/components/oa-vconsole/audio.vue +25 -0
- package/components/oa-vconsole/console.vue +14 -0
- package/components/oa-vconsole/native-event.vue +23 -0
- package/components/oa-vconsole/network.vue +25 -0
- package/components/oa-vconsole/storage.vue +20 -0
- package/components/oa-vconsole/websocket.vue +28 -0
- package/package.json +1 -1
|
@@ -17,6 +17,9 @@
|
|
|
17
17
|
}"
|
|
18
18
|
>
|
|
19
19
|
<view style="font-size: 10px; padding: 10px 15px">
|
|
20
|
+
<view style="text-align: right; margin-bottom: 8px">
|
|
21
|
+
<text style="color: #007aff; font-size: 12px" @click="handleCopy(meta)">复制</text>
|
|
22
|
+
</view>
|
|
20
23
|
<view style="word-break: break-all; padding: 8px 0; margin-bottom: 10px">
|
|
21
24
|
<text :selectable="true" style="font-weight: bolder">实例ID:</text>
|
|
22
25
|
{{ meta.instanceId }}
|
|
@@ -197,6 +200,28 @@
|
|
|
197
200
|
keyword.value = '';
|
|
198
201
|
};
|
|
199
202
|
|
|
203
|
+
const handleCopy = (meta: AudioLogMeta) => {
|
|
204
|
+
const detail = getAudioLogDetail(meta.id);
|
|
205
|
+
const text = JSON.stringify(
|
|
206
|
+
{
|
|
207
|
+
instanceId: meta.instanceId,
|
|
208
|
+
src: meta.src,
|
|
209
|
+
duration: meta.duration,
|
|
210
|
+
currentTime: meta.currentTime,
|
|
211
|
+
action: meta.action,
|
|
212
|
+
data: detail?.data,
|
|
213
|
+
},
|
|
214
|
+
null,
|
|
215
|
+
2,
|
|
216
|
+
);
|
|
217
|
+
uni.setClipboardData({
|
|
218
|
+
data: text,
|
|
219
|
+
success: () => {
|
|
220
|
+
uni.showToast({ title: '已复制', icon: 'success' });
|
|
221
|
+
},
|
|
222
|
+
});
|
|
223
|
+
};
|
|
224
|
+
|
|
200
225
|
const upsertLogs = (logs: AudioLog[]) => {
|
|
201
226
|
const visibleLogs = clearTimestamp.value ? logs.filter((log) => log.timestamp > clearTimestamp.value!) : logs;
|
|
202
227
|
if (
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
:key="`${index}-${log}`"
|
|
13
13
|
class="log-item"
|
|
14
14
|
style="font-size: 10px; width: calc(100vw - 16px); word-break: break-all"
|
|
15
|
+
@longpress="handleLongPress(log)"
|
|
15
16
|
>
|
|
16
17
|
{{ log }}
|
|
17
18
|
</view>
|
|
@@ -75,6 +76,15 @@
|
|
|
75
76
|
keyword.value = '';
|
|
76
77
|
};
|
|
77
78
|
|
|
79
|
+
const handleLongPress = (log: string) => {
|
|
80
|
+
uni.setClipboardData({
|
|
81
|
+
data: log,
|
|
82
|
+
success: () => {
|
|
83
|
+
uni.showToast({ title: '已复制', icon: 'success' });
|
|
84
|
+
},
|
|
85
|
+
});
|
|
86
|
+
};
|
|
87
|
+
|
|
78
88
|
const stop = consoleSubject.subscribe((data: any) => {
|
|
79
89
|
if (data.length < clearedLogCount.value) {
|
|
80
90
|
clearedLogCount.value = 0;
|
|
@@ -145,6 +155,10 @@
|
|
|
145
155
|
background-color: #eee;
|
|
146
156
|
}
|
|
147
157
|
|
|
158
|
+
.log-item:active {
|
|
159
|
+
background-color: #d0e8ff;
|
|
160
|
+
}
|
|
161
|
+
|
|
148
162
|
.empty-state {
|
|
149
163
|
padding: 16px 0;
|
|
150
164
|
font-size: 12px;
|
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
<uni-collapse>
|
|
3
3
|
<uni-collapse-item v-for="log in nativeEventLogs" :title="getTitle(log)" :key="log.key">
|
|
4
4
|
<view style="font-size: 10px">
|
|
5
|
+
<view style="text-align: right; margin-bottom: 8px; padding: 0 15px">
|
|
6
|
+
<text style="color: #007aff; font-size: 12px" @click="handleCopy(log)">复制</text>
|
|
7
|
+
</view>
|
|
5
8
|
<view style="word-break: break-all; padding: 0 15px">
|
|
6
9
|
<text :selectable="true" style="font-weight: bolder">发送数据:</text>
|
|
7
10
|
<awesome-display-info :log="log.params" />
|
|
@@ -50,6 +53,26 @@
|
|
|
50
53
|
onBeforeUnmount(() => {
|
|
51
54
|
stop?.unsubscribe();
|
|
52
55
|
});
|
|
56
|
+
|
|
57
|
+
const handleCopy = (log: NativeEventLog) => {
|
|
58
|
+
const text = JSON.stringify(
|
|
59
|
+
{
|
|
60
|
+
key: log.key,
|
|
61
|
+
params: log.params,
|
|
62
|
+
response: log.response,
|
|
63
|
+
startTime: log.startTime,
|
|
64
|
+
endTime: log.endTime,
|
|
65
|
+
},
|
|
66
|
+
null,
|
|
67
|
+
2,
|
|
68
|
+
);
|
|
69
|
+
uni.setClipboardData({
|
|
70
|
+
data: text,
|
|
71
|
+
success: () => {
|
|
72
|
+
uni.showToast({ title: '已复制', icon: 'success' });
|
|
73
|
+
},
|
|
74
|
+
});
|
|
75
|
+
};
|
|
53
76
|
</script>
|
|
54
77
|
|
|
55
78
|
<style lang="scss" scoped>
|
|
@@ -18,6 +18,9 @@
|
|
|
18
18
|
}"
|
|
19
19
|
>
|
|
20
20
|
<view style="font-size: 10px; padding: 10px 15px">
|
|
21
|
+
<view style="text-align: right; margin-bottom: 8px">
|
|
22
|
+
<text style="color: #007aff; font-size: 12px" @click="handleCopy(meta)">复制</text>
|
|
23
|
+
</view>
|
|
21
24
|
<view style="word-break: break-all; padding: 8px 0; margin-bottom: 10px">
|
|
22
25
|
<text :selectable="true" style="font-weight: bolder">状态码:</text>
|
|
23
26
|
{{ meta.method }} {{ meta.statusCode ?? '-' }}
|
|
@@ -200,6 +203,28 @@
|
|
|
200
203
|
keyword.value = '';
|
|
201
204
|
};
|
|
202
205
|
|
|
206
|
+
const handleCopy = (meta: NetworkLogMeta) => {
|
|
207
|
+
const detail = getNetworkLogDetail(meta.id);
|
|
208
|
+
const text = JSON.stringify(
|
|
209
|
+
{
|
|
210
|
+
url: detail?.request?.url,
|
|
211
|
+
method: meta.method,
|
|
212
|
+
statusCode: meta.statusCode,
|
|
213
|
+
requestHeader: detail?.request?.header,
|
|
214
|
+
requestData: detail?.request?.data,
|
|
215
|
+
response: detail?.response,
|
|
216
|
+
},
|
|
217
|
+
null,
|
|
218
|
+
2,
|
|
219
|
+
);
|
|
220
|
+
uni.setClipboardData({
|
|
221
|
+
data: text,
|
|
222
|
+
success: () => {
|
|
223
|
+
uni.showToast({ title: '已复制', icon: 'success' });
|
|
224
|
+
},
|
|
225
|
+
});
|
|
226
|
+
};
|
|
227
|
+
|
|
203
228
|
const upsertLogs = (logs: any[]): void => {
|
|
204
229
|
// 过滤出非 websocket 的日志
|
|
205
230
|
const httpLogs = logs.filter(isHttpLog);
|
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
<uni-collapse>
|
|
3
3
|
<uni-collapse-item v-for="log in storageLogs" :title="log.key" :key="log.key">
|
|
4
4
|
<view style="padding: 5px 15px">
|
|
5
|
+
<view style="text-align: right; margin-bottom: 8px">
|
|
6
|
+
<text style="color: #007aff; font-size: 12px" @click="handleCopy(log)">复制</text>
|
|
7
|
+
</view>
|
|
5
8
|
<awesome-display-info :log="log.data" />
|
|
6
9
|
</view>
|
|
7
10
|
</uni-collapse-item>
|
|
@@ -28,6 +31,23 @@
|
|
|
28
31
|
isComponentMounted = false;
|
|
29
32
|
});
|
|
30
33
|
|
|
34
|
+
const handleCopy = (log: StorageItem) => {
|
|
35
|
+
const text = JSON.stringify(
|
|
36
|
+
{
|
|
37
|
+
key: log.key,
|
|
38
|
+
data: log.data,
|
|
39
|
+
},
|
|
40
|
+
null,
|
|
41
|
+
2,
|
|
42
|
+
);
|
|
43
|
+
uni.setClipboardData({
|
|
44
|
+
data: text,
|
|
45
|
+
success: () => {
|
|
46
|
+
uni.showToast({ title: '已复制', icon: 'success' });
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
};
|
|
50
|
+
|
|
31
51
|
uni.getStorageInfo({
|
|
32
52
|
success: function (res) {
|
|
33
53
|
// 如果组件已卸载,直接返回,防止内存泄漏
|
|
@@ -18,6 +18,9 @@
|
|
|
18
18
|
}"
|
|
19
19
|
>
|
|
20
20
|
<view style="font-size: 10px; padding: 10px 15px">
|
|
21
|
+
<view style="text-align: right; margin-bottom: 8px">
|
|
22
|
+
<text style="color: #007aff; font-size: 12px" @click="handleCopy(meta)">复制</text>
|
|
23
|
+
</view>
|
|
21
24
|
<view style="word-break: break-all; padding: 8px 0; margin-bottom: 10px">
|
|
22
25
|
<text :selectable="true" style="font-weight: bolder">URL:</text>
|
|
23
26
|
{{ meta.url }}
|
|
@@ -239,6 +242,31 @@
|
|
|
239
242
|
keyword.value = '';
|
|
240
243
|
};
|
|
241
244
|
|
|
245
|
+
const handleCopy = (meta: WebsocketLogMeta) => {
|
|
246
|
+
const detail = getWebsocketLogDetail(meta.id);
|
|
247
|
+
const text = JSON.stringify(
|
|
248
|
+
{
|
|
249
|
+
url: meta.url,
|
|
250
|
+
status: meta.status,
|
|
251
|
+
messageTotal: meta.messageTotal,
|
|
252
|
+
sendCount: meta.sendCount,
|
|
253
|
+
receiveCount: meta.receiveCount,
|
|
254
|
+
protocols: meta.protocols,
|
|
255
|
+
header: detail?.request?.header,
|
|
256
|
+
errorInfo: detail?.errorInfo,
|
|
257
|
+
messages: detail?.messages,
|
|
258
|
+
},
|
|
259
|
+
null,
|
|
260
|
+
2,
|
|
261
|
+
);
|
|
262
|
+
uni.setClipboardData({
|
|
263
|
+
data: text,
|
|
264
|
+
success: () => {
|
|
265
|
+
uni.showToast({ title: '已复制', icon: 'success' });
|
|
266
|
+
},
|
|
267
|
+
});
|
|
268
|
+
};
|
|
269
|
+
|
|
242
270
|
const buildVisibleWebsocketLog = (log: WebsocketLog): WebsocketLog | null => {
|
|
243
271
|
if (!clearTimestamp.value) return log;
|
|
244
272
|
|