whistle.mock-plugins 1.4.0-beta.0 → 1.4.0-beta.2

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 (71) hide show
  1. package/VERSION.md +14 -0
  2. package/app/cgi-bin/interfaces.js +2 -0
  3. package/app/cgi-bin/stats.js +22 -12
  4. package/app/public/index.html +1 -1
  5. package/app/public/js/11.index.js +2 -0
  6. package/app/public/js/11.index.js.LICENSE.txt +5 -0
  7. package/app/public/js/704.index.js +2 -0
  8. package/app/public/js/704.index.js.LICENSE.txt +1 -0
  9. package/app/public/js/798.index.js +2 -0
  10. package/app/public/js/798.index.js.LICENSE.txt +53 -0
  11. package/app/public/js/807.index.js +2 -0
  12. package/app/public/js/807.index.js.LICENSE.txt +1 -0
  13. package/app/public/js/968.index.js +2 -0
  14. package/app/public/js/968.index.js.LICENSE.txt +12 -0
  15. package/app/public/js/index.js +1 -1
  16. package/app/public/js/index.js.LICENSE.txt +0 -185
  17. package/package.json +9 -2
  18. package/API.md +0 -247
  19. package/COLUMN_RESIZE_IMPLEMENTATION.md +0 -162
  20. package/FEATURE_ENHANCEMENT.md +0 -157
  21. package/TEST_GUIDE.md +0 -156
  22. package/data/features.json +0 -1
  23. package/data/interfaces.json +0 -1
  24. package/index.html +0 -52
  25. package/initialize.js +0 -32
  26. package/public/bundle.js +0 -2
  27. package/public/bundle.js.LICENSE.txt +0 -38
  28. package/public/index.html +0 -1
  29. package/public/plugin.mock-plugin.html +0 -14
  30. package/rules.txt +0 -22
  31. package/test/api-error.test.js +0 -29
  32. package/test/webdav-sync.test.js +0 -428
  33. package/ui/src/App.css +0 -173
  34. package/ui/src/components/AppLayout.js +0 -407
  35. package/ui/src/components/FeatureCard.js +0 -58
  36. package/ui/src/components/KeyboardShortcutsHelp.js +0 -58
  37. package/ui/src/components/Layout.js +0 -94
  38. package/ui/src/components/MainNav.js +0 -42
  39. package/ui/src/components/PageContainer.js +0 -16
  40. package/ui/src/components/VersionModal.js +0 -99
  41. package/ui/src/components/WebDavSyncModal.js +0 -516
  42. package/ui/src/components/interface-management/DataManagementDrawer.js +0 -115
  43. package/ui/src/components/interface-management/DataManagementModal.js +0 -110
  44. package/ui/src/components/interface-management/InterfaceTestModal.js +0 -313
  45. package/ui/src/components/interface-management/PreviewModal.js +0 -48
  46. package/ui/src/components/interface-management/README.md +0 -184
  47. package/ui/src/components/interface-management/RealResponseRecorder.js +0 -165
  48. package/ui/src/components/interface-management/ResponseContentEditor.js +0 -645
  49. package/ui/src/components/interface-management/constants.js +0 -36
  50. package/ui/src/components/interface-management/index.js +0 -7
  51. package/ui/src/components/interface-management/utils.js +0 -103
  52. package/ui/src/hooks/useKeyboardShortcuts.js +0 -99
  53. package/ui/src/index.html +0 -14
  54. package/ui/src/index.js +0 -50
  55. package/ui/src/pages/InterfaceManagementV2.js +0 -2351
  56. package/ui/src/pages/MockDataV2.js +0 -1122
  57. package/ui/src/pages/Settings.js +0 -341
  58. package/ui/src/pages/Sniffer.js +0 -521
  59. package/ui/src/pages/Stats.js +0 -288
  60. package/ui/src/services/del_api.js +0 -192
  61. package/ui/src/styles/app-layout.css +0 -373
  62. package/ui/src/styles/cyber-theme.css +0 -1234
  63. package/ui/src/styles/earth-theme.css +0 -618
  64. package/ui/src/styles/global.css +0 -224
  65. package/ui/src/styles/interface-management.css +0 -1321
  66. package/ui/src/styles/mock-data.css +0 -1185
  67. package/ui/src/styles/settings.css +0 -252
  68. package/ui/src/styles/version-modal.css +0 -116
  69. package/ui/src/styles/webdav-sync.css +0 -408
  70. package/ui/src/utils/api-error.js +0 -57
  71. package/webpack.config.js +0 -54
@@ -1,408 +0,0 @@
1
- .webdav-sync-modal .ant-modal-content {
2
- display: flex;
3
- max-height: calc(100vh - 24px);
4
- flex-direction: column;
5
- overflow: hidden;
6
- padding: 0;
7
- }
8
-
9
- .webdav-sync-modal {
10
- top: 12px;
11
- max-width: calc(100vw - 32px);
12
- padding-bottom: 0;
13
- }
14
-
15
- .webdav-sync-modal-wrap {
16
- overflow: hidden;
17
- }
18
-
19
- .webdav-sync-modal .ant-modal-body {
20
- min-height: 0;
21
- overflow-y: auto;
22
- overscroll-behavior: contain;
23
- }
24
-
25
- .webdav-sync-modal .ant-modal-close {
26
- top: 12px;
27
- color: rgba(255, 255, 255, 0.86);
28
- }
29
-
30
- .webdav-sync-hero {
31
- display: grid;
32
- grid-template-columns: auto minmax(0, 1fr) auto;
33
- align-items: center;
34
- gap: 12px;
35
- padding: 14px 20px;
36
- color: #fff;
37
- background:
38
- radial-gradient(circle at 85% 0%, rgba(56, 189, 248, 0.32), transparent 38%),
39
- linear-gradient(135deg, #102a43 0%, #0b7285 100%);
40
- }
41
-
42
- .webdav-sync-hero .ant-typography {
43
- margin: 0;
44
- color: inherit;
45
- }
46
-
47
- .webdav-sync-hero .ant-typography.ant-typography-secondary {
48
- color: rgba(255, 255, 255, 0.68);
49
- }
50
-
51
- .webdav-sync-hero-copy {
52
- min-width: 0;
53
- }
54
-
55
- .webdav-sync-hero-copy .ant-typography:last-child {
56
- font-size: 13px;
57
- white-space: nowrap;
58
- }
59
-
60
- .webdav-sync-hero-icon {
61
- display: flex;
62
- width: 40px;
63
- height: 40px;
64
- align-items: center;
65
- justify-content: center;
66
- border: 1px solid rgba(255, 255, 255, 0.25);
67
- border-radius: 11px;
68
- background: rgba(255, 255, 255, 0.12);
69
- font-size: 20px;
70
- box-shadow: inset 0 1px rgba(255, 255, 255, 0.18);
71
- }
72
-
73
- .webdav-sync-kicker {
74
- display: block;
75
- margin-bottom: 1px !important;
76
- color: #67e8f9 !important;
77
- font-size: 9px;
78
- font-weight: 700;
79
- letter-spacing: 0.18em;
80
- }
81
-
82
- .webdav-sync-grid {
83
- display: grid;
84
- grid-template-columns: minmax(0, 1.55fr) minmax(260px, 0.65fr);
85
- gap: 12px;
86
- padding: 12px;
87
- background: #f3f6f8;
88
- }
89
-
90
- .webdav-sync-error {
91
- margin: 10px 12px 0;
92
- padding: 8px 12px;
93
- }
94
-
95
- .webdav-sync-error .ant-alert-description {
96
- overflow-wrap: anywhere;
97
- }
98
-
99
- .webdav-sync-modal .ant-descriptions-item-label {
100
- width: 82px;
101
- white-space: nowrap;
102
- }
103
-
104
- .webdav-sync-modal .ant-descriptions-item-content {
105
- min-width: 0;
106
- }
107
-
108
- .webdav-sync-card,
109
- .webdav-sync-note,
110
- .webdav-sync-status-card,
111
- .webdav-sync-connection-card,
112
- .webdav-sync-module-card {
113
- border-radius: 10px;
114
- box-shadow: 0 5px 18px rgba(15, 42, 67, 0.06);
115
- }
116
-
117
- .webdav-sync-card .ant-card-body,
118
- .webdav-sync-note .ant-card-body {
119
- padding: 16px;
120
- }
121
-
122
- .webdav-sync-modal .ant-form-item {
123
- margin-bottom: 14px;
124
- }
125
-
126
- .webdav-sync-connected {
127
- display: grid;
128
- gap: 10px;
129
- padding: 12px;
130
- background: #f3f6f8;
131
- }
132
-
133
- .webdav-sync-connection-card .ant-card-body {
134
- display: grid;
135
- grid-template-columns: minmax(0, 1fr) auto;
136
- align-items: end;
137
- gap: 12px;
138
- padding: 12px 16px;
139
- }
140
-
141
- .webdav-sync-connection-card .ant-descriptions {
142
- min-width: 0;
143
- }
144
-
145
- .webdav-sync-connection-card .ant-descriptions-header {
146
- margin-bottom: 8px;
147
- }
148
-
149
- .webdav-sync-connection-card .ant-descriptions-row > th,
150
- .webdav-sync-connection-card .ant-descriptions-row > td {
151
- padding-bottom: 6px;
152
- }
153
-
154
- .webdav-sync-form-row {
155
- display: grid;
156
- grid-template-columns: 1fr 1fr;
157
- gap: 12px;
158
- }
159
-
160
- .webdav-sync-form-actions,
161
- .webdav-sync-form-actions .ant-space-item {
162
- display: flex;
163
- width: 100%;
164
- }
165
-
166
- .webdav-sync-form-actions .ant-btn {
167
- flex: 1;
168
- }
169
-
170
- .webdav-sync-note {
171
- color: #475569;
172
- background: linear-gradient(160deg, #ecfeff, #f8fafc 62%);
173
- }
174
-
175
- .webdav-sync-note-icon {
176
- display: block;
177
- margin-bottom: 10px;
178
- color: #0891b2;
179
- font-size: 24px;
180
- }
181
-
182
- .webdav-sync-file-tree,
183
- .webdav-sync-file-name {
184
- padding: 8px 10px;
185
- border-radius: 7px;
186
- color: #d8f3f5;
187
- background: #102a43;
188
- font-family: SFMono-Regular, Consolas, "Liberation Mono", monospace;
189
- font-size: 12px;
190
- line-height: 1.6;
191
- }
192
-
193
- .webdav-sync-break-all {
194
- white-space: normal;
195
- overflow-wrap: anywhere;
196
- }
197
-
198
- .webdav-sync-actions {
199
- display: grid;
200
- grid-template-columns: 1fr 1fr;
201
- gap: 10px;
202
- margin-top: 22px;
203
- }
204
-
205
- .webdav-sync-actions .ant-btn {
206
- white-space: nowrap;
207
- }
208
-
209
- .webdav-sync-pull-button {
210
- border-color: #059669 !important;
211
- background: #059669 !important;
212
- }
213
-
214
- .webdav-sync-disconnect {
215
- padding-inline: 0;
216
- }
217
-
218
- .webdav-sync-module-grid {
219
- display: grid;
220
- grid-template-columns: repeat(2, minmax(0, 1fr));
221
- gap: 12px;
222
- }
223
-
224
- .webdav-sync-module-card .ant-card-body {
225
- display: flex;
226
- height: min(440px, calc(100vh - 300px));
227
- min-height: 280px;
228
- flex-direction: column;
229
- padding: 14px;
230
- }
231
-
232
- .webdav-sync-module-header,
233
- .webdav-sync-select-all {
234
- display: flex;
235
- align-items: center;
236
- justify-content: space-between;
237
- gap: 8px;
238
- }
239
-
240
- .webdav-sync-module-header {
241
- align-items: flex-start;
242
- }
243
-
244
- .webdav-sync-module-header .ant-typography {
245
- margin: 0;
246
- }
247
-
248
- .webdav-sync-module-eyebrow {
249
- font-size: 10px;
250
- font-weight: 700;
251
- letter-spacing: 0.14em;
252
- }
253
-
254
- .webdav-sync-select-all {
255
- margin-top: 8px;
256
- padding: 7px 10px;
257
- border-radius: 7px;
258
- background: #f8fafc;
259
- }
260
-
261
- .webdav-sync-module-list {
262
- min-height: 0;
263
- flex: 1;
264
- margin: 8px 0 10px;
265
- overflow: auto;
266
- overscroll-behavior: contain;
267
- }
268
-
269
- .webdav-sync-module-list .ant-checkbox-group {
270
- display: grid;
271
- gap: 5px;
272
- }
273
-
274
- .webdav-sync-module-option.ant-checkbox-wrapper {
275
- display: grid;
276
- grid-template-columns: auto minmax(0, 1fr) auto;
277
- align-items: center;
278
- gap: 8px;
279
- margin-inline-start: 0;
280
- padding: 7px 9px;
281
- border: 1px solid #e6edf2;
282
- border-radius: 7px;
283
- background: #fff;
284
- }
285
-
286
- .webdav-sync-module-option .ant-checkbox + span {
287
- display: contents;
288
- padding-inline-start: 0;
289
- }
290
-
291
- .webdav-sync-module-name {
292
- min-width: 0;
293
- font-weight: 500;
294
- overflow-wrap: anywhere;
295
- }
296
-
297
- .webdav-sync-module-count {
298
- color: #94a3b8;
299
- font-size: 12px;
300
- white-space: nowrap;
301
- }
302
-
303
- .webdav-sync-manual-note {
304
- padding: 8px 12px;
305
- border-radius: 8px;
306
- }
307
-
308
- .webdav-sync-manual-note .ant-alert-message {
309
- margin-bottom: 1px;
310
- }
311
-
312
- .webdav-sync-manual-note .ant-alert-description {
313
- font-size: 12px;
314
- line-height: 1.5;
315
- }
316
-
317
- .webdav-sync-status-title {
318
- display: flex;
319
- align-items: flex-start;
320
- justify-content: space-between;
321
- gap: 12px;
322
- margin-bottom: 16px;
323
- }
324
-
325
- .webdav-sync-status-title .ant-typography {
326
- margin: 0;
327
- }
328
-
329
- .webdav-sync-status-title > div > .ant-typography:first-child {
330
- font-size: 10px;
331
- font-weight: 700;
332
- letter-spacing: 0.14em;
333
- }
334
-
335
- .webdav-sync-file-name {
336
- margin-bottom: 16px;
337
- line-height: 1.5;
338
- }
339
-
340
- body.cyber-theme .webdav-sync-grid {
341
- background: #071116;
342
- }
343
-
344
- body.cyber-theme .webdav-sync-connected {
345
- background: #071116;
346
- }
347
-
348
- body.cyber-theme .webdav-sync-card,
349
- body.cyber-theme .webdav-sync-note,
350
- body.cyber-theme .webdav-sync-status-card,
351
- body.cyber-theme .webdav-sync-connection-card,
352
- body.cyber-theme .webdav-sync-module-card {
353
- border: 1px solid rgba(0, 240, 255, 0.2);
354
- background: #0b1c24;
355
- }
356
-
357
- body.cyber-theme .webdav-sync-select-all,
358
- body.cyber-theme .webdav-sync-module-option.ant-checkbox-wrapper {
359
- border-color: rgba(0, 240, 255, 0.18);
360
- background: #102730;
361
- }
362
-
363
- body.earth-theme .webdav-sync-grid {
364
- background: #f0ebe3;
365
- }
366
-
367
- body.earth-theme .webdav-sync-connected {
368
- background: #f0ebe3;
369
- }
370
-
371
- body.earth-theme .webdav-sync-hero {
372
- background:
373
- radial-gradient(circle at 85% 0%, rgba(212, 160, 23, 0.3), transparent 38%),
374
- linear-gradient(135deg, #3d3630 0%, #8b5e3c 100%);
375
- }
376
-
377
- @media (max-width: 720px) {
378
- .webdav-sync-hero {
379
- grid-template-columns: auto 1fr;
380
- padding: 12px 14px;
381
- }
382
-
383
- .webdav-sync-hero > .ant-tag {
384
- grid-column: 2;
385
- justify-self: start;
386
- }
387
-
388
- .webdav-sync-hero-copy .ant-typography:last-child {
389
- white-space: normal;
390
- }
391
-
392
- .webdav-sync-grid,
393
- .webdav-sync-form-row,
394
- .webdav-sync-actions,
395
- .webdav-sync-module-grid,
396
- .webdav-sync-connection-card .ant-card-body {
397
- grid-template-columns: 1fr;
398
- }
399
-
400
- .webdav-sync-module-card .ant-card-body {
401
- height: auto;
402
- min-height: 300px;
403
- }
404
-
405
- .webdav-sync-module-list {
406
- max-height: 240px;
407
- }
408
- }
@@ -1,57 +0,0 @@
1
- const normalizeMessage = (value) => {
2
- if (typeof value != 'string') return '';
3
- return value
4
- .replace(/<style[\s\S]*?<\/style>/gi, ' ')
5
- .replace(/<script[\s\S]*?<\/script>/gi, ' ')
6
- .replace(/<[^>]+>/g, ' ')
7
- .replace(/\s+/g, ' ')
8
- .trim()
9
- .slice(0, 300);
10
- };
11
-
12
- const parseResponseData = (data) => {
13
- if (!data) return {};
14
- if (typeof data == 'object') {
15
- return {
16
- message: normalizeMessage(data.message || data.error || data.detail),
17
- conflict: data.conflict || null,
18
- };
19
- }
20
- if (typeof data != 'string') return {};
21
-
22
- const text = data.trim();
23
- if (!text) return {};
24
- try {
25
- return parseResponseData(JSON.parse(text));
26
- } catch (error) {
27
- return { message: normalizeMessage(text), conflict: null };
28
- }
29
- };
30
-
31
- const getApiError = (error, fallback) => {
32
- const safeFallback = normalizeMessage(fallback) || 'WebDAV 操作失败';
33
- const response = error && error.response;
34
- const responseError = parseResponseData(response && response.data);
35
- if (responseError.message) return responseError;
36
-
37
- const status = response && response.status;
38
- if (status) {
39
- const statusText = normalizeMessage(response.statusText);
40
- return {
41
- message: `${safeFallback}(HTTP ${status}${statusText ? ` ${statusText}` : ''})`,
42
- conflict: responseError.conflict || null,
43
- };
44
- }
45
-
46
- if (error && error.code == 'ECONNABORTED') {
47
- return { message: `${safeFallback}:请求超时,请检查 WebDAV 地址和网络`, conflict: null };
48
- }
49
-
50
- const message = normalizeMessage(error && error.message);
51
- if (message && message != 'Network Error') {
52
- return { message, conflict: null };
53
- }
54
- return { message: `${safeFallback}:网络请求失败,请检查 Whistle 服务日志`, conflict: null };
55
- };
56
-
57
- module.exports = { getApiError, normalizeMessage, parseResponseData };
package/webpack.config.js DELETED
@@ -1,54 +0,0 @@
1
- const path = require('path');
2
- const webpack = require('webpack');
3
- const HtmlWebpackPlugin = require('html-webpack-plugin');
4
- const packageJson = require('./package.json');
5
-
6
- module.exports = {
7
- mode: process.env.NODE_ENV === 'production' ? 'production' : 'development',
8
- entry: './ui/src/index.js',
9
- output: {
10
- path: path.resolve(__dirname, 'app/public'),
11
- filename: 'js/index.js',
12
- publicPath: '/'
13
- },
14
- resolve: {
15
- extensions: ['.js', '.jsx', '.ts', '.tsx']
16
- },
17
- module: {
18
- rules: [
19
- {
20
- test: /\.(js|jsx|ts|tsx)$/,
21
- exclude: /node_modules/,
22
- use: {
23
- loader: 'babel-loader',
24
- options: {
25
- presets: ['@babel/preset-env', '@babel/preset-react']
26
- }
27
- }
28
- },
29
- {
30
- test: /\.css$/,
31
- use: ['style-loader', 'css-loader']
32
- }
33
- ]
34
- },
35
- plugins: [
36
- new HtmlWebpackPlugin({
37
- template: './ui/src/index.html',
38
- filename: 'index.html'
39
- }),
40
- new webpack.DefinePlugin({
41
- __APP_VERSION__: JSON.stringify(packageJson.version)
42
- })
43
- ],
44
- devServer: {
45
- static: {
46
- directory: path.join(__dirname, 'app/public')
47
- },
48
- port: 8080,
49
- hot: true,
50
- proxy: {
51
- '/api': 'http://localhost:8899'
52
- }
53
- }
54
- };