vite-uni-dev-tool 0.0.48 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -0
- package/dist/const.cjs +1 -0
- package/dist/const.d.ts +78 -161
- package/dist/const.d.ts.map +1 -1
- package/dist/const.js +1 -47
- package/dist/core-shared.d.ts +44 -0
- package/dist/core-shared.d.ts.map +1 -0
- package/dist/core-shared.js +1 -0
- package/dist/core.d.ts +2 -40
- package/dist/core.d.ts.map +1 -1
- package/dist/core.js +4 -159
- package/dist/i18n/index.cjs +1 -0
- package/dist/i18n/index.d.ts +9 -0
- package/dist/i18n/index.d.ts.map +1 -0
- package/dist/i18n/index.js +1 -0
- package/dist/i18n/instance.cjs +1 -0
- package/dist/i18n/instance.d.ts +15 -0
- package/dist/i18n/instance.d.ts.map +1 -0
- package/dist/i18n/instance.js +1 -0
- package/dist/i18n/locales/en.cjs +1 -0
- package/dist/i18n/locales/en.d.ts +470 -0
- package/dist/i18n/locales/en.d.ts.map +1 -0
- package/dist/i18n/locales/en.js +1 -0
- package/dist/i18n/locales/zh-Hans.cjs +1 -0
- package/dist/i18n/locales/zh-Hans.d.ts +476 -0
- package/dist/i18n/locales/zh-Hans.d.ts.map +1 -0
- package/dist/i18n/locales/zh-Hans.js +1 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/modules/devConsole/index.cjs +4 -0
- package/dist/{devConsole → modules/devConsole}/index.d.ts +1 -1
- package/dist/modules/devConsole/index.d.ts.map +1 -0
- package/dist/modules/devConsole/index.js +4 -0
- package/dist/modules/devEvent/index.cjs +5 -0
- package/dist/modules/devEvent/index.d.ts +115 -0
- package/dist/modules/devEvent/index.d.ts.map +1 -0
- package/dist/modules/devEvent/index.js +5 -0
- package/dist/modules/devIntercept/index.cjs +13 -0
- package/dist/modules/devIntercept/index.d.ts +71 -0
- package/dist/modules/devIntercept/index.d.ts.map +1 -0
- package/dist/modules/devIntercept/index.js +13 -0
- package/dist/modules/devStore/index.cjs +1 -0
- package/dist/modules/devStore/index.d.ts +159 -0
- package/dist/modules/devStore/index.d.ts.map +1 -0
- package/dist/modules/devStore/index.js +1 -0
- package/dist/modules/devToolInfo/index.cjs +1 -0
- package/dist/modules/devToolInfo/index.d.ts +27 -0
- package/dist/modules/devToolInfo/index.d.ts.map +1 -0
- package/dist/modules/devToolInfo/index.js +1 -0
- package/dist/plugins/uniDevTool/transform/transformApp.cjs +44 -0
- package/dist/plugins/uniDevTool/transform/transformApp.d.ts.map +1 -1
- package/dist/plugins/uniDevTool/transform/transformApp.js +17 -17
- package/dist/plugins/uniDevTool/transform/transformMain.cjs +3 -0
- package/dist/plugins/uniDevTool/transform/transformMain.d.ts.map +1 -1
- package/dist/plugins/uniDevTool/transform/transformMain.js +3 -3
- package/dist/plugins/uniDevTool/transform/transformVue.cjs +41 -0
- package/dist/plugins/uniDevTool/transform/transformVue.d.ts +1 -2
- package/dist/plugins/uniDevTool/transform/transformVue.d.ts.map +1 -1
- package/dist/plugins/uniDevTool/transform/transformVue.js +32 -19
- package/dist/plugins/uniDevTool/uniDevTool.cjs +5 -0
- package/dist/plugins/uniDevTool/uniDevTool.d.ts +3 -11
- package/dist/plugins/uniDevTool/uniDevTool.d.ts.map +1 -1
- package/dist/plugins/uniDevTool/uniDevTool.js +3 -3
- package/dist/plugins/uniGlobalComponents/uniGlobalComponents.cjs +19 -0
- package/dist/plugins/uniGlobalComponents/uniGlobalComponents.d.ts.map +1 -1
- package/dist/plugins/uniGlobalComponents/uniGlobalComponents.js +11 -19
- package/dist/plugins/uniParseStock/index.d.ts +10 -0
- package/dist/plugins/uniParseStock/index.d.ts.map +1 -0
- package/dist/plugins/utils/index.cjs +2 -0
- package/dist/plugins/utils/index.d.ts +1 -3
- package/dist/plugins/utils/index.d.ts.map +1 -1
- package/dist/plugins/utils/index.js +2 -2
- package/dist/shims-uni.d.ts +140 -0
- package/dist/type.d.ts +174 -16
- package/dist/type.d.ts.map +1 -1
- package/dist/utils/array.cjs +1 -0
- package/dist/utils/array.d.ts.map +1 -1
- package/dist/utils/array.js +1 -12
- package/dist/utils/date.cjs +1 -0
- package/dist/utils/date.d.ts.map +1 -1
- package/dist/utils/date.js +1 -59
- package/dist/utils/file.cjs +1 -0
- package/dist/utils/file.d.ts.map +1 -1
- package/dist/utils/file.js +1 -85
- package/dist/utils/function.cjs +1 -0
- package/dist/utils/function.d.ts +13 -0
- package/dist/utils/function.d.ts.map +1 -1
- package/dist/utils/function.js +1 -68
- package/dist/utils/index.cjs +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -63
- package/dist/utils/ip.cjs +1 -0
- package/dist/utils/ip.d.ts +1 -1
- package/dist/utils/ip.d.ts.map +1 -1
- package/dist/utils/ip.js +1 -45
- package/dist/utils/language.cjs +1 -0
- package/dist/utils/language.d.ts +2 -1
- package/dist/utils/language.d.ts.map +1 -1
- package/dist/utils/language.js +1 -63
- package/dist/utils/object.cjs +1 -0
- package/dist/utils/object.d.ts +4 -5
- package/dist/utils/object.d.ts.map +1 -1
- package/dist/utils/object.js +1 -136
- package/dist/utils/openLink.cjs +1 -0
- package/dist/utils/openLink.d.ts.map +1 -1
- package/dist/utils/openLink.js +1 -28
- package/dist/utils/page.cjs +1 -0
- package/dist/utils/page.d.ts.map +1 -1
- package/dist/utils/page.js +1 -7
- package/dist/utils/platform.cjs +1 -0
- package/dist/utils/platform.d.ts.map +1 -1
- package/dist/utils/platform.js +1 -17
- package/dist/utils/string.cjs +1 -0
- package/dist/utils/string.d.ts.map +1 -1
- package/dist/utils/string.js +1 -114
- package/dist/utils/utils.cjs +1 -0
- package/dist/utils/utils.d.ts +1 -1
- package/dist/utils/utils.d.ts.map +1 -1
- package/dist/utils/utils.js +1 -126
- package/dist/v3/AppTransition/index.vue +170 -0
- package/dist/v3/AutoSizer/index.vue +4 -5
- package/dist/v3/AutoSizer/index1.vue +4 -6
- package/dist/v3/AutoSizer/utils.ts +1 -1
- package/dist/v3/CaptureScreen/index.vue +19 -8
- package/dist/v3/CircularButton/index.vue +64 -13
- package/dist/v3/ConsoleList/ConsoleItem.vue +56 -5
- package/dist/v3/ConsoleList/RunJSInput.vue +10 -6
- package/dist/v3/ConsoleList/index.vue +51 -35
- package/dist/v3/CustomSwiper/CustomSwiperItem.vue +49 -0
- package/dist/v3/CustomSwiper/index.vue +104 -0
- package/dist/v3/DevTool/fps-collector.render.ts +148 -0
- package/dist/v3/DevTool/index.vue +209 -102
- package/dist/v3/DevToolButton/index.vue +40 -59
- package/dist/v3/DevToolTitle/index.vue +4 -1
- package/dist/v3/DevToolWindow/DevToolOverlay.vue +182 -0
- package/dist/v3/DevToolWindow/const.ts +47 -69
- package/dist/v3/DevToolWindow/hooks/dataUtils.ts +48 -0
- package/dist/v3/DevToolWindow/hooks/useDevToolData.ts +338 -0
- package/dist/v3/DevToolWindow/hooks/useDevToolHandlers.ts +549 -0
- package/dist/v3/DevToolWindow/hooks/useDevToolOverlay.ts +184 -0
- package/dist/v3/DevToolWindow/index.css +89 -0
- package/dist/v3/DevToolWindow/index.vue +800 -1450
- package/dist/v3/DraggableContainer/index.vue +456 -0
- package/dist/v3/ElEvent/ElEventItem.vue +4 -3
- package/dist/v3/ElEvent/index.vue +26 -9
- package/dist/v3/Empty/index.vue +1 -0
- package/dist/v3/FilterInput/index.vue +8 -22
- package/dist/v3/FilterSelect/index.vue +37 -24
- package/dist/v3/Instance/components/InstanceTreeNode.vue +265 -0
- package/dist/v3/Instance/flatten.ts +226 -0
- package/dist/v3/Instance/index.vue +94 -0
- package/dist/v3/Instance/registry.ts +49 -0
- package/dist/v3/Instance/transformTree.ts +375 -0
- package/dist/v3/Instance/transformTreeCtx.ts +268 -0
- package/dist/v3/{InstanceTree → Instance}/typing.d.ts +15 -2
- package/dist/v3/InstanceDetail/index.vue +433 -44
- package/dist/v3/JsonDetail/index.vue +12 -8
- package/dist/v3/JsonPretty/components/Brackets/index.vue +1 -0
- package/dist/v3/JsonPretty/components/Carets/index.vue +2 -1
- package/dist/v3/JsonPretty/components/CheckController/index.vue +26 -15
- package/dist/v3/JsonPretty/components/TreeNode/index.vue +42 -20
- package/dist/v3/JsonPretty/index.vue +60 -37
- package/dist/v3/JsonPretty/utils/index.ts +41 -44
- package/dist/v3/MovableContainer/index.vue +89 -0
- package/dist/v3/NFCList/NFCItem.vue +14 -14
- package/dist/v3/NFCList/NFCTool.vue +99 -81
- package/dist/v3/NFCList/index.vue +14 -10
- package/dist/v3/NetworkList/InterceptConfig.vue +154 -364
- package/dist/v3/NetworkList/InterceptItem.vue +14 -6
- package/dist/v3/NetworkList/NetworkDetail.vue +34 -29
- package/dist/v3/NetworkList/NetworkIntercept.vue +11 -8
- package/dist/v3/NetworkList/NetworkItem.vue +27 -11
- package/dist/v3/NetworkList/NetworkSend.vue +132 -290
- package/dist/v3/NetworkList/hooks/useNetworkForm.ts +86 -0
- package/dist/v3/NetworkList/index.vue +32 -24
- package/dist/v3/NetworkList/utils.ts +101 -0
- package/dist/v3/Performance/index.vue +495 -0
- package/dist/v3/Performance/modules/PerformanceMetrics.vue +153 -0
- package/dist/v3/Performance/modules/PerformanceWidget.vue +249 -0
- package/dist/v3/Performance/modules/usePerformanceChart.ts +460 -0
- package/dist/v3/Performance/modules/usePerformanceData.ts +258 -0
- package/dist/v3/Pick/index.vue +322 -0
- package/dist/v3/PiniaList/index.vue +38 -17
- package/dist/v3/RouteList/index.vue +32 -15
- package/dist/v3/RunJS/index.vue +30 -10
- package/dist/v3/ScanCodeList/ScanCodeItem.vue +2 -9
- package/dist/v3/ScanCodeList/index.vue +12 -9
- package/dist/v3/SettingButton/index.vue +45 -0
- package/dist/v3/SettingList/index.css +120 -0
- package/dist/v3/SettingList/index.vue +96 -537
- package/dist/v3/SettingList/modules/SettingDevTool.vue +208 -0
- package/dist/v3/SettingList/modules/SettingInfo.vue +119 -0
- package/dist/v3/SettingList/modules/SettingLanguage.vue +74 -0
- package/dist/v3/SettingList/modules/SettingLog.vue +230 -0
- package/dist/v3/SettingList/modules/SettingNetwork.vue +120 -0
- package/dist/v3/SettingList/modules/SettingTheme.vue +312 -0
- package/dist/v3/SourceCode/Line.vue +15 -2
- package/dist/v3/SourceCode/index.vue +25 -24
- package/dist/v3/SourceCode/parseCode.ts +114 -56
- package/dist/v3/StorageList/index.vue +33 -33
- package/dist/v3/Tabs/index.vue +31 -28
- package/dist/v3/Tag/index.vue +39 -20
- package/dist/v3/TransferList/TransferDetail.vue +268 -0
- package/dist/v3/TransferList/TransferItem.vue +125 -0
- package/dist/v3/TransferList/index.vue +181 -0
- package/dist/v3/UniEvent/UniEventItem.vue +1 -0
- package/dist/v3/UniEvent/index.vue +28 -29
- package/dist/v3/{VirtualListPro → VirtualList}/AutoSize.vue +1 -1
- package/dist/v3/VirtualList/index.vue +382 -82
- package/dist/v3/VuexList/index.vue +38 -17
- package/dist/v3/WebSocket/WebSocketDetail.vue +142 -80
- package/dist/v3/WebSocket/WebSocketItem.vue +10 -4
- package/dist/v3/WebSocket/index.vue +44 -30
- package/dist/v3/hooks/useNFC/index.ts +6 -6
- package/dist/v3/hooks/useNFC/typing.d.ts +2 -2
- package/dist/v3/hooks/useNFC/useNFCAndroid.ts +215 -626
- package/dist/v3/hooks/useNFC/useNFCMpWeiXin.ts +54 -85
- package/dist/v3/hooks/useNFC/utils.ts +3 -3
- package/dist/v3/hooks/useRequest/index.ts +2 -2
- package/dist/v3/hooks/useScanCode/index.ts +10 -8
- package/dist/v3/styles/theme.css +290 -0
- package/dist/v3/styles/theme.ts +12 -0
- package/package.json +25 -5
- package/dist/devConsole/index.d.ts.map +0 -1
- package/dist/devConsole/index.js +0 -273
- package/dist/devEvent/index.d.ts +0 -328
- package/dist/devEvent/index.d.ts.map +0 -1
- package/dist/devEvent/index.js +0 -697
- package/dist/devEventBus/index.d.ts +0 -42
- package/dist/devEventBus/index.d.ts.map +0 -1
- package/dist/devEventBus/index.js +0 -70
- package/dist/devIntercept/index.d.ts +0 -281
- package/dist/devIntercept/index.d.ts.map +0 -1
- package/dist/devIntercept/index.js +0 -949
- package/dist/devRunJS/index.d.ts +0 -67
- package/dist/devRunJS/index.d.ts.map +0 -1
- package/dist/devStore/index.d.ts +0 -199
- package/dist/devStore/index.d.ts.map +0 -1
- package/dist/devStore/index.js +0 -562
- package/dist/devToolInfo/index.d.ts +0 -17
- package/dist/devToolInfo/index.d.ts.map +0 -1
- package/dist/devToolInfo/index.js +0 -15
- package/dist/v3/AutoSizer/utils.d.ts +0 -5
- package/dist/v3/AutoSizer/utils.d.ts.map +0 -1
- package/dist/v3/ConsoleList/staticTips.d.ts +0 -13
- package/dist/v3/ConsoleList/staticTips.d.ts.map +0 -1
- package/dist/v3/DevToolWindow/const.d.ts +0 -46
- package/dist/v3/DevToolWindow/const.d.ts.map +0 -1
- package/dist/v3/InstanceTree/components/InstanceTreeNode.vue +0 -81
- package/dist/v3/InstanceTree/flatten.d.ts +0 -10
- package/dist/v3/InstanceTree/flatten.d.ts.map +0 -1
- package/dist/v3/InstanceTree/flatten.ts +0 -75
- package/dist/v3/InstanceTree/index.vue +0 -51
- package/dist/v3/InstanceTree/transformTree.d.ts +0 -17
- package/dist/v3/InstanceTree/transformTree.d.ts.map +0 -1
- package/dist/v3/InstanceTree/transformTree.ts +0 -237
- package/dist/v3/JsonPretty/hooks/useClipboard.d.ts +0 -4
- package/dist/v3/JsonPretty/hooks/useClipboard.d.ts.map +0 -1
- package/dist/v3/JsonPretty/hooks/useError.d.ts +0 -8
- package/dist/v3/JsonPretty/hooks/useError.d.ts.map +0 -1
- package/dist/v3/JsonPretty/type.d.ts +0 -94
- package/dist/v3/JsonPretty/type.d.ts.map +0 -1
- package/dist/v3/JsonPretty/utils/index.d.ts +0 -10
- package/dist/v3/JsonPretty/utils/index.d.ts.map +0 -1
- package/dist/v3/NFCList/const.d.ts +0 -13
- package/dist/v3/NFCList/const.d.ts.map +0 -1
- package/dist/v3/NetworkList/const.d.ts +0 -5
- package/dist/v3/NetworkList/const.d.ts.map +0 -1
- package/dist/v3/SourceCode/parseCode.d.ts +0 -27
- package/dist/v3/SourceCode/parseCode.d.ts.map +0 -1
- package/dist/v3/UploadList/UploadDetail.vue +0 -255
- package/dist/v3/UploadList/UploadItem.vue +0 -122
- package/dist/v3/UploadList/index.vue +0 -125
- package/dist/v3/VirtualListPro/index.vue +0 -229
- package/dist/v3/hooks/useContainerStyle.d.ts +0 -15
- package/dist/v3/hooks/useContainerStyle.d.ts.map +0 -1
- package/dist/v3/hooks/useNFC/index.d.ts +0 -5
- package/dist/v3/hooks/useNFC/index.d.ts.map +0 -1
- package/dist/v3/hooks/useNFC/useNFCAndroid.d.ts +0 -2
- package/dist/v3/hooks/useNFC/useNFCAndroid.d.ts.map +0 -1
- package/dist/v3/hooks/useNFC/useNFCMpWeiXin.d.ts +0 -2
- package/dist/v3/hooks/useNFC/useNFCMpWeiXin.d.ts.map +0 -1
- package/dist/v3/hooks/useNFC/utils.d.ts +0 -95
- package/dist/v3/hooks/useNFC/utils.d.ts.map +0 -1
- package/dist/v3/hooks/useRequest/index.d.ts +0 -126
- package/dist/v3/hooks/useRequest/index.d.ts.map +0 -1
- package/dist/v3/hooks/useRequest/utils.d.ts +0 -35
- package/dist/v3/hooks/useRequest/utils.d.ts.map +0 -1
- package/dist/v3/hooks/useScanCode/index.d.ts +0 -36
- package/dist/v3/hooks/useScanCode/index.d.ts.map +0 -1
- /package/dist/v3/{VirtualListPro → VirtualList}/readme.md +0 -0
|
@@ -1,25 +1,34 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<view class="vuex-content">
|
|
3
|
-
<
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
3
|
+
<view class="vuex-control">
|
|
4
|
+
<DevToolTitle>{{ t('vuex.title') }}</DevToolTitle>
|
|
5
|
+
</view>
|
|
6
|
+
<view class="vuex-json-wrapper">
|
|
7
|
+
<JsonPretty
|
|
8
|
+
editable
|
|
9
|
+
showLength
|
|
10
|
+
virtual
|
|
11
|
+
v-if="showJson"
|
|
12
|
+
:data="vuexList"
|
|
13
|
+
:theme="theme"
|
|
14
|
+
:height="contentHeight - 32 - 32"
|
|
15
|
+
:nodeSelectable="() => false"
|
|
16
|
+
:pathCollapsible="() => false"
|
|
17
|
+
@update:data="onUpdateData"
|
|
18
|
+
@nodeClick="onNodeClick"
|
|
19
|
+
/>
|
|
20
|
+
<Empty v-else />
|
|
21
|
+
</view>
|
|
17
22
|
</view>
|
|
18
23
|
</template>
|
|
19
24
|
<script lang="ts" setup>
|
|
20
25
|
import { computed } from 'vue';
|
|
21
26
|
import JsonPretty from '../JsonPretty/index.vue';
|
|
22
27
|
import Empty from '../Empty/index.vue';
|
|
28
|
+
import DevToolTitle from '../DevToolTitle/index.vue';
|
|
29
|
+
import { useI18n } from '../../i18n';
|
|
30
|
+
|
|
31
|
+
const { t } = useI18n();
|
|
23
32
|
const props = defineProps<{
|
|
24
33
|
vuexList: Record<string, any>;
|
|
25
34
|
theme?: string;
|
|
@@ -36,7 +45,7 @@ const showJson = computed(() => {
|
|
|
36
45
|
return false;
|
|
37
46
|
}
|
|
38
47
|
return true;
|
|
39
|
-
} catch (
|
|
48
|
+
} catch (_error) {
|
|
40
49
|
return false;
|
|
41
50
|
}
|
|
42
51
|
});
|
|
@@ -54,10 +63,22 @@ function onNodeClick(node: any) {
|
|
|
54
63
|
</script>
|
|
55
64
|
<style scoped>
|
|
56
65
|
.vuex-content {
|
|
57
|
-
padding: 16px;
|
|
58
66
|
font-size: var(--dev-tool-base-font-size);
|
|
59
67
|
height: 100%;
|
|
60
68
|
box-sizing: border-box;
|
|
61
|
-
overflow:
|
|
69
|
+
overflow: hidden;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.vuex-control {
|
|
73
|
+
display: flex;
|
|
74
|
+
align-items: center;
|
|
75
|
+
padding: 0 16px;
|
|
76
|
+
height: 32px;
|
|
77
|
+
border-bottom: 1px solid var(--dev-tool-border-color);
|
|
78
|
+
box-sizing: border-box;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.vuex-json-wrapper {
|
|
82
|
+
padding: 0 16px;
|
|
62
83
|
}
|
|
63
84
|
</style>
|
|
@@ -1,45 +1,48 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<view class="web-socket-list-container" :style="customStyle">
|
|
3
3
|
<view class="web-socket-detail-control">
|
|
4
|
-
<DevToolTitle customStyle="margin-right: 16px">
|
|
4
|
+
<DevToolTitle customStyle="margin-right: 16px">
|
|
5
|
+
{{ t('websocket.detailTitle') }}
|
|
6
|
+
</DevToolTitle>
|
|
5
7
|
<Tag
|
|
6
8
|
mode="info"
|
|
7
|
-
v-for="item in
|
|
9
|
+
v-for="item in translatedSelectItems"
|
|
8
10
|
:active="item.value === currentSelect"
|
|
9
11
|
:key="item.value"
|
|
10
12
|
customStyle="margin-right: 16px"
|
|
11
|
-
@click="onSelect(item)"
|
|
12
|
-
>
|
|
13
|
+
@click="onSelect(item)">
|
|
13
14
|
{{ item.label }}
|
|
14
15
|
</Tag>
|
|
15
16
|
<CircularButton
|
|
16
17
|
style="margin-left: auto"
|
|
17
18
|
customStyle="margin-left: auto"
|
|
18
19
|
text="×"
|
|
19
|
-
@click="onClose"
|
|
20
|
-
/>
|
|
20
|
+
@click="onClose" />
|
|
21
21
|
</view>
|
|
22
22
|
|
|
23
23
|
<view class="web-socket-data" v-if="currentSelect === 'base'">
|
|
24
|
-
<DevToolTitle>
|
|
24
|
+
<DevToolTitle>{{ t('network.general') }}</DevToolTitle>
|
|
25
25
|
<view class="web-socket-detail-item">
|
|
26
|
-
<view
|
|
26
|
+
<view class="web-socket-detail-item-key">
|
|
27
|
+
{{ t('network.requestUrl') }}:
|
|
28
|
+
</view>
|
|
27
29
|
<view>{{ ws?.url }}</view>
|
|
28
30
|
</view>
|
|
29
31
|
|
|
30
32
|
<view class="web-socket-detail-item">
|
|
31
|
-
<view
|
|
33
|
+
<view class="web-socket-detail-item-key">
|
|
34
|
+
{{ t('network.method') }}:
|
|
35
|
+
</view>
|
|
32
36
|
<Tag mode="info">{{ ws?.method }}</Tag>
|
|
33
37
|
</view>
|
|
34
38
|
|
|
35
|
-
<DevToolTitle
|
|
39
|
+
<DevToolTitle>{{ t('network.requestHeaders') }}</DevToolTitle>
|
|
36
40
|
<template v-if="ws?.headers && ws.headers?.length > 0">
|
|
37
41
|
<view
|
|
38
42
|
class="web-socket-detail-item"
|
|
39
43
|
v-for="item in ws.headers"
|
|
40
|
-
:key="item.key"
|
|
41
|
-
|
|
42
|
-
<view class="web-socket-detail-item-key">{{ item.key }}: </view>
|
|
44
|
+
:key="item.key">
|
|
45
|
+
<view class="web-socket-detail-item-key">{{ item.key }}:</view>
|
|
43
46
|
{{ item.value }}
|
|
44
47
|
</view>
|
|
45
48
|
</template>
|
|
@@ -47,87 +50,125 @@
|
|
|
47
50
|
</view>
|
|
48
51
|
<template v-if="currentSelect === 'message'">
|
|
49
52
|
<view class="web-socket-detail-control">
|
|
50
|
-
<DevToolTitle
|
|
53
|
+
<DevToolTitle>{{ t('websocket.messageList') }}</DevToolTitle>
|
|
51
54
|
<Tag
|
|
52
55
|
mode="clear"
|
|
53
56
|
style="margin-left: auto"
|
|
54
57
|
customStyle="margin-left: auto"
|
|
55
|
-
@click="emit('clear', ws!)"
|
|
56
|
-
|
|
57
|
-
清除
|
|
58
|
+
@click="emit('clear', ws!)">
|
|
59
|
+
{{ t('common.clear') }}
|
|
58
60
|
</Tag>
|
|
59
61
|
</view>
|
|
60
62
|
|
|
61
63
|
<view class="web-socket-data-list">
|
|
62
|
-
<
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
:
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
64
|
+
<VirtualList
|
|
65
|
+
v-if="ws?.message && ws.message.length > 0"
|
|
66
|
+
:data="ws.message"
|
|
67
|
+
:itemHeight="32"
|
|
68
|
+
:dataChangeScrollToTop="false"
|
|
69
|
+
:showBackTop="false"
|
|
70
|
+
:scrollIntoView="scrollIntoView"
|
|
71
|
+
:scrollWithAnimation="true">
|
|
72
|
+
<template #default="{ list, onSizeChange, itemsHeight, start }">
|
|
73
|
+
<AutoSize
|
|
74
|
+
v-for="(msg, index) in list as DevTool.Message[]"
|
|
75
|
+
:key="msg.time"
|
|
76
|
+
:index="index + start"
|
|
77
|
+
:itemsHeight="itemsHeight"
|
|
78
|
+
:onSizeChange="onSizeChange">
|
|
79
|
+
<view
|
|
80
|
+
:id="`ws-msg-${index + start}`"
|
|
81
|
+
:class="`web-socket-data-item web-socket-data-item-${msg.status}`"
|
|
82
|
+
@click="onClick(msg)">
|
|
83
|
+
<view class="web-socket-data-time">
|
|
84
|
+
{{ msg.type === 'send' ? '↑' : '↓' }}
|
|
85
|
+
{{ formatDate(msg.time, 'HH:mm:ss') }}
|
|
86
|
+
</view>
|
|
87
|
+
<view
|
|
88
|
+
:class="[
|
|
89
|
+
'web-socket-data-content',
|
|
90
|
+
`web-socket-data-${msg.valueType}`,
|
|
91
|
+
]"
|
|
92
|
+
@click.stop="onClickValue(msg)">
|
|
93
|
+
{{ msg.shortValue || msg.value }}
|
|
94
|
+
</view>
|
|
95
|
+
</view>
|
|
96
|
+
</AutoSize>
|
|
97
|
+
</template>
|
|
98
|
+
</VirtualList>
|
|
99
|
+
<Empty v-else :text="t('websocket.noMessage')" />
|
|
85
100
|
</view>
|
|
86
101
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
102
|
+
<view class="web-socket-send-container">
|
|
103
|
+
<textarea
|
|
104
|
+
class="web-socket-textarea"
|
|
105
|
+
:value="sendText"
|
|
106
|
+
@input="onInputText"
|
|
107
|
+
:placeholder="t('websocket.sendPlaceholder')" />
|
|
108
|
+
<SettingButton customStyle="margin-top: 12px" @click="onSendMessage">
|
|
109
|
+
{{ t('websocket.send') }}
|
|
110
|
+
</SettingButton>
|
|
111
|
+
</view>
|
|
95
112
|
</template>
|
|
96
113
|
</view>
|
|
97
114
|
</template>
|
|
98
115
|
<script setup lang="ts">
|
|
99
|
-
import { ref } from 'vue';
|
|
116
|
+
import { ref, computed, watch } from 'vue';
|
|
100
117
|
import Tag from '../Tag/index.vue';
|
|
101
118
|
import CircularButton from '../CircularButton/index.vue';
|
|
102
119
|
import DevToolTitle from '../DevToolTitle/index.vue';
|
|
103
120
|
import Empty from '../Empty/index.vue';
|
|
104
121
|
import { formatDate } from '../../utils/index';
|
|
105
122
|
import type { DevTool } from '../../type';
|
|
123
|
+
import { useI18n } from '../../i18n';
|
|
124
|
+
import SettingButton from '../SettingButton/index.vue';
|
|
125
|
+
import VirtualList from '../VirtualList/index.vue';
|
|
126
|
+
import AutoSize from '../VirtualList/AutoSize.vue';
|
|
127
|
+
|
|
128
|
+
const { t } = useI18n();
|
|
106
129
|
|
|
107
|
-
defineProps<{
|
|
130
|
+
const props = defineProps<{
|
|
108
131
|
ws?: DevTool.WS;
|
|
109
132
|
zIndex?: number;
|
|
110
133
|
customStyle?: Record<string, any>;
|
|
111
134
|
}>();
|
|
135
|
+
|
|
112
136
|
const emit = defineEmits<{
|
|
113
137
|
(e: 'close'): void;
|
|
114
138
|
(e: 'clear', value: DevTool.WS): void;
|
|
139
|
+
(e: 'send', data: { url: string; message: any }): void;
|
|
115
140
|
(e: 'openJson', value: { title?: string; data: Record<string, any> }): void;
|
|
116
141
|
}>();
|
|
117
142
|
|
|
118
|
-
const
|
|
143
|
+
const translatedSelectItems = computed(() => [
|
|
119
144
|
{
|
|
120
|
-
label: 'base',
|
|
145
|
+
label: t('common.base'),
|
|
121
146
|
value: 'base',
|
|
122
147
|
},
|
|
123
148
|
{
|
|
124
|
-
label: 'message',
|
|
149
|
+
label: t('common.message'),
|
|
125
150
|
value: 'message',
|
|
126
151
|
},
|
|
127
|
-
];
|
|
128
|
-
const currentSelect = ref('base');
|
|
152
|
+
]);
|
|
153
|
+
const currentSelect = ref<string>('base');
|
|
154
|
+
|
|
155
|
+
const sendText = ref<string>('');
|
|
129
156
|
|
|
130
|
-
const
|
|
157
|
+
const scrollIntoView = ref<string>('');
|
|
158
|
+
|
|
159
|
+
watch(
|
|
160
|
+
() => props.ws?.message?.length,
|
|
161
|
+
(newLen) => {
|
|
162
|
+
const len = newLen || 0;
|
|
163
|
+
if (len > 0) {
|
|
164
|
+
// 延迟一点确保渲染完成
|
|
165
|
+
setTimeout(() => {
|
|
166
|
+
scrollIntoView.value = `ws-msg-${len - 1}`;
|
|
167
|
+
}, 100);
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
{ immediate: true },
|
|
171
|
+
);
|
|
131
172
|
|
|
132
173
|
function onSelect(item: { label: string; value: string }) {
|
|
133
174
|
currentSelect.value = item.value;
|
|
@@ -136,39 +177,50 @@ function onClose() {
|
|
|
136
177
|
emit('close');
|
|
137
178
|
}
|
|
138
179
|
|
|
139
|
-
function onClick(item: {
|
|
140
|
-
status: 'success' | 'error';
|
|
141
|
-
value: string;
|
|
142
|
-
time: number;
|
|
143
|
-
}) {
|
|
180
|
+
function onClick(item: DevTool.Message) {
|
|
144
181
|
uni.setClipboardData({
|
|
145
|
-
data: JSON.stringify(item),
|
|
182
|
+
data: JSON.stringify(item.value), // 只拷贝 value 可能更符合直觉,或者拷贝整个 item
|
|
146
183
|
success() {
|
|
147
184
|
uni.showToast({
|
|
148
|
-
title: '
|
|
185
|
+
title: t('common.copySuccess'),
|
|
149
186
|
icon: 'none',
|
|
150
187
|
});
|
|
151
188
|
},
|
|
152
189
|
fail() {
|
|
153
190
|
uni.showToast({
|
|
154
|
-
title: '
|
|
191
|
+
title: t('common.copyFail'),
|
|
155
192
|
icon: 'none',
|
|
156
193
|
});
|
|
157
194
|
},
|
|
158
195
|
});
|
|
159
196
|
}
|
|
160
197
|
|
|
161
|
-
function onChangeText(e: any) {
|
|
162
|
-
sendText.value = e.detail.value;
|
|
163
|
-
console.log(' sendText.value: ', sendText.value);
|
|
164
|
-
}
|
|
165
|
-
|
|
166
198
|
function onClickValue(message: DevTool.Message) {
|
|
167
199
|
emit('openJson', {
|
|
168
|
-
title: '
|
|
200
|
+
title: t('websocket.messageDetail'),
|
|
169
201
|
data: message.value,
|
|
170
202
|
});
|
|
171
203
|
}
|
|
204
|
+
|
|
205
|
+
function onInputText(e: any) {
|
|
206
|
+
sendText.value = e.detail.value;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
function onSendMessage() {
|
|
210
|
+
if (!sendText.value) return;
|
|
211
|
+
let message: any = sendText.value;
|
|
212
|
+
try {
|
|
213
|
+
const parsed = JSON.parse(sendText.value);
|
|
214
|
+
if (typeof parsed === 'object' && parsed !== null) {
|
|
215
|
+
message = parsed;
|
|
216
|
+
}
|
|
217
|
+
} catch (_e) {
|
|
218
|
+
//
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
emit('send', { url: props.ws?.url || '', message });
|
|
222
|
+
sendText.value = '';
|
|
223
|
+
}
|
|
172
224
|
</script>
|
|
173
225
|
<style>
|
|
174
226
|
.web-socket-list-container {
|
|
@@ -179,18 +231,20 @@ function onClickValue(message: DevTool.Message) {
|
|
|
179
231
|
top: 0;
|
|
180
232
|
left: 0;
|
|
181
233
|
padding: 0 16px;
|
|
234
|
+
|
|
182
235
|
/* #ifdef H5 || APP-PLUS */
|
|
183
236
|
padding: 50px 16px;
|
|
237
|
+
|
|
184
238
|
/* #endif */
|
|
185
239
|
|
|
186
240
|
background-color: var(--dev-tool-bg3-color);
|
|
187
|
-
|
|
188
241
|
box-sizing: border-box;
|
|
189
242
|
}
|
|
190
243
|
|
|
191
244
|
.web-socket-detail-control {
|
|
192
245
|
display: flex;
|
|
193
246
|
align-items: center;
|
|
247
|
+
|
|
194
248
|
/* margin-bottom: 4px; */
|
|
195
249
|
height: 32px;
|
|
196
250
|
border-bottom: 1px solid transparent;
|
|
@@ -213,7 +267,6 @@ function onClickValue(message: DevTool.Message) {
|
|
|
213
267
|
align-items: center;
|
|
214
268
|
min-height: 28px;
|
|
215
269
|
word-break: break-all;
|
|
216
|
-
font-size: 12px;
|
|
217
270
|
}
|
|
218
271
|
|
|
219
272
|
.web-socket-detail-item-key {
|
|
@@ -226,7 +279,6 @@ function onClickValue(message: DevTool.Message) {
|
|
|
226
279
|
display: flex;
|
|
227
280
|
align-items: center;
|
|
228
281
|
min-height: 28px;
|
|
229
|
-
|
|
230
282
|
white-space: wrap;
|
|
231
283
|
word-break: break-all;
|
|
232
284
|
}
|
|
@@ -235,20 +287,23 @@ function onClickValue(message: DevTool.Message) {
|
|
|
235
287
|
display: flex;
|
|
236
288
|
align-items: center;
|
|
237
289
|
min-height: 28px;
|
|
238
|
-
font-size: 12px;
|
|
239
290
|
}
|
|
291
|
+
|
|
240
292
|
.web-socket-data-item-error {
|
|
241
|
-
|
|
293
|
+
border-left: 2px solid var(--dev-tool-error-color);
|
|
242
294
|
}
|
|
295
|
+
|
|
243
296
|
.web-socket-data-item-success {
|
|
244
|
-
|
|
297
|
+
border-left: 2px solid var(--dev-tool-success-color);
|
|
245
298
|
}
|
|
299
|
+
|
|
246
300
|
.web-socket-data-time {
|
|
247
301
|
/* margin-right: 16px; */
|
|
248
302
|
padding: 0 6px;
|
|
249
303
|
flex-shrink: 0;
|
|
250
304
|
color: var(--dev-tool-info-color);
|
|
251
305
|
}
|
|
306
|
+
|
|
252
307
|
.web-socket-data-content {
|
|
253
308
|
padding: 6px;
|
|
254
309
|
flex: 1;
|
|
@@ -264,19 +319,26 @@ function onClickValue(message: DevTool.Message) {
|
|
|
264
319
|
}
|
|
265
320
|
|
|
266
321
|
.web-socket-data-list {
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
322
|
+
height: calc(100% - 32px - 32px - 140px);
|
|
323
|
+
overflow: hidden;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
.web-socket-send-container {
|
|
327
|
+
height: 140px;
|
|
328
|
+
padding-top: 10px;
|
|
329
|
+
box-sizing: border-box;
|
|
270
330
|
}
|
|
271
331
|
|
|
272
332
|
.web-socket-textarea {
|
|
273
333
|
padding: 6px;
|
|
274
334
|
height: 80px;
|
|
275
335
|
width: 100%;
|
|
276
|
-
font-size: 12px;
|
|
277
336
|
border: 1px solid var(--dev-tool-border-color);
|
|
278
337
|
box-sizing: border-box;
|
|
338
|
+
font-size: var(--dev-tool-base-font-size);
|
|
339
|
+
color: var(--dev-tool-text-color);
|
|
279
340
|
}
|
|
341
|
+
|
|
280
342
|
.web-socket-send-button {
|
|
281
343
|
margin-top: 12px;
|
|
282
344
|
width: 100%;
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
<template>
|
|
2
|
+
<!-- eslint-disable vue/no-v-html, vue/no-v-text-v-html-on-component -->
|
|
2
3
|
<view class="websocket-item">
|
|
3
4
|
<view class="websocket-url-row" @click="emit('openDetail', ws)">
|
|
4
5
|
<Tag mode="info" v-if="ws.readyState === 'connection'">connection</Tag>
|
|
5
6
|
<Tag mode="success" v-if="ws.readyState === 'open'">open</Tag>
|
|
6
7
|
<Tag
|
|
7
8
|
mode="warn"
|
|
8
|
-
v-if="ws.readyState === 'closing' || ws.readyState === 'closed'"
|
|
9
|
-
>
|
|
9
|
+
v-if="ws.readyState === 'closing' || ws.readyState === 'closed'">
|
|
10
10
|
close
|
|
11
11
|
</Tag>
|
|
12
12
|
|
|
13
13
|
<Tag mode="error" v-if="ws.readyState === 'error'">error</Tag>
|
|
14
14
|
|
|
15
|
-
<view class="websocket-url" v-html="ws.url" />
|
|
15
|
+
<view class="websocket-url" v-html="ws._highlightUrl || ws.url" />
|
|
16
16
|
</view>
|
|
17
17
|
<view class="websocket-info">
|
|
18
18
|
<view class="websocket-info-last">
|
|
19
19
|
{{
|
|
20
20
|
(ws?.message?.[ws.message.length - 1]?.shortValue ||
|
|
21
21
|
ws?.message?.[ws.message.length - 1]?.value) ??
|
|
22
|
-
'
|
|
22
|
+
t('websocket.noMessage')
|
|
23
23
|
}}
|
|
24
24
|
</view>
|
|
25
25
|
|
|
@@ -40,6 +40,9 @@
|
|
|
40
40
|
import Tag from '../Tag/index.vue';
|
|
41
41
|
import { formatDate } from '../../utils';
|
|
42
42
|
import type { DevTool } from '../../type';
|
|
43
|
+
import { useI18n } from '../../i18n';
|
|
44
|
+
|
|
45
|
+
const { t } = useI18n();
|
|
43
46
|
|
|
44
47
|
defineProps<{ ws: DevTool.WS; zIndex?: number }>();
|
|
45
48
|
|
|
@@ -52,6 +55,7 @@ const emit = defineEmits<{ (e: 'openDetail', value: DevTool.WS): void }>();
|
|
|
52
55
|
border-bottom: 1px solid var(--dev-tool-border-color);
|
|
53
56
|
font-size: var(--dev-tool-base-font-size);
|
|
54
57
|
}
|
|
58
|
+
|
|
55
59
|
.websocket-url-row {
|
|
56
60
|
display: flex;
|
|
57
61
|
align-items: center;
|
|
@@ -71,9 +75,11 @@ const emit = defineEmits<{ (e: 'openDetail', value: DevTool.WS): void }>();
|
|
|
71
75
|
flex-shrink: 0;
|
|
72
76
|
margin-left: auto;
|
|
73
77
|
}
|
|
78
|
+
|
|
74
79
|
.websocket-detail-active {
|
|
75
80
|
transform: rotate(135deg);
|
|
76
81
|
}
|
|
82
|
+
|
|
77
83
|
.websocket-info {
|
|
78
84
|
display: flex;
|
|
79
85
|
align-items: center;
|
|
@@ -1,73 +1,78 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<view class="websocket-content">
|
|
3
3
|
<view class="websocket-control">
|
|
4
|
+
<DevToolTitle>{{ t('websocket.title') }}</DevToolTitle>
|
|
4
5
|
<FilterInput
|
|
5
|
-
|
|
6
|
-
placeholder="
|
|
7
|
-
@search="emit('search', $event)"
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
:
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
{{ item.label }}
|
|
6
|
+
v-model="modelValue"
|
|
7
|
+
:placeholder="t('websocket.searchUrl')"
|
|
8
|
+
@search="emit('search', $event)" />
|
|
9
|
+
<Pick
|
|
10
|
+
v-model="currentWebSocketType"
|
|
11
|
+
:options="filterOptions"
|
|
12
|
+
:readonly="true"
|
|
13
|
+
:placeholder="t('common.selectStatus')"
|
|
14
|
+
customStyle="width: 100px; flex: none;"
|
|
15
|
+
@change="onFilterChange" />
|
|
16
|
+
<Tag mode="clear" @click="onChoose('clear')">
|
|
17
|
+
{{ t('common.clear') }}
|
|
18
18
|
</Tag>
|
|
19
19
|
</view>
|
|
20
20
|
|
|
21
|
-
<
|
|
21
|
+
<VirtualList
|
|
22
22
|
:data="wsList"
|
|
23
23
|
:pageSize="10"
|
|
24
24
|
:height="contentHeight - 32 - 32"
|
|
25
|
-
className="websocket-list"
|
|
26
|
-
>
|
|
25
|
+
className="websocket-list">
|
|
27
26
|
<template v-slot="{ list, start, itemsHeight, onSizeChange }">
|
|
28
27
|
<AutoSize
|
|
29
28
|
v-for="(item, index) in list"
|
|
30
29
|
:index="start + index"
|
|
31
30
|
:key="start + index"
|
|
32
31
|
:itemsHeight="itemsHeight"
|
|
33
|
-
:onSizeChange="onSizeChange"
|
|
34
|
-
>
|
|
32
|
+
:onSizeChange="onSizeChange">
|
|
35
33
|
<WebSocketItem
|
|
36
34
|
:ws="item"
|
|
37
35
|
:zIndex="zIndex"
|
|
38
|
-
@openDetail="emit('openDetail', $event)"
|
|
39
|
-
/>
|
|
36
|
+
@openDetail="emit('openDetail', $event)" />
|
|
40
37
|
</AutoSize>
|
|
41
38
|
<Empty v-if="!wsList || wsList.length === 0" />
|
|
42
39
|
</template>
|
|
43
|
-
</
|
|
40
|
+
</VirtualList>
|
|
44
41
|
</view>
|
|
45
42
|
</template>
|
|
46
43
|
<script lang="ts" setup>
|
|
44
|
+
import { computed } from 'vue';
|
|
47
45
|
import WebSocketItem from './WebSocketItem.vue';
|
|
48
46
|
import Tag from '../Tag/index.vue';
|
|
49
47
|
import Empty from '../Empty/index.vue';
|
|
50
48
|
import FilterInput from '../FilterInput/index.vue';
|
|
49
|
+
import Pick from '../Pick/index.vue'; // Changed from FilterSelect to Pick
|
|
51
50
|
import type { DevTool } from '../../type';
|
|
52
|
-
import
|
|
53
|
-
import AutoSize from '../
|
|
51
|
+
import VirtualList from '../VirtualList/index.vue';
|
|
52
|
+
import AutoSize from '../VirtualList/AutoSize.vue';
|
|
53
|
+
import DevToolTitle from '../DevToolTitle/index.vue';
|
|
54
|
+
import { useI18n } from '../../i18n';
|
|
55
|
+
|
|
56
|
+
const { t } = useI18n();
|
|
54
57
|
|
|
55
58
|
defineProps<{
|
|
56
59
|
wsList: DevTool.WS[];
|
|
57
|
-
currentWebSocketType: string;
|
|
58
|
-
modelValue: string;
|
|
59
60
|
zIndex?: number;
|
|
60
61
|
contentHeight: number;
|
|
61
62
|
}>();
|
|
62
63
|
const emit = defineEmits<{
|
|
63
64
|
(e: 'choose', type: string): void;
|
|
64
|
-
(e: 'update:modelValue', value: string): void;
|
|
65
65
|
(e: 'search', value: string): void;
|
|
66
66
|
(e: 'openDetail', value: DevTool.WS): void;
|
|
67
67
|
}>();
|
|
68
|
-
|
|
68
|
+
|
|
69
|
+
const modelValue = defineModel<string>('modelValue', { required: true });
|
|
70
|
+
const currentWebSocketType = defineModel<string>('currentWebSocketType', {
|
|
71
|
+
required: true,
|
|
72
|
+
});
|
|
73
|
+
const webSocketFilter = computed(() => [
|
|
69
74
|
{
|
|
70
|
-
label: '
|
|
75
|
+
label: t('common.all'),
|
|
71
76
|
value: 'all',
|
|
72
77
|
mode: 'all',
|
|
73
78
|
},
|
|
@@ -92,15 +97,23 @@ const webSocketFilter = [
|
|
|
92
97
|
mode: 'error',
|
|
93
98
|
},
|
|
94
99
|
{
|
|
95
|
-
label: '
|
|
100
|
+
label: t('common.clear'),
|
|
96
101
|
value: 'clear',
|
|
97
102
|
mode: 'clear',
|
|
98
103
|
},
|
|
99
|
-
];
|
|
104
|
+
]);
|
|
100
105
|
|
|
101
106
|
function onChoose(type: string) {
|
|
102
107
|
emit('choose', type);
|
|
103
108
|
}
|
|
109
|
+
|
|
110
|
+
const filterOptions = computed(() => {
|
|
111
|
+
return webSocketFilter.value.filter((item) => item.value !== 'clear');
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
function onFilterChange(item: { label: string; value: any }) {
|
|
115
|
+
emit('choose', item.value);
|
|
116
|
+
}
|
|
104
117
|
</script>
|
|
105
118
|
<style scoped>
|
|
106
119
|
.websocket-content {
|
|
@@ -118,6 +131,7 @@ function onChoose(type: string) {
|
|
|
118
131
|
border-bottom: 1px solid var(--dev-tool-border-color);
|
|
119
132
|
box-sizing: border-box;
|
|
120
133
|
}
|
|
134
|
+
|
|
121
135
|
.websocket-list {
|
|
122
136
|
height: calc(100% - 32px);
|
|
123
137
|
overflow: auto;
|