vite-uni-dev-tool 0.0.12 → 0.0.14
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/dist/const.d.ts +133 -0
- package/dist/const.d.ts.map +1 -0
- package/dist/const.js +36 -0
- package/dist/core.d.ts +52 -0
- package/dist/core.d.ts.map +1 -0
- package/dist/core.js +80 -0
- package/dist/devConsole/index.d.ts +169 -0
- package/dist/devConsole/index.d.ts.map +1 -0
- package/dist/devConsole/index.js +270 -0
- package/dist/devEvent/index.d.ts +286 -0
- package/dist/devEvent/index.d.ts.map +1 -0
- package/dist/devEvent/index.js +435 -0
- package/dist/devEventBus/index.d.ts +42 -0
- package/dist/devEventBus/index.d.ts.map +1 -0
- package/dist/devEventBus/index.js +70 -0
- package/dist/devIntercept/index.d.ts +119 -0
- package/dist/devIntercept/index.d.ts.map +1 -0
- package/dist/devIntercept/index.js +582 -0
- package/dist/devRunJS/index.d.ts +67 -0
- package/dist/devRunJS/index.d.ts.map +1 -0
- package/dist/devStore/index.d.ts +178 -0
- package/dist/devStore/index.d.ts.map +1 -0
- package/dist/devStore/index.js +395 -0
- package/dist/devToolInfo/index.d.ts +17 -0
- package/dist/devToolInfo/index.d.ts.map +1 -0
- package/dist/devToolInfo/index.js +15 -0
- package/{dev → dist}/plugins/uniDevTool/uniDevTool.d.ts +7 -1
- package/dist/plugins/uniDevTool/uniDevTool.d.ts.map +1 -0
- package/dist/plugins/uniDevTool/uniDevTool.js +35 -0
- package/{dev → dist}/plugins/utils/index.d.ts +3 -0
- package/{dev → dist}/plugins/utils/index.d.ts.map +1 -1
- package/dist/plugins/utils/index.js +1 -0
- package/dist/type.d.ts +264 -0
- package/dist/type.d.ts.map +1 -0
- package/dist/utils/array.d.ts +2 -0
- package/dist/utils/array.d.ts.map +1 -0
- package/dist/utils/array.js +12 -0
- package/dist/utils/date.d.ts +19 -0
- package/dist/utils/date.d.ts.map +1 -0
- package/dist/utils/date.js +40 -0
- package/dist/utils/file.d.ts +11 -0
- package/dist/utils/file.d.ts.map +1 -0
- package/dist/utils/file.js +87 -0
- package/dist/utils/function.d.ts +28 -0
- package/dist/utils/function.d.ts.map +1 -0
- package/dist/utils/function.js +46 -0
- package/dist/utils/index.d.ts +11 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +55 -0
- package/dist/utils/ip.d.ts +5 -0
- package/dist/utils/ip.d.ts.map +1 -0
- package/dist/utils/ip.js +21 -0
- package/dist/utils/language.d.ts +29 -0
- package/dist/utils/language.d.ts.map +1 -0
- package/dist/utils/language.js +50 -0
- package/dist/utils/object.d.ts +49 -0
- package/dist/utils/object.d.ts.map +1 -0
- package/dist/utils/object.js +118 -0
- package/dist/utils/page.d.ts +7 -0
- package/dist/utils/page.d.ts.map +1 -0
- package/dist/utils/page.js +7 -0
- package/dist/utils/platform.d.ts +4 -0
- package/dist/utils/platform.d.ts.map +1 -0
- package/dist/utils/platform.js +14 -0
- package/dist/utils/string.d.ts +45 -0
- package/dist/utils/string.d.ts.map +1 -0
- package/dist/utils/string.js +88 -0
- package/dist/utils/utils.d.ts +16 -0
- package/dist/utils/utils.d.ts.map +1 -0
- package/dist/v2/AppInfo/index.vue +41 -0
- package/dist/v2/AutoSizer/index.vue +189 -0
- package/dist/v2/AutoSizer/index1.vue +193 -0
- package/dist/v2/AutoSizer/utils.d.ts +5 -0
- package/dist/v2/AutoSizer/utils.d.ts.map +1 -0
- package/dist/v2/CaptureScreen/index.vue +78 -0
- package/dist/v2/CloseButton/index.vue +32 -0
- package/dist/v2/Connection/index.vue +94 -0
- package/dist/v2/ConsoleList/ConsoleItem.vue +235 -0
- package/dist/v2/ConsoleList/RunJSInput.vue +243 -0
- package/dist/v2/ConsoleList/index.vue +164 -0
- package/dist/v2/ConsoleList/staticTips.js +1144 -0
- package/dist/v2/DevTool/index.vue +162 -0
- package/dist/v2/DevToolButton/index.vue +228 -0
- package/dist/v2/DevToolTitle/index.vue +28 -0
- package/dist/v2/DevToolWindow/index.vue +1051 -0
- package/dist/v2/DeviceInfo/index.vue +48 -0
- package/dist/v2/Empty/index.vue +40 -0
- package/dist/v2/FilterInput/index.vue +100 -0
- package/dist/v2/JsonPretty/components/Brackets/index.vue +30 -0
- package/dist/v2/JsonPretty/components/Carets/index.vue +65 -0
- package/dist/v2/JsonPretty/components/CheckController/index.vue +127 -0
- package/dist/v2/JsonPretty/components/TreeNode/index.vue +417 -0
- package/dist/v2/JsonPretty/hooks/useClipboard.d.ts +4 -0
- package/dist/v2/JsonPretty/hooks/useClipboard.d.ts.map +1 -0
- package/dist/v2/JsonPretty/hooks/useError.d.ts +8 -0
- package/dist/v2/JsonPretty/hooks/useError.d.ts.map +1 -0
- package/dist/v2/JsonPretty/index.vue +531 -0
- package/dist/v2/JsonPretty/type.d.ts +93 -0
- package/dist/v2/JsonPretty/type.d.ts.map +1 -0
- package/dist/v2/JsonPretty/utils/index.js +211 -0
- package/dist/v2/NetworkList/NetworkDetail.vue +215 -0
- package/dist/v2/NetworkList/NetworkItem.vue +135 -0
- package/dist/v2/NetworkList/index.vue +148 -0
- package/dist/v2/PiniaList/index.vue +79 -0
- package/dist/v2/RouteList/index.vue +137 -0
- package/dist/v2/SettingList/index.vue +318 -0
- package/dist/v2/SourceCode/index.vue +237 -0
- package/dist/v2/StorageList/index.vue +165 -0
- package/dist/v2/SystemInfo/index.vue +49 -0
- package/dist/v2/Tabs/index.vue +127 -0
- package/dist/v2/Tag/index.vue +91 -0
- package/dist/v2/UniEvent/UniEventItem.vue +157 -0
- package/dist/v2/UniEvent/index.vue +127 -0
- package/dist/v2/UploadList/UploadDetail.vue +204 -0
- package/dist/v2/UploadList/UploadItem.vue +134 -0
- package/dist/v2/UploadList/index.vue +143 -0
- package/dist/v2/VirtualList/index.vue +140 -0
- package/dist/v2/VirtualListPro/AutoSize.vue +50 -0
- package/dist/v2/VirtualListPro/index.vue +255 -0
- package/dist/v2/VuexList/index.vue +80 -0
- package/dist/v2/WebSocket/WebSocketItem.vue +129 -0
- package/dist/v2/WebSocket/WebSocketList.vue +183 -0
- package/dist/v2/WebSocket/index.vue +155 -0
- package/dist/v2/WindowInfo/index.vue +49 -0
- package/{dev/components → dist/v3}/AppInfo/index.vue +0 -1
- package/dist/v3/AutoSizer/utils.d.ts +5 -0
- package/dist/v3/AutoSizer/utils.d.ts.map +1 -0
- package/dist/v3/AutoSizer/utils.ts +49 -0
- package/{dev/components → dist/v3}/CloseButton/index.vue +5 -2
- package/{dev/components → dist/v3}/ConsoleList/ConsoleItem.vue +10 -9
- package/{dev/components → dist/v3}/ConsoleList/RunJSInput.vue +5 -2
- package/dist/v3/ConsoleList/staticTips.d.ts +13 -0
- package/dist/v3/ConsoleList/staticTips.d.ts.map +1 -0
- package/{dev/components → dist/v3}/DevTool/index.vue +33 -4
- package/{dev/components → dist/v3}/DevToolWindow/index.vue +67 -4
- package/dist/v3/Empty/empty.png +0 -0
- package/{dev/components → dist/v3}/FilterInput/index.vue +5 -4
- package/dist/v3/JsonPretty/hooks/useClipboard.d.ts +4 -0
- package/dist/v3/JsonPretty/hooks/useClipboard.d.ts.map +1 -0
- package/dist/v3/JsonPretty/hooks/useClipboard.ts +21 -0
- package/dist/v3/JsonPretty/hooks/useError.d.ts +8 -0
- package/dist/v3/JsonPretty/hooks/useError.d.ts.map +1 -0
- package/dist/v3/JsonPretty/hooks/useError.ts +21 -0
- package/{dev/components → dist/v3}/JsonPretty/index.vue +10 -10
- package/dist/v3/JsonPretty/type.d.ts +93 -0
- package/dist/v3/JsonPretty/type.d.ts.map +1 -0
- package/dist/v3/JsonPretty/type.ts +125 -0
- package/dist/v3/JsonPretty/utils/index.d.ts +10 -0
- package/dist/v3/JsonPretty/utils/index.d.ts.map +1 -0
- package/{dev/components → dist/v3}/NetworkList/NetworkDetail.vue +2 -2
- package/{dev/components → dist/v3}/NetworkList/NetworkItem.vue +2 -1
- package/dist/v3/RunJS/index.vue +128 -0
- package/{dev/components → dist/v3}/SettingList/index.vue +128 -37
- package/{dev/components → dist/v3}/SourceCode/index.vue +2 -2
- package/{dev/components → dist/v3}/Tag/index.vue +4 -4
- package/{dev/components → dist/v3}/UploadList/UploadDetail.vue +3 -15
- package/{dev/components → dist/v3}/UploadList/UploadItem.vue +1 -1
- package/dist/v3/VirtualListPro/readme.md +40 -0
- package/{dev/components → dist/v3}/WebSocket/WebSocketItem.vue +1 -1
- package/{dev/components → dist/v3}/WebSocket/WebSocketList.vue +3 -15
- package/package.json +5 -5
- package/dev/components/Button/index.vue +0 -34
- package/dev/components/Checkbox/index.vue +0 -40
- package/dev/components/Code/index.vue +0 -230
- package/dev/components/ConsoleList/Code.vue +0 -227
- package/dev/const.ts +0 -164
- package/dev/core.ts +0 -118
- package/dev/devConsole/index.ts +0 -350
- package/dev/devEvent/index.ts +0 -810
- package/dev/devEventBus/index.ts +0 -94
- package/dev/devIntercept/index.ts +0 -745
- package/dev/devRunJS/index.ts +0 -170
- package/dev/devStore/index.ts +0 -732
- package/dev/devToolInfo/index.ts +0 -26
- package/dev/plugins/uniDevTool/uniDevTool.d.ts.map +0 -1
- package/dev/plugins/uniDevTool/uniDevTool.js +0 -36
- package/dev/plugins/utils/index.js +0 -1
- package/dev/shims-uni.d.ts +0 -43
- package/dev/type.ts +0 -291
- package/dev/utils/array.ts +0 -15
- package/dev/utils/date.ts +0 -75
- package/dev/utils/file.ts +0 -121
- package/dev/utils/function.ts +0 -192
- package/dev/utils/index.d.ts +0 -6
- package/dev/utils/index.ts +0 -51
- package/dev/utils/ip.ts +0 -79
- package/dev/utils/language.ts +0 -77
- package/dev/utils/object.ts +0 -306
- package/dev/utils/page.ts +0 -13
- package/dev/utils/platform.ts +0 -14
- package/dev/utils/string.ts +0 -133
- package/dev/utils/utils.ts +0 -198
- /package/{dev → dist}/index.d.ts +0 -0
- /package/{dev → dist}/index.d.ts.map +0 -0
- /package/{dev → dist}/index.js +0 -0
- /package/{dev → dist}/plugins/uniGlobalComponents/uniGlobalComponents.d.ts +0 -0
- /package/{dev → dist}/plugins/uniGlobalComponents/uniGlobalComponents.d.ts.map +0 -0
- /package/{dev → dist}/plugins/uniGlobalComponents/uniGlobalComponents.js +0 -0
- /package/{dev/components → dist/v2}/AutoSizer/utils.ts +0 -0
- /package/{dev/components → dist/v2}/Empty/empty.png +0 -0
- /package/{dev/components → dist/v2}/JsonPretty/hooks/useClipboard.ts +0 -0
- /package/{dev/components → dist/v2}/JsonPretty/hooks/useError.ts +0 -0
- /package/{dev/components → dist/v2}/JsonPretty/type.ts +0 -0
- /package/{dev/components → dist/v2}/RunJS/index.vue +0 -0
- /package/{dev/components → dist/v2}/VirtualListPro/readme.md +0 -0
- /package/{dev/components → dist/v3}/AutoSizer/index.vue +0 -0
- /package/{dev/components → dist/v3}/AutoSizer/index1.vue +0 -0
- /package/{dev/components → dist/v3}/CaptureScreen/index.vue +0 -0
- /package/{dev/components → dist/v3}/Connection/index.vue +0 -0
- /package/{dev/components → dist/v3}/ConsoleList/index.vue +0 -0
- /package/{dev/components → dist/v3}/ConsoleList/staticTips.ts +0 -0
- /package/{dev/components → dist/v3}/DevToolButton/index.vue +0 -0
- /package/{dev/components → dist/v3}/DevToolTitle/index.vue +0 -0
- /package/{dev/components → dist/v3}/DeviceInfo/index.vue +0 -0
- /package/{dev/components → dist/v3}/Empty/index.vue +0 -0
- /package/{dev/components → dist/v3}/JsonPretty/components/Brackets/index.vue +0 -0
- /package/{dev/components → dist/v3}/JsonPretty/components/Carets/index.vue +0 -0
- /package/{dev/components → dist/v3}/JsonPretty/components/CheckController/index.vue +0 -0
- /package/{dev/components → dist/v3}/JsonPretty/components/TreeNode/index.vue +0 -0
- /package/{dev/components → dist/v3}/JsonPretty/utils/index.ts +0 -0
- /package/{dev/components → dist/v3}/NetworkList/index.vue +0 -0
- /package/{dev/components → dist/v3}/PiniaList/index.vue +0 -0
- /package/{dev/components → dist/v3}/RouteList/index.vue +0 -0
- /package/{dev/components → dist/v3}/StorageList/index.vue +0 -0
- /package/{dev/components → dist/v3}/SystemInfo/index.vue +0 -0
- /package/{dev/components → dist/v3}/Tabs/index.vue +0 -0
- /package/{dev/components → dist/v3}/UniEvent/UniEventItem.vue +0 -0
- /package/{dev/components → dist/v3}/UniEvent/index.vue +0 -0
- /package/{dev/components → dist/v3}/UploadList/index.vue +0 -0
- /package/{dev/components → dist/v3}/VirtualList/index.vue +0 -0
- /package/{dev/components → dist/v3}/VirtualListPro/AutoSize.vue +0 -0
- /package/{dev/components → dist/v3}/VirtualListPro/index.vue +0 -0
- /package/{dev/components → dist/v3}/VuexList/index.vue +0 -0
- /package/{dev/components → dist/v3}/WebSocket/index.vue +0 -0
- /package/{dev/components → dist/v3}/WindowInfo/index.vue +0 -0
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view class="websocket-item">
|
|
3
|
+
<view class="websocket-url-row">
|
|
4
|
+
<Tag mode="info" v-if="ws.readyState === 'connection'">con</Tag>
|
|
5
|
+
<Tag mode="success" v-if="ws.readyState === 'open'">open</Tag>
|
|
6
|
+
<Tag
|
|
7
|
+
mode="warn"
|
|
8
|
+
v-if="ws.readyState === 'closing' || ws.readyState === 'closed'"
|
|
9
|
+
>
|
|
10
|
+
close
|
|
11
|
+
</Tag>
|
|
12
|
+
|
|
13
|
+
<Tag mode="error" v-if="ws.readyState === 'error'">error</Tag>
|
|
14
|
+
|
|
15
|
+
<view class="websocket-url" v-html="ws.url" />
|
|
16
|
+
|
|
17
|
+
<Tag
|
|
18
|
+
mode="main"
|
|
19
|
+
class="websocket-detail-icon"
|
|
20
|
+
@click="showDetail = !showDetail"
|
|
21
|
+
>
|
|
22
|
+
详情
|
|
23
|
+
</Tag>
|
|
24
|
+
</view>
|
|
25
|
+
<view class="websocket-info">
|
|
26
|
+
<view class="websocket-info-last">
|
|
27
|
+
{{ ws?.message?.[ws.message.length - 1]?.data }}
|
|
28
|
+
</view>
|
|
29
|
+
|
|
30
|
+
<view>{{
|
|
31
|
+
ws?.message?.[ws.message.length - 1].time
|
|
32
|
+
? formatDate(ws?.message?.[ws.message.length - 1].time, 'HH:mm:ss')
|
|
33
|
+
: '-'
|
|
34
|
+
}}</view>
|
|
35
|
+
</view>
|
|
36
|
+
|
|
37
|
+
<WebSocketList
|
|
38
|
+
v-if="showDetail"
|
|
39
|
+
:ws="ws"
|
|
40
|
+
:zIndex="zIndex"
|
|
41
|
+
@close="onClose"
|
|
42
|
+
/>
|
|
43
|
+
</view>
|
|
44
|
+
</template>
|
|
45
|
+
|
|
46
|
+
<script>
|
|
47
|
+
import Tag from '../Tag/index.vue';
|
|
48
|
+
import WebSocketList from './WebSocketList.vue';
|
|
49
|
+
import { formatDate } from '../../utils';
|
|
50
|
+
|
|
51
|
+
export default {
|
|
52
|
+
components: {
|
|
53
|
+
Tag,
|
|
54
|
+
WebSocketList,
|
|
55
|
+
},
|
|
56
|
+
props: {
|
|
57
|
+
ws: {
|
|
58
|
+
type: Object,
|
|
59
|
+
required: true,
|
|
60
|
+
validator: (value) => {
|
|
61
|
+
// 验证必要字段存在
|
|
62
|
+
return ['readyState', 'url', 'message'].every((key) => key in value);
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
zIndex: {
|
|
66
|
+
type: Number,
|
|
67
|
+
default: 1000,
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
data() {
|
|
71
|
+
return {
|
|
72
|
+
showDetail: false, // 控制详情显示/隐藏
|
|
73
|
+
};
|
|
74
|
+
},
|
|
75
|
+
methods: {
|
|
76
|
+
// 关闭详情
|
|
77
|
+
onClose() {
|
|
78
|
+
this.showDetail = false;
|
|
79
|
+
},
|
|
80
|
+
// 引入日期格式化工具函数
|
|
81
|
+
formatDate,
|
|
82
|
+
},
|
|
83
|
+
};
|
|
84
|
+
</script>
|
|
85
|
+
|
|
86
|
+
<style scoped>
|
|
87
|
+
.websocket-item {
|
|
88
|
+
padding: 16px;
|
|
89
|
+
|
|
90
|
+
box-sizing: border-box;
|
|
91
|
+
border-bottom: 1px solid var(--dev-tool-border-color);
|
|
92
|
+
font-size: var(--dev-tool-base-font-size);
|
|
93
|
+
}
|
|
94
|
+
.websocket-item .websocket-url-row {
|
|
95
|
+
display: flex;
|
|
96
|
+
align-items: center;
|
|
97
|
+
word-break: break-all;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.websocket-item .websocket-url-row .websocket-url {
|
|
101
|
+
margin-left: 4px;
|
|
102
|
+
flex: 1;
|
|
103
|
+
white-space: nowrap;
|
|
104
|
+
overflow: hidden;
|
|
105
|
+
text-overflow: ellipsis;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.websocket-item .websocket-url-row .websocket-detail-icon {
|
|
109
|
+
flex-shrink: 0;
|
|
110
|
+
margin-left: auto;
|
|
111
|
+
}
|
|
112
|
+
.websocket-item .websocket-url-row .websocket-detail-active {
|
|
113
|
+
transform: rotate(135deg);
|
|
114
|
+
}
|
|
115
|
+
.websocket-item .websocket-info {
|
|
116
|
+
display: flex;
|
|
117
|
+
align-items: center;
|
|
118
|
+
justify-content: space-between;
|
|
119
|
+
margin-top: 4px;
|
|
120
|
+
color: var(--dev-tool-info-color);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.websocket-item .websocket-info .websocket-info-last {
|
|
124
|
+
white-space: nowrap;
|
|
125
|
+
flex: 1;
|
|
126
|
+
overflow: hidden;
|
|
127
|
+
text-overflow: ellipsis;
|
|
128
|
+
}
|
|
129
|
+
</style>
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view class="web-socket-list-container" :style="{ zIndex: zIndex }">
|
|
3
|
+
<view class="web-socket-top">
|
|
4
|
+
请求url:
|
|
5
|
+
|
|
6
|
+
<CloseButton style="margin-left: auto" @click="onClose" />
|
|
7
|
+
</view>
|
|
8
|
+
<view class="web-socket-url">
|
|
9
|
+
{{ ws.url }}
|
|
10
|
+
</view>
|
|
11
|
+
|
|
12
|
+
<view class="web-socket-data">
|
|
13
|
+
<view class="web-socket-title"
|
|
14
|
+
>请求方式:<Tag mode="info"> {{ ws.method }} </Tag></view
|
|
15
|
+
>
|
|
16
|
+
<view class="web-socket-title">请求头:</view>
|
|
17
|
+
<view
|
|
18
|
+
class="header-detail-item"
|
|
19
|
+
v-for="item in ws.headers"
|
|
20
|
+
:key="item.key"
|
|
21
|
+
>
|
|
22
|
+
<view>{{ item.key }}: </view>
|
|
23
|
+
{{ item.value }}
|
|
24
|
+
</view>
|
|
25
|
+
|
|
26
|
+
<view class="web-socket-title">消息列表:</view>
|
|
27
|
+
<view class="web-socket-data-list">
|
|
28
|
+
<view
|
|
29
|
+
v-for="item in ws.message"
|
|
30
|
+
:key="item.time"
|
|
31
|
+
:class="`web-socket-data-item web-socket-data-item-${item.type}`"
|
|
32
|
+
@click="onClick(item)"
|
|
33
|
+
>
|
|
34
|
+
<view class="web-socket-data-time">
|
|
35
|
+
{{ formatDate(item.time, 'HH:mm:ss') }}
|
|
36
|
+
</view>
|
|
37
|
+
<view class="web-socket-data-content">
|
|
38
|
+
{{ item.data }}
|
|
39
|
+
</view>
|
|
40
|
+
</view>
|
|
41
|
+
</view>
|
|
42
|
+
</view>
|
|
43
|
+
</view>
|
|
44
|
+
</template>
|
|
45
|
+
|
|
46
|
+
<script>
|
|
47
|
+
import Tag from '../Tag/index.vue';
|
|
48
|
+
import CloseButton from '../CloseButton/index.vue';
|
|
49
|
+
import { formatDate } from '../../utils/index';
|
|
50
|
+
|
|
51
|
+
export default {
|
|
52
|
+
components: {
|
|
53
|
+
Tag,
|
|
54
|
+
CloseButton,
|
|
55
|
+
},
|
|
56
|
+
props: {
|
|
57
|
+
/** @type {{url:string; method:string; headers: {key:string; value:string}[]; message: { time:string; data:string }[] }} */
|
|
58
|
+
ws: {
|
|
59
|
+
type: Object,
|
|
60
|
+
required: true,
|
|
61
|
+
validator: (value) => {
|
|
62
|
+
// 验证必要字段存在
|
|
63
|
+
return ['url', 'method', 'headers', 'message'].every(
|
|
64
|
+
(key) => key in value,
|
|
65
|
+
);
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
zIndex: {
|
|
69
|
+
type: Number,
|
|
70
|
+
default: 1001,
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
methods: {
|
|
74
|
+
// 关闭详情面板
|
|
75
|
+
onClose() {
|
|
76
|
+
this.$emit('close');
|
|
77
|
+
},
|
|
78
|
+
// 点击消息项,复制到剪贴板
|
|
79
|
+
onClick(item) {
|
|
80
|
+
uni.setClipboardData({
|
|
81
|
+
data: JSON.stringify(item),
|
|
82
|
+
success() {
|
|
83
|
+
uni.showToast({
|
|
84
|
+
title: '复制成功',
|
|
85
|
+
icon: 'none',
|
|
86
|
+
});
|
|
87
|
+
},
|
|
88
|
+
fail() {
|
|
89
|
+
uni.showToast({
|
|
90
|
+
title: '复制失败',
|
|
91
|
+
icon: 'none',
|
|
92
|
+
});
|
|
93
|
+
},
|
|
94
|
+
});
|
|
95
|
+
},
|
|
96
|
+
// 引入日期格式化工具函数
|
|
97
|
+
formatDate,
|
|
98
|
+
},
|
|
99
|
+
};
|
|
100
|
+
</script>
|
|
101
|
+
|
|
102
|
+
<style>
|
|
103
|
+
.web-socket-list-container {
|
|
104
|
+
position: fixed;
|
|
105
|
+
width: 100vw;
|
|
106
|
+
height: 100vh;
|
|
107
|
+
z-index: 1001;
|
|
108
|
+
top: 0;
|
|
109
|
+
left: 0;
|
|
110
|
+
padding: 0 16px;
|
|
111
|
+
|
|
112
|
+
background-color: var(--dev-tool-bg2-color);
|
|
113
|
+
box-sizing: border-box;
|
|
114
|
+
}
|
|
115
|
+
.web-socket-list-title {
|
|
116
|
+
min-height: 32px;
|
|
117
|
+
display: flex;
|
|
118
|
+
align-items: center;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.web-socket-data {
|
|
122
|
+
height: calc(100% - 32px);
|
|
123
|
+
overflow: auto;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.web-socket-url {
|
|
127
|
+
display: flex;
|
|
128
|
+
align-items: center;
|
|
129
|
+
min-height: 28px;
|
|
130
|
+
|
|
131
|
+
white-space: wrap;
|
|
132
|
+
word-break: break-all;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.web-socket-top {
|
|
136
|
+
display: flex;
|
|
137
|
+
align-items: center;
|
|
138
|
+
height: 32px;
|
|
139
|
+
|
|
140
|
+
border-bottom: 1px solid transparent;
|
|
141
|
+
box-sizing: border-box;
|
|
142
|
+
}
|
|
143
|
+
.web-socket-title {
|
|
144
|
+
display: flex;
|
|
145
|
+
align-items: center;
|
|
146
|
+
}
|
|
147
|
+
.header-detail-item {
|
|
148
|
+
display: flex;
|
|
149
|
+
align-items: center;
|
|
150
|
+
min-height: 28px;
|
|
151
|
+
word-break: break-all;
|
|
152
|
+
}
|
|
153
|
+
.header-detail-item > view:first-child {
|
|
154
|
+
white-space: nowrap;
|
|
155
|
+
margin-right: 8px;
|
|
156
|
+
color: var(--dev-tool-info-color);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.web-socket-data-item {
|
|
160
|
+
display: flex;
|
|
161
|
+
align-items: center;
|
|
162
|
+
min-height: 28px;
|
|
163
|
+
}
|
|
164
|
+
.web-socket-data-item-error {
|
|
165
|
+
background-color: var(--dev-tool-error-bg-color);
|
|
166
|
+
}
|
|
167
|
+
.web-socket-data-item-success {
|
|
168
|
+
background-color: var(--dev-tool-success-bg-color);
|
|
169
|
+
}
|
|
170
|
+
.web-socket-data-time {
|
|
171
|
+
/* margin-right: 16px; */
|
|
172
|
+
padding: 0 6px;
|
|
173
|
+
flex-shrink: 0;
|
|
174
|
+
color: var(--dev-tool-info-color);
|
|
175
|
+
}
|
|
176
|
+
.web-socket-data-content {
|
|
177
|
+
padding: 6px;
|
|
178
|
+
flex: 1;
|
|
179
|
+
overflow: hidden;
|
|
180
|
+
text-overflow: ellipsis;
|
|
181
|
+
word-break: break-all;
|
|
182
|
+
}
|
|
183
|
+
</style>
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view class="websocket-content">
|
|
3
|
+
<view class="websocket-control">
|
|
4
|
+
<FilterInput
|
|
5
|
+
:modelValue="modelValue"
|
|
6
|
+
placeholder="查询url"
|
|
7
|
+
@search="handleSearch"
|
|
8
|
+
@update:modelValue="handleUpdateModelValue"
|
|
9
|
+
/>
|
|
10
|
+
<Tag
|
|
11
|
+
v-for="item in webSocketFilter"
|
|
12
|
+
:mode="item.mode"
|
|
13
|
+
:key="item.value"
|
|
14
|
+
:active="item.value === currentWebSocketType"
|
|
15
|
+
@click="onChoose(item.value)"
|
|
16
|
+
>
|
|
17
|
+
{{ item.label }}
|
|
18
|
+
</Tag>
|
|
19
|
+
</view>
|
|
20
|
+
|
|
21
|
+
<VirtualListPro
|
|
22
|
+
:dataSource="wsList"
|
|
23
|
+
:pageSize="15"
|
|
24
|
+
:height="height"
|
|
25
|
+
className="websocket-list"
|
|
26
|
+
>
|
|
27
|
+
<template v-slot="{ list, start }">
|
|
28
|
+
<AutoSize
|
|
29
|
+
v-for="(item, index) in list"
|
|
30
|
+
:index="start + index"
|
|
31
|
+
:key="start + index"
|
|
32
|
+
>
|
|
33
|
+
<WebSocketItem :ws="item" :zIndex="zIndex" />
|
|
34
|
+
</AutoSize>
|
|
35
|
+
<Empty v-if="!wsList || wsList.length === 0" />
|
|
36
|
+
</template>
|
|
37
|
+
</VirtualListPro>
|
|
38
|
+
</view>
|
|
39
|
+
</template>
|
|
40
|
+
|
|
41
|
+
<script>
|
|
42
|
+
import WebSocketItem from './WebSocketItem.vue';
|
|
43
|
+
import Tag from '../Tag/index.vue';
|
|
44
|
+
import Empty from '../Empty/index.vue';
|
|
45
|
+
import FilterInput from '../FilterInput/index.vue';
|
|
46
|
+
import VirtualListPro from '../VirtualListPro/index.vue';
|
|
47
|
+
import AutoSize from '../VirtualListPro/AutoSize.vue';
|
|
48
|
+
|
|
49
|
+
export default {
|
|
50
|
+
components: {
|
|
51
|
+
WebSocketItem,
|
|
52
|
+
Tag,
|
|
53
|
+
Empty,
|
|
54
|
+
FilterInput,
|
|
55
|
+
VirtualListPro,
|
|
56
|
+
AutoSize,
|
|
57
|
+
},
|
|
58
|
+
props: {
|
|
59
|
+
wsList: {
|
|
60
|
+
type: Array,
|
|
61
|
+
default: () => [],
|
|
62
|
+
},
|
|
63
|
+
currentWebSocketType: {
|
|
64
|
+
type: String,
|
|
65
|
+
required: true,
|
|
66
|
+
},
|
|
67
|
+
modelValue: {
|
|
68
|
+
type: String,
|
|
69
|
+
default: '',
|
|
70
|
+
},
|
|
71
|
+
zIndex: {
|
|
72
|
+
type: Number,
|
|
73
|
+
default: 1000,
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
data() {
|
|
77
|
+
return {
|
|
78
|
+
height: 0,
|
|
79
|
+
webSocketFilter: [
|
|
80
|
+
{
|
|
81
|
+
label: '全部',
|
|
82
|
+
value: 'all',
|
|
83
|
+
mode: 'all',
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
label: 'con',
|
|
87
|
+
value: 'connection',
|
|
88
|
+
mode: 'info',
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
label: 'open',
|
|
92
|
+
value: 'open',
|
|
93
|
+
mode: 'success',
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
label: 'close',
|
|
97
|
+
value: 'close',
|
|
98
|
+
mode: 'warn',
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
label: 'error',
|
|
102
|
+
value: 'error',
|
|
103
|
+
mode: 'error',
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
label: '清除',
|
|
107
|
+
value: 'clear',
|
|
108
|
+
mode: 'clear',
|
|
109
|
+
},
|
|
110
|
+
],
|
|
111
|
+
};
|
|
112
|
+
},
|
|
113
|
+
mounted() {
|
|
114
|
+
// 计算列表高度(窗口高度减去控制栏高度)
|
|
115
|
+
const { windowHeight } = uni.getWindowInfo();
|
|
116
|
+
this.height = windowHeight - 32 - 32;
|
|
117
|
+
},
|
|
118
|
+
methods: {
|
|
119
|
+
// 选择筛选类型
|
|
120
|
+
onChoose(type) {
|
|
121
|
+
this.$emit('choose', type);
|
|
122
|
+
},
|
|
123
|
+
// 处理搜索事件
|
|
124
|
+
handleSearch(value) {
|
|
125
|
+
this.$emit('search', value);
|
|
126
|
+
},
|
|
127
|
+
// 处理输入框值更新
|
|
128
|
+
handleUpdateModelValue(value) {
|
|
129
|
+
this.$emit('update:modelValue', value);
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
};
|
|
133
|
+
</script>
|
|
134
|
+
|
|
135
|
+
<style scoped>
|
|
136
|
+
.websocket-content {
|
|
137
|
+
height: 100%;
|
|
138
|
+
font-size: var(--dev-tool-base-font-size);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.websocket-control {
|
|
142
|
+
display: flex;
|
|
143
|
+
align-items: center;
|
|
144
|
+
justify-content: space-between;
|
|
145
|
+
gap: 8px;
|
|
146
|
+
padding: 0 16px;
|
|
147
|
+
height: 32px;
|
|
148
|
+
border-bottom: 1px solid var(--dev-tool-border-color);
|
|
149
|
+
box-sizing: border-box;
|
|
150
|
+
}
|
|
151
|
+
.websocket-list {
|
|
152
|
+
height: calc(100% - 32px);
|
|
153
|
+
overflow: auto;
|
|
154
|
+
}
|
|
155
|
+
</style>
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view class="window-info-content">
|
|
3
|
+
<JsonPretty v-if="showJson" :data="windowInfo" />
|
|
4
|
+
<Empty v-else />
|
|
5
|
+
</view>
|
|
6
|
+
</template>
|
|
7
|
+
|
|
8
|
+
<script>
|
|
9
|
+
import JsonPretty from '../JsonPretty/index.vue';
|
|
10
|
+
import Empty from '../Empty/index.vue';
|
|
11
|
+
|
|
12
|
+
export default {
|
|
13
|
+
components: {
|
|
14
|
+
JsonPretty,
|
|
15
|
+
Empty,
|
|
16
|
+
},
|
|
17
|
+
props: {
|
|
18
|
+
windowInfo: {
|
|
19
|
+
type: Object,
|
|
20
|
+
required: true,
|
|
21
|
+
default: () => ({}),
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
computed: {
|
|
25
|
+
// 判断是否显示JSON视图
|
|
26
|
+
showJson() {
|
|
27
|
+
try {
|
|
28
|
+
const str = JSON.stringify(this.windowInfo);
|
|
29
|
+
// 当数据为对象且不为空时显示
|
|
30
|
+
return (
|
|
31
|
+
typeof this.windowInfo === 'object' &&
|
|
32
|
+
this.windowInfo !== null &&
|
|
33
|
+
str !== '{}' &&
|
|
34
|
+
str !== ''
|
|
35
|
+
);
|
|
36
|
+
} catch (error) {
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
</script>
|
|
43
|
+
|
|
44
|
+
<style scoped>
|
|
45
|
+
.window-info-content {
|
|
46
|
+
padding: 16px;
|
|
47
|
+
font-size: var(--dev-tool-base-font-size);
|
|
48
|
+
}
|
|
49
|
+
</style>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ComponentInternalInstance } from 'vue';
|
|
2
|
+
|
|
3
|
+
export declare function getRect(selector: string, context: ComponentInternalInstance | null | any, node?: boolean): Promise<UniApp.NodeInfo>;
|
|
4
|
+
export declare function addUnit(value?: string | number): string;
|
|
5
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../dev/v3/AutoSizer/utils.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,yBAAyB,EAA2B,MAAM,KAAK,CAAC;AAE9E,wBAAgB,OAAO,CACrB,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,yBAAyB,GAAG,IAAI,GAAG,GAAG,EAC/C,IAAI,GAAE,OAAe,4BAmCtB;AAED,wBAAgB,OAAO,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAMvD"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { ComponentInternalInstance, ComponentPublicInstance } from 'vue';
|
|
2
|
+
|
|
3
|
+
export function getRect(
|
|
4
|
+
selector: string,
|
|
5
|
+
context: ComponentInternalInstance | null | any,
|
|
6
|
+
node: boolean = false,
|
|
7
|
+
) {
|
|
8
|
+
// 之前是个对象,现在改成实例,防止旧版会报错
|
|
9
|
+
if (context == null) {
|
|
10
|
+
return Promise.reject('context is null');
|
|
11
|
+
}
|
|
12
|
+
if (context?.context) {
|
|
13
|
+
context = context.context;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
return new Promise<UniNamespace.NodeInfo>((resolve, reject) => {
|
|
17
|
+
const dom = uni.createSelectorQuery().in(context).select(selector);
|
|
18
|
+
const result: any = (rect: UniNamespace.NodeInfo) => {
|
|
19
|
+
if (rect) {
|
|
20
|
+
resolve(rect);
|
|
21
|
+
} else {
|
|
22
|
+
reject('no rect');
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
if (!node) {
|
|
27
|
+
dom.boundingClientRect(result).exec();
|
|
28
|
+
} else {
|
|
29
|
+
dom
|
|
30
|
+
.fields(
|
|
31
|
+
{
|
|
32
|
+
node: true,
|
|
33
|
+
size: true,
|
|
34
|
+
rect: true,
|
|
35
|
+
},
|
|
36
|
+
result,
|
|
37
|
+
)
|
|
38
|
+
.exec();
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export function addUnit(value?: string | number): string {
|
|
44
|
+
if (!value) {
|
|
45
|
+
return '0px';
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return typeof value === 'number' ? `${value}px` : value;
|
|
49
|
+
}
|
|
@@ -19,8 +19,11 @@ function onClick() {
|
|
|
19
19
|
height: 24px;
|
|
20
20
|
margin-left: auto;
|
|
21
21
|
border-radius: 50%;
|
|
22
|
-
border: 1px solid
|
|
22
|
+
border: 1px solid var(--dev-tool-text-color);
|
|
23
23
|
box-sizing: border-box;
|
|
24
|
-
color:
|
|
24
|
+
color: var(--dev-tool-text-color);
|
|
25
|
+
transition:
|
|
26
|
+
border,
|
|
27
|
+
color 0.3s;
|
|
25
28
|
}
|
|
26
29
|
</style>
|
|
@@ -134,7 +134,8 @@ function onCloseCode() {
|
|
|
134
134
|
.console-args {
|
|
135
135
|
display: flex;
|
|
136
136
|
flex-wrap: wrap;
|
|
137
|
-
color: #000;
|
|
137
|
+
/* color: #000; */
|
|
138
|
+
/* color: var(--dev-tool-text-color); */
|
|
138
139
|
}
|
|
139
140
|
.console-arg {
|
|
140
141
|
margin-right: 4px;
|
|
@@ -146,7 +147,7 @@ function onCloseCode() {
|
|
|
146
147
|
align-items: flex-start;
|
|
147
148
|
justify-content: space-between;
|
|
148
149
|
margin-top: 4px;
|
|
149
|
-
color: #616161;
|
|
150
|
+
/* color: #616161; */
|
|
150
151
|
text-align: right;
|
|
151
152
|
}
|
|
152
153
|
|
|
@@ -180,28 +181,28 @@ function onCloseCode() {
|
|
|
180
181
|
background-color: var(--dev-tool-success-color);
|
|
181
182
|
}
|
|
182
183
|
.console-item-info {
|
|
183
|
-
color:
|
|
184
|
+
color: var(--dev-tool-log-color);
|
|
184
185
|
}
|
|
185
186
|
.console-item-log {
|
|
186
187
|
color: #f9f9f9;
|
|
187
188
|
}
|
|
188
189
|
|
|
189
190
|
.console-arg-null {
|
|
190
|
-
color:
|
|
191
|
+
color: var(--dev-tool-nil-color);
|
|
191
192
|
}
|
|
192
193
|
.console-arg-undefined {
|
|
193
|
-
color:
|
|
194
|
+
color: var(--dev-tool-nil-color);
|
|
194
195
|
}
|
|
195
196
|
.console-arg-string {
|
|
196
|
-
color:
|
|
197
|
+
color: var(--dev-tool-string-color);
|
|
197
198
|
}
|
|
198
199
|
.console-arg-number {
|
|
199
|
-
color:
|
|
200
|
+
color: var(--dev-tool-number-color);
|
|
200
201
|
}
|
|
201
202
|
.console-arg-boolean {
|
|
202
|
-
color:
|
|
203
|
+
color: var(--dev-tool-boolean-color);
|
|
203
204
|
}
|
|
204
205
|
.console-arg-symbol {
|
|
205
|
-
color:
|
|
206
|
+
color: var(--dev-tool-symbol-color);
|
|
206
207
|
}
|
|
207
208
|
</style>
|
|
@@ -192,11 +192,12 @@ function findFunction(fn: string) {
|
|
|
192
192
|
margin: 10px 0 10px -4px;
|
|
193
193
|
width: 8px;
|
|
194
194
|
height: 8px;
|
|
195
|
-
border: 1px solid
|
|
195
|
+
border: 1px solid var(--dev-tool-text-color);
|
|
196
196
|
border-bottom-color: transparent;
|
|
197
197
|
border-left-color: transparent;
|
|
198
198
|
overflow: hidden;
|
|
199
199
|
transform: rotate(45deg);
|
|
200
|
+
transition: border 0.3s;
|
|
200
201
|
}
|
|
201
202
|
|
|
202
203
|
.run-js-input {
|
|
@@ -205,13 +206,15 @@ function findFunction(fn: string) {
|
|
|
205
206
|
width: 100%;
|
|
206
207
|
border: 1px solid transparent;
|
|
207
208
|
font-size: var(--dev-tool-base-font-size);
|
|
209
|
+
color: var(--dev-tool-text-color);
|
|
210
|
+
transition: color 0.3s;
|
|
208
211
|
}
|
|
209
212
|
|
|
210
213
|
.run-js-tips {
|
|
211
214
|
position: absolute;
|
|
212
215
|
bottom: 31px;
|
|
213
216
|
left: 0;
|
|
214
|
-
background-color:
|
|
217
|
+
background-color: var(--dev-tool-bg-color);
|
|
215
218
|
width: 100%;
|
|
216
219
|
max-height: 200px;
|
|
217
220
|
padding: 0 16px 0 36px;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type Tip = {
|
|
2
|
+
name: string;
|
|
3
|
+
description: string;
|
|
4
|
+
result: string[];
|
|
5
|
+
};
|
|
6
|
+
export declare const staticTips: Record<string, {
|
|
7
|
+
attr: Tip[];
|
|
8
|
+
fun: Tip[];
|
|
9
|
+
}>;
|
|
10
|
+
export declare const flatStaticTips: Tip[];
|
|
11
|
+
export declare const singleTips: string[];
|
|
12
|
+
export declare const baseSymbols: string[];
|
|
13
|
+
//# sourceMappingURL=staticTips.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"staticTips.d.ts","sourceRoot":"","sources":["../../../dev/v3/ConsoleList/staticTips.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,GAAG,GAAG;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,MAAM,CAC7B,MAAM,EACN;IACE,IAAI,EAAE,GAAG,EAAE,CAAC;IACZ,GAAG,EAAE,GAAG,EAAE,CAAC;CACZ,CA4lCF,CAAC;AAEF,eAAO,MAAM,cAAc,OAEjB,CAAC;AAEX,eAAO,MAAM,UAAU,UAStB,CAAC;AAEF,eAAO,MAAM,WAAW,UAAqD,CAAC"}
|