vite-uni-dev-tool 0.0.21 → 0.0.22
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/README.md +8 -3
- package/dist/const.d.ts +12 -0
- package/dist/const.d.ts.map +1 -1
- package/dist/const.js +23 -20
- package/dist/core.d.ts +3 -3
- package/dist/core.d.ts.map +1 -1
- package/dist/core.js +89 -49
- package/dist/devEvent/index.d.ts +34 -0
- package/dist/devEvent/index.d.ts.map +1 -1
- package/dist/devEvent/index.js +71 -27
- package/dist/devIntercept/index.d.ts.map +1 -1
- package/dist/devIntercept/index.js +171 -145
- package/dist/devStore/index.d.ts +9 -0
- package/dist/devStore/index.d.ts.map +1 -1
- package/dist/devStore/index.js +54 -20
- package/dist/plugins/uniDevTool/uniDevTool.d.ts +1 -1
- package/dist/plugins/uniDevTool/uniDevTool.d.ts.map +1 -1
- package/dist/type.d.ts +18 -1
- package/dist/type.d.ts.map +1 -1
- package/dist/v2/DevTool/index.vue +8 -8
- package/dist/v3/DevTool/index.vue +13 -12
- package/dist/v3/DevToolWindow/const.d.ts +30 -0
- package/dist/v3/DevToolWindow/const.d.ts.map +1 -0
- package/dist/v3/DevToolWindow/const.ts +123 -0
- package/dist/v3/DevToolWindow/index.vue +166 -107
- package/dist/v3/NetworkList/InterceptConfig.vue +835 -0
- package/dist/v3/NetworkList/InterceptItem.vue +132 -0
- package/dist/v3/NetworkList/NetworkDetail.vue +23 -12
- package/dist/v3/NetworkList/NetworkIntercept.vue +85 -0
- package/dist/v3/NetworkList/NetworkItem.vue +18 -18
- package/dist/v3/NetworkList/NetworkSend.vue +61 -45
- package/dist/v3/NetworkList/index.vue +11 -67
- package/dist/v3/SettingList/index.vue +23 -2
- package/dist/v3/SourceCode/index.vue +0 -1
- package/dist/v3/Tag/index.vue +1 -0
- package/package.json +1 -1
|
@@ -19,7 +19,8 @@
|
|
|
19
19
|
{{ sortMap?.[currentNetworkSort] ?? '一' }}
|
|
20
20
|
</Tag>
|
|
21
21
|
|
|
22
|
-
<Tag mode="
|
|
22
|
+
<Tag mode="error" @click="emit('openIntercept')"> 拦截 </Tag>
|
|
23
|
+
<Tag mode="primary" @click="emit('openSend')"> 发起 </Tag>
|
|
23
24
|
<Tag mode="clear" @click="onChoose('clear')"> 清除 </Tag>
|
|
24
25
|
</view>
|
|
25
26
|
|
|
@@ -28,6 +29,7 @@
|
|
|
28
29
|
:pageSize="15"
|
|
29
30
|
:height="height"
|
|
30
31
|
className="network-list"
|
|
32
|
+
v-if="networkList.length > 0"
|
|
31
33
|
>
|
|
32
34
|
<template v-slot="{ list, start }">
|
|
33
35
|
<AutoSize
|
|
@@ -41,24 +43,14 @@
|
|
|
41
43
|
:currentNetworkSort="currentNetworkSort"
|
|
42
44
|
:mode="mode"
|
|
43
45
|
:useDevSource="useDevSource"
|
|
44
|
-
@openDetail="
|
|
45
|
-
@resend="
|
|
46
|
+
@openDetail="emit('openDetail', item)"
|
|
47
|
+
@resend="emit('openSend', item)"
|
|
46
48
|
@openCode="emit('openCode', $event)"
|
|
47
49
|
/>
|
|
48
50
|
</AutoSize>
|
|
49
|
-
<Empty v-if="!networkList || networkList.length === 0" />
|
|
50
51
|
</template>
|
|
51
52
|
</VirtualListPro>
|
|
52
|
-
|
|
53
|
-
<!-- 请求详情 -->
|
|
54
|
-
<NetworkDetail
|
|
55
|
-
v-if="showDetail"
|
|
56
|
-
:network="network"
|
|
57
|
-
@close="onCloseDetail"
|
|
58
|
-
/>
|
|
59
|
-
|
|
60
|
-
<!-- 发起请求 -->
|
|
61
|
-
<NetworkSend v-if="showSend" :network="network" @close="onCloseSend" />
|
|
53
|
+
<Empty v-else />
|
|
62
54
|
</view>
|
|
63
55
|
</template>
|
|
64
56
|
<script lang="ts" setup>
|
|
@@ -70,10 +62,9 @@ import FilterSelect from '../FilterSelect/index.vue';
|
|
|
70
62
|
import type { DevTool } from '../../type';
|
|
71
63
|
import VirtualListPro from '../VirtualListPro/index.vue';
|
|
72
64
|
import AutoSize from '../VirtualListPro/AutoSize.vue';
|
|
73
|
-
|
|
74
|
-
import NetworkDetail from './NetworkDetail.vue';
|
|
65
|
+
|
|
75
66
|
import { sortMap } from './const';
|
|
76
|
-
import { onMounted, ref
|
|
67
|
+
import { onMounted, ref } from 'vue';
|
|
77
68
|
|
|
78
69
|
const props = defineProps<{
|
|
79
70
|
currentNetworkType: string;
|
|
@@ -91,6 +82,9 @@ const emit = defineEmits<{
|
|
|
91
82
|
(e: 'search', value: string): void;
|
|
92
83
|
(e: 'sort', sort: -1 | 1): void;
|
|
93
84
|
(e: 'openCode', value?: string): void;
|
|
85
|
+
(e: 'openSend', value?: DevTool.NetworkItem): void;
|
|
86
|
+
(e: 'openDetail', value?: DevTool.NetworkItem): void;
|
|
87
|
+
(e: 'openIntercept'): void;
|
|
94
88
|
}>();
|
|
95
89
|
const networkFilterItems = [
|
|
96
90
|
{
|
|
@@ -125,29 +119,6 @@ const networkFilterItems = [
|
|
|
125
119
|
},
|
|
126
120
|
];
|
|
127
121
|
|
|
128
|
-
const showSend = ref(false);
|
|
129
|
-
|
|
130
|
-
const showDetail = ref(false);
|
|
131
|
-
|
|
132
|
-
const emptyNetwork = {
|
|
133
|
-
index: 0,
|
|
134
|
-
url: '',
|
|
135
|
-
name: '',
|
|
136
|
-
method: '',
|
|
137
|
-
status: '',
|
|
138
|
-
time: '',
|
|
139
|
-
startTime: 0,
|
|
140
|
-
endTime: 0,
|
|
141
|
-
size: '',
|
|
142
|
-
headers: {
|
|
143
|
-
requestHeader: [],
|
|
144
|
-
responseHeader: [],
|
|
145
|
-
},
|
|
146
|
-
response: '',
|
|
147
|
-
payload: undefined,
|
|
148
|
-
};
|
|
149
|
-
const network = reactive<DevTool.NetworkItem>({ ...emptyNetwork });
|
|
150
|
-
|
|
151
122
|
function onChoose(type: string) {
|
|
152
123
|
emit('choose', type);
|
|
153
124
|
}
|
|
@@ -158,33 +129,6 @@ onMounted(() => {
|
|
|
158
129
|
height.value = windowHeight - 32 - 32;
|
|
159
130
|
});
|
|
160
131
|
|
|
161
|
-
function onOpenSend() {
|
|
162
|
-
showSend.value = true;
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
function onCloseSend() {
|
|
166
|
-
showSend.value = false;
|
|
167
|
-
|
|
168
|
-
Object.assign(network, emptyNetwork);
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
function onOpenDetail(ni: DevTool.NetworkItem) {
|
|
172
|
-
showDetail.value = true;
|
|
173
|
-
|
|
174
|
-
Object.assign(network, emptyNetwork);
|
|
175
|
-
Object.assign(network, ni);
|
|
176
|
-
}
|
|
177
|
-
function onCloseDetail() {
|
|
178
|
-
showDetail.value = false;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
function onResend(ni: DevTool.NetworkItem) {
|
|
182
|
-
showSend.value = true;
|
|
183
|
-
|
|
184
|
-
Object.assign(network, emptyNetwork);
|
|
185
|
-
Object.assign(network, ni);
|
|
186
|
-
}
|
|
187
|
-
|
|
188
132
|
function onSort() {
|
|
189
133
|
const sort = props.currentNetworkSort === 1 ? -1 : 1;
|
|
190
134
|
emit('sort', sort);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<view class="setting-content">
|
|
3
3
|
<view class="setting-item">
|
|
4
|
-
<DevToolTitle>DevTool(v0.0.
|
|
4
|
+
<DevToolTitle>DevTool(v0.0.22-vue3)</DevToolTitle>
|
|
5
5
|
<view class="setting-item-content">
|
|
6
6
|
<view class="setting-row">
|
|
7
7
|
<view>显示调试按钮:</view>
|
|
@@ -163,15 +163,31 @@
|
|
|
163
163
|
<button class="setting-button" @click="onExportLog">导出</button>
|
|
164
164
|
</view>
|
|
165
165
|
</view>
|
|
166
|
+
<view class="setting-item">
|
|
167
|
+
<DevToolTitle>请求拦截规则</DevToolTitle>
|
|
168
|
+
<view class="setting-item-content">
|
|
169
|
+
<view class="setting-row">
|
|
170
|
+
<view>缓存拦截规则到本地:</view>
|
|
171
|
+
<checkbox
|
|
172
|
+
:checked="cacheInterceptConfig"
|
|
173
|
+
color="#9254de"
|
|
174
|
+
style="transform: scale(0.8)"
|
|
175
|
+
@click="onCacheInterceptNetworkConfig"
|
|
176
|
+
/>
|
|
177
|
+
</view>
|
|
178
|
+
<view class="setting-tips">勾选后将会把 network 拦截缓存到本地</view>
|
|
179
|
+
</view>
|
|
180
|
+
</view>
|
|
166
181
|
</view>
|
|
167
182
|
</template>
|
|
168
183
|
<script lang="ts" setup>
|
|
169
184
|
import { reactive } from 'vue';
|
|
170
185
|
import DevToolTitle from '../DevToolTitle/index.vue';
|
|
171
|
-
defineProps<{
|
|
186
|
+
const props = defineProps<{
|
|
172
187
|
devToolVisible?: boolean;
|
|
173
188
|
sizeFormat?: string;
|
|
174
189
|
theme?: string;
|
|
190
|
+
cacheInterceptConfig?: boolean;
|
|
175
191
|
}>();
|
|
176
192
|
const setting = reactive({
|
|
177
193
|
restartDevTool: false,
|
|
@@ -206,6 +222,7 @@ const emit = defineEmits<{
|
|
|
206
222
|
(e: 'clearCache'): void;
|
|
207
223
|
(e: 'destroyDevTool'): void;
|
|
208
224
|
(e: 'changeTheme', value: string): void;
|
|
225
|
+
(e: 'changeCacheInterceptConfig', value: boolean): void;
|
|
209
226
|
}>();
|
|
210
227
|
|
|
211
228
|
function onChangeShowDevButton(show: boolean) {
|
|
@@ -243,6 +260,10 @@ function onScreenshot() {
|
|
|
243
260
|
function onClearCache() {
|
|
244
261
|
emit('clearCache');
|
|
245
262
|
}
|
|
263
|
+
|
|
264
|
+
function onCacheInterceptNetworkConfig() {
|
|
265
|
+
emit('changeCacheInterceptConfig', !props.cacheInterceptConfig);
|
|
266
|
+
}
|
|
246
267
|
</script>
|
|
247
268
|
<style scoped>
|
|
248
269
|
.setting-content {
|
package/dist/v3/Tag/index.vue
CHANGED