vite-uni-dev-tool 0.0.11 → 0.0.13
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 +55 -1
- 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 +15 -1
- package/dist/plugins/uniDevTool/uniDevTool.d.ts.map +1 -0
- package/dist/plugins/uniDevTool/uniDevTool.js +35 -0
- package/{dev → dist}/plugins/uniGlobalComponents/uniGlobalComponents.js +7 -7
- 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/AutoSizer/utils.d.ts +5 -0
- package/dist/v2/AutoSizer/utils.d.ts.map +1 -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/type.d.ts +93 -0
- package/dist/v2/JsonPretty/type.d.ts.map +1 -0
- package/dist/v3/AutoSizer/utils.d.ts +5 -0
- package/dist/v3/AutoSizer/utils.d.ts.map +1 -0
- package/dist/v3/ConsoleList/staticTips.d.ts +13 -0
- package/dist/v3/ConsoleList/staticTips.d.ts.map +1 -0
- 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/useError.d.ts +8 -0
- package/dist/v3/JsonPretty/hooks/useError.d.ts.map +1 -0
- package/dist/v3/JsonPretty/type.d.ts +93 -0
- package/dist/v3/JsonPretty/type.d.ts.map +1 -0
- package/dist/v3/JsonPretty/utils/index.d.ts +10 -0
- package/dist/v3/JsonPretty/utils/index.d.ts.map +1 -0
- package/package.json +5 -5
- package/dev/components/AppInfo/index.vue +0 -36
- package/dev/components/AutoSizer/index.vue +0 -193
- package/dev/components/AutoSizer/index1.vue +0 -186
- package/dev/components/AutoSizer/utils.ts +0 -49
- package/dev/components/Button/index.vue +0 -34
- package/dev/components/CaptureScreen/index.vue +0 -62
- package/dev/components/Checkbox/index.vue +0 -40
- package/dev/components/CloseButton/index.vue +0 -26
- package/dev/components/Code/index.vue +0 -230
- package/dev/components/Connection/index.vue +0 -88
- package/dev/components/ConsoleList/Code.vue +0 -227
- package/dev/components/ConsoleList/ConsoleItem.vue +0 -186
- package/dev/components/ConsoleList/RunJSInput.vue +0 -235
- package/dev/components/ConsoleList/index.vue +0 -130
- package/dev/components/ConsoleList/staticTips.ts +0 -1145
- package/dev/components/DevTool/index.vue +0 -182
- package/dev/components/DevToolButton/index.vue +0 -213
- package/dev/components/DevToolTitle/index.vue +0 -21
- package/dev/components/DevToolWindow/index.vue +0 -1037
- package/dev/components/DeviceInfo/index.vue +0 -32
- package/dev/components/Empty/empty.png +0 -0
- package/dev/components/Empty/index.vue +0 -28
- package/dev/components/FilterInput/index.vue +0 -86
- package/dev/components/JsonPretty/components/Brackets/index.vue +0 -23
- package/dev/components/JsonPretty/components/Carets/index.vue +0 -59
- package/dev/components/JsonPretty/components/CheckController/index.vue +0 -125
- package/dev/components/JsonPretty/components/TreeNode/index.vue +0 -349
- package/dev/components/JsonPretty/hooks/useClipboard.ts +0 -21
- package/dev/components/JsonPretty/hooks/useError.ts +0 -21
- package/dev/components/JsonPretty/index.vue +0 -474
- package/dev/components/JsonPretty/type.ts +0 -125
- package/dev/components/JsonPretty/utils/index.ts +0 -172
- package/dev/components/NetworkList/NetworkDetail.vue +0 -197
- package/dev/components/NetworkList/NetworkItem.vue +0 -106
- package/dev/components/NetworkList/index.vue +0 -115
- package/dev/components/PiniaList/index.vue +0 -64
- package/dev/components/RouteList/index.vue +0 -110
- package/dev/components/RunJS/index.vue +0 -128
- package/dev/components/SettingList/index.vue +0 -225
- package/dev/components/StorageList/index.vue +0 -170
- package/dev/components/SystemInfo/index.vue +0 -34
- package/dev/components/Tabs/index.vue +0 -123
- package/dev/components/Tag/index.vue +0 -89
- package/dev/components/UniEvent/UniEventItem.vue +0 -124
- package/dev/components/UniEvent/index.vue +0 -94
- package/dev/components/UploadList/UploadDetail.vue +0 -208
- package/dev/components/UploadList/UploadItem.vue +0 -111
- package/dev/components/UploadList/index.vue +0 -104
- package/dev/components/VirtualList/index.vue +0 -112
- package/dev/components/VirtualListPro/AutoSize.vue +0 -43
- package/dev/components/VirtualListPro/index.vue +0 -175
- package/dev/components/VirtualListPro/readme.md +0 -40
- package/dev/components/VuexList/index.vue +0 -54
- package/dev/components/WebSocket/WebSocketItem.vue +0 -98
- package/dev/components/WebSocket/WebSocketList.vue +0 -176
- package/dev/components/WebSocket/index.vue +0 -111
- package/dev/components/WindowInfo/index.vue +0 -33
- package/dev/const.ts +0 -166
- package/dev/core.ts +0 -118
- package/dev/devConsole/index.ts +0 -350
- package/dev/devEvent/index.ts +0 -806
- 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 -718
- 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 -264
- 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 -46
- package/dev/utils/ip.ts +0 -79
- package/dev/utils/language.ts +0 -72
- package/dev/utils/object.ts +0 -298
- 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
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<view class="route-content">
|
|
3
|
-
<view class="route-control">
|
|
4
|
-
<FilterInput
|
|
5
|
-
style="width: 100%"
|
|
6
|
-
placeholder="搜索name/path"
|
|
7
|
-
:modelValue="modelValue"
|
|
8
|
-
@search="emit('search', $event)"
|
|
9
|
-
@update:modelValue="emit('update:modelValue', $event)"
|
|
10
|
-
/>
|
|
11
|
-
<Tag mode="clear" @click="onRefresh">刷新</Tag>
|
|
12
|
-
</view>
|
|
13
|
-
|
|
14
|
-
<VirtualListPro :data="routeList" :pageSize="10" className="route-list">
|
|
15
|
-
<template v-slot="{ list, start }">
|
|
16
|
-
<AutoSize
|
|
17
|
-
v-for="(item, index) in list"
|
|
18
|
-
:index="start + index"
|
|
19
|
-
:key="start + index"
|
|
20
|
-
>
|
|
21
|
-
<view class="route-item">
|
|
22
|
-
<view class="route-item-name">
|
|
23
|
-
<view v-html="item.name" />
|
|
24
|
-
<Tag v-if="item.type" mode="info">{{ item.type }}</Tag>
|
|
25
|
-
<Tag mode="warn" v-if="item.index === 4 || item.index === 3">
|
|
26
|
-
当前页
|
|
27
|
-
</Tag>
|
|
28
|
-
<Tag mode="primary" v-if="item.index === 4 || item.index === 2">
|
|
29
|
-
启动页
|
|
30
|
-
</Tag>
|
|
31
|
-
</view>
|
|
32
|
-
<view class="route-item-path">
|
|
33
|
-
<view v-html="item.path" />
|
|
34
|
-
<Tag mode="main" @click="onGoTo(item)">跳转</Tag>
|
|
35
|
-
</view>
|
|
36
|
-
</view>
|
|
37
|
-
</AutoSize>
|
|
38
|
-
<Empty v-if="!routeList || routeList.length === 0" />
|
|
39
|
-
</template>
|
|
40
|
-
</VirtualListPro>
|
|
41
|
-
</view>
|
|
42
|
-
</template>
|
|
43
|
-
<script lang="ts" setup>
|
|
44
|
-
import Tag from '../Tag/index.vue';
|
|
45
|
-
import Empty from '../Empty/index.vue';
|
|
46
|
-
import FilterInput from '../FilterInput/index.vue';
|
|
47
|
-
import type { DevTool } from '../../type';
|
|
48
|
-
import VirtualListPro from '../VirtualListPro/index.vue';
|
|
49
|
-
import AutoSize from '../VirtualListPro/AutoSize.vue';
|
|
50
|
-
|
|
51
|
-
defineProps<{ routeList: DevTool.Page[]; modelValue?: string }>();
|
|
52
|
-
const emit = defineEmits<{
|
|
53
|
-
(e: 'goTo', params: DevTool.Page): void;
|
|
54
|
-
(e: 'search', value: string): void;
|
|
55
|
-
(e: 'update:modelValue', value: string): void;
|
|
56
|
-
(e: 'routeRefresh'): void;
|
|
57
|
-
}>();
|
|
58
|
-
|
|
59
|
-
function onGoTo(page: DevTool.Page) {
|
|
60
|
-
emit('goTo', page);
|
|
61
|
-
}
|
|
62
|
-
function onRefresh() {
|
|
63
|
-
emit('routeRefresh');
|
|
64
|
-
}
|
|
65
|
-
</script>
|
|
66
|
-
<style scoped>
|
|
67
|
-
.route-content {
|
|
68
|
-
height: 100%;
|
|
69
|
-
|
|
70
|
-
font-size: var(--dev-tool-base-font-size);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
.route-control {
|
|
74
|
-
display: flex;
|
|
75
|
-
align-items: center;
|
|
76
|
-
justify-content: flex-end;
|
|
77
|
-
gap: 8px;
|
|
78
|
-
padding: 0 16px;
|
|
79
|
-
height: 32px;
|
|
80
|
-
border-bottom: 1px solid var(--dev-tool-border-color);
|
|
81
|
-
box-sizing: border-box;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
.route-list {
|
|
85
|
-
height: calc(100% - 32px);
|
|
86
|
-
overflow: auto;
|
|
87
|
-
}
|
|
88
|
-
.route-content .route-item {
|
|
89
|
-
padding: 16px;
|
|
90
|
-
border-bottom: 1px solid var(--dev-tool-border-color);
|
|
91
|
-
}
|
|
92
|
-
.route-content .route-item .route-item-name {
|
|
93
|
-
display: flex;
|
|
94
|
-
align-items: center;
|
|
95
|
-
margin-bottom: 8px;
|
|
96
|
-
gap: 12px;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
.route-content .route-item .route-item-path {
|
|
100
|
-
display: flex;
|
|
101
|
-
align-items: center;
|
|
102
|
-
justify-content: space-between;
|
|
103
|
-
word-break: break-all;
|
|
104
|
-
}
|
|
105
|
-
/* #ifdef APP-PLUS */
|
|
106
|
-
.route-content .route-item .route-item-path :deep(.tag) {
|
|
107
|
-
margin-left: 16px;
|
|
108
|
-
}
|
|
109
|
-
/* #endif */
|
|
110
|
-
</style>
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<view class="run-js">
|
|
3
|
-
<view class="run-js-control">
|
|
4
|
-
<FilterInput
|
|
5
|
-
:modelValue="modelValue"
|
|
6
|
-
placeholder="查询"
|
|
7
|
-
@search="emit('search', $event)"
|
|
8
|
-
@update:modelValue="emit('update:modelValue', $event)"
|
|
9
|
-
/>
|
|
10
|
-
<Tag mode="clear" @click="emit('clear')">清空</Tag>
|
|
11
|
-
</view>
|
|
12
|
-
<view class="run-js-list">
|
|
13
|
-
<view class="run-js-item" v-for="item in runJSList">
|
|
14
|
-
<view :class="`run-js-item-icon run-js-item-${item.mode}`"></view>
|
|
15
|
-
<view class="run-js-item-duration" v-if="item.mode === 'output'">
|
|
16
|
-
{{ item.duration }}ms
|
|
17
|
-
</view>
|
|
18
|
-
<view
|
|
19
|
-
class="run-js-item-content"
|
|
20
|
-
v-html="item.mode === 'input' ? item.code : item.result"
|
|
21
|
-
>
|
|
22
|
-
</view>
|
|
23
|
-
</view>
|
|
24
|
-
<view class="run-js-item">
|
|
25
|
-
<view class="run-js-item-icon run-js-item-input"> </view>
|
|
26
|
-
|
|
27
|
-
<input v-model="code" class="run-js-input" @confirm="onConfirm" />
|
|
28
|
-
</view>
|
|
29
|
-
</view>
|
|
30
|
-
</view>
|
|
31
|
-
</template>
|
|
32
|
-
<script lang="ts" setup>
|
|
33
|
-
import { ref } from 'vue';
|
|
34
|
-
import type { DevTool } from '../../type';
|
|
35
|
-
import FilterInput from '../FilterInput/index.vue';
|
|
36
|
-
import Tag from '../Tag/index.vue';
|
|
37
|
-
|
|
38
|
-
defineProps<{ runJSList: DevTool.RunJSItem[]; modelValue: string }>();
|
|
39
|
-
|
|
40
|
-
const emit = defineEmits<{
|
|
41
|
-
(e: 'search', value: string): void;
|
|
42
|
-
(e: 'update:modelValue', value: string): void;
|
|
43
|
-
(e: 'clear'): void;
|
|
44
|
-
(e: 'run', value: string): void;
|
|
45
|
-
}>();
|
|
46
|
-
const code = ref('');
|
|
47
|
-
function onConfirm() {
|
|
48
|
-
const value = code.value;
|
|
49
|
-
if (!value) return;
|
|
50
|
-
code.value = '';
|
|
51
|
-
setTimeout(() => {
|
|
52
|
-
emit('run', value);
|
|
53
|
-
}, 100);
|
|
54
|
-
}
|
|
55
|
-
</script>
|
|
56
|
-
<style scoped>
|
|
57
|
-
.run-js {
|
|
58
|
-
height: 100%;
|
|
59
|
-
font-size: var(--dev-tool-base-font-size);
|
|
60
|
-
}
|
|
61
|
-
.run-js-control {
|
|
62
|
-
display: flex;
|
|
63
|
-
align-items: center;
|
|
64
|
-
justify-content: space-between;
|
|
65
|
-
gap: 8px;
|
|
66
|
-
padding: 0 16px;
|
|
67
|
-
height: 32px;
|
|
68
|
-
border-bottom: 1px solid var(--dev-tool-border-color);
|
|
69
|
-
box-sizing: border-box;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
.run-js-list {
|
|
73
|
-
height: calc(100% - 32px);
|
|
74
|
-
overflow: auto;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
.run-js-item {
|
|
78
|
-
position: relative;
|
|
79
|
-
display: flex;
|
|
80
|
-
padding: 0 16px;
|
|
81
|
-
min-height: 28px;
|
|
82
|
-
border-bottom: 1px solid var(--dev-tool-border-color);
|
|
83
|
-
overflow: hidden;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
.run-js-item-icon {
|
|
87
|
-
width: 8px;
|
|
88
|
-
height: 8px;
|
|
89
|
-
border: 1px solid #000;
|
|
90
|
-
border-bottom-color: transparent;
|
|
91
|
-
border-left-color: transparent;
|
|
92
|
-
overflow: hidden;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
.run-js-item-input {
|
|
96
|
-
margin: 10px 0 10px -4px;
|
|
97
|
-
transform: rotate(45deg);
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
.run-js-item-output {
|
|
101
|
-
margin: 10px -4px 10px 0px;
|
|
102
|
-
transform: rotate(-135deg);
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
.run-js-item-content {
|
|
106
|
-
margin-left: 16px;
|
|
107
|
-
min-height: 28px;
|
|
108
|
-
line-height: 28px;
|
|
109
|
-
white-space: pre-line;
|
|
110
|
-
word-break: break-all;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
.run-js-input {
|
|
114
|
-
margin: 1px 0 1px 16px;
|
|
115
|
-
min-height: 26px;
|
|
116
|
-
width: 100%;
|
|
117
|
-
border: 1px solid transparent;
|
|
118
|
-
font-size: var(--dev-tool-base-font-size);
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
.run-js-item-duration {
|
|
122
|
-
position: absolute;
|
|
123
|
-
top: 2px;
|
|
124
|
-
right: 16px;
|
|
125
|
-
height: 24px;
|
|
126
|
-
line-height: 24px;
|
|
127
|
-
}
|
|
128
|
-
</style>
|
|
@@ -1,225 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<view class="setting-content">
|
|
3
|
-
<view class="setting-item">
|
|
4
|
-
<DevToolTitle>DevTool</DevToolTitle>
|
|
5
|
-
<view class="setting-item-content">
|
|
6
|
-
<view class="setting-row">
|
|
7
|
-
<view>显示调试按钮:</view>
|
|
8
|
-
<Checkbox
|
|
9
|
-
v-model="setting.showDevButton"
|
|
10
|
-
@change="onChangeShowDevButton"
|
|
11
|
-
/>
|
|
12
|
-
</view>
|
|
13
|
-
<view class="setting-tips"> 取消后将不在展示调试按钮 </view>
|
|
14
|
-
<view class="setting-row">
|
|
15
|
-
<view>重启调试器:</view>
|
|
16
|
-
</view>
|
|
17
|
-
|
|
18
|
-
<view class="setting-tips">点击后将会重启调试器</view>
|
|
19
|
-
<DButton class="setting-button" @click="onRestartDevTool(true)">
|
|
20
|
-
重启调试器
|
|
21
|
-
</DButton>
|
|
22
|
-
|
|
23
|
-
<view class="setting-row">
|
|
24
|
-
<view>销毁调试器:</view>
|
|
25
|
-
</view>
|
|
26
|
-
|
|
27
|
-
<view class="setting-tips">
|
|
28
|
-
点击后将会销毁调试器,销毁后不再接收调试信息,需要通过 createDevTool()
|
|
29
|
-
重新创建
|
|
30
|
-
</view>
|
|
31
|
-
<DButton class="setting-button" @click="onDestructionDevTool">
|
|
32
|
-
销毁调试器
|
|
33
|
-
</DButton>
|
|
34
|
-
|
|
35
|
-
<view class="setting-row">
|
|
36
|
-
<view>重启APP:</view>
|
|
37
|
-
</view>
|
|
38
|
-
<view class="setting-tips">点击后将会重启APP</view>
|
|
39
|
-
<DButton class="setting-button" @click="onRestartApp(true)">
|
|
40
|
-
重启APP
|
|
41
|
-
</DButton>
|
|
42
|
-
<view class="setting-row">
|
|
43
|
-
<view>占用存储空间:{{ sizeFormat }}</view>
|
|
44
|
-
</view>
|
|
45
|
-
<view class="setting-tips">
|
|
46
|
-
当前所有信息占用的存储空间,只会清除 Console, Network, Upload,
|
|
47
|
-
Websocket, UniEvent
|
|
48
|
-
</view>
|
|
49
|
-
<DButton class="setting-button" @click="onClearCache">
|
|
50
|
-
清除缓存
|
|
51
|
-
</DButton>
|
|
52
|
-
</view>
|
|
53
|
-
</view>
|
|
54
|
-
<view class="setting-item">
|
|
55
|
-
<DevToolTitle>Log</DevToolTitle>
|
|
56
|
-
<view class="setting-item-content">
|
|
57
|
-
<view class="setting-row">
|
|
58
|
-
<view>导出当前日志信息:</view>
|
|
59
|
-
<Checkbox v-model="setting.exportLog" />
|
|
60
|
-
</view>
|
|
61
|
-
<view class="setting-tips">勾选后将会导出当前的Log</view>
|
|
62
|
-
<view class="setting-row">
|
|
63
|
-
<view>导出当前网络信息:</view>
|
|
64
|
-
<Checkbox v-model="setting.exportNetwork" />
|
|
65
|
-
</view>
|
|
66
|
-
<view class="setting-tips">勾选后将会导出当前的Network</view>
|
|
67
|
-
<view class="setting-row">
|
|
68
|
-
<view>导出当前上传信息:</view>
|
|
69
|
-
<Checkbox v-model="setting.exportUpload" />
|
|
70
|
-
</view>
|
|
71
|
-
<view class="setting-tips">勾选后将会导出当前的Upload</view>
|
|
72
|
-
<view class="setting-row">
|
|
73
|
-
<view>导出当前套接字信息:</view>
|
|
74
|
-
<Checkbox v-model="setting.exportWebsocket" />
|
|
75
|
-
</view>
|
|
76
|
-
<view class="setting-tips">勾选后将会导出当前的Websocket</view>
|
|
77
|
-
<view class="setting-row">
|
|
78
|
-
<view>导出当前缓存信息:</view>
|
|
79
|
-
<Checkbox v-model="setting.exportStorage" />
|
|
80
|
-
</view>
|
|
81
|
-
<view class="setting-tips">
|
|
82
|
-
勾选后将会导出当前的Storage, Vuex, Pinia
|
|
83
|
-
</view>
|
|
84
|
-
<view class="setting-row">
|
|
85
|
-
<view>导出当前窗口信息:</view>
|
|
86
|
-
<Checkbox v-model="setting.exportWindow" />
|
|
87
|
-
</view>
|
|
88
|
-
<view class="setting-tips">勾选后将会导出当前的Window</view>
|
|
89
|
-
|
|
90
|
-
<view class="setting-row">
|
|
91
|
-
<view>导出当前设备信息:</view>
|
|
92
|
-
<Checkbox v-model="setting.exportDevice" />
|
|
93
|
-
</view>
|
|
94
|
-
<view class="setting-tips">勾选后将会导出当前的Device</view>
|
|
95
|
-
|
|
96
|
-
<view class="setting-row">
|
|
97
|
-
<view>导出当前系统信息:</view>
|
|
98
|
-
<Checkbox v-model="setting.exportSystem" />
|
|
99
|
-
</view>
|
|
100
|
-
<view class="setting-tips">勾选后将会导出当前的System</view>
|
|
101
|
-
|
|
102
|
-
<DButton class="setting-button" @click="onExportLog"> 导出 </DButton>
|
|
103
|
-
</view>
|
|
104
|
-
</view>
|
|
105
|
-
|
|
106
|
-
<!--
|
|
107
|
-
<view class="setting-item">
|
|
108
|
-
<view class="setting-item-title">截图</view>
|
|
109
|
-
<DButton
|
|
110
|
-
class="setting-button"
|
|
111
|
-
|
|
112
|
-
@click="onScreenshot"
|
|
113
|
-
>
|
|
114
|
-
截图当前路由
|
|
115
|
-
</DButton>
|
|
116
|
-
</view>
|
|
117
|
-
-->
|
|
118
|
-
</view>
|
|
119
|
-
</template>
|
|
120
|
-
<script lang="ts" setup>
|
|
121
|
-
import { reactive } from 'vue';
|
|
122
|
-
import Checkbox from '../Checkbox/index.vue';
|
|
123
|
-
import DButton from '../Button/index.vue';
|
|
124
|
-
import DevToolTitle from '../DevToolTitle/index.vue';
|
|
125
|
-
const props = defineProps<{
|
|
126
|
-
devToolVisible?: boolean;
|
|
127
|
-
sizeFormat?: string;
|
|
128
|
-
}>();
|
|
129
|
-
const setting = reactive({
|
|
130
|
-
showDevButton: props.devToolVisible,
|
|
131
|
-
|
|
132
|
-
restartDevTool: false,
|
|
133
|
-
restartApp: false,
|
|
134
|
-
exportLog: false,
|
|
135
|
-
exportNetwork: false,
|
|
136
|
-
exportUpload: false,
|
|
137
|
-
exportStorage: false,
|
|
138
|
-
exportWebsocket: false,
|
|
139
|
-
exportWindow: false,
|
|
140
|
-
exportDevice: false,
|
|
141
|
-
exportSystem: false,
|
|
142
|
-
});
|
|
143
|
-
const emit = defineEmits<{
|
|
144
|
-
(e: 'showDevButton', show: boolean): void;
|
|
145
|
-
(e: 'restartDevTool', restart?: boolean): void;
|
|
146
|
-
(e: 'restartApp', restart?: boolean): void;
|
|
147
|
-
(
|
|
148
|
-
e: 'exportLog',
|
|
149
|
-
params: {
|
|
150
|
-
exportLog: boolean;
|
|
151
|
-
exportNetwork: boolean;
|
|
152
|
-
exportStorage: boolean;
|
|
153
|
-
exportWebsocket: boolean;
|
|
154
|
-
exportUpload: boolean;
|
|
155
|
-
exportWindow: boolean;
|
|
156
|
-
exportDevice: boolean;
|
|
157
|
-
exportSystem: boolean;
|
|
158
|
-
},
|
|
159
|
-
): void;
|
|
160
|
-
(e: 'screenshot'): void;
|
|
161
|
-
(e: 'clearCache'): void;
|
|
162
|
-
(e: 'destroyDevTool'): void;
|
|
163
|
-
}>();
|
|
164
|
-
|
|
165
|
-
function onChangeShowDevButton(show: boolean) {
|
|
166
|
-
emit('showDevButton', show);
|
|
167
|
-
}
|
|
168
|
-
function onRestartDevTool(restart: boolean) {
|
|
169
|
-
console.log('restart: ', restart);
|
|
170
|
-
restart && emit('restartDevTool');
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
function onDestructionDevTool() {
|
|
174
|
-
emit('destroyDevTool');
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
function onRestartApp(restart: boolean) {
|
|
178
|
-
restart && emit('restartApp');
|
|
179
|
-
}
|
|
180
|
-
function onExportLog() {
|
|
181
|
-
if (setting.exportLog || setting.exportNetwork || setting.exportStorage) {
|
|
182
|
-
emit('exportLog', {
|
|
183
|
-
exportLog: setting.exportLog,
|
|
184
|
-
exportNetwork: setting.exportNetwork,
|
|
185
|
-
exportStorage: setting.exportStorage,
|
|
186
|
-
exportWebsocket: setting.exportWebsocket,
|
|
187
|
-
exportUpload: setting.exportUpload,
|
|
188
|
-
exportWindow: setting.exportWindow,
|
|
189
|
-
exportDevice: setting.exportDevice,
|
|
190
|
-
exportSystem: setting.exportSystem,
|
|
191
|
-
});
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
function onScreenshot() {
|
|
195
|
-
emit('screenshot');
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
function onClearCache() {
|
|
199
|
-
emit('clearCache');
|
|
200
|
-
}
|
|
201
|
-
</script>
|
|
202
|
-
<style scoped>
|
|
203
|
-
.setting-content {
|
|
204
|
-
height: 100%;
|
|
205
|
-
overflow: auto;
|
|
206
|
-
font-size: var(--dev-tool-base-font-size);
|
|
207
|
-
}
|
|
208
|
-
.setting-item {
|
|
209
|
-
padding: 16px 16px 0 16px;
|
|
210
|
-
box-sizing: border-box;
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
.setting-row {
|
|
214
|
-
display: flex;
|
|
215
|
-
align-items: center;
|
|
216
|
-
justify-content: space-between;
|
|
217
|
-
margin: 8px 0;
|
|
218
|
-
min-height: 18px;
|
|
219
|
-
}
|
|
220
|
-
.setting-tips {
|
|
221
|
-
color: #616161;
|
|
222
|
-
font-size: var(--dev-tool-tips-font-size);
|
|
223
|
-
margin-bottom: 8px;
|
|
224
|
-
}
|
|
225
|
-
</style>
|
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<view class="storage-content">
|
|
3
|
-
<view class="storage-control">
|
|
4
|
-
<FilterInput
|
|
5
|
-
:modelValue="modelValue"
|
|
6
|
-
style="width: 100%"
|
|
7
|
-
placeholder="查询key"
|
|
8
|
-
@search="emit('search', $event)"
|
|
9
|
-
@update:modelValue="emit('update:modelValue', $event)"
|
|
10
|
-
/>
|
|
11
|
-
<Tag
|
|
12
|
-
v-for="item in storageFilerItem"
|
|
13
|
-
mode="clear"
|
|
14
|
-
:key="item.label"
|
|
15
|
-
@click="onChoose(item.value)"
|
|
16
|
-
>
|
|
17
|
-
{{ item.label }}
|
|
18
|
-
</Tag>
|
|
19
|
-
</view>
|
|
20
|
-
<view class="storage-list">
|
|
21
|
-
<view class="storage-item" v-for="item in storageList" :key="item.key">
|
|
22
|
-
<view class="storage-key">
|
|
23
|
-
<view class="storage-key-label">
|
|
24
|
-
<view>key: </view>
|
|
25
|
-
<view v-html="item._oldKey" />
|
|
26
|
-
</view>
|
|
27
|
-
<CloseButton style="margin-left: auto" @click="onRemove(item.key)" />
|
|
28
|
-
</view>
|
|
29
|
-
|
|
30
|
-
<JsonPretty
|
|
31
|
-
:data="{
|
|
32
|
-
key: item.key,
|
|
33
|
-
value: item.value,
|
|
34
|
-
}"
|
|
35
|
-
showLength
|
|
36
|
-
editable
|
|
37
|
-
@update:data="onUpdateData($event, item)"
|
|
38
|
-
/>
|
|
39
|
-
</view>
|
|
40
|
-
<Empty v-if="!storageList || storageList.length === 0" />
|
|
41
|
-
</view>
|
|
42
|
-
</view>
|
|
43
|
-
</template>
|
|
44
|
-
<script lang="ts" setup>
|
|
45
|
-
import Tag from '../Tag/index.vue';
|
|
46
|
-
import JsonPretty from '../JsonPretty/index.vue';
|
|
47
|
-
import Empty from '../Empty/index.vue';
|
|
48
|
-
import CloseButton from '../CloseButton/index.vue';
|
|
49
|
-
import FilterInput from '../FilterInput/index.vue';
|
|
50
|
-
import type { DevTool } from '../../type';
|
|
51
|
-
const props = defineProps<{
|
|
52
|
-
storageList: DevTool.StorageItem[];
|
|
53
|
-
modelValue: string;
|
|
54
|
-
}>();
|
|
55
|
-
|
|
56
|
-
const emit = defineEmits<{
|
|
57
|
-
(e: 'choose', type: string): void;
|
|
58
|
-
(e: 'remove', key: string): void;
|
|
59
|
-
(e: 'update:storageList', data: Record<string, any>): void;
|
|
60
|
-
(e: 'diffValue', value: any): void;
|
|
61
|
-
(e: 'update:modelValue', value: string): void;
|
|
62
|
-
(e: 'search', value: string): void;
|
|
63
|
-
}>();
|
|
64
|
-
|
|
65
|
-
function onUpdateData(
|
|
66
|
-
data: DevTool.StorageItem,
|
|
67
|
-
item: DevTool.StorageItem,
|
|
68
|
-
) {
|
|
69
|
-
const tempList = JSON.parse(JSON.stringify(props.storageList));
|
|
70
|
-
const index = props.storageList.findIndex(
|
|
71
|
-
(store) => store.key === item._oldKey,
|
|
72
|
-
);
|
|
73
|
-
if (index === -1) return;
|
|
74
|
-
tempList[index] = {
|
|
75
|
-
key: data.key,
|
|
76
|
-
_oldKey: tempList[index]._oldKey,
|
|
77
|
-
value: data.value,
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
emit('update:storageList', tempList);
|
|
81
|
-
emit('diffValue', {
|
|
82
|
-
...data,
|
|
83
|
-
_oldKey: tempList[index]._oldKey,
|
|
84
|
-
key: data.key,
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
const storageFilerItem = [
|
|
89
|
-
{
|
|
90
|
-
label: '新增',
|
|
91
|
-
value: 'add',
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
label: '刷新',
|
|
95
|
-
value: 'refresh',
|
|
96
|
-
},
|
|
97
|
-
{
|
|
98
|
-
label: '清除',
|
|
99
|
-
value: 'clear',
|
|
100
|
-
},
|
|
101
|
-
];
|
|
102
|
-
function calcValue(value: string) {
|
|
103
|
-
try {
|
|
104
|
-
return {
|
|
105
|
-
value: JSON.parse(value),
|
|
106
|
-
type: 'object',
|
|
107
|
-
};
|
|
108
|
-
} catch (error) {
|
|
109
|
-
return {
|
|
110
|
-
value,
|
|
111
|
-
type: 'string',
|
|
112
|
-
};
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
function onChoose(type: string) {
|
|
116
|
-
emit('choose', type);
|
|
117
|
-
}
|
|
118
|
-
function onRemove(key: string) {
|
|
119
|
-
emit('remove', key);
|
|
120
|
-
}
|
|
121
|
-
</script>
|
|
122
|
-
<style scoped>
|
|
123
|
-
.storage-content {
|
|
124
|
-
height: 100%;
|
|
125
|
-
font-size: var(--dev-tool-base-font-size);
|
|
126
|
-
}
|
|
127
|
-
.storage-content .storage-list {
|
|
128
|
-
height: calc(100% - 32px);
|
|
129
|
-
overflow: auto;
|
|
130
|
-
}
|
|
131
|
-
.storage-content .storage-list .storage-item {
|
|
132
|
-
padding: 16px;
|
|
133
|
-
border-bottom: 1px solid var(--dev-tool-border-color);
|
|
134
|
-
}
|
|
135
|
-
.storage-content .storage-list .storage-item .storage-key {
|
|
136
|
-
display: flex;
|
|
137
|
-
align-items: center;
|
|
138
|
-
justify-content: space-between;
|
|
139
|
-
word-break: break-all;
|
|
140
|
-
}
|
|
141
|
-
.storage-key-label {
|
|
142
|
-
display: flex;
|
|
143
|
-
align-items: center;
|
|
144
|
-
}
|
|
145
|
-
.storage-content .storage-list .storage-item .storage-value {
|
|
146
|
-
word-break: break-all;
|
|
147
|
-
}
|
|
148
|
-
.storage-content .storage-list .storage-item .storage-remove {
|
|
149
|
-
flex-shrink: 0;
|
|
150
|
-
display: flex;
|
|
151
|
-
align-items: center;
|
|
152
|
-
justify-content: center;
|
|
153
|
-
width: 24px;
|
|
154
|
-
height: 24px;
|
|
155
|
-
margin: auto 0 auto 16px;
|
|
156
|
-
border-radius: 50%;
|
|
157
|
-
border: 1px solid #000;
|
|
158
|
-
box-sizing: border-box;
|
|
159
|
-
}
|
|
160
|
-
.storage-control {
|
|
161
|
-
display: flex;
|
|
162
|
-
align-items: center;
|
|
163
|
-
justify-content: flex-end;
|
|
164
|
-
gap: 8px;
|
|
165
|
-
padding: 0 16px;
|
|
166
|
-
height: 32px;
|
|
167
|
-
border-bottom: 1px solid var(--dev-tool-border-color);
|
|
168
|
-
box-sizing: border-box;
|
|
169
|
-
}
|
|
170
|
-
</style>
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<view class="system-content">
|
|
3
|
-
<JsonPretty :data="systemInfo" showLength v-if="showJson" />
|
|
4
|
-
<Empty v-else />
|
|
5
|
-
</view>
|
|
6
|
-
</template>
|
|
7
|
-
<script lang="ts" setup>
|
|
8
|
-
import { computed } from 'vue';
|
|
9
|
-
import JsonPretty from '../JsonPretty/index.vue';
|
|
10
|
-
import Empty from '../Empty/index.vue';
|
|
11
|
-
const props = defineProps<{
|
|
12
|
-
systemInfo: Record<string, any>;
|
|
13
|
-
}>();
|
|
14
|
-
const showJson = computed(() => {
|
|
15
|
-
try {
|
|
16
|
-
const str = JSON.stringify(props.systemInfo);
|
|
17
|
-
if (typeof props.systemInfo === 'object' && (str === '' || str === '{}')) {
|
|
18
|
-
return false;
|
|
19
|
-
}
|
|
20
|
-
return true;
|
|
21
|
-
} catch (error) {
|
|
22
|
-
return false;
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
</script>
|
|
26
|
-
<style scoped>
|
|
27
|
-
.system-content {
|
|
28
|
-
padding: 16px;
|
|
29
|
-
font-size: var(--dev-tool-base-font-size);
|
|
30
|
-
|
|
31
|
-
height: calc(100% - 32px);
|
|
32
|
-
overflow: auto;
|
|
33
|
-
}
|
|
34
|
-
</style>
|