vite-uni-dev-tool 0.0.13 → 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/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.ts +49 -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/empty.png +0 -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.ts +21 -0
- package/dist/v2/JsonPretty/hooks/useError.ts +21 -0
- package/dist/v2/JsonPretty/index.vue +531 -0
- package/dist/v2/JsonPretty/type.ts +125 -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/RunJS/index.vue +128 -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/VirtualListPro/readme.md +40 -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/dist/v3/AppInfo/index.vue +35 -0
- package/dist/v3/AutoSizer/index.vue +193 -0
- package/dist/v3/AutoSizer/index1.vue +186 -0
- package/dist/v3/AutoSizer/utils.ts +49 -0
- package/dist/v3/CaptureScreen/index.vue +62 -0
- package/dist/v3/CloseButton/index.vue +29 -0
- package/dist/v3/Connection/index.vue +88 -0
- package/dist/v3/ConsoleList/ConsoleItem.vue +208 -0
- package/dist/v3/ConsoleList/RunJSInput.vue +240 -0
- package/dist/v3/ConsoleList/index.vue +139 -0
- package/dist/v3/ConsoleList/staticTips.ts +1145 -0
- package/dist/v3/DevTool/index.vue +217 -0
- package/dist/v3/DevToolButton/index.vue +210 -0
- package/dist/v3/DevToolTitle/index.vue +21 -0
- package/dist/v3/DevToolWindow/index.vue +1116 -0
- package/dist/v3/DeviceInfo/index.vue +32 -0
- package/dist/v3/Empty/empty.png +0 -0
- package/dist/v3/Empty/index.vue +28 -0
- package/dist/v3/FilterInput/index.vue +87 -0
- package/dist/v3/JsonPretty/components/Brackets/index.vue +23 -0
- package/dist/v3/JsonPretty/components/Carets/index.vue +59 -0
- package/dist/v3/JsonPretty/components/CheckController/index.vue +125 -0
- package/dist/v3/JsonPretty/components/TreeNode/index.vue +349 -0
- package/dist/v3/JsonPretty/hooks/useClipboard.ts +21 -0
- package/dist/v3/JsonPretty/hooks/useError.ts +21 -0
- package/dist/v3/JsonPretty/index.vue +476 -0
- package/dist/v3/JsonPretty/type.ts +125 -0
- package/dist/v3/JsonPretty/utils/index.ts +172 -0
- package/dist/v3/NetworkList/NetworkDetail.vue +194 -0
- package/dist/v3/NetworkList/NetworkItem.vue +120 -0
- package/dist/v3/NetworkList/index.vue +128 -0
- package/dist/v3/PiniaList/index.vue +64 -0
- package/dist/v3/RouteList/index.vue +121 -0
- package/dist/v3/RunJS/index.vue +128 -0
- package/dist/v3/SettingList/index.vue +313 -0
- package/dist/v3/SourceCode/index.vue +231 -0
- package/dist/v3/StorageList/index.vue +170 -0
- package/dist/v3/SystemInfo/index.vue +34 -0
- package/dist/v3/Tabs/index.vue +123 -0
- package/dist/v3/Tag/index.vue +89 -0
- package/dist/v3/UniEvent/UniEventItem.vue +126 -0
- package/dist/v3/UniEvent/index.vue +98 -0
- package/dist/v3/UploadList/UploadDetail.vue +192 -0
- package/dist/v3/UploadList/UploadItem.vue +117 -0
- package/dist/v3/UploadList/index.vue +117 -0
- package/dist/v3/VirtualList/index.vue +112 -0
- package/dist/v3/VirtualListPro/AutoSize.vue +43 -0
- package/dist/v3/VirtualListPro/index.vue +238 -0
- package/dist/v3/VirtualListPro/readme.md +40 -0
- package/dist/v3/VuexList/index.vue +54 -0
- package/dist/v3/WebSocket/WebSocketItem.vue +103 -0
- package/dist/v3/WebSocket/WebSocketList.vue +161 -0
- package/dist/v3/WebSocket/index.vue +124 -0
- package/dist/v3/WindowInfo/index.vue +33 -0
- package/package.json +1 -1
|
@@ -0,0 +1,121 @@
|
|
|
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
|
|
15
|
+
:data="routeList"
|
|
16
|
+
:pageSize="15"
|
|
17
|
+
:height="height"
|
|
18
|
+
className="route-list"
|
|
19
|
+
>
|
|
20
|
+
<template v-slot="{ list, start }">
|
|
21
|
+
<AutoSize
|
|
22
|
+
v-for="(item, index) in list"
|
|
23
|
+
:index="start + index"
|
|
24
|
+
:key="start + index"
|
|
25
|
+
>
|
|
26
|
+
<view class="route-item">
|
|
27
|
+
<view class="route-item-name">
|
|
28
|
+
<view v-html="item.name" />
|
|
29
|
+
<Tag v-if="item.type" mode="info">{{ item.type }}</Tag>
|
|
30
|
+
<Tag mode="warn" v-if="item.index === 4 || item.index === 3">
|
|
31
|
+
当前页
|
|
32
|
+
</Tag>
|
|
33
|
+
<Tag mode="primary" v-if="item.index === 4 || item.index === 2">
|
|
34
|
+
启动页
|
|
35
|
+
</Tag>
|
|
36
|
+
</view>
|
|
37
|
+
<view class="route-item-path">
|
|
38
|
+
<view v-html="item.path" />
|
|
39
|
+
<Tag mode="main" @click="onGoTo(item)">跳转</Tag>
|
|
40
|
+
</view>
|
|
41
|
+
</view>
|
|
42
|
+
</AutoSize>
|
|
43
|
+
<Empty v-if="!routeList || routeList.length === 0" />
|
|
44
|
+
</template>
|
|
45
|
+
</VirtualListPro>
|
|
46
|
+
</view>
|
|
47
|
+
</template>
|
|
48
|
+
<script lang="ts" setup>
|
|
49
|
+
import Tag from '../Tag/index.vue';
|
|
50
|
+
import Empty from '../Empty/index.vue';
|
|
51
|
+
import FilterInput from '../FilterInput/index.vue';
|
|
52
|
+
import type { DevTool } from '../../type';
|
|
53
|
+
import VirtualListPro from '../VirtualListPro/index.vue';
|
|
54
|
+
import AutoSize from '../VirtualListPro/AutoSize.vue';
|
|
55
|
+
import { onMounted, ref } from 'vue';
|
|
56
|
+
|
|
57
|
+
defineProps<{ routeList: DevTool.Page[]; modelValue?: string }>();
|
|
58
|
+
const emit = defineEmits<{
|
|
59
|
+
(e: 'goTo', params: DevTool.Page): void;
|
|
60
|
+
(e: 'search', value: string): void;
|
|
61
|
+
(e: 'update:modelValue', value: string): void;
|
|
62
|
+
(e: 'routeRefresh'): void;
|
|
63
|
+
}>();
|
|
64
|
+
|
|
65
|
+
function onGoTo(page: DevTool.Page) {
|
|
66
|
+
emit('goTo', page);
|
|
67
|
+
}
|
|
68
|
+
function onRefresh() {
|
|
69
|
+
emit('routeRefresh');
|
|
70
|
+
}
|
|
71
|
+
const height = ref(0);
|
|
72
|
+
onMounted(() => {
|
|
73
|
+
const { windowHeight } = uni.getWindowInfo();
|
|
74
|
+
height.value = windowHeight - 32 - 32;
|
|
75
|
+
});
|
|
76
|
+
</script>
|
|
77
|
+
<style scoped>
|
|
78
|
+
.route-content {
|
|
79
|
+
height: 100%;
|
|
80
|
+
|
|
81
|
+
font-size: var(--dev-tool-base-font-size);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.route-control {
|
|
85
|
+
display: flex;
|
|
86
|
+
align-items: center;
|
|
87
|
+
justify-content: flex-end;
|
|
88
|
+
gap: 8px;
|
|
89
|
+
padding: 0 16px;
|
|
90
|
+
height: 32px;
|
|
91
|
+
border-bottom: 1px solid var(--dev-tool-border-color);
|
|
92
|
+
box-sizing: border-box;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.route-list {
|
|
96
|
+
height: calc(100% - 32px);
|
|
97
|
+
overflow: auto;
|
|
98
|
+
}
|
|
99
|
+
.route-content .route-item {
|
|
100
|
+
padding: 16px;
|
|
101
|
+
border-bottom: 1px solid var(--dev-tool-border-color);
|
|
102
|
+
}
|
|
103
|
+
.route-content .route-item .route-item-name {
|
|
104
|
+
display: flex;
|
|
105
|
+
align-items: center;
|
|
106
|
+
margin-bottom: 8px;
|
|
107
|
+
gap: 12px;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.route-content .route-item .route-item-path {
|
|
111
|
+
display: flex;
|
|
112
|
+
align-items: center;
|
|
113
|
+
justify-content: space-between;
|
|
114
|
+
word-break: break-all;
|
|
115
|
+
}
|
|
116
|
+
/* #ifdef APP-PLUS */
|
|
117
|
+
.route-content .route-item .route-item-path :deep(.tag) {
|
|
118
|
+
margin-left: 16px;
|
|
119
|
+
}
|
|
120
|
+
/* #endif */
|
|
121
|
+
</style>
|
|
@@ -0,0 +1,128 @@
|
|
|
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>
|
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view class="setting-content">
|
|
3
|
+
<view class="setting-item">
|
|
4
|
+
<DevToolTitle>DevTool(v0.0.12-vue3)</DevToolTitle>
|
|
5
|
+
<view class="setting-item-content">
|
|
6
|
+
<view class="setting-row">
|
|
7
|
+
<view>显示调试按钮:</view>
|
|
8
|
+
<checkbox
|
|
9
|
+
:checked="devToolVisible"
|
|
10
|
+
color="#9254de"
|
|
11
|
+
style="transform: scale(0.8)"
|
|
12
|
+
@click="onChangeShowDevButton"
|
|
13
|
+
/>
|
|
14
|
+
</view>
|
|
15
|
+
<view class="setting-tips"> 取消后将不在展示调试按钮 </view>
|
|
16
|
+
<view class="setting-row">
|
|
17
|
+
<view>重启调试器:</view>
|
|
18
|
+
</view>
|
|
19
|
+
|
|
20
|
+
<view class="setting-tips">点击后将会重启调试器</view>
|
|
21
|
+
<button class="setting-button" @click="onRestartDevTool(true)">
|
|
22
|
+
重启调试器
|
|
23
|
+
</button>
|
|
24
|
+
|
|
25
|
+
<view class="setting-row">
|
|
26
|
+
<view>销毁调试器:</view>
|
|
27
|
+
</view>
|
|
28
|
+
|
|
29
|
+
<view class="setting-tips">
|
|
30
|
+
点击后将会销毁调试器,销毁后不再接收调试信息,需要通过 createDevTool()
|
|
31
|
+
重新创建
|
|
32
|
+
</view>
|
|
33
|
+
<button class="setting-button" @click="onDestructionDevTool">
|
|
34
|
+
销毁调试器
|
|
35
|
+
</button>
|
|
36
|
+
|
|
37
|
+
<view class="setting-row">
|
|
38
|
+
<view>重启APP:</view>
|
|
39
|
+
</view>
|
|
40
|
+
<view class="setting-tips">点击后将会重启APP</view>
|
|
41
|
+
<button class="setting-button" @click="onRestartApp(true)">
|
|
42
|
+
重启APP
|
|
43
|
+
</button>
|
|
44
|
+
<view class="setting-row">
|
|
45
|
+
<view>占用存储空间:{{ sizeFormat }}</view>
|
|
46
|
+
</view>
|
|
47
|
+
<view class="setting-tips">
|
|
48
|
+
当前所有信息占用的存储空间,只会清除 Console, Network, Upload,
|
|
49
|
+
Websocket, UniEvent
|
|
50
|
+
</view>
|
|
51
|
+
<button class="setting-button" @click="onClearCache">清除缓存</button>
|
|
52
|
+
</view>
|
|
53
|
+
</view>
|
|
54
|
+
<view class="setting-item">
|
|
55
|
+
<DevToolTitle>主题</DevToolTitle>
|
|
56
|
+
<view class="setting-item-content">
|
|
57
|
+
<view class="setting-theme">
|
|
58
|
+
<view
|
|
59
|
+
class="setting-item-theme setting-theme-light"
|
|
60
|
+
:class="{
|
|
61
|
+
'setting-theme-active': theme === 'light',
|
|
62
|
+
}"
|
|
63
|
+
@click="emit('changeTheme', 'light')"
|
|
64
|
+
></view>
|
|
65
|
+
<view
|
|
66
|
+
class="setting-item-theme setting-theme-dark"
|
|
67
|
+
:class="{
|
|
68
|
+
'setting-theme-active': theme === 'dart',
|
|
69
|
+
}"
|
|
70
|
+
@click="emit('changeTheme', 'dart')"
|
|
71
|
+
></view>
|
|
72
|
+
</view>
|
|
73
|
+
</view>
|
|
74
|
+
</view>
|
|
75
|
+
<view class="setting-item">
|
|
76
|
+
<DevToolTitle>Log</DevToolTitle>
|
|
77
|
+
<view class="setting-item-content">
|
|
78
|
+
<view class="setting-row">
|
|
79
|
+
<view>导出当前日志信息:</view>
|
|
80
|
+
<checkbox
|
|
81
|
+
:checked="setting.exportLog"
|
|
82
|
+
color="#9254de"
|
|
83
|
+
style="transform: scale(0.8)"
|
|
84
|
+
@click="setting.exportLog = !setting.exportLog"
|
|
85
|
+
/>
|
|
86
|
+
</view>
|
|
87
|
+
<view class="setting-tips">勾选后将会导出当前的Log</view>
|
|
88
|
+
<view class="setting-row">
|
|
89
|
+
<view>导出当前网络信息:</view>
|
|
90
|
+
<checkbox
|
|
91
|
+
:checked="setting.exportNetwork"
|
|
92
|
+
color="#9254de"
|
|
93
|
+
style="transform: scale(0.8)"
|
|
94
|
+
@click="setting.exportNetwork = !setting.exportNetwork"
|
|
95
|
+
/>
|
|
96
|
+
</view>
|
|
97
|
+
<view class="setting-tips">勾选后将会导出当前的Network</view>
|
|
98
|
+
<view class="setting-row">
|
|
99
|
+
<view>导出当前上传信息:</view>
|
|
100
|
+
<checkbox
|
|
101
|
+
:checked="setting.exportUpload"
|
|
102
|
+
color="#9254de"
|
|
103
|
+
style="transform: scale(0.8)"
|
|
104
|
+
@click="setting.exportUpload = !setting.exportUpload"
|
|
105
|
+
/>
|
|
106
|
+
</view>
|
|
107
|
+
<view class="setting-tips">勾选后将会导出当前的Upload</view>
|
|
108
|
+
<view class="setting-row">
|
|
109
|
+
<view>导出当前套接字信息:</view>
|
|
110
|
+
<checkbox
|
|
111
|
+
:checked="setting.exportWebsocket"
|
|
112
|
+
color="#9254de"
|
|
113
|
+
style="transform: scale(0.8)"
|
|
114
|
+
@click="setting.exportWebsocket = !setting.exportWebsocket"
|
|
115
|
+
/>
|
|
116
|
+
</view>
|
|
117
|
+
<view class="setting-tips">勾选后将会导出当前的Websocket</view>
|
|
118
|
+
<view class="setting-row">
|
|
119
|
+
<view>导出当前缓存信息:</view>
|
|
120
|
+
<checkbox
|
|
121
|
+
:checked="setting.exportStorage"
|
|
122
|
+
color="#9254de"
|
|
123
|
+
style="transform: scale(0.8)"
|
|
124
|
+
@click="setting.exportStorage = !setting.exportStorage"
|
|
125
|
+
/>
|
|
126
|
+
</view>
|
|
127
|
+
<view class="setting-tips">
|
|
128
|
+
勾选后将会导出当前的Storage, Vuex, Pinia
|
|
129
|
+
</view>
|
|
130
|
+
<view class="setting-row">
|
|
131
|
+
<view>导出当前窗口信息:</view>
|
|
132
|
+
<checkbox
|
|
133
|
+
:checked="setting.exportWindow"
|
|
134
|
+
color="#9254de"
|
|
135
|
+
style="transform: scale(0.8)"
|
|
136
|
+
@click="setting.exportWindow = !setting.exportWindow"
|
|
137
|
+
/>
|
|
138
|
+
</view>
|
|
139
|
+
<view class="setting-tips">勾选后将会导出当前的Window</view>
|
|
140
|
+
|
|
141
|
+
<view class="setting-row">
|
|
142
|
+
<view>导出当前设备信息:</view>
|
|
143
|
+
<checkbox
|
|
144
|
+
:checked="setting.exportDevice"
|
|
145
|
+
color="#9254de"
|
|
146
|
+
style="transform: scale(0.8)"
|
|
147
|
+
@click="setting.exportDevice = !setting.exportDevice"
|
|
148
|
+
/>
|
|
149
|
+
</view>
|
|
150
|
+
<view class="setting-tips">勾选后将会导出当前的Device</view>
|
|
151
|
+
|
|
152
|
+
<view class="setting-row">
|
|
153
|
+
<view>导出当前系统信息:</view>
|
|
154
|
+
<checkbox
|
|
155
|
+
:checked="setting.exportSystem"
|
|
156
|
+
color="#9254de"
|
|
157
|
+
style="transform: scale(0.8)"
|
|
158
|
+
@click="setting.exportSystem = !setting.exportSystem"
|
|
159
|
+
/>
|
|
160
|
+
</view>
|
|
161
|
+
<view class="setting-tips">勾选后将会导出当前的System</view>
|
|
162
|
+
|
|
163
|
+
<button class="setting-button" @click="onExportLog">导出</button>
|
|
164
|
+
</view>
|
|
165
|
+
</view>
|
|
166
|
+
</view>
|
|
167
|
+
</template>
|
|
168
|
+
<script lang="ts" setup>
|
|
169
|
+
import { reactive } from 'vue';
|
|
170
|
+
import DevToolTitle from '../DevToolTitle/index.vue';
|
|
171
|
+
defineProps<{
|
|
172
|
+
devToolVisible?: boolean;
|
|
173
|
+
sizeFormat?: string;
|
|
174
|
+
theme?: string;
|
|
175
|
+
}>();
|
|
176
|
+
const setting = reactive({
|
|
177
|
+
restartDevTool: false,
|
|
178
|
+
restartApp: false,
|
|
179
|
+
exportLog: false,
|
|
180
|
+
exportNetwork: false,
|
|
181
|
+
exportUpload: false,
|
|
182
|
+
exportStorage: false,
|
|
183
|
+
exportWebsocket: false,
|
|
184
|
+
exportWindow: false,
|
|
185
|
+
exportDevice: false,
|
|
186
|
+
exportSystem: false,
|
|
187
|
+
});
|
|
188
|
+
const emit = defineEmits<{
|
|
189
|
+
(e: 'showDevButton', show: boolean): void;
|
|
190
|
+
(e: 'restartDevTool', restart?: boolean): void;
|
|
191
|
+
(e: 'restartApp', restart?: boolean): void;
|
|
192
|
+
(
|
|
193
|
+
e: 'exportLog',
|
|
194
|
+
params: {
|
|
195
|
+
exportLog: boolean;
|
|
196
|
+
exportNetwork: boolean;
|
|
197
|
+
exportStorage: boolean;
|
|
198
|
+
exportWebsocket: boolean;
|
|
199
|
+
exportUpload: boolean;
|
|
200
|
+
exportWindow: boolean;
|
|
201
|
+
exportDevice: boolean;
|
|
202
|
+
exportSystem: boolean;
|
|
203
|
+
},
|
|
204
|
+
): void;
|
|
205
|
+
(e: 'screenshot'): void;
|
|
206
|
+
(e: 'clearCache'): void;
|
|
207
|
+
(e: 'destroyDevTool'): void;
|
|
208
|
+
(e: 'changeTheme', value: string): void;
|
|
209
|
+
}>();
|
|
210
|
+
|
|
211
|
+
function onChangeShowDevButton(show: boolean) {
|
|
212
|
+
emit('showDevButton', show);
|
|
213
|
+
}
|
|
214
|
+
function onRestartDevTool(restart: boolean) {
|
|
215
|
+
restart && emit('restartDevTool');
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
function onDestructionDevTool() {
|
|
219
|
+
emit('destroyDevTool');
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
function onRestartApp(restart: boolean) {
|
|
223
|
+
restart && emit('restartApp');
|
|
224
|
+
}
|
|
225
|
+
function onExportLog() {
|
|
226
|
+
if (setting.exportLog || setting.exportNetwork || setting.exportStorage) {
|
|
227
|
+
emit('exportLog', {
|
|
228
|
+
exportLog: setting.exportLog,
|
|
229
|
+
exportNetwork: setting.exportNetwork,
|
|
230
|
+
exportStorage: setting.exportStorage,
|
|
231
|
+
exportWebsocket: setting.exportWebsocket,
|
|
232
|
+
exportUpload: setting.exportUpload,
|
|
233
|
+
exportWindow: setting.exportWindow,
|
|
234
|
+
exportDevice: setting.exportDevice,
|
|
235
|
+
exportSystem: setting.exportSystem,
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
function onScreenshot() {
|
|
240
|
+
emit('screenshot');
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
function onClearCache() {
|
|
244
|
+
emit('clearCache');
|
|
245
|
+
}
|
|
246
|
+
</script>
|
|
247
|
+
<style scoped>
|
|
248
|
+
.setting-content {
|
|
249
|
+
height: 100%;
|
|
250
|
+
overflow: auto;
|
|
251
|
+
font-size: var(--dev-tool-base-font-size);
|
|
252
|
+
}
|
|
253
|
+
.setting-item {
|
|
254
|
+
padding: 16px 16px 0 16px;
|
|
255
|
+
box-sizing: border-box;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
.setting-row {
|
|
259
|
+
display: flex;
|
|
260
|
+
align-items: center;
|
|
261
|
+
justify-content: space-between;
|
|
262
|
+
margin: 8px 0;
|
|
263
|
+
min-height: 18px;
|
|
264
|
+
}
|
|
265
|
+
.setting-tips {
|
|
266
|
+
color: #616161;
|
|
267
|
+
font-size: var(--dev-tool-tips-font-size);
|
|
268
|
+
margin-bottom: 8px;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
.setting-button {
|
|
272
|
+
display: flex;
|
|
273
|
+
align-items: center;
|
|
274
|
+
justify-content: center;
|
|
275
|
+
width: 100%;
|
|
276
|
+
height: 32px;
|
|
277
|
+
border-radius: 4px;
|
|
278
|
+
color: #fff;
|
|
279
|
+
outline: none;
|
|
280
|
+
border: 1px solid transparent;
|
|
281
|
+
background-color: var(--dev-tool-main-color);
|
|
282
|
+
transform: all 0.3s;
|
|
283
|
+
font-size: var(--dev-tool-base-font-size);
|
|
284
|
+
padding: 0;
|
|
285
|
+
cursor: pointer;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
.setting-theme {
|
|
289
|
+
display: flex;
|
|
290
|
+
align-items: center;
|
|
291
|
+
gap: 16px;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
.setting-item-theme {
|
|
295
|
+
margin-top: 16px;
|
|
296
|
+
width: 30px;
|
|
297
|
+
height: 30px;
|
|
298
|
+
|
|
299
|
+
border-radius: 4px;
|
|
300
|
+
border: 1px solid #fff;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
.setting-theme-light {
|
|
304
|
+
background-color: #fff;
|
|
305
|
+
}
|
|
306
|
+
.setting-theme-dark {
|
|
307
|
+
background-color: rgba(0, 0, 0, 0.8);
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
.setting-theme-active {
|
|
311
|
+
border: 1px solid var(--dev-tool-main-color);
|
|
312
|
+
}
|
|
313
|
+
</style>
|