vite-uni-dev-tool 0.0.16 → 0.0.18

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.
Files changed (44) hide show
  1. package/README.md +12 -0
  2. package/dist/devIntercept/index.d.ts.map +1 -1
  3. package/dist/devIntercept/index.js +139 -137
  4. package/dist/devStore/index.js +1 -1
  5. package/dist/type.d.ts +5 -1
  6. package/dist/type.d.ts.map +1 -1
  7. package/dist/v2/{CloseButton → CircularButton}/index.vue +5 -2
  8. package/dist/v2/NetworkList/NetworkDetail.vue +3 -3
  9. package/dist/v2/NetworkList/NetworkItem.vue +5 -3
  10. package/dist/v2/SettingList/index.vue +1 -1
  11. package/dist/v2/SourceCode/index.vue +3 -3
  12. package/dist/v2/StorageList/index.vue +7 -3
  13. package/dist/v2/Tabs/index.vue +3 -3
  14. package/dist/v2/UploadList/UploadDetail.vue +3 -3
  15. package/dist/v2/WebSocket/WebSocketList.vue +3 -3
  16. package/dist/v3/AppInfo/index.vue +2 -1
  17. package/dist/v3/{CloseButton → CircularButton}/index.vue +4 -2
  18. package/dist/v3/ConsoleList/ConsoleItem.vue +44 -96
  19. package/dist/v3/ConsoleList/index.vue +2 -0
  20. package/dist/v3/DevTool/index.vue +4 -4
  21. package/dist/v3/DevToolWindow/index.vue +182 -19
  22. package/dist/v3/DeviceInfo/index.vue +2 -1
  23. package/dist/v3/FilterSelect/index.vue +166 -0
  24. package/dist/v3/JsonPretty/index.vue +2 -0
  25. package/dist/v3/NetworkList/NetworkDetail.vue +12 -8
  26. package/dist/v3/NetworkList/NetworkItem.vue +56 -26
  27. package/dist/v3/NetworkList/NetworkSend.vue +701 -0
  28. package/dist/v3/NetworkList/const.d.ts +5 -0
  29. package/dist/v3/NetworkList/const.d.ts.map +1 -0
  30. package/dist/v3/NetworkList/const.ts +4 -0
  31. package/dist/v3/NetworkList/index.vue +104 -21
  32. package/dist/v3/PiniaList/index.vue +5 -4
  33. package/dist/v3/SettingList/index.vue +3 -3
  34. package/dist/v3/SourceCode/index.vue +22 -8
  35. package/dist/v3/StorageList/index.vue +9 -6
  36. package/dist/v3/SystemInfo/index.vue +2 -1
  37. package/dist/v3/Tabs/index.vue +2 -2
  38. package/dist/v3/UniEvent/UniEventItem.vue +6 -54
  39. package/dist/v3/UniEvent/index.vue +2 -0
  40. package/dist/v3/UploadList/UploadDetail.vue +2 -2
  41. package/dist/v3/VuexList/index.vue +4 -2
  42. package/dist/v3/WebSocket/WebSocketList.vue +2 -2
  43. package/dist/v3/WindowInfo/index.vue +2 -1
  44. package/package.json +1 -1
@@ -1,16 +1,13 @@
1
1
  <template>
2
- <view class="network-item">
2
+ <view class="network-item" @click="emit('openDetail')">
3
3
  <view class="network-url-row">
4
4
  <Tag mode="info">{{ network.method }}</Tag>
5
5
 
6
6
  <view class="network-url" v-html="lastUrl"> </view>
7
7
 
8
- <Tag
9
- mode="main"
10
- class="network-detail-icon"
11
- @click="showDetail = !showDetail"
12
- >详情</Tag
13
- >
8
+ <Tag mode="main" class="network-detail-icon" @click.stop="emit('resend')">
9
+ 重发
10
+ </Tag>
14
11
  </view>
15
12
  <view class="network-info">
16
13
  <view>
@@ -29,52 +26,69 @@
29
26
  <!-- <view>{{ network.status }}</view> -->
30
27
  <view>{{ network.time }}</view>
31
28
  <view>{{ network.size }}</view>
32
- <view
33
- >开始:
29
+ <view>
30
+ {{ sortMap?.[props.currentNetworkSort] ?? '一' }}
31
+ 开始:
34
32
  {{
35
33
  network.startTime
36
- ? formatDate(network.startTime, 'HH:mm:ss')
34
+ ? formatDate(network.startTime, 'HH:mm:ss:SS')
37
35
  : '--:--:--'
38
36
  }}</view
39
37
  >
40
38
  <view>
41
39
  结束:
42
40
  {{
43
- network.endTime ? formatDate(network.endTime, 'HH:mm:ss') : '--:--:--'
41
+ network.endTime
42
+ ? formatDate(network.endTime, 'HH:mm:ss:SS')
43
+ : '--:--:--:---'
44
44
  }}
45
45
  </view>
46
46
  </view>
47
+ <view
48
+ class="network-time-line"
49
+ :style="`width: ${network.width}; left: ${network.left};`"
50
+ ></view>
51
+ <view
52
+ :class="`network-stock ${isUseDevSource ? 'network-stock-link' : ''}`"
53
+ @click.stop="emit('openCode', network.stack)"
54
+ >
55
+ {{ network?.stack }}
56
+ </view>
47
57
  </view>
48
- <!-- <Transition name="slide-fade"> -->
49
- <NetworkDetail
50
- v-if="showDetail"
51
- :network="network"
52
- :zIndex="zIndex"
53
- @close="onClose"
54
- />
55
- <!-- </Transition> -->
56
58
  </template>
57
59
 
58
60
  <script lang="ts" setup>
59
- import { computed, ref } from 'vue';
61
+ import { computed } from 'vue';
62
+ import { sortMap } from './const';
60
63
  import Tag from '../Tag/index.vue';
61
- import NetworkDetail from './NetworkDetail.vue';
62
- import { formatDate } from '../../utils';
64
+ import { formatDate, isMockWX } from '../../utils';
63
65
  import type { DevTool } from '../../type';
64
66
  const props = defineProps<{
65
67
  network: DevTool.NetworkItem;
68
+ currentNetworkSort: -1 | 1;
66
69
  zIndex?: number;
70
+ mode?: string;
71
+ useDevSource?: boolean;
72
+ }>();
73
+
74
+ const emit = defineEmits<{
75
+ (e: 'openDetail'): void;
76
+ (e: 'resend'): void;
77
+ (e: 'openCode', value?: string): void;
67
78
  }>();
68
- const showDetail = ref(false);
69
79
 
70
80
  const lastUrl = computed(() => {
71
81
  const start = props.network.url.lastIndexOf('/');
72
82
  return props.network.url.slice(start + 1);
73
83
  });
74
84
 
75
- function onClose() {
76
- showDetail.value = false;
77
- }
85
+ const isUseDevSource = computed(() => {
86
+ return (
87
+ !isMockWX(props?.network?.stack ?? '') &&
88
+ props.mode === 'development' &&
89
+ props.useDevSource
90
+ );
91
+ });
78
92
  </script>
79
93
  <style scoped>
80
94
  .network-item {
@@ -117,4 +131,20 @@ function onClose() {
117
131
  transform: translateY(20px);
118
132
  opacity: 0;
119
133
  }
134
+
135
+ .network-time-line {
136
+ position: relative;
137
+ margin-top: 10px;
138
+ height: 2px;
139
+ min-width: 6px;
140
+ background-color: var(--dev-tool-time-line-color);
141
+ }
142
+
143
+ .network-stock {
144
+ text-align: right;
145
+ word-wrap: break-word;
146
+ }
147
+ .network-stock-link {
148
+ text-decoration: underline;
149
+ }
120
150
  </style>