gz-research-assistant 1.0.9 → 1.0.10
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/index.js
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import { _ as e, a as t, c as n, d as r, f as i, g as a, h as o, i as s, l as c, m as l, n as u, o as d, p as f, r as p, s as m, t as h, u as g } from "./core-CJ37HVMm.js";
|
|
2
2
|
import { Component as _, createElement as ee, useCallback as v, useEffect as y, useId as b, useLayoutEffect as te, useMemo as ne, useRef as re, useState as x, useSyncExternalStore as ie } from "react";
|
|
3
3
|
import { StyleProvider as ae } from "@ant-design/cssinjs";
|
|
4
|
-
import { Alert as S, Badge as oe, Button as C, Card as se, Checkbox as
|
|
5
|
-
import { ApiOutlined as
|
|
6
|
-
import { Fragment as
|
|
7
|
-
import { OverlayScrollbars as
|
|
8
|
-
import { createRoot as
|
|
4
|
+
import { Alert as S, Badge as oe, Button as C, Card as se, Checkbox as w, Collapse as ce, ConfigProvider as le, Dropdown as ue, Empty as de, Input as T, InputNumber as fe, Select as E, Tabs as pe, Tag as D, Tooltip as me, Upload as he, getDesignTokenCssVariables as O } from "gz-ui-web";
|
|
5
|
+
import { ApiOutlined as k, BulbOutlined as A, CameraOutlined as ge, CheckCircleOutlined as j, CheckOutlined as _e, CloseOutlined as ve, CodeOutlined as M, DashboardOutlined as N, DeleteOutlined as ye, DesktopOutlined as be, DownloadOutlined as xe, EditOutlined as P, EllipsisOutlined as F, ExperimentOutlined as Se, FieldTimeOutlined as Ce, FileAddOutlined as we, FileTextOutlined as Te, FlagOutlined as Ee, FolderOpenOutlined as De, FullscreenExitOutlined as I, FullscreenOutlined as L, HistoryOutlined as Oe, InfoCircleOutlined as R, LineChartOutlined as ke, LinkOutlined as Ae, MessageOutlined as je, MinusOutlined as z, PauseOutlined as Me, PlayCircleOutlined as Ne, PlusOutlined as B, ReadOutlined as Pe, SaveOutlined as V, ScissorOutlined as H, SearchOutlined as Fe, StopOutlined as Ie, UploadOutlined as Le, VideoCameraOutlined as Re, WarningOutlined as ze } from "@ant-design/icons";
|
|
6
|
+
import { Fragment as U, jsx as W, jsxs as G } from "react/jsx-runtime";
|
|
7
|
+
import { OverlayScrollbars as Be } from "overlayscrollbars";
|
|
8
|
+
import { createRoot as Ve } from "react-dom/client";
|
|
9
9
|
// \0rolldown/runtime.js
|
|
10
|
-
var
|
|
10
|
+
var He = Object.defineProperty, Ue = Object.getOwnPropertyDescriptor, We = Object.getOwnPropertyNames, Ge = Object.prototype.hasOwnProperty, Ke = (e, t) => {
|
|
11
11
|
let n = {};
|
|
12
|
-
for (var r in e)
|
|
12
|
+
for (var r in e) He(n, r, {
|
|
13
13
|
get: e[r],
|
|
14
14
|
enumerable: !0
|
|
15
15
|
});
|
|
16
|
-
return t ||
|
|
17
|
-
},
|
|
18
|
-
if (t && typeof t == "object" || typeof t == "function") for (var i =
|
|
16
|
+
return t || He(n, Symbol.toStringTag, { value: "Module" }), n;
|
|
17
|
+
}, qe = (e, t, n, r) => {
|
|
18
|
+
if (t && typeof t == "object" || typeof t == "function") for (var i = We(t), a = 0, o = i.length, s; a < o; a++) s = i[a], !Ge.call(e, s) && s !== n && He(e, s, {
|
|
19
19
|
get: ((e) => t[e]).bind(null, s),
|
|
20
|
-
enumerable: !(r =
|
|
20
|
+
enumerable: !(r = Ue(t, s)) || r.enumerable
|
|
21
21
|
});
|
|
22
22
|
return e;
|
|
23
|
-
},
|
|
23
|
+
}, Je = (e, t, n) => (qe(e, t, "default"), n && qe(n, t, "default")), Ye = { scope: "_scope_tudpr_1" }, K = {
|
|
24
24
|
dock: "_dock_1oshs_1",
|
|
25
25
|
launcher: "_launcher_1oshs_12",
|
|
26
26
|
launcherAvatar: "_launcherAvatar_1oshs_42",
|
|
@@ -55,11 +55,11 @@ var ze = Object.defineProperty, Be = Object.getOwnPropertyDescriptor, Ve = Objec
|
|
|
55
55
|
request: "_request_1oshs_316",
|
|
56
56
|
requestUrl: "_requestUrl_1oshs_448",
|
|
57
57
|
toolbarActions: "_toolbarActions_1oshs_465"
|
|
58
|
-
},
|
|
58
|
+
}, Xe = (e, t) => ({
|
|
59
59
|
x: Math.max(0, Math.min(e.x, Math.max(0, window.innerWidth - t.width - 12))),
|
|
60
60
|
y: Math.max(0, Math.min(e.y, Math.max(0, window.innerHeight - t.height - 12)))
|
|
61
61
|
});
|
|
62
|
-
function
|
|
62
|
+
function Ze(e, t, n) {
|
|
63
63
|
y(() => {
|
|
64
64
|
let r = e.current, i = r?.closest("[data-assistant-part=\"dock\"]");
|
|
65
65
|
if (!r || !i) return;
|
|
@@ -97,7 +97,7 @@ function Je(e, t, n) {
|
|
|
97
97
|
}, m = (e) => {
|
|
98
98
|
if (!s || s.id !== e.pointerId) return;
|
|
99
99
|
let t = e.clientX - s.pointer.x, i = e.clientY - s.pointer.y;
|
|
100
|
-
!s.moved && Math.hypot(t, i) < 5 || (s.moved || (s.moved = !0, c = !0, n(!0), r.setPointerCapture(e.pointerId)), e.preventDefault(), e.stopPropagation(), a =
|
|
100
|
+
!s.moved && Math.hypot(t, i) < 5 || (s.moved || (s.moved = !0, c = !0, n(!0), r.setPointerCapture(e.pointerId)), e.preventDefault(), e.stopPropagation(), a = Xe({
|
|
101
101
|
x: s.origin.x + t,
|
|
102
102
|
y: s.origin.y + i
|
|
103
103
|
}, o), l ||= requestAnimationFrame(d));
|
|
@@ -111,7 +111,7 @@ function Je(e, t, n) {
|
|
|
111
111
|
}, ee = (e) => {
|
|
112
112
|
u(e) && e.preventDefault();
|
|
113
113
|
}, v = () => {
|
|
114
|
-
a && (a =
|
|
114
|
+
a && (a = Xe(a, o), f());
|
|
115
115
|
}, y = () => {
|
|
116
116
|
s && (c = !0, h());
|
|
117
117
|
};
|
|
@@ -127,7 +127,7 @@ function Je(e, t, n) {
|
|
|
127
127
|
n
|
|
128
128
|
]);
|
|
129
129
|
}
|
|
130
|
-
var
|
|
130
|
+
var q = {
|
|
131
131
|
formStack: "_formStack_175v2_1 _formStack_13kbl_763",
|
|
132
132
|
subheading: "_subheading_175v2_4 _subheading_13kbl_639",
|
|
133
133
|
json: "_json_175v2_7 _json_13kbl_377",
|
|
@@ -155,7 +155,7 @@ var J = {
|
|
|
155
155
|
assertionResults: "_assertionResults_175v2_175",
|
|
156
156
|
assertionResult: "_assertionResult_175v2_175",
|
|
157
157
|
assertionSummary: "_assertionSummary_175v2_202"
|
|
158
|
-
},
|
|
158
|
+
}, Qe = {
|
|
159
159
|
click: "点击",
|
|
160
160
|
fill: "输入",
|
|
161
161
|
select: "选择",
|
|
@@ -164,10 +164,25 @@ var J = {
|
|
|
164
164
|
"assert-text": "检查文字",
|
|
165
165
|
assert: "断言",
|
|
166
166
|
unsupported: "需要处理"
|
|
167
|
-
},
|
|
168
|
-
import * as
|
|
169
|
-
|
|
170
|
-
|
|
167
|
+
}, J = /* @__PURE__ */ Ke({});
|
|
168
|
+
import * as $e from "gz-laya-pilot/schema";
|
|
169
|
+
Je(J, $e);
|
|
170
|
+
// src/pages/assistant/components/ActionMenu.tsx
|
|
171
|
+
function et({ label: e, items: t, disabled: n }) {
|
|
172
|
+
return /* @__PURE__ */ W(ue, {
|
|
173
|
+
trigger: ["click"],
|
|
174
|
+
menu: { items: t },
|
|
175
|
+
disabled: n,
|
|
176
|
+
children: /* @__PURE__ */ W(C, {
|
|
177
|
+
type: "text",
|
|
178
|
+
icon: /* @__PURE__ */ W(F, {}),
|
|
179
|
+
"aria-label": e,
|
|
180
|
+
disabled: n,
|
|
181
|
+
children: "更多"
|
|
182
|
+
})
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
var Y = {
|
|
171
186
|
buttonRow: "_buttonRow_gry3r_1 _buttonRow_13kbl_627",
|
|
172
187
|
field: "_field_gry3r_4 _field_13kbl_761",
|
|
173
188
|
hint: "_hint_gry3r_7 _hint_13kbl_515",
|
|
@@ -177,7 +192,7 @@ var X = {
|
|
|
177
192
|
assertionFields: "_assertionFields_gry3r_29"
|
|
178
193
|
};
|
|
179
194
|
// src/pages/assistant/components/AssertionEditor/index.tsx
|
|
180
|
-
function
|
|
195
|
+
function tt({ initial: e, steps: t, position: n, disabled: r, onSave: i, onCancel: a }) {
|
|
181
196
|
let o = b(), [s, c] = x(e ?? {
|
|
182
197
|
name: "",
|
|
183
198
|
source: "page-text",
|
|
@@ -187,24 +202,24 @@ function Ze({ initial: e, steps: t, position: n, disabled: r, onSave: i, onCance
|
|
|
187
202
|
}), [l, u] = x(n), [d, f] = x(""), p = (e) => c((t) => ({
|
|
188
203
|
...t,
|
|
189
204
|
...e
|
|
190
|
-
})), m = (0,
|
|
191
|
-
return /* @__PURE__ */
|
|
192
|
-
className: [
|
|
205
|
+
})), m = (0, J.isRequestAssertion)(s.source), h = t.slice(0, l).some((e) => e.target);
|
|
206
|
+
return /* @__PURE__ */ G("div", {
|
|
207
|
+
className: [Y.assertionEditor, Y.formStack].join(" "),
|
|
193
208
|
"data-assistant-part": "assertion-editor form-stack",
|
|
194
209
|
"aria-label": e ? "编辑断言配置" : "新增断言配置",
|
|
195
210
|
children: [
|
|
196
|
-
/* @__PURE__ */
|
|
197
|
-
className:
|
|
211
|
+
/* @__PURE__ */ G("h3", {
|
|
212
|
+
className: Y.subheading,
|
|
198
213
|
"data-assistant-part": "subheading",
|
|
199
|
-
children: [/* @__PURE__ */
|
|
214
|
+
children: [/* @__PURE__ */ W(j, {}), e ? "编辑断言" : "添加断言"]
|
|
200
215
|
}),
|
|
201
|
-
/* @__PURE__ */
|
|
202
|
-
className:
|
|
216
|
+
/* @__PURE__ */ G("div", {
|
|
217
|
+
className: Y.field,
|
|
203
218
|
"data-assistant-part": "field",
|
|
204
|
-
children: [/* @__PURE__ */
|
|
219
|
+
children: [/* @__PURE__ */ W("label", {
|
|
205
220
|
htmlFor: `${o}-name`,
|
|
206
221
|
children: "断言名称"
|
|
207
|
-
}), /* @__PURE__ */
|
|
222
|
+
}), /* @__PURE__ */ W(T, {
|
|
208
223
|
id: `${o}-name`,
|
|
209
224
|
placeholder: "例如:保存后显示成功提示",
|
|
210
225
|
value: s.name,
|
|
@@ -213,13 +228,13 @@ function Ze({ initial: e, steps: t, position: n, disabled: r, onSave: i, onCance
|
|
|
213
228
|
onChange: (e) => p({ name: e.target.value })
|
|
214
229
|
})]
|
|
215
230
|
}),
|
|
216
|
-
!e && /* @__PURE__ */
|
|
217
|
-
className:
|
|
231
|
+
!e && /* @__PURE__ */ G("div", {
|
|
232
|
+
className: Y.field,
|
|
218
233
|
"data-assistant-part": "field",
|
|
219
|
-
children: [/* @__PURE__ */
|
|
234
|
+
children: [/* @__PURE__ */ W("label", {
|
|
220
235
|
htmlFor: `${o}-position`,
|
|
221
236
|
children: "执行位置"
|
|
222
|
-
}), /* @__PURE__ */
|
|
237
|
+
}), /* @__PURE__ */ W(E, {
|
|
223
238
|
id: `${o}-position`,
|
|
224
239
|
value: l,
|
|
225
240
|
disabled: r,
|
|
@@ -233,60 +248,60 @@ function Ze({ initial: e, steps: t, position: n, disabled: r, onSave: i, onCance
|
|
|
233
248
|
}))]
|
|
234
249
|
})]
|
|
235
250
|
}),
|
|
236
|
-
/* @__PURE__ */
|
|
237
|
-
className:
|
|
251
|
+
/* @__PURE__ */ G("div", {
|
|
252
|
+
className: Y.assertionFields,
|
|
238
253
|
"data-assistant-part": "assertion-fields",
|
|
239
|
-
children: [/* @__PURE__ */
|
|
240
|
-
className:
|
|
254
|
+
children: [/* @__PURE__ */ G("div", {
|
|
255
|
+
className: Y.field,
|
|
241
256
|
"data-assistant-part": "field",
|
|
242
|
-
children: [/* @__PURE__ */
|
|
257
|
+
children: [/* @__PURE__ */ W("label", {
|
|
243
258
|
htmlFor: `${o}-source`,
|
|
244
259
|
children: "断言对象"
|
|
245
|
-
}), /* @__PURE__ */
|
|
260
|
+
}), /* @__PURE__ */ W(E, {
|
|
246
261
|
id: `${o}-source`,
|
|
247
262
|
value: s.source,
|
|
248
263
|
disabled: r,
|
|
249
|
-
options: Object.entries(
|
|
264
|
+
options: Object.entries(J.assertionSources).map(([e, t]) => ({
|
|
250
265
|
value: e,
|
|
251
266
|
label: t
|
|
252
267
|
})),
|
|
253
268
|
onChange: (e) => p({
|
|
254
269
|
source: e,
|
|
255
|
-
operator: (0,
|
|
270
|
+
operator: (0, J.operatorsFor)(e)[0],
|
|
256
271
|
expected: e === "element-count" || e === "request-count" ? "1" : "",
|
|
257
|
-
timeout: (0,
|
|
272
|
+
timeout: (0, J.isRequestAssertion)(e) ? m ? s.timeout : 3e3 : m ? 1e4 : s.timeout,
|
|
258
273
|
method: s.method ?? "GET",
|
|
259
274
|
selector: s.selector ?? ""
|
|
260
275
|
})
|
|
261
276
|
})]
|
|
262
|
-
}), /* @__PURE__ */
|
|
263
|
-
className:
|
|
277
|
+
}), /* @__PURE__ */ G("div", {
|
|
278
|
+
className: Y.field,
|
|
264
279
|
"data-assistant-part": "field",
|
|
265
|
-
children: [/* @__PURE__ */
|
|
280
|
+
children: [/* @__PURE__ */ W("label", {
|
|
266
281
|
htmlFor: `${o}-operator`,
|
|
267
282
|
children: "比较条件"
|
|
268
|
-
}), /* @__PURE__ */
|
|
283
|
+
}), /* @__PURE__ */ W(E, {
|
|
269
284
|
id: `${o}-operator`,
|
|
270
285
|
value: s.operator,
|
|
271
286
|
disabled: r,
|
|
272
287
|
onChange: (e) => p({ operator: e }),
|
|
273
|
-
options: (0,
|
|
288
|
+
options: (0, J.operatorsFor)(s.source).map((e) => ({
|
|
274
289
|
value: e,
|
|
275
|
-
label:
|
|
290
|
+
label: J.assertionOperators[e]
|
|
276
291
|
}))
|
|
277
292
|
})]
|
|
278
293
|
})]
|
|
279
294
|
}),
|
|
280
|
-
m && /* @__PURE__ */
|
|
281
|
-
/* @__PURE__ */
|
|
282
|
-
className:
|
|
295
|
+
m && /* @__PURE__ */ G(U, { children: [
|
|
296
|
+
/* @__PURE__ */ G("div", {
|
|
297
|
+
className: Y.assertionFields,
|
|
283
298
|
"data-assistant-part": "assertion-fields",
|
|
284
|
-
children: [/* @__PURE__ */
|
|
285
|
-
className:
|
|
286
|
-
children: [/* @__PURE__ */
|
|
299
|
+
children: [/* @__PURE__ */ G("div", {
|
|
300
|
+
className: Y.field,
|
|
301
|
+
children: [/* @__PURE__ */ W("label", {
|
|
287
302
|
htmlFor: `${o}-method`,
|
|
288
303
|
children: "请求方法"
|
|
289
|
-
}), /* @__PURE__ */
|
|
304
|
+
}), /* @__PURE__ */ W(E, {
|
|
290
305
|
id: `${o}-method`,
|
|
291
306
|
value: s.method,
|
|
292
307
|
disabled: r,
|
|
@@ -304,12 +319,12 @@ function Ze({ initial: e, steps: t, position: n, disabled: r, onSave: i, onCance
|
|
|
304
319
|
})),
|
|
305
320
|
onChange: (e) => p({ method: e })
|
|
306
321
|
})]
|
|
307
|
-
}), /* @__PURE__ */
|
|
308
|
-
className:
|
|
309
|
-
children: [/* @__PURE__ */
|
|
322
|
+
}), /* @__PURE__ */ G("div", {
|
|
323
|
+
className: Y.field,
|
|
324
|
+
children: [/* @__PURE__ */ W("label", {
|
|
310
325
|
htmlFor: `${o}-pathname`,
|
|
311
326
|
children: "接口路径"
|
|
312
|
-
}), /* @__PURE__ */
|
|
327
|
+
}), /* @__PURE__ */ W(T, {
|
|
313
328
|
id: `${o}-pathname`,
|
|
314
329
|
placeholder: "/api/orders",
|
|
315
330
|
maxLength: 2e3,
|
|
@@ -319,24 +334,24 @@ function Ze({ initial: e, steps: t, position: n, disabled: r, onSave: i, onCance
|
|
|
319
334
|
})]
|
|
320
335
|
})]
|
|
321
336
|
}),
|
|
322
|
-
/* @__PURE__ */
|
|
323
|
-
className:
|
|
337
|
+
/* @__PURE__ */ G("p", {
|
|
338
|
+
className: Y.hint,
|
|
324
339
|
children: ["从上一操作开始,只统计同源 Fetch / XHR,忽略查询参数。", s.source === "request-success" && " 至少调用一次,且所有调用须在窗口内完成并返回 HTTP 2xx。"]
|
|
325
340
|
}),
|
|
326
|
-
!h && /* @__PURE__ */
|
|
341
|
+
!h && /* @__PURE__ */ W(S, {
|
|
327
342
|
type: "warning",
|
|
328
343
|
title: "接口断言必须放在一次操作之后"
|
|
329
344
|
})
|
|
330
345
|
] }),
|
|
331
|
-
(0,
|
|
332
|
-
className:
|
|
346
|
+
(0, J.assertionNeedsSelector)(s.source) && /* @__PURE__ */ G("div", {
|
|
347
|
+
className: Y.field,
|
|
333
348
|
"data-assistant-part": "field",
|
|
334
349
|
children: [
|
|
335
|
-
/* @__PURE__ */
|
|
350
|
+
/* @__PURE__ */ W("label", {
|
|
336
351
|
htmlFor: `${o}-selector`,
|
|
337
352
|
children: "元素定位(CSS)"
|
|
338
353
|
}),
|
|
339
|
-
/* @__PURE__ */
|
|
354
|
+
/* @__PURE__ */ W(T, {
|
|
340
355
|
id: `${o}-selector`,
|
|
341
356
|
value: s.selector,
|
|
342
357
|
maxLength: 2e3,
|
|
@@ -344,20 +359,20 @@ function Ze({ initial: e, steps: t, position: n, disabled: r, onSave: i, onCance
|
|
|
344
359
|
disabled: r,
|
|
345
360
|
onChange: (e) => p({ selector: e.target.value })
|
|
346
361
|
}),
|
|
347
|
-
/* @__PURE__ */
|
|
348
|
-
className:
|
|
362
|
+
/* @__PURE__ */ W("p", {
|
|
363
|
+
className: Y.hint,
|
|
349
364
|
"data-assistant-part": "hint",
|
|
350
365
|
children: "可从步骤定位信息复制。除数量断言外,必须匹配唯一元素。"
|
|
351
366
|
})
|
|
352
367
|
]
|
|
353
368
|
}),
|
|
354
|
-
(0,
|
|
355
|
-
className:
|
|
369
|
+
(0, J.assertionNeedsExpected)(s.source) && /* @__PURE__ */ G("div", {
|
|
370
|
+
className: Y.field,
|
|
356
371
|
"data-assistant-part": "field",
|
|
357
|
-
children: [/* @__PURE__ */
|
|
372
|
+
children: [/* @__PURE__ */ W("label", {
|
|
358
373
|
htmlFor: `${o}-expected`,
|
|
359
374
|
children: m ? "调用次数" : "期望值"
|
|
360
|
-
}), /* @__PURE__ */
|
|
375
|
+
}), /* @__PURE__ */ W(T, {
|
|
361
376
|
id: `${o}-expected`,
|
|
362
377
|
value: s.expected,
|
|
363
378
|
maxLength: 2e3,
|
|
@@ -366,13 +381,13 @@ function Ze({ initial: e, steps: t, position: n, disabled: r, onSave: i, onCance
|
|
|
366
381
|
onChange: (e) => p({ expected: e.target.value })
|
|
367
382
|
})]
|
|
368
383
|
}),
|
|
369
|
-
/* @__PURE__ */
|
|
370
|
-
className:
|
|
384
|
+
/* @__PURE__ */ G("div", {
|
|
385
|
+
className: Y.field,
|
|
371
386
|
"data-assistant-part": "field",
|
|
372
|
-
children: [/* @__PURE__ */
|
|
387
|
+
children: [/* @__PURE__ */ W("label", {
|
|
373
388
|
htmlFor: `${o}-timeout`,
|
|
374
389
|
children: m ? "观察时间(毫秒)" : "最长等待时间(毫秒)"
|
|
375
|
-
}), /* @__PURE__ */
|
|
390
|
+
}), /* @__PURE__ */ W(fe, {
|
|
376
391
|
id: `${o}-timeout`,
|
|
377
392
|
min: 500,
|
|
378
393
|
max: 3e4,
|
|
@@ -382,21 +397,21 @@ function Ze({ initial: e, steps: t, position: n, disabled: r, onSave: i, onCance
|
|
|
382
397
|
onChange: (e) => p({ timeout: e ?? (m ? 3e3 : 1e4) })
|
|
383
398
|
})]
|
|
384
399
|
}),
|
|
385
|
-
d && /* @__PURE__ */
|
|
400
|
+
d && /* @__PURE__ */ W(S, {
|
|
386
401
|
showIcon: !0,
|
|
387
402
|
type: "error",
|
|
388
403
|
title: d
|
|
389
404
|
}),
|
|
390
|
-
/* @__PURE__ */
|
|
391
|
-
className:
|
|
405
|
+
/* @__PURE__ */ G("div", {
|
|
406
|
+
className: Y.buttonRow,
|
|
392
407
|
"data-assistant-part": "button-row",
|
|
393
|
-
children: [/* @__PURE__ */
|
|
394
|
-
icon: /* @__PURE__ */
|
|
408
|
+
children: [/* @__PURE__ */ W(C, {
|
|
409
|
+
icon: /* @__PURE__ */ W(V, {}),
|
|
395
410
|
type: "primary",
|
|
396
411
|
disabled: r || m && !h,
|
|
397
412
|
onClick: () => {
|
|
398
413
|
try {
|
|
399
|
-
let e = (0,
|
|
414
|
+
let e = (0, J.parseAssertion)(s);
|
|
400
415
|
if (e.selector) try {
|
|
401
416
|
document.querySelector(e.selector);
|
|
402
417
|
} catch {
|
|
@@ -408,7 +423,7 @@ function Ze({ initial: e, steps: t, position: n, disabled: r, onSave: i, onCance
|
|
|
408
423
|
}
|
|
409
424
|
},
|
|
410
425
|
children: "保存断言"
|
|
411
|
-
}), /* @__PURE__ */
|
|
426
|
+
}), /* @__PURE__ */ W(C, {
|
|
412
427
|
onClick: a,
|
|
413
428
|
children: "取消"
|
|
414
429
|
})]
|
|
@@ -416,17 +431,17 @@ function Ze({ initial: e, steps: t, position: n, disabled: r, onSave: i, onCance
|
|
|
416
431
|
]
|
|
417
432
|
});
|
|
418
433
|
}
|
|
419
|
-
var
|
|
434
|
+
var nt = {
|
|
420
435
|
field: "_field_1qtxy_1 _field_13kbl_761",
|
|
421
436
|
formStack: "_formStack_1qtxy_4 _formStack_13kbl_763",
|
|
422
437
|
hint: "_hint_1qtxy_7 _hint_13kbl_515",
|
|
423
438
|
supplement: "_supplement_1qtxy_10"
|
|
424
439
|
};
|
|
425
440
|
// src/pages/assistant/components/StepSupplement/index.tsx
|
|
426
|
-
function
|
|
441
|
+
function rt({ step: e, disabled: t, onApply: n }) {
|
|
427
442
|
let r = b(), [i, a] = x("click"), [o, s] = x(""), [c, l] = x(""), [u, d] = x(""), [f, p] = x(!0), [m, h] = x("");
|
|
428
|
-
return /* @__PURE__ */
|
|
429
|
-
className:
|
|
443
|
+
return /* @__PURE__ */ W(ce, {
|
|
444
|
+
className: nt.supplement,
|
|
430
445
|
"data-assistant-part": "supplement",
|
|
431
446
|
ghost: !0,
|
|
432
447
|
size: "small",
|
|
@@ -440,22 +455,22 @@ function $e({ step: e, disabled: t, onApply: n }) {
|
|
|
440
455
|
},
|
|
441
456
|
items: [{
|
|
442
457
|
key: "details",
|
|
443
|
-
label: /* @__PURE__ */
|
|
444
|
-
children: /* @__PURE__ */
|
|
445
|
-
className:
|
|
458
|
+
label: /* @__PURE__ */ W(U, { children: "补充为可执行步骤" }),
|
|
459
|
+
children: /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W("p", {
|
|
460
|
+
className: nt.hint,
|
|
446
461
|
"data-assistant-part": "hint",
|
|
447
462
|
children: "补充步骤不会改写原始事件。无法定位控件时,可退出选段后重新录制。"
|
|
448
|
-
}), /* @__PURE__ */
|
|
449
|
-
className:
|
|
463
|
+
}), /* @__PURE__ */ G("div", {
|
|
464
|
+
className: nt.formStack,
|
|
450
465
|
"data-assistant-part": "form-stack",
|
|
451
466
|
children: [
|
|
452
|
-
/* @__PURE__ */
|
|
453
|
-
className:
|
|
467
|
+
/* @__PURE__ */ G("div", {
|
|
468
|
+
className: nt.field,
|
|
454
469
|
"data-assistant-part": "field",
|
|
455
|
-
children: [/* @__PURE__ */
|
|
470
|
+
children: [/* @__PURE__ */ W("label", {
|
|
456
471
|
htmlFor: r,
|
|
457
472
|
children: "操作类型"
|
|
458
|
-
}), /* @__PURE__ */
|
|
473
|
+
}), /* @__PURE__ */ W(E, {
|
|
459
474
|
id: r,
|
|
460
475
|
"aria-label": "补充操作类型",
|
|
461
476
|
value: i,
|
|
@@ -490,30 +505,30 @@ function $e({ step: e, disabled: t, onApply: n }) {
|
|
|
490
505
|
]
|
|
491
506
|
})]
|
|
492
507
|
}),
|
|
493
|
-
i !== "assert-text" && /* @__PURE__ */
|
|
494
|
-
className:
|
|
508
|
+
i !== "assert-text" && /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ G("div", {
|
|
509
|
+
className: nt.field,
|
|
495
510
|
"data-assistant-part": "field",
|
|
496
|
-
children: [/* @__PURE__ */
|
|
511
|
+
children: [/* @__PURE__ */ W("label", {
|
|
497
512
|
htmlFor: `${r}-selector`,
|
|
498
513
|
children: "CSS 定位"
|
|
499
|
-
}), /* @__PURE__ */
|
|
514
|
+
}), /* @__PURE__ */ W(T, {
|
|
500
515
|
id: `${r}-selector`,
|
|
501
|
-
prefix: /* @__PURE__ */
|
|
516
|
+
prefix: /* @__PURE__ */ W(M, {}),
|
|
502
517
|
placeholder: "例如 button[aria-label=\"展开\"]",
|
|
503
518
|
maxLength: 2e3,
|
|
504
519
|
value: o,
|
|
505
520
|
disabled: t,
|
|
506
521
|
onChange: (e) => s(e.target.value)
|
|
507
522
|
})]
|
|
508
|
-
}), /* @__PURE__ */
|
|
509
|
-
className:
|
|
523
|
+
}), /* @__PURE__ */ G("div", {
|
|
524
|
+
className: nt.field,
|
|
510
525
|
"data-assistant-part": "field",
|
|
511
|
-
children: [/* @__PURE__ */
|
|
526
|
+
children: [/* @__PURE__ */ W("label", {
|
|
512
527
|
htmlFor: `${r}-label`,
|
|
513
528
|
children: "控件文字"
|
|
514
|
-
}), /* @__PURE__ */
|
|
529
|
+
}), /* @__PURE__ */ W(T, {
|
|
515
530
|
id: `${r}-label`,
|
|
516
|
-
prefix: /* @__PURE__ */
|
|
531
|
+
prefix: /* @__PURE__ */ W(P, {}),
|
|
517
532
|
placeholder: "如按钮文字、无障碍名称或输入提示",
|
|
518
533
|
maxLength: 200,
|
|
519
534
|
value: c,
|
|
@@ -526,13 +541,13 @@ function $e({ step: e, disabled: t, onApply: n }) {
|
|
|
526
541
|
"select",
|
|
527
542
|
"press",
|
|
528
543
|
"assert-text"
|
|
529
|
-
].includes(i) && /* @__PURE__ */
|
|
530
|
-
className:
|
|
544
|
+
].includes(i) && /* @__PURE__ */ G("div", {
|
|
545
|
+
className: nt.field,
|
|
531
546
|
"data-assistant-part": "field",
|
|
532
|
-
children: [/* @__PURE__ */
|
|
547
|
+
children: [/* @__PURE__ */ W("label", {
|
|
533
548
|
htmlFor: `${r}-value`,
|
|
534
549
|
children: i === "press" ? "按键" : i === "assert-text" ? "预期文字" : "输入值"
|
|
535
|
-
}), /* @__PURE__ */
|
|
550
|
+
}), /* @__PURE__ */ W(T, {
|
|
536
551
|
id: `${r}-value`,
|
|
537
552
|
placeholder: i === "press" ? "Enter / Escape / Tab" : void 0,
|
|
538
553
|
maxLength: 2e3,
|
|
@@ -541,14 +556,14 @@ function $e({ step: e, disabled: t, onApply: n }) {
|
|
|
541
556
|
onChange: (e) => d(e.target.value)
|
|
542
557
|
})]
|
|
543
558
|
}),
|
|
544
|
-
i === "check" && /* @__PURE__ */
|
|
559
|
+
i === "check" && /* @__PURE__ */ W(w, {
|
|
545
560
|
checked: f,
|
|
546
561
|
disabled: t,
|
|
547
562
|
onChange: (e) => p(e.target.checked),
|
|
548
563
|
children: "选中"
|
|
549
564
|
}),
|
|
550
|
-
/* @__PURE__ */
|
|
551
|
-
icon: /* @__PURE__ */
|
|
565
|
+
/* @__PURE__ */ W(C, {
|
|
566
|
+
icon: /* @__PURE__ */ W(_e, {}),
|
|
552
567
|
disabled: t,
|
|
553
568
|
onClick: () => {
|
|
554
569
|
try {
|
|
@@ -584,7 +599,7 @@ function $e({ step: e, disabled: t, onApply: n }) {
|
|
|
584
599
|
},
|
|
585
600
|
children: "应用补充"
|
|
586
601
|
}),
|
|
587
|
-
m && /* @__PURE__ */
|
|
602
|
+
m && /* @__PURE__ */ W("span", {
|
|
588
603
|
role: "alert",
|
|
589
604
|
children: m
|
|
590
605
|
})
|
|
@@ -594,7 +609,7 @@ function $e({ step: e, disabled: t, onApply: n }) {
|
|
|
594
609
|
});
|
|
595
610
|
}
|
|
596
611
|
// src/api/automation.ts
|
|
597
|
-
async function
|
|
612
|
+
async function it(e, t, n) {
|
|
598
613
|
let r = await fetch(`${e.replace(/\/$/, "")}/agent/${t}`, n === void 0 ? {} : {
|
|
599
614
|
method: "POST",
|
|
600
615
|
headers: {
|
|
@@ -616,10 +631,10 @@ async function et(e, t, n) {
|
|
|
616
631
|
].includes(i.state)) throw Error("自主探索服务版本不匹配");
|
|
617
632
|
return i;
|
|
618
633
|
}
|
|
619
|
-
var
|
|
634
|
+
var at = (e, t, n) => `${e.replace(/\/$/, "")}/agent/artifact?${new URLSearchParams({
|
|
620
635
|
id: t,
|
|
621
636
|
file: n
|
|
622
|
-
})}`,
|
|
637
|
+
})}`, X = {
|
|
623
638
|
card: "_card_1ixz9_1 _card_13kbl_633",
|
|
624
639
|
cardHeading: "_cardHeading_1ixz9_6 _cardHeading_13kbl_633",
|
|
625
640
|
buttonRow: "_buttonRow_1ixz9_9 _buttonRow_13kbl_627",
|
|
@@ -627,30 +642,30 @@ var tt = (e, t, n) => `${e.replace(/\/$/, "")}/agent/artifact?${new URLSearchPar
|
|
|
627
642
|
hint: "_hint_1ixz9_15 _hint_13kbl_515",
|
|
628
643
|
stack: "_stack_1ixz9_18",
|
|
629
644
|
caseHeading: "_caseHeading_1ixz9_25"
|
|
630
|
-
},
|
|
645
|
+
}, ot = {
|
|
631
646
|
idle: "待探索",
|
|
632
647
|
running: "执行中",
|
|
633
648
|
passed: "全部通过",
|
|
634
649
|
partial: "部分完成",
|
|
635
650
|
failed: "执行失败",
|
|
636
651
|
stopped: "已停止"
|
|
637
|
-
},
|
|
652
|
+
}, st = {
|
|
638
653
|
passed: "通过",
|
|
639
654
|
failed: "失败",
|
|
640
655
|
skipped: "未执行"
|
|
641
|
-
},
|
|
656
|
+
}, ct = {
|
|
642
657
|
state: "idle",
|
|
643
658
|
mode: "explore",
|
|
644
659
|
message: "",
|
|
645
660
|
cases: [],
|
|
646
661
|
decisions: 0
|
|
647
662
|
};
|
|
648
|
-
function
|
|
649
|
-
let [r, i] = x(
|
|
663
|
+
function lt({ bridgeUrl: e, disabled: t, onRunningChange: n }) {
|
|
664
|
+
let [r, i] = x(ct), [a, o] = x(), [s, c] = x(""), [l, u] = x(!1), [d, f] = x(!1), [p, m] = x(""), [h, g] = x(!1), [_, ee] = x();
|
|
650
665
|
y(() => {
|
|
651
666
|
let t = !1, r, a = async () => {
|
|
652
667
|
try {
|
|
653
|
-
let r = await
|
|
668
|
+
let r = await it(e, "status");
|
|
654
669
|
t || (g(!0), i(r), o(r.capabilities), n(r.state === "running"), c((e) => e || r.capabilities?.targets[0] || ""));
|
|
655
670
|
} catch {
|
|
656
671
|
t || g(!1);
|
|
@@ -665,7 +680,7 @@ function at({ bridgeUrl: e, disabled: t, onRunningChange: n }) {
|
|
|
665
680
|
let v = d || r.state === "running", b = async (t) => {
|
|
666
681
|
f(!0), m("");
|
|
667
682
|
try {
|
|
668
|
-
let r = await
|
|
683
|
+
let r = await it(e, t, {
|
|
669
684
|
url: s,
|
|
670
685
|
allowWrite: l,
|
|
671
686
|
...t === "replay" ? { workbook: _?.data } : {}
|
|
@@ -676,13 +691,14 @@ function at({ bridgeUrl: e, disabled: t, onRunningChange: n }) {
|
|
|
676
691
|
} finally {
|
|
677
692
|
f(!1);
|
|
678
693
|
}
|
|
679
|
-
}, te = (t, n) => r.id && /* @__PURE__ */
|
|
680
|
-
|
|
681
|
-
|
|
694
|
+
}, te = (t, n) => r.id && /* @__PURE__ */ W(C, {
|
|
695
|
+
type: "link",
|
|
696
|
+
icon: /* @__PURE__ */ W(xe, {}),
|
|
697
|
+
href: at(e, r.id, t),
|
|
682
698
|
children: n
|
|
683
699
|
});
|
|
684
|
-
return /* @__PURE__ */
|
|
685
|
-
className:
|
|
700
|
+
return /* @__PURE__ */ G(se, {
|
|
701
|
+
className: X.card,
|
|
686
702
|
"aria-label": "自主探索",
|
|
687
703
|
"data-assistant-part": "agent-card",
|
|
688
704
|
styles: { body: {
|
|
@@ -692,26 +708,26 @@ function at({ bridgeUrl: e, disabled: t, onRunningChange: n }) {
|
|
|
692
708
|
gap: 16
|
|
693
709
|
} },
|
|
694
710
|
children: [
|
|
695
|
-
/* @__PURE__ */
|
|
696
|
-
className:
|
|
697
|
-
children: [/* @__PURE__ */
|
|
711
|
+
/* @__PURE__ */ G("div", {
|
|
712
|
+
className: X.cardHeading,
|
|
713
|
+
children: [/* @__PURE__ */ G("h3", { children: [/* @__PURE__ */ W(Se, {}), "自主探索"] }), /* @__PURE__ */ W(D, {
|
|
698
714
|
color: v ? "processing" : r.state === "passed" ? "success" : "default",
|
|
699
|
-
children:
|
|
715
|
+
children: ot[r.state]
|
|
700
716
|
})]
|
|
701
717
|
}),
|
|
702
|
-
h ? !a?.configured && /* @__PURE__ */
|
|
718
|
+
h ? !a?.configured && /* @__PURE__ */ W(S, {
|
|
703
719
|
type: "info",
|
|
704
720
|
title: a?.message ?? "模型尚未配置"
|
|
705
|
-
}) : /* @__PURE__ */
|
|
721
|
+
}) : /* @__PURE__ */ W(S, {
|
|
706
722
|
type: "info",
|
|
707
723
|
title: "自主探索服务未连接,请启动宿主的 Laya 服务。"
|
|
708
724
|
}),
|
|
709
|
-
/* @__PURE__ */
|
|
710
|
-
className:
|
|
711
|
-
children: [/* @__PURE__ */
|
|
725
|
+
/* @__PURE__ */ G("div", {
|
|
726
|
+
className: X.field,
|
|
727
|
+
children: [/* @__PURE__ */ W("label", {
|
|
712
728
|
htmlFor: "assistant-explore-target",
|
|
713
729
|
children: "测试页面"
|
|
714
|
-
}), /* @__PURE__ */
|
|
730
|
+
}), /* @__PURE__ */ W(E, {
|
|
715
731
|
id: "assistant-explore-target",
|
|
716
732
|
"aria-label": "自主探索测试页面",
|
|
717
733
|
placeholder: "选择测试页面",
|
|
@@ -725,64 +741,66 @@ function at({ bridgeUrl: e, disabled: t, onRunningChange: n }) {
|
|
|
725
741
|
})) ?? []
|
|
726
742
|
})]
|
|
727
743
|
}),
|
|
728
|
-
/* @__PURE__ */
|
|
744
|
+
/* @__PURE__ */ W(w, {
|
|
729
745
|
disabled: v || t,
|
|
730
746
|
checked: l,
|
|
731
747
|
onChange: (e) => u(e.target.checked),
|
|
732
748
|
children: "允许创建、修改和删除本轮测试数据"
|
|
733
749
|
}),
|
|
734
|
-
/* @__PURE__ */
|
|
735
|
-
className:
|
|
736
|
-
children: v ? /* @__PURE__ */
|
|
737
|
-
|
|
750
|
+
/* @__PURE__ */ W("div", {
|
|
751
|
+
className: X.buttonRow,
|
|
752
|
+
children: v ? /* @__PURE__ */ W(C, {
|
|
753
|
+
type: "primary",
|
|
754
|
+
danger: !0,
|
|
755
|
+
icon: /* @__PURE__ */ W(Ie, {}),
|
|
738
756
|
disabled: !v || d,
|
|
739
757
|
onClick: () => void b("stop"),
|
|
740
758
|
children: "停止探索"
|
|
741
|
-
}) : /* @__PURE__ */
|
|
759
|
+
}) : /* @__PURE__ */ W(C, {
|
|
742
760
|
type: "primary",
|
|
743
|
-
icon: /* @__PURE__ */
|
|
761
|
+
icon: /* @__PURE__ */ W(Se, {}),
|
|
744
762
|
disabled: v || t || !s || !h || !a?.configured,
|
|
745
763
|
onClick: () => void b("explore"),
|
|
746
764
|
children: "开始自主探索"
|
|
747
765
|
})
|
|
748
766
|
}),
|
|
749
|
-
r.state !== "idle" && /* @__PURE__ */
|
|
750
|
-
className:
|
|
767
|
+
r.state !== "idle" && /* @__PURE__ */ G("span", {
|
|
768
|
+
className: X.hint,
|
|
751
769
|
children: [
|
|
752
770
|
r.message,
|
|
753
771
|
" ",
|
|
754
772
|
r.decisions > 0 && `· ${r.decisions} 次模型决策`
|
|
755
773
|
]
|
|
756
774
|
}),
|
|
757
|
-
p && /* @__PURE__ */
|
|
775
|
+
p && /* @__PURE__ */ W(S, {
|
|
758
776
|
closable: !0,
|
|
759
777
|
type: "error",
|
|
760
778
|
title: p,
|
|
761
779
|
onClose: () => m("")
|
|
762
780
|
}),
|
|
763
|
-
/* @__PURE__ */
|
|
764
|
-
className:
|
|
781
|
+
/* @__PURE__ */ G("div", {
|
|
782
|
+
className: X.buttonRow,
|
|
765
783
|
children: [
|
|
766
784
|
r.workbook && te(r.workbook, "下载 Excel 用例"),
|
|
767
785
|
r.id && !v && r.cases.length > 0 && te("results.xlsx", "下载执行报告"),
|
|
768
786
|
r.trace && te(r.trace, "下载 Trace")
|
|
769
787
|
]
|
|
770
788
|
}),
|
|
771
|
-
/* @__PURE__ */
|
|
789
|
+
/* @__PURE__ */ W(ce, {
|
|
772
790
|
size: "small",
|
|
773
791
|
items: [{
|
|
774
792
|
key: "replay",
|
|
775
793
|
label: "Excel 回放",
|
|
776
|
-
children: /* @__PURE__ */
|
|
777
|
-
className:
|
|
794
|
+
children: /* @__PURE__ */ G("div", {
|
|
795
|
+
className: X.stack,
|
|
778
796
|
children: [
|
|
779
|
-
/* @__PURE__ */
|
|
780
|
-
className:
|
|
797
|
+
/* @__PURE__ */ W("span", {
|
|
798
|
+
className: X.hint,
|
|
781
799
|
children: "使用自主探索生成的 Excel,入口需与所选测试页面一致。"
|
|
782
800
|
}),
|
|
783
|
-
/* @__PURE__ */
|
|
784
|
-
className:
|
|
785
|
-
children: [/* @__PURE__ */
|
|
801
|
+
/* @__PURE__ */ G("div", {
|
|
802
|
+
className: X.buttonRow,
|
|
803
|
+
children: [/* @__PURE__ */ W(he, {
|
|
786
804
|
accept: ".xlsx",
|
|
787
805
|
maxCount: 1,
|
|
788
806
|
showUploadList: !1,
|
|
@@ -803,49 +821,51 @@ function at({ bridgeUrl: e, disabled: t, onRunningChange: n }) {
|
|
|
803
821
|
}
|
|
804
822
|
return !1;
|
|
805
823
|
},
|
|
806
|
-
children: /* @__PURE__ */
|
|
807
|
-
|
|
824
|
+
children: /* @__PURE__ */ W(C, {
|
|
825
|
+
type: "text",
|
|
826
|
+
icon: /* @__PURE__ */ W(Le, {}),
|
|
808
827
|
disabled: v || t,
|
|
809
828
|
children: "导入 Excel"
|
|
810
829
|
})
|
|
811
|
-
}), /* @__PURE__ */
|
|
812
|
-
|
|
830
|
+
}), /* @__PURE__ */ W(C, {
|
|
831
|
+
type: "primary",
|
|
832
|
+
icon: /* @__PURE__ */ W(Ne, {}),
|
|
813
833
|
disabled: v || t || !h || !a?.configured || !s || !_,
|
|
814
834
|
onClick: () => void b("replay"),
|
|
815
835
|
children: "新会话回放"
|
|
816
836
|
})]
|
|
817
837
|
}),
|
|
818
|
-
_ && /* @__PURE__ */
|
|
838
|
+
_ && /* @__PURE__ */ W("span", { children: _.name })
|
|
819
839
|
]
|
|
820
840
|
})
|
|
821
841
|
}]
|
|
822
842
|
}),
|
|
823
|
-
r.cases.length > 0 && /* @__PURE__ */
|
|
843
|
+
r.cases.length > 0 && /* @__PURE__ */ W(ce, {
|
|
824
844
|
size: "small",
|
|
825
845
|
items: r.cases.map((e) => ({
|
|
826
846
|
key: e.id,
|
|
827
|
-
label: /* @__PURE__ */
|
|
828
|
-
className:
|
|
829
|
-
children: [/* @__PURE__ */
|
|
847
|
+
label: /* @__PURE__ */ G("div", {
|
|
848
|
+
className: X.caseHeading,
|
|
849
|
+
children: [/* @__PURE__ */ W(D, {
|
|
830
850
|
color: e.state === "passed" ? "success" : e.state === "failed" ? "error" : "default",
|
|
831
|
-
children:
|
|
832
|
-
}), /* @__PURE__ */
|
|
851
|
+
children: st[e.state]
|
|
852
|
+
}), /* @__PURE__ */ W("span", { children: e.title })]
|
|
833
853
|
}),
|
|
834
|
-
children: /* @__PURE__ */
|
|
835
|
-
className:
|
|
854
|
+
children: /* @__PURE__ */ G("div", {
|
|
855
|
+
className: X.stack,
|
|
836
856
|
children: [
|
|
837
|
-
/* @__PURE__ */
|
|
838
|
-
e.assertions.map((e, t) => /* @__PURE__ */
|
|
857
|
+
/* @__PURE__ */ W("span", { children: e.reason }),
|
|
858
|
+
e.assertions.map((e, t) => /* @__PURE__ */ W(S, {
|
|
839
859
|
type: e.passed ? "success" : "error",
|
|
840
860
|
title: e.expected,
|
|
841
861
|
description: `实际:${e.actual}`
|
|
842
862
|
}, t)),
|
|
843
|
-
e.errors.map((e, t) => /* @__PURE__ */
|
|
863
|
+
e.errors.map((e, t) => /* @__PURE__ */ W(S, {
|
|
844
864
|
type: "error",
|
|
845
865
|
title: e
|
|
846
866
|
}, t)),
|
|
847
|
-
e.cleanup && /* @__PURE__ */
|
|
848
|
-
className:
|
|
867
|
+
e.cleanup && /* @__PURE__ */ W("span", {
|
|
868
|
+
className: X.hint,
|
|
849
869
|
children: e.cleanup
|
|
850
870
|
}),
|
|
851
871
|
e.screenshot && te(e.screenshot, "查看截图证据")
|
|
@@ -857,7 +877,7 @@ function at({ bridgeUrl: e, disabled: t, onRunningChange: n }) {
|
|
|
857
877
|
});
|
|
858
878
|
}
|
|
859
879
|
// src/pages/assistant/components/TestLibraryPanel/libraryRequest.ts
|
|
860
|
-
function
|
|
880
|
+
function ut(e) {
|
|
861
881
|
return v(async (t = "", n = "GET", r, i) => {
|
|
862
882
|
let a = await fetch(e + t, {
|
|
863
883
|
method: n,
|
|
@@ -875,7 +895,7 @@ function ot(e) {
|
|
|
875
895
|
return o;
|
|
876
896
|
}, [e]);
|
|
877
897
|
}
|
|
878
|
-
var
|
|
898
|
+
var Z = {
|
|
879
899
|
card: "_card_137oe_1 _card_13kbl_633",
|
|
880
900
|
hint: "_hint_137oe_4 _hint_13kbl_515",
|
|
881
901
|
buttonRow: "_buttonRow_137oe_7 _buttonRow_13kbl_627",
|
|
@@ -883,7 +903,7 @@ var Q = {
|
|
|
883
903
|
list: "_list_137oe_11",
|
|
884
904
|
entryLink: "_entryLink_137oe_26",
|
|
885
905
|
resourceList: "_resourceList_137oe_33"
|
|
886
|
-
},
|
|
906
|
+
}, dt = {
|
|
887
907
|
running: "执行中",
|
|
888
908
|
stopping: "停止中",
|
|
889
909
|
passed: "通过",
|
|
@@ -893,19 +913,20 @@ var Q = {
|
|
|
893
913
|
idle: "未执行",
|
|
894
914
|
interrupted: "已中断"
|
|
895
915
|
};
|
|
896
|
-
function
|
|
897
|
-
return /* @__PURE__ */
|
|
898
|
-
className:
|
|
916
|
+
function ft({ run: e, base: t, onExport: n }) {
|
|
917
|
+
return /* @__PURE__ */ G("div", {
|
|
918
|
+
className: Z.stack,
|
|
899
919
|
children: [
|
|
900
|
-
/* @__PURE__ */
|
|
901
|
-
className:
|
|
902
|
-
children: /* @__PURE__ */
|
|
920
|
+
/* @__PURE__ */ W("div", {
|
|
921
|
+
className: Z.buttonRow,
|
|
922
|
+
children: /* @__PURE__ */ W(C, {
|
|
923
|
+
type: "text",
|
|
903
924
|
onClick: n,
|
|
904
925
|
children: "导出报告 JSON"
|
|
905
926
|
})
|
|
906
927
|
}),
|
|
907
|
-
/* @__PURE__ */
|
|
908
|
-
e.iterations?.map(({ iteration: n, cases: r }) => /* @__PURE__ */
|
|
928
|
+
/* @__PURE__ */ G("div", { children: [/* @__PURE__ */ W(D, { children: dt[e.state] ?? e.state }), e.message] }),
|
|
929
|
+
e.iterations?.map(({ iteration: n, cases: r }) => /* @__PURE__ */ G("details", { children: [/* @__PURE__ */ G("summary", { children: [
|
|
909
930
|
"第 ",
|
|
910
931
|
n,
|
|
911
932
|
" / ",
|
|
@@ -913,17 +934,17 @@ function ct({ run: e, base: t, onExport: n }) {
|
|
|
913
934
|
" 轮 · ",
|
|
914
935
|
r.length,
|
|
915
936
|
" 个用例"
|
|
916
|
-
] }), /* @__PURE__ */
|
|
917
|
-
className:
|
|
918
|
-
children: r.map((r) => /* @__PURE__ */
|
|
919
|
-
/* @__PURE__ */
|
|
937
|
+
] }), /* @__PURE__ */ W("ul", {
|
|
938
|
+
className: Z.list,
|
|
939
|
+
children: r.map((r) => /* @__PURE__ */ G("li", { children: [
|
|
940
|
+
/* @__PURE__ */ G("strong", { children: [
|
|
920
941
|
r.suiteName,
|
|
921
942
|
" · ",
|
|
922
943
|
r.caseName
|
|
923
944
|
] }),
|
|
924
|
-
/* @__PURE__ */
|
|
925
|
-
/* @__PURE__ */
|
|
926
|
-
/* @__PURE__ */
|
|
945
|
+
/* @__PURE__ */ W("code", { children: r.url ?? r.path }),
|
|
946
|
+
/* @__PURE__ */ G("span", { children: [
|
|
947
|
+
/* @__PURE__ */ W(D, { children: dt[r.status.state] ?? r.status.state }),
|
|
927
948
|
"步骤 ",
|
|
928
949
|
r.status.step,
|
|
929
950
|
" / ",
|
|
@@ -931,22 +952,22 @@ function ct({ run: e, base: t, onExport: n }) {
|
|
|
931
952
|
" · ",
|
|
932
953
|
r.status.message
|
|
933
954
|
] }),
|
|
934
|
-
r.status.failure && /* @__PURE__ */
|
|
935
|
-
/* @__PURE__ */
|
|
936
|
-
/* @__PURE__ */
|
|
955
|
+
r.status.failure && /* @__PURE__ */ G("div", { children: [
|
|
956
|
+
/* @__PURE__ */ W("strong", { children: "已观察" }),
|
|
957
|
+
/* @__PURE__ */ G("div", { children: [
|
|
937
958
|
r.status.failure.label,
|
|
938
959
|
" ",
|
|
939
|
-
r.status.failure.selector && /* @__PURE__ */
|
|
960
|
+
r.status.failure.selector && /* @__PURE__ */ W("code", { children: r.status.failure.selector })
|
|
940
961
|
] }),
|
|
941
|
-
r.status.failure.matchedCount !== void 0 && /* @__PURE__ */
|
|
962
|
+
r.status.failure.matchedCount !== void 0 && /* @__PURE__ */ G("div", { children: [
|
|
942
963
|
"匹配到 ",
|
|
943
964
|
r.status.failure.matchedCount,
|
|
944
965
|
" 个元素"
|
|
945
966
|
] }),
|
|
946
|
-
r.status.failure.hint && /* @__PURE__ */
|
|
967
|
+
r.status.failure.hint && /* @__PURE__ */ G("div", { children: ["建议检查:", r.status.failure.hint] })
|
|
947
968
|
] }),
|
|
948
|
-
r.status.assertions?.map((e) => /* @__PURE__ */
|
|
949
|
-
/* @__PURE__ */
|
|
969
|
+
r.status.assertions?.map((e) => /* @__PURE__ */ G("div", { children: [
|
|
970
|
+
/* @__PURE__ */ W(D, {
|
|
950
971
|
color: e.passed ? "green" : "red",
|
|
951
972
|
children: e.passed ? "通过" : "失败"
|
|
952
973
|
}),
|
|
@@ -960,15 +981,15 @@ function ct({ run: e, base: t, onExport: n }) {
|
|
|
960
981
|
" ",
|
|
961
982
|
e.actual
|
|
962
983
|
] }, e.step)),
|
|
963
|
-
r.trace && /* @__PURE__ */
|
|
964
|
-
className:
|
|
965
|
-
children: [/* @__PURE__ */
|
|
984
|
+
r.trace && /* @__PURE__ */ G("div", {
|
|
985
|
+
className: Z.buttonRow,
|
|
986
|
+
children: [/* @__PURE__ */ W(C, {
|
|
966
987
|
size: "small",
|
|
967
988
|
href: `${t}/runs/${e.id}/trace?iteration=${n}&caseIndex=${r.caseIndex}`,
|
|
968
989
|
download: !0,
|
|
969
990
|
children: "下载 Trace"
|
|
970
|
-
}), /* @__PURE__ */
|
|
971
|
-
className:
|
|
991
|
+
}), /* @__PURE__ */ W("small", {
|
|
992
|
+
className: Z.hint,
|
|
972
993
|
children: "含页面与网络信息,仅在本机查看"
|
|
973
994
|
})]
|
|
974
995
|
})
|
|
@@ -978,8 +999,8 @@ function ct({ run: e, base: t, onExport: n }) {
|
|
|
978
999
|
});
|
|
979
1000
|
}
|
|
980
1001
|
// src/pages/assistant/components/TestLibraryPanel/LibraryDetail.tsx
|
|
981
|
-
function
|
|
982
|
-
return /* @__PURE__ */
|
|
1002
|
+
function pt({ options: e, values: t, onChange: n }) {
|
|
1003
|
+
return /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W(E, {
|
|
983
1004
|
"aria-label": "添加到执行顺序",
|
|
984
1005
|
placeholder: "选择要添加的项目",
|
|
985
1006
|
value: null,
|
|
@@ -988,12 +1009,13 @@ function lt({ options: e, values: t, onChange: n }) {
|
|
|
988
1009
|
onChange: (e) => {
|
|
989
1010
|
e && n([...t, e]);
|
|
990
1011
|
}
|
|
991
|
-
}), /* @__PURE__ */
|
|
992
|
-
className:
|
|
993
|
-
children: t.map((r, i) => /* @__PURE__ */
|
|
994
|
-
className:
|
|
995
|
-
children: [/* @__PURE__ */
|
|
1012
|
+
}), /* @__PURE__ */ W("ol", {
|
|
1013
|
+
className: Z.list,
|
|
1014
|
+
children: t.map((r, i) => /* @__PURE__ */ G("li", { children: [/* @__PURE__ */ W("span", { children: e.find(({ value: e }) => e === r)?.label ?? r }), /* @__PURE__ */ G("div", {
|
|
1015
|
+
className: Z.buttonRow,
|
|
1016
|
+
children: [/* @__PURE__ */ W(C, {
|
|
996
1017
|
size: "small",
|
|
1018
|
+
type: "text",
|
|
997
1019
|
"aria-label": `上移第 ${i + 1} 项`,
|
|
998
1020
|
disabled: i === 0,
|
|
999
1021
|
onClick: () => {
|
|
@@ -1001,8 +1023,9 @@ function lt({ options: e, values: t, onChange: n }) {
|
|
|
1001
1023
|
[e[i - 1], e[i]] = [e[i], e[i - 1]], n(e);
|
|
1002
1024
|
},
|
|
1003
1025
|
children: "上移"
|
|
1004
|
-
}), /* @__PURE__ */
|
|
1026
|
+
}), /* @__PURE__ */ W(C, {
|
|
1005
1027
|
size: "small",
|
|
1028
|
+
type: "text",
|
|
1006
1029
|
"aria-label": `移除第 ${i + 1} 项`,
|
|
1007
1030
|
onClick: () => n(t.filter((e, t) => t !== i)),
|
|
1008
1031
|
children: "移除"
|
|
@@ -1010,37 +1033,37 @@ function lt({ options: e, values: t, onChange: n }) {
|
|
|
1010
1033
|
})] }, i))
|
|
1011
1034
|
})] });
|
|
1012
1035
|
}
|
|
1013
|
-
function
|
|
1014
|
-
let [d, f] = x(), [m, h] = x([]), [g, _] = x("cases"), ee = re(null), [b, ne] = x(!1), [ie, ae] = x(""), [oe,
|
|
1015
|
-
o(e),
|
|
1036
|
+
function mt({ base: e, name: t, onBack: n, onRename: r, draft: i, disabled: a, onEdit: o, recording: s, incomingDraft: c, onConsumeDraft: l, renderEditor: u }) {
|
|
1037
|
+
let [d, f] = x(), [m, h] = x([]), [g, _] = x("cases"), ee = re(null), [b, ne] = x(!1), [ie, ae] = x(""), [oe, w] = x(), [ce, le] = x(), [ue, me] = x(!1), [he, O] = x(!1), [k, A] = x(), ge = !!(k && k.baseline !== JSON.stringify(i)), j = () => !s && (!ge || window.confirm("当前用例有未保存修改,确定离开?")), _e = (e, t, n) => {
|
|
1038
|
+
o(e), w(t), xe(void 0), le(n), A({
|
|
1016
1039
|
caseId: t,
|
|
1017
1040
|
suiteId: n,
|
|
1018
1041
|
baseline: JSON.stringify(e)
|
|
1019
1042
|
}), _("cases");
|
|
1020
1043
|
}, ve = (e) => {
|
|
1021
|
-
!b && !s &&
|
|
1022
|
-
}, [
|
|
1044
|
+
!b && !s && j() && Re() && ze() && (A(void 0), me(!1), O(!1), _(e));
|
|
1045
|
+
}, [M, N] = x({
|
|
1023
1046
|
id: "",
|
|
1024
1047
|
name: "",
|
|
1025
1048
|
caseIds: []
|
|
1026
|
-
}),
|
|
1049
|
+
}), ye = re(null), [be, xe] = x(), [P, F] = x({
|
|
1027
1050
|
id: "",
|
|
1028
1051
|
name: "",
|
|
1029
1052
|
suiteIds: [],
|
|
1030
1053
|
repeat: 1
|
|
1031
|
-
}), [
|
|
1054
|
+
}), [Se, Ce] = x(), [we, Te] = x();
|
|
1032
1055
|
y(() => {
|
|
1033
|
-
c && d && !s && !b && ((!
|
|
1056
|
+
c && d && !s && !b && ((!ge || window.confirm("时间线草稿会替换当前未保存的编辑。继续?")) && Re() && ze() && (me(!1), O(!1), w(void 0), le(void 0), o(c), A({ baseline: "" }), _("cases")), l?.());
|
|
1034
1057
|
}, [
|
|
1035
1058
|
c,
|
|
1036
1059
|
d,
|
|
1037
1060
|
s,
|
|
1038
1061
|
b,
|
|
1039
|
-
|
|
1062
|
+
ge,
|
|
1040
1063
|
o,
|
|
1041
1064
|
l
|
|
1042
1065
|
]);
|
|
1043
|
-
let
|
|
1066
|
+
let Ee = Se ?? m[0]?.id, De = m.some((e) => e.state === "running" || e.state === "stopping"), I = ut(e), L = async (e) => {
|
|
1044
1067
|
if (!b) {
|
|
1045
1068
|
ne(!0), ae("");
|
|
1046
1069
|
try {
|
|
@@ -1051,63 +1074,74 @@ function ut({ base: e, name: t, onBack: n, onRename: r, draft: i, disabled: a, o
|
|
|
1051
1074
|
ne(!1);
|
|
1052
1075
|
}
|
|
1053
1076
|
}
|
|
1054
|
-
},
|
|
1055
|
-
let t = await
|
|
1077
|
+
}, Oe = v(async (e) => {
|
|
1078
|
+
let t = await I("", "GET", void 0, e);
|
|
1056
1079
|
if (t.version !== 1 || !Array.isArray(t.cases)) throw Error("本机测试库服务版本不匹配");
|
|
1057
|
-
let n = await
|
|
1080
|
+
let n = await I("/runs", "GET", void 0, e);
|
|
1058
1081
|
e?.aborted || (f(t), h(n));
|
|
1059
|
-
}, [
|
|
1082
|
+
}, [I]), R = () => void L(Oe);
|
|
1060
1083
|
y(() => {
|
|
1061
1084
|
let e = new AbortController();
|
|
1062
|
-
return ne(!0),
|
|
1085
|
+
return ne(!0), Oe(e.signal).catch((t) => {
|
|
1063
1086
|
e.signal.aborted || ae(t instanceof Error ? t.message : "本机测试库服务未连接");
|
|
1064
1087
|
}).finally(() => {
|
|
1065
1088
|
e.signal.aborted || ne(!1);
|
|
1066
1089
|
}), () => e.abort();
|
|
1067
|
-
}, [
|
|
1068
|
-
if (!
|
|
1090
|
+
}, [Oe]), y(() => {
|
|
1091
|
+
if (!De && (!Ee || g !== "reports")) return;
|
|
1069
1092
|
let e = new AbortController(), t = async () => {
|
|
1070
|
-
let t = await
|
|
1071
|
-
e.signal.aborted || (h(t), n &&
|
|
1093
|
+
let t = await I("/runs", "GET", void 0, e.signal), n = g === "reports" && Ee ? await I(`/runs/${Ee}`, "GET", void 0, e.signal) : void 0;
|
|
1094
|
+
e.signal.aborted || (h(t), n && Te(n));
|
|
1072
1095
|
}, n = () => void t().catch(() => {});
|
|
1073
1096
|
n();
|
|
1074
|
-
let r =
|
|
1097
|
+
let r = De ? setInterval(n, 1e3) : void 0;
|
|
1075
1098
|
return () => {
|
|
1076
1099
|
clearInterval(r), e.abort();
|
|
1077
1100
|
};
|
|
1078
1101
|
}, [
|
|
1079
|
-
|
|
1102
|
+
I,
|
|
1103
|
+
Ee,
|
|
1080
1104
|
De,
|
|
1081
|
-
Oe,
|
|
1082
1105
|
g
|
|
1083
1106
|
]);
|
|
1084
|
-
let
|
|
1085
|
-
f(await
|
|
1086
|
-
},
|
|
1107
|
+
let ke = async (e) => {
|
|
1108
|
+
f(await I("", "PUT", e));
|
|
1109
|
+
}, Ae = (e, t) => {
|
|
1087
1110
|
let n = URL.createObjectURL(new Blob([JSON.stringify(e, null, 2)], { type: "application/json" })), r = document.createElement("a");
|
|
1088
1111
|
r.href = n, r.download = t, r.click(), setTimeout(() => URL.revokeObjectURL(n), 3e4);
|
|
1089
|
-
},
|
|
1112
|
+
}, je = (e, t) => e.some(({ id: e }) => e === t.id) ? e.map((e) => e.id === t.id ? t : e) : [...e, t], z = !a && !b && !De, Me = d?.cases.map(({ id: e, testCase: t }) => ({
|
|
1090
1113
|
label: t.name,
|
|
1091
1114
|
value: e
|
|
1092
|
-
})) ?? [],
|
|
1115
|
+
})) ?? [], Ne = d?.suites.map(({ id: e, name: t }) => ({
|
|
1093
1116
|
label: t,
|
|
1094
1117
|
value: e
|
|
1095
|
-
})) ?? [],
|
|
1118
|
+
})) ?? [], B = d?.cases.find(({ id: e }) => e === oe), Pe = B ? d?.suites.filter((e) => !e.caseIds.includes(B.id)) ?? [] : [], V = d?.suites.find(({ id: e }) => e === M.id), H = d?.plans.find(({ id: e }) => e === P.id), Fe = V?.caseIds ?? [], Ie = M.name !== (V?.name ?? "") || JSON.stringify(M.caseIds) !== JSON.stringify(Fe), Le = P.name !== (H?.name ?? "") || P.repeat !== (H?.repeat ?? 1) || JSON.stringify(P.suiteIds) !== JSON.stringify(H?.suiteIds ?? []), Re = () => !ue || !Ie || window.confirm("当前套件有未保存修改,确定放弃?"), ze = () => !he || !Le || window.confirm("当前计划有未保存修改,确定放弃?");
|
|
1096
1119
|
te(() => {
|
|
1097
1120
|
let e = ee.current?.closest("[role=\"dialog\"]");
|
|
1098
1121
|
if (e) for (let t = ee.current?.parentElement; t && t !== e; t = t.parentElement) t.scrollTop && (t.scrollTop = 0);
|
|
1099
1122
|
}, [
|
|
1100
1123
|
g,
|
|
1101
1124
|
oe,
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1125
|
+
k,
|
|
1126
|
+
M.id,
|
|
1127
|
+
ue,
|
|
1128
|
+
P.id,
|
|
1106
1129
|
he
|
|
1107
1130
|
]);
|
|
1108
|
-
let
|
|
1109
|
-
|
|
1110
|
-
|
|
1131
|
+
let Be = g === "cases" ? B?.testCase.name : g === "suites" ? V?.name : g === "plans" ? H?.name : void 0, Ve = () => {
|
|
1132
|
+
!b && j() && Re() && ze() && (w(void 0), A(void 0), me(!1), O(!1), N({
|
|
1133
|
+
id: "",
|
|
1134
|
+
name: "",
|
|
1135
|
+
caseIds: []
|
|
1136
|
+
}), F({
|
|
1137
|
+
id: "",
|
|
1138
|
+
name: "",
|
|
1139
|
+
suiteIds: [],
|
|
1140
|
+
repeat: 1
|
|
1141
|
+
}));
|
|
1142
|
+
};
|
|
1143
|
+
return /* @__PURE__ */ G(se, {
|
|
1144
|
+
className: Z.card,
|
|
1111
1145
|
"aria-label": "本机测试库",
|
|
1112
1146
|
styles: { body: {
|
|
1113
1147
|
padding: 0,
|
|
@@ -1116,296 +1150,280 @@ function ut({ base: e, name: t, onBack: n, onRename: r, draft: i, disabled: a, o
|
|
|
1116
1150
|
gap: 16
|
|
1117
1151
|
} },
|
|
1118
1152
|
children: [
|
|
1119
|
-
/* @__PURE__ */
|
|
1153
|
+
/* @__PURE__ */ G("nav", {
|
|
1120
1154
|
ref: ee,
|
|
1121
1155
|
"aria-label": "当前位置",
|
|
1122
|
-
className:
|
|
1156
|
+
className: Z.buttonRow,
|
|
1123
1157
|
children: [
|
|
1124
|
-
/* @__PURE__ */
|
|
1158
|
+
/* @__PURE__ */ W(C, {
|
|
1125
1159
|
type: "link",
|
|
1126
1160
|
size: "small",
|
|
1127
|
-
className:
|
|
1161
|
+
className: Z.entryLink,
|
|
1128
1162
|
disabled: b || s,
|
|
1129
1163
|
onClick: () => {
|
|
1130
|
-
|
|
1164
|
+
j() && Re() && ze() && n();
|
|
1131
1165
|
},
|
|
1132
1166
|
children: "测试库"
|
|
1133
1167
|
}),
|
|
1134
|
-
/* @__PURE__ */
|
|
1168
|
+
/* @__PURE__ */ W("span", {
|
|
1135
1169
|
"aria-hidden": "true",
|
|
1136
1170
|
children: "/"
|
|
1137
1171
|
}),
|
|
1138
|
-
|
|
1139
|
-
/* @__PURE__ */
|
|
1172
|
+
Be || k || ue || he ? /* @__PURE__ */ G(U, { children: [
|
|
1173
|
+
/* @__PURE__ */ W(C, {
|
|
1140
1174
|
type: "link",
|
|
1141
1175
|
size: "small",
|
|
1142
|
-
className:
|
|
1176
|
+
className: Z.entryLink,
|
|
1143
1177
|
disabled: b || s,
|
|
1144
|
-
onClick:
|
|
1145
|
-
!b && ge() && ze() && Be() && (ce(void 0), j(void 0), O(!1), k(!1), be(void 0), P({
|
|
1146
|
-
id: "",
|
|
1147
|
-
name: "",
|
|
1148
|
-
caseIds: []
|
|
1149
|
-
}), I({
|
|
1150
|
-
id: "",
|
|
1151
|
-
name: "",
|
|
1152
|
-
suiteIds: [],
|
|
1153
|
-
repeat: 1
|
|
1154
|
-
}));
|
|
1155
|
-
},
|
|
1178
|
+
onClick: Ve,
|
|
1156
1179
|
children: t
|
|
1157
1180
|
}),
|
|
1158
|
-
/* @__PURE__ */
|
|
1181
|
+
/* @__PURE__ */ W("span", {
|
|
1159
1182
|
"aria-hidden": "true",
|
|
1160
1183
|
children: "/"
|
|
1161
1184
|
}),
|
|
1162
|
-
/* @__PURE__ */
|
|
1185
|
+
/* @__PURE__ */ W("span", {
|
|
1163
1186
|
"aria-current": "page",
|
|
1164
|
-
children:
|
|
1187
|
+
children: Be ?? (k ? "新建用例" : ue ? "新建套件" : "新建计划")
|
|
1165
1188
|
})
|
|
1166
|
-
] }) : /* @__PURE__ */
|
|
1189
|
+
] }) : /* @__PURE__ */ W("h3", { children: t })
|
|
1167
1190
|
]
|
|
1168
1191
|
}),
|
|
1169
|
-
ie && /* @__PURE__ */
|
|
1192
|
+
ie && /* @__PURE__ */ W(S, {
|
|
1170
1193
|
type: "error",
|
|
1171
1194
|
title: ie,
|
|
1172
|
-
action: d && /* @__PURE__ */
|
|
1195
|
+
action: d && /* @__PURE__ */ W(C, {
|
|
1196
|
+
type: "text",
|
|
1173
1197
|
size: "small",
|
|
1174
1198
|
disabled: b || s,
|
|
1175
|
-
onClick:
|
|
1199
|
+
onClick: R,
|
|
1176
1200
|
children: "刷新测试库"
|
|
1177
1201
|
})
|
|
1178
1202
|
}),
|
|
1179
|
-
d ? /* @__PURE__ */
|
|
1180
|
-
|
|
1181
|
-
/* @__PURE__ */
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1203
|
+
d ? /* @__PURE__ */ G(U, { children: [!k && !ue && !he && !(g === "cases" && B) && !(g === "suites" && V) && !(g === "plans" && H) && /* @__PURE__ */ G("div", {
|
|
1204
|
+
className: Z.buttonRow,
|
|
1205
|
+
children: [/* @__PURE__ */ W(et, {
|
|
1206
|
+
label: "测试库更多操作",
|
|
1207
|
+
items: [
|
|
1208
|
+
{
|
|
1209
|
+
key: "rename",
|
|
1210
|
+
label: "重命名",
|
|
1211
|
+
disabled: !z,
|
|
1212
|
+
onClick: r
|
|
1213
|
+
},
|
|
1214
|
+
{
|
|
1215
|
+
key: "refresh",
|
|
1216
|
+
label: "刷新测试库",
|
|
1190
1217
|
disabled: b,
|
|
1191
|
-
onClick:
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1218
|
+
onClick: R
|
|
1219
|
+
},
|
|
1220
|
+
{
|
|
1221
|
+
key: "import",
|
|
1222
|
+
label: "导入测试库",
|
|
1223
|
+
disabled: !z,
|
|
1224
|
+
onClick: () => ye.current?.click()
|
|
1225
|
+
},
|
|
1226
|
+
{
|
|
1227
|
+
key: "export",
|
|
1228
|
+
label: "导出测试库",
|
|
1229
|
+
title: "导出包含用例入口的查询参数和片段,分享前请移除敏感值。",
|
|
1195
1230
|
disabled: b,
|
|
1196
|
-
onClick: () =>
|
|
1197
|
-
|
|
1198
|
-
}),
|
|
1199
|
-
/* @__PURE__ */ G(me, {
|
|
1200
|
-
accept: ".json,application/json",
|
|
1201
|
-
showUploadList: !1,
|
|
1202
|
-
disabled: !B,
|
|
1203
|
-
beforeUpload: async (e) => (s || A && !ge() || !window.confirm("导入会替换本机测试库,并丢弃未保存的套件和计划。继续?") || await R(async () => {
|
|
1204
|
-
if (e.size > 2097152) throw Error("测试库文件不能超过 2 MB");
|
|
1205
|
-
let t = JSON.parse(await e.text());
|
|
1206
|
-
await Ae({
|
|
1207
|
-
...t,
|
|
1208
|
-
revision: d.revision
|
|
1209
|
-
}), j(void 0), ce(void 0), O(!1), k(!1), P({
|
|
1210
|
-
id: "",
|
|
1211
|
-
name: "",
|
|
1212
|
-
caseIds: []
|
|
1213
|
-
}), be(void 0), I({
|
|
1214
|
-
id: "",
|
|
1215
|
-
name: "",
|
|
1216
|
-
suiteIds: [],
|
|
1217
|
-
repeat: 1
|
|
1218
|
-
}), we(void 0), _("cases");
|
|
1219
|
-
}), me.LIST_IGNORE),
|
|
1220
|
-
children: /* @__PURE__ */ G(C, {
|
|
1221
|
-
disabled: !B,
|
|
1222
|
-
children: "导入测试库"
|
|
1223
|
-
})
|
|
1224
|
-
})
|
|
1231
|
+
onClick: () => Ae(d, "研发小蜜测试库.json")
|
|
1232
|
+
}
|
|
1225
1233
|
]
|
|
1226
|
-
}),
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1234
|
+
}), /* @__PURE__ */ W("input", {
|
|
1235
|
+
hidden: !0,
|
|
1236
|
+
type: "file",
|
|
1237
|
+
ref: ye,
|
|
1238
|
+
accept: ".json,application/json",
|
|
1239
|
+
onChange: (e) => {
|
|
1240
|
+
let t = e.target.files?.[0];
|
|
1241
|
+
e.target.value = "", t && z && window.confirm("导入会替换当前测试库中的用例、套件和计划。继续?") && L(async () => {
|
|
1242
|
+
if (t.size > 2097152) throw Error("测试库文件不能超过 2 MB");
|
|
1243
|
+
let e = JSON.parse(await t.text());
|
|
1244
|
+
await ke({
|
|
1245
|
+
...e,
|
|
1246
|
+
revision: d.revision
|
|
1247
|
+
}), Ve(), Ce(void 0), _("cases");
|
|
1248
|
+
});
|
|
1249
|
+
}
|
|
1250
|
+
})]
|
|
1251
|
+
}), /* @__PURE__ */ W(pe, {
|
|
1232
1252
|
activeKey: g,
|
|
1233
1253
|
onChange: ve,
|
|
1234
1254
|
items: [
|
|
1235
1255
|
{
|
|
1236
1256
|
key: "cases",
|
|
1237
1257
|
label: "用例",
|
|
1238
|
-
children:
|
|
1239
|
-
className:
|
|
1240
|
-
children: [/* @__PURE__ */
|
|
1241
|
-
className:
|
|
1242
|
-
children: [
|
|
1243
|
-
/* @__PURE__ */ G(C, {
|
|
1244
|
-
disabled: b || s,
|
|
1245
|
-
onClick: () => {
|
|
1246
|
-
ge() && (j(void 0), A.suiteId && !A.caseId && _("suites"));
|
|
1247
|
-
},
|
|
1248
|
-
children: A.caseId ? "返回用例详情" : A.suiteId ? "返回原套件" : "返回用例列表"
|
|
1249
|
-
}),
|
|
1250
|
-
/* @__PURE__ */ G("h4", { children: A.caseId ? "编辑用例" : "新建用例" }),
|
|
1251
|
-
/* @__PURE__ */ G(D, { children: M ? "未保存" : A.caseId ? "已保存" : "新用例" })
|
|
1252
|
-
]
|
|
1258
|
+
children: k ? /* @__PURE__ */ G("div", {
|
|
1259
|
+
className: Z.stack,
|
|
1260
|
+
children: [/* @__PURE__ */ G("div", {
|
|
1261
|
+
className: Z.buttonRow,
|
|
1262
|
+
children: [/* @__PURE__ */ W("h4", { children: k.caseId ? "编辑用例" : "新建用例" }), /* @__PURE__ */ W(D, { children: ge ? "未保存" : k.caseId ? "已保存" : "新用例" })]
|
|
1253
1263
|
}), u({
|
|
1254
|
-
busy: b ||
|
|
1255
|
-
dirty:
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1264
|
+
busy: b || De || a && !s,
|
|
1265
|
+
dirty: ge,
|
|
1266
|
+
cancel: () => {
|
|
1267
|
+
j() && (A(void 0), k.suiteId && !k.caseId && _("suites"));
|
|
1268
|
+
},
|
|
1269
|
+
save: (e) => L(async () => {
|
|
1270
|
+
let t = k.caseId ?? crypto.randomUUID();
|
|
1271
|
+
if (k.caseId && !d.cases.some(({ id: e }) => e === t)) throw Error("当前用例已被删除,可返回后另存为新用例");
|
|
1272
|
+
let n = d.suites.find(({ id: e }) => e === k.suiteId);
|
|
1273
|
+
if (k.suiteId && !n) throw Error("原套件已被删除");
|
|
1261
1274
|
let r = n && !n.caseIds.includes(t) ? {
|
|
1262
1275
|
...n,
|
|
1263
1276
|
caseIds: [...n.caseIds, t]
|
|
1264
1277
|
} : n;
|
|
1265
|
-
await
|
|
1278
|
+
await ke({
|
|
1266
1279
|
...d,
|
|
1267
|
-
cases:
|
|
1280
|
+
cases: je(d.cases, {
|
|
1268
1281
|
id: t,
|
|
1269
1282
|
testCase: e
|
|
1270
1283
|
}),
|
|
1271
|
-
suites: r ?
|
|
1272
|
-
}), r &&
|
|
1284
|
+
suites: r ? je(d.suites, r) : d.suites
|
|
1285
|
+
}), r && N(r), o(e), w(t), A(void 0);
|
|
1273
1286
|
})
|
|
1274
1287
|
})]
|
|
1275
|
-
}) :
|
|
1276
|
-
className:
|
|
1288
|
+
}) : B ? /* @__PURE__ */ G("section", {
|
|
1289
|
+
className: Z.stack,
|
|
1277
1290
|
"aria-label": "用例详情",
|
|
1278
1291
|
children: [
|
|
1279
|
-
/* @__PURE__ */
|
|
1280
|
-
/* @__PURE__ */
|
|
1281
|
-
/* @__PURE__ */
|
|
1282
|
-
className:
|
|
1283
|
-
children:
|
|
1284
|
-
/* @__PURE__ */
|
|
1285
|
-
e.assertion.method && /* @__PURE__ */
|
|
1292
|
+
/* @__PURE__ */ W("h4", { children: B.testCase.name }),
|
|
1293
|
+
/* @__PURE__ */ W("code", { children: B.url ?? B.testCase.path }),
|
|
1294
|
+
/* @__PURE__ */ W("ol", {
|
|
1295
|
+
className: Z.list,
|
|
1296
|
+
children: B.testCase.steps.map((e, t) => /* @__PURE__ */ G("li", { children: [/* @__PURE__ */ G("strong", { children: [Qe[e.kind], e.assertion?.name ? ` · ${e.assertion.name}` : ""] }), e.assertion ? /* @__PURE__ */ G(U, { children: [
|
|
1297
|
+
/* @__PURE__ */ W("span", { children: J.assertionSources[e.assertion.source] }),
|
|
1298
|
+
e.assertion.method && /* @__PURE__ */ G("code", { children: [
|
|
1286
1299
|
e.assertion.method,
|
|
1287
1300
|
" ",
|
|
1288
1301
|
e.assertion.pathname
|
|
1289
1302
|
] }),
|
|
1290
|
-
e.assertion.selector && /* @__PURE__ */
|
|
1291
|
-
/* @__PURE__ */
|
|
1292
|
-
|
|
1303
|
+
e.assertion.selector && /* @__PURE__ */ W("code", { children: e.assertion.selector }),
|
|
1304
|
+
/* @__PURE__ */ G("span", { children: [
|
|
1305
|
+
J.assertionOperators[e.assertion.operator],
|
|
1293
1306
|
e.assertion.expected !== void 0 && ` · 期望:${e.assertion.expected === "" ? "空字符串" : e.assertion.expected}`,
|
|
1294
1307
|
" · ",
|
|
1295
1308
|
e.assertion.timeout / 1e3,
|
|
1296
1309
|
" 秒"
|
|
1297
1310
|
] })
|
|
1298
|
-
] }) : /* @__PURE__ */
|
|
1299
|
-
e.target?.label && /* @__PURE__ */
|
|
1300
|
-
e.target?.selector && /* @__PURE__ */
|
|
1301
|
-
e.kind === "check" && /* @__PURE__ */
|
|
1302
|
-
e.value !== void 0 && /* @__PURE__ */
|
|
1311
|
+
] }) : /* @__PURE__ */ G(U, { children: [
|
|
1312
|
+
e.target?.label && /* @__PURE__ */ W("span", { children: e.target.label }),
|
|
1313
|
+
e.target?.selector && /* @__PURE__ */ W("code", { children: e.target.selector }),
|
|
1314
|
+
e.kind === "check" && /* @__PURE__ */ W("span", { children: e.checked ? "选中" : "取消选中" }),
|
|
1315
|
+
e.value !== void 0 && /* @__PURE__ */ W("span", { children: e.value || "空字符串" })
|
|
1303
1316
|
] })] }, t))
|
|
1304
1317
|
}),
|
|
1305
|
-
/* @__PURE__ */
|
|
1306
|
-
className:
|
|
1307
|
-
children: [
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
}),
|
|
1319
|
-
/* @__PURE__ */ G(C, {
|
|
1318
|
+
/* @__PURE__ */ G("div", {
|
|
1319
|
+
className: Z.buttonRow,
|
|
1320
|
+
children: [/* @__PURE__ */ W(C, {
|
|
1321
|
+
type: "primary",
|
|
1322
|
+
disabled: !z,
|
|
1323
|
+
onClick: () => _e(B.testCase, B.id, ce),
|
|
1324
|
+
children: "编辑用例"
|
|
1325
|
+
}), /* @__PURE__ */ W(et, {
|
|
1326
|
+
label: "用例更多操作",
|
|
1327
|
+
disabled: !z,
|
|
1328
|
+
items: [{
|
|
1329
|
+
key: "delete",
|
|
1330
|
+
label: "删除用例",
|
|
1320
1331
|
danger: !0,
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
window.confirm("删除该用例?") && (await Ae({
|
|
1332
|
+
onClick: () => void L(async () => {
|
|
1333
|
+
if (d.suites.some((e) => e.caseIds.includes(B.id))) throw Error("请先从套件移除此用例");
|
|
1334
|
+
window.confirm("删除该用例?") && (await ke({
|
|
1325
1335
|
...d,
|
|
1326
|
-
cases: d.cases.filter(({ id: e }) => e !==
|
|
1327
|
-
}),
|
|
1328
|
-
})
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
]
|
|
1336
|
+
cases: d.cases.filter(({ id: e }) => e !== B.id)
|
|
1337
|
+
}), w(void 0));
|
|
1338
|
+
})
|
|
1339
|
+
}]
|
|
1340
|
+
})]
|
|
1332
1341
|
}),
|
|
1333
|
-
/* @__PURE__ */
|
|
1334
|
-
className:
|
|
1342
|
+
/* @__PURE__ */ G("section", {
|
|
1343
|
+
className: Z.stack,
|
|
1335
1344
|
"aria-label": "所属套件",
|
|
1336
|
-
children: [
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
+
children: [/* @__PURE__ */ W("h5", { children: "所属套件" }), /* @__PURE__ */ G("div", {
|
|
1346
|
+
className: Z.buttonRow,
|
|
1347
|
+
children: [
|
|
1348
|
+
d.suites.filter((e) => e.caseIds.includes(B.id)).map((e) => /* @__PURE__ */ W(C, {
|
|
1349
|
+
className: Z.entryLink,
|
|
1350
|
+
type: "link",
|
|
1351
|
+
size: "small",
|
|
1352
|
+
onClick: () => {
|
|
1353
|
+
N(e), _("suites");
|
|
1354
|
+
},
|
|
1355
|
+
children: e.name
|
|
1356
|
+
}, e.id)),
|
|
1357
|
+
Pe.length > 0 && /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W(E, {
|
|
1345
1358
|
"aria-label": "选择套件",
|
|
1346
1359
|
placeholder: "选择套件",
|
|
1347
|
-
value:
|
|
1348
|
-
options:
|
|
1360
|
+
value: be,
|
|
1361
|
+
options: Pe.map(({ id: e, name: t }) => ({
|
|
1349
1362
|
value: e,
|
|
1350
1363
|
label: t
|
|
1351
1364
|
})),
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1365
|
+
loading: b,
|
|
1366
|
+
disabled: !z,
|
|
1367
|
+
onChange: xe
|
|
1368
|
+
}), /* @__PURE__ */ W(C, {
|
|
1369
|
+
type: "text",
|
|
1370
|
+
disabled: !z || !be,
|
|
1371
|
+
onClick: () => {
|
|
1372
|
+
let e = Pe.find((e) => e.id === be);
|
|
1373
|
+
e && L(async () => {
|
|
1374
|
+
await ke({
|
|
1375
|
+
...d,
|
|
1376
|
+
suites: je(d.suites, {
|
|
1377
|
+
...e,
|
|
1378
|
+
caseIds: [...e.caseIds, B.id]
|
|
1379
|
+
})
|
|
1380
|
+
}), xe(void 0);
|
|
1381
|
+
});
|
|
1382
|
+
},
|
|
1366
1383
|
children: "添加到套件"
|
|
1367
|
-
})] }),
|
|
1384
|
+
})] }),
|
|
1385
|
+
/* @__PURE__ */ W(C, {
|
|
1368
1386
|
type: "link",
|
|
1369
|
-
disabled: !
|
|
1387
|
+
disabled: !z,
|
|
1370
1388
|
onClick: () => {
|
|
1371
|
-
|
|
1389
|
+
N({
|
|
1372
1390
|
id: "",
|
|
1373
1391
|
name: "",
|
|
1374
|
-
caseIds: [
|
|
1375
|
-
}),
|
|
1392
|
+
caseIds: [B.id]
|
|
1393
|
+
}), me(!0), _("suites");
|
|
1376
1394
|
},
|
|
1377
1395
|
children: "新建套件"
|
|
1378
|
-
})
|
|
1379
|
-
|
|
1380
|
-
]
|
|
1396
|
+
})
|
|
1397
|
+
]
|
|
1398
|
+
})]
|
|
1381
1399
|
})
|
|
1382
1400
|
]
|
|
1383
|
-
}) : /* @__PURE__ */
|
|
1384
|
-
className:
|
|
1401
|
+
}) : /* @__PURE__ */ G("div", {
|
|
1402
|
+
className: Z.stack,
|
|
1385
1403
|
children: [
|
|
1386
|
-
/* @__PURE__ */
|
|
1404
|
+
/* @__PURE__ */ W(C, {
|
|
1387
1405
|
type: "primary",
|
|
1388
|
-
disabled: !
|
|
1406
|
+
disabled: !z,
|
|
1389
1407
|
onClick: () => _e(p()),
|
|
1390
1408
|
children: "新建用例"
|
|
1391
1409
|
}),
|
|
1392
|
-
!d.cases.length && /* @__PURE__ */
|
|
1393
|
-
/* @__PURE__ */
|
|
1394
|
-
className:
|
|
1395
|
-
children: d.cases.map(({ id: e, testCase: t, url: n }) => /* @__PURE__ */
|
|
1396
|
-
/* @__PURE__ */
|
|
1410
|
+
!d.cases.length && /* @__PURE__ */ W(de, { description: "暂无用例" }),
|
|
1411
|
+
/* @__PURE__ */ W("ul", {
|
|
1412
|
+
className: Z.resourceList,
|
|
1413
|
+
children: d.cases.map(({ id: e, testCase: t, url: n }) => /* @__PURE__ */ W("li", { children: /* @__PURE__ */ G("div", { children: [
|
|
1414
|
+
/* @__PURE__ */ W(C, {
|
|
1397
1415
|
type: "link",
|
|
1398
1416
|
size: "small",
|
|
1399
|
-
className:
|
|
1417
|
+
className: Z.entryLink,
|
|
1400
1418
|
onClick: () => {
|
|
1401
|
-
le(void 0),
|
|
1419
|
+
le(void 0), w(e), xe(void 0);
|
|
1402
1420
|
},
|
|
1403
1421
|
children: t.name
|
|
1404
1422
|
}),
|
|
1405
1423
|
" ",
|
|
1406
|
-
/* @__PURE__ */
|
|
1407
|
-
/* @__PURE__ */
|
|
1408
|
-
/* @__PURE__ */
|
|
1424
|
+
/* @__PURE__ */ G(D, { children: [t.steps.length, " 步"] }),
|
|
1425
|
+
/* @__PURE__ */ W("br", {}),
|
|
1426
|
+
/* @__PURE__ */ W("code", { children: n ?? t.path })
|
|
1409
1427
|
] }) }, e))
|
|
1410
1428
|
})
|
|
1411
1429
|
]
|
|
@@ -1414,154 +1432,166 @@ function ut({ base: e, name: t, onBack: n, onRename: r, draft: i, disabled: a, o
|
|
|
1414
1432
|
{
|
|
1415
1433
|
key: "suites",
|
|
1416
1434
|
label: "套件",
|
|
1417
|
-
children:
|
|
1418
|
-
className:
|
|
1435
|
+
children: ue ? /* @__PURE__ */ G("section", {
|
|
1436
|
+
className: Z.stack,
|
|
1419
1437
|
"aria-label": "套件编辑",
|
|
1420
1438
|
children: [
|
|
1421
|
-
/* @__PURE__ */
|
|
1439
|
+
/* @__PURE__ */ W(C, {
|
|
1422
1440
|
disabled: b,
|
|
1423
1441
|
onClick: () => {
|
|
1424
|
-
|
|
1442
|
+
Re() && me(!1);
|
|
1425
1443
|
},
|
|
1426
1444
|
children: "取消"
|
|
1427
1445
|
}),
|
|
1428
|
-
/* @__PURE__ */
|
|
1429
|
-
/* @__PURE__ */
|
|
1430
|
-
className:
|
|
1446
|
+
/* @__PURE__ */ W("h4", { children: M.id ? "编辑套件" : "新建套件" }),
|
|
1447
|
+
/* @__PURE__ */ G("div", {
|
|
1448
|
+
className: Z.stack,
|
|
1431
1449
|
children: [
|
|
1432
|
-
/* @__PURE__ */
|
|
1450
|
+
/* @__PURE__ */ W("label", {
|
|
1433
1451
|
htmlFor: "assistant-suite-name",
|
|
1434
1452
|
children: "套件名称"
|
|
1435
1453
|
}),
|
|
1436
|
-
/* @__PURE__ */
|
|
1454
|
+
/* @__PURE__ */ W(T, {
|
|
1437
1455
|
id: "assistant-suite-name",
|
|
1438
1456
|
"aria-required": "true",
|
|
1439
|
-
"aria-invalid": !
|
|
1440
|
-
"aria-describedby":
|
|
1457
|
+
"aria-invalid": !M.name.trim(),
|
|
1458
|
+
"aria-describedby": M.name.trim() ? void 0 : "assistant-suite-name-error",
|
|
1441
1459
|
maxLength: 100,
|
|
1442
|
-
value:
|
|
1443
|
-
onChange: (e) =>
|
|
1444
|
-
...
|
|
1460
|
+
value: M.name,
|
|
1461
|
+
onChange: (e) => N({
|
|
1462
|
+
...M,
|
|
1445
1463
|
name: e.target.value
|
|
1446
1464
|
})
|
|
1447
1465
|
}),
|
|
1448
|
-
!
|
|
1449
|
-
className:
|
|
1466
|
+
!M.name.trim() && /* @__PURE__ */ W("span", {
|
|
1467
|
+
className: Z.hint,
|
|
1450
1468
|
id: "assistant-suite-name-error",
|
|
1451
1469
|
children: "请输入套件名称"
|
|
1452
1470
|
})
|
|
1453
1471
|
]
|
|
1454
1472
|
}),
|
|
1455
|
-
/* @__PURE__ */
|
|
1456
|
-
options:
|
|
1457
|
-
values:
|
|
1458
|
-
onChange: (e) =>
|
|
1459
|
-
...
|
|
1473
|
+
/* @__PURE__ */ W(pt, {
|
|
1474
|
+
options: Me,
|
|
1475
|
+
values: M.caseIds,
|
|
1476
|
+
onChange: (e) => N({
|
|
1477
|
+
...M,
|
|
1460
1478
|
caseIds: e
|
|
1461
1479
|
})
|
|
1462
1480
|
}),
|
|
1463
|
-
/* @__PURE__ */
|
|
1481
|
+
/* @__PURE__ */ W(C, {
|
|
1464
1482
|
type: "primary",
|
|
1465
|
-
disabled: !
|
|
1466
|
-
onClick: () => void
|
|
1483
|
+
disabled: !z || !M.name.trim() || !M.caseIds.length,
|
|
1484
|
+
onClick: () => void L(async () => {
|
|
1467
1485
|
let e = {
|
|
1468
|
-
...
|
|
1469
|
-
id:
|
|
1470
|
-
name:
|
|
1486
|
+
...M,
|
|
1487
|
+
id: M.id || crypto.randomUUID(),
|
|
1488
|
+
name: M.name.trim()
|
|
1471
1489
|
};
|
|
1472
|
-
await
|
|
1490
|
+
await ke({
|
|
1473
1491
|
...d,
|
|
1474
|
-
suites:
|
|
1475
|
-
}),
|
|
1492
|
+
suites: je(d.suites, e)
|
|
1493
|
+
}), N(e), me(!1);
|
|
1476
1494
|
}),
|
|
1477
1495
|
children: "保存套件"
|
|
1478
1496
|
})
|
|
1479
1497
|
]
|
|
1480
|
-
}) :
|
|
1481
|
-
className:
|
|
1498
|
+
}) : V ? /* @__PURE__ */ G("section", {
|
|
1499
|
+
className: Z.stack,
|
|
1482
1500
|
"aria-label": "套件详情",
|
|
1483
1501
|
children: [
|
|
1484
|
-
/* @__PURE__ */
|
|
1485
|
-
/* @__PURE__ */
|
|
1486
|
-
className:
|
|
1487
|
-
children:
|
|
1502
|
+
/* @__PURE__ */ W("h4", { children: V.name }),
|
|
1503
|
+
/* @__PURE__ */ W("ol", {
|
|
1504
|
+
className: Z.list,
|
|
1505
|
+
children: V.caseIds.map((e, t) => /* @__PURE__ */ W("li", { children: /* @__PURE__ */ W(C, {
|
|
1506
|
+
type: "link",
|
|
1507
|
+
size: "small",
|
|
1508
|
+
className: Z.entryLink,
|
|
1509
|
+
onClick: () => {
|
|
1510
|
+
w(e), le(V.id), xe(void 0), _("cases");
|
|
1511
|
+
},
|
|
1512
|
+
children: Me.find(({ value: t }) => t === e)?.label ?? e
|
|
1513
|
+
}) }, t))
|
|
1488
1514
|
}),
|
|
1489
|
-
/* @__PURE__ */
|
|
1490
|
-
className:
|
|
1515
|
+
/* @__PURE__ */ G("div", {
|
|
1516
|
+
className: Z.buttonRow,
|
|
1491
1517
|
children: [
|
|
1492
|
-
/* @__PURE__ */
|
|
1493
|
-
|
|
1518
|
+
/* @__PURE__ */ W(C, {
|
|
1519
|
+
type: "primary",
|
|
1520
|
+
disabled: !z,
|
|
1494
1521
|
onClick: () => {
|
|
1495
|
-
|
|
1496
|
-
...H,
|
|
1497
|
-
caseIds: [...H.caseIds, ye]
|
|
1498
|
-
} : H), O(!0);
|
|
1522
|
+
N(V), me(!0);
|
|
1499
1523
|
},
|
|
1500
1524
|
children: "编辑套件"
|
|
1501
1525
|
}),
|
|
1502
|
-
/* @__PURE__ */
|
|
1503
|
-
|
|
1504
|
-
|
|
1526
|
+
/* @__PURE__ */ W(C, {
|
|
1527
|
+
type: "text",
|
|
1528
|
+
disabled: !z,
|
|
1529
|
+
onClick: () => _e(p(), void 0, V.id),
|
|
1505
1530
|
children: "新建用例"
|
|
1506
1531
|
}),
|
|
1507
|
-
/* @__PURE__ */
|
|
1508
|
-
|
|
1532
|
+
/* @__PURE__ */ W(C, {
|
|
1533
|
+
type: "text",
|
|
1534
|
+
disabled: !z,
|
|
1509
1535
|
onClick: () => {
|
|
1510
|
-
|
|
1536
|
+
F({
|
|
1511
1537
|
id: "",
|
|
1512
1538
|
name: "",
|
|
1513
|
-
suiteIds: [
|
|
1539
|
+
suiteIds: [V.id],
|
|
1514
1540
|
repeat: 1
|
|
1515
|
-
}),
|
|
1541
|
+
}), O(!0), _("plans");
|
|
1516
1542
|
},
|
|
1517
1543
|
children: "创建计划"
|
|
1518
1544
|
}),
|
|
1519
|
-
/* @__PURE__ */
|
|
1520
|
-
|
|
1521
|
-
disabled: !
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1545
|
+
/* @__PURE__ */ W(et, {
|
|
1546
|
+
label: "套件更多操作",
|
|
1547
|
+
disabled: !z,
|
|
1548
|
+
items: [{
|
|
1549
|
+
key: "delete",
|
|
1550
|
+
label: "删除套件",
|
|
1551
|
+
danger: !0,
|
|
1552
|
+
onClick: () => void L(async () => {
|
|
1553
|
+
if (d.plans.some((e) => e.suiteIds.includes(V.id))) throw Error("请先从计划移除此套件");
|
|
1554
|
+
window.confirm("删除该套件?") && (await ke({
|
|
1555
|
+
...d,
|
|
1556
|
+
suites: d.suites.filter(({ id: e }) => e !== V.id)
|
|
1557
|
+
}), N({
|
|
1558
|
+
id: "",
|
|
1559
|
+
name: "",
|
|
1560
|
+
caseIds: []
|
|
1561
|
+
}));
|
|
1562
|
+
})
|
|
1563
|
+
}]
|
|
1534
1564
|
})
|
|
1535
1565
|
]
|
|
1536
1566
|
})
|
|
1537
1567
|
]
|
|
1538
|
-
}) : /* @__PURE__ */
|
|
1539
|
-
className:
|
|
1568
|
+
}) : /* @__PURE__ */ G("div", {
|
|
1569
|
+
className: Z.stack,
|
|
1540
1570
|
children: [
|
|
1541
|
-
/* @__PURE__ */
|
|
1571
|
+
/* @__PURE__ */ W(C, {
|
|
1542
1572
|
type: "primary",
|
|
1543
|
-
disabled: !
|
|
1573
|
+
disabled: !z,
|
|
1544
1574
|
onClick: () => {
|
|
1545
|
-
|
|
1575
|
+
N({
|
|
1546
1576
|
id: "",
|
|
1547
1577
|
name: "",
|
|
1548
|
-
caseIds:
|
|
1549
|
-
}),
|
|
1578
|
+
caseIds: []
|
|
1579
|
+
}), me(!0);
|
|
1550
1580
|
},
|
|
1551
1581
|
children: "新建套件"
|
|
1552
1582
|
}),
|
|
1553
|
-
!d.suites.length && /* @__PURE__ */
|
|
1554
|
-
/* @__PURE__ */
|
|
1555
|
-
className:
|
|
1556
|
-
children: d.suites.map((e) => /* @__PURE__ */
|
|
1583
|
+
!d.suites.length && /* @__PURE__ */ W(de, { description: "暂无套件" }),
|
|
1584
|
+
/* @__PURE__ */ W("ul", {
|
|
1585
|
+
className: Z.resourceList,
|
|
1586
|
+
children: d.suites.map((e) => /* @__PURE__ */ G("li", { children: [/* @__PURE__ */ W(C, {
|
|
1557
1587
|
type: "link",
|
|
1558
1588
|
size: "small",
|
|
1559
|
-
className:
|
|
1589
|
+
className: Z.entryLink,
|
|
1560
1590
|
onClick: () => {
|
|
1561
|
-
|
|
1591
|
+
N(e);
|
|
1562
1592
|
},
|
|
1563
1593
|
children: e.name
|
|
1564
|
-
}), /* @__PURE__ */
|
|
1594
|
+
}), /* @__PURE__ */ G("span", { children: [e.caseIds.length, " 个用例"] })] }, e.id))
|
|
1565
1595
|
})
|
|
1566
1596
|
]
|
|
1567
1597
|
})
|
|
@@ -1569,157 +1599,177 @@ function ut({ base: e, name: t, onBack: n, onRename: r, draft: i, disabled: a, o
|
|
|
1569
1599
|
{
|
|
1570
1600
|
key: "plans",
|
|
1571
1601
|
label: "计划",
|
|
1572
|
-
children: he ? /* @__PURE__ */
|
|
1573
|
-
className:
|
|
1602
|
+
children: he ? /* @__PURE__ */ G("section", {
|
|
1603
|
+
className: Z.stack,
|
|
1574
1604
|
"aria-label": "计划编辑",
|
|
1575
1605
|
children: [
|
|
1576
|
-
/* @__PURE__ */
|
|
1606
|
+
/* @__PURE__ */ W(C, {
|
|
1577
1607
|
disabled: b,
|
|
1578
1608
|
onClick: () => {
|
|
1579
|
-
|
|
1609
|
+
ze() && O(!1);
|
|
1580
1610
|
},
|
|
1581
1611
|
children: "取消"
|
|
1582
1612
|
}),
|
|
1583
|
-
/* @__PURE__ */
|
|
1584
|
-
/* @__PURE__ */
|
|
1585
|
-
className:
|
|
1613
|
+
/* @__PURE__ */ W("h4", { children: P.id ? "编辑计划" : "新建计划" }),
|
|
1614
|
+
/* @__PURE__ */ G("div", {
|
|
1615
|
+
className: Z.stack,
|
|
1586
1616
|
children: [
|
|
1587
|
-
/* @__PURE__ */
|
|
1617
|
+
/* @__PURE__ */ W("label", {
|
|
1588
1618
|
htmlFor: "assistant-plan-name",
|
|
1589
1619
|
children: "计划名称"
|
|
1590
1620
|
}),
|
|
1591
|
-
/* @__PURE__ */
|
|
1621
|
+
/* @__PURE__ */ W(T, {
|
|
1592
1622
|
id: "assistant-plan-name",
|
|
1593
1623
|
"aria-required": "true",
|
|
1594
|
-
"aria-invalid": !
|
|
1595
|
-
"aria-describedby":
|
|
1624
|
+
"aria-invalid": !P.name.trim(),
|
|
1625
|
+
"aria-describedby": P.name.trim() ? void 0 : "assistant-plan-name-error",
|
|
1596
1626
|
maxLength: 100,
|
|
1597
|
-
value:
|
|
1598
|
-
onChange: (e) =>
|
|
1599
|
-
...
|
|
1627
|
+
value: P.name,
|
|
1628
|
+
onChange: (e) => F({
|
|
1629
|
+
...P,
|
|
1600
1630
|
name: e.target.value
|
|
1601
1631
|
})
|
|
1602
1632
|
}),
|
|
1603
|
-
!
|
|
1604
|
-
className:
|
|
1633
|
+
!P.name.trim() && /* @__PURE__ */ W("span", {
|
|
1634
|
+
className: Z.hint,
|
|
1605
1635
|
id: "assistant-plan-name-error",
|
|
1606
1636
|
children: "请输入计划名称"
|
|
1607
1637
|
})
|
|
1608
1638
|
]
|
|
1609
1639
|
}),
|
|
1610
|
-
/* @__PURE__ */
|
|
1640
|
+
/* @__PURE__ */ G("label", { children: [
|
|
1611
1641
|
"重复轮数",
|
|
1612
1642
|
" ",
|
|
1613
|
-
/* @__PURE__ */
|
|
1643
|
+
/* @__PURE__ */ W(fe, {
|
|
1614
1644
|
min: 1,
|
|
1615
1645
|
max: 20,
|
|
1616
1646
|
precision: 0,
|
|
1617
1647
|
"aria-label": "重复轮数",
|
|
1618
|
-
value:
|
|
1619
|
-
onChange: (e) =>
|
|
1620
|
-
...
|
|
1648
|
+
value: P.repeat,
|
|
1649
|
+
onChange: (e) => F({
|
|
1650
|
+
...P,
|
|
1621
1651
|
repeat: e ?? 1
|
|
1622
1652
|
})
|
|
1623
1653
|
})
|
|
1624
1654
|
] }),
|
|
1625
|
-
/* @__PURE__ */
|
|
1626
|
-
options:
|
|
1627
|
-
values:
|
|
1628
|
-
onChange: (e) =>
|
|
1629
|
-
...
|
|
1655
|
+
/* @__PURE__ */ W(pt, {
|
|
1656
|
+
options: Ne,
|
|
1657
|
+
values: P.suiteIds,
|
|
1658
|
+
onChange: (e) => F({
|
|
1659
|
+
...P,
|
|
1630
1660
|
suiteIds: e
|
|
1631
1661
|
})
|
|
1632
1662
|
}),
|
|
1633
|
-
/* @__PURE__ */
|
|
1663
|
+
/* @__PURE__ */ W(C, {
|
|
1634
1664
|
type: "primary",
|
|
1635
|
-
disabled: !
|
|
1636
|
-
onClick: () => void
|
|
1665
|
+
disabled: !z || !P.name.trim() || !P.suiteIds.length,
|
|
1666
|
+
onClick: () => void L(async () => {
|
|
1637
1667
|
let e = {
|
|
1638
|
-
...
|
|
1639
|
-
id:
|
|
1640
|
-
name:
|
|
1668
|
+
...P,
|
|
1669
|
+
id: P.id || crypto.randomUUID(),
|
|
1670
|
+
name: P.name.trim()
|
|
1641
1671
|
};
|
|
1642
|
-
await
|
|
1672
|
+
await ke({
|
|
1643
1673
|
...d,
|
|
1644
|
-
plans:
|
|
1645
|
-
}),
|
|
1674
|
+
plans: je(d.plans, e)
|
|
1675
|
+
}), F(e), O(!1);
|
|
1646
1676
|
}),
|
|
1647
1677
|
children: "保存计划"
|
|
1648
1678
|
})
|
|
1649
1679
|
]
|
|
1650
|
-
}) :
|
|
1651
|
-
className:
|
|
1680
|
+
}) : H ? /* @__PURE__ */ G("section", {
|
|
1681
|
+
className: Z.stack,
|
|
1652
1682
|
"aria-label": "计划详情",
|
|
1653
1683
|
children: [
|
|
1654
|
-
/* @__PURE__ */
|
|
1655
|
-
/* @__PURE__ */
|
|
1684
|
+
/* @__PURE__ */ W("h4", { children: H.name }),
|
|
1685
|
+
/* @__PURE__ */ G("span", { children: [
|
|
1656
1686
|
"重复 ",
|
|
1657
|
-
|
|
1687
|
+
H.repeat,
|
|
1658
1688
|
" 轮"
|
|
1659
1689
|
] }),
|
|
1660
|
-
/* @__PURE__ */
|
|
1661
|
-
className:
|
|
1662
|
-
children:
|
|
1690
|
+
/* @__PURE__ */ W("ol", {
|
|
1691
|
+
className: Z.list,
|
|
1692
|
+
children: H.suiteIds.map((e, t) => /* @__PURE__ */ W("li", { children: /* @__PURE__ */ W(C, {
|
|
1693
|
+
type: "link",
|
|
1694
|
+
size: "small",
|
|
1695
|
+
className: Z.entryLink,
|
|
1696
|
+
onClick: () => {
|
|
1697
|
+
let t = d.suites.find((t) => t.id === e);
|
|
1698
|
+
t && (N(t), _("suites"));
|
|
1699
|
+
},
|
|
1700
|
+
children: Ne.find(({ value: t }) => t === e)?.label ?? e
|
|
1701
|
+
}) }, t))
|
|
1663
1702
|
}),
|
|
1664
|
-
/* @__PURE__ */
|
|
1665
|
-
className:
|
|
1666
|
-
children: [/* @__PURE__ */
|
|
1667
|
-
|
|
1703
|
+
/* @__PURE__ */ G("div", {
|
|
1704
|
+
className: Z.buttonRow,
|
|
1705
|
+
children: [/* @__PURE__ */ W(C, {
|
|
1706
|
+
type: "text",
|
|
1707
|
+
disabled: !z,
|
|
1668
1708
|
onClick: () => {
|
|
1669
|
-
|
|
1709
|
+
F(H), O(!0);
|
|
1670
1710
|
},
|
|
1671
1711
|
children: "编辑计划"
|
|
1672
|
-
}), /* @__PURE__ */
|
|
1673
|
-
|
|
1674
|
-
disabled: !
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1712
|
+
}), /* @__PURE__ */ W(et, {
|
|
1713
|
+
label: "计划更多操作",
|
|
1714
|
+
disabled: !z,
|
|
1715
|
+
items: [{
|
|
1716
|
+
key: "delete",
|
|
1717
|
+
label: "删除计划",
|
|
1718
|
+
danger: !0,
|
|
1719
|
+
onClick: () => void L(async () => {
|
|
1720
|
+
window.confirm("删除该计划?") && (await ke({
|
|
1721
|
+
...d,
|
|
1722
|
+
plans: d.plans.filter(({ id: e }) => e !== H.id)
|
|
1723
|
+
}), F({
|
|
1724
|
+
id: "",
|
|
1725
|
+
name: "",
|
|
1726
|
+
suiteIds: [],
|
|
1727
|
+
repeat: 1
|
|
1728
|
+
}));
|
|
1729
|
+
})
|
|
1730
|
+
}]
|
|
1687
1731
|
})]
|
|
1688
1732
|
}),
|
|
1689
|
-
/* @__PURE__ */
|
|
1690
|
-
className:
|
|
1733
|
+
/* @__PURE__ */ W("p", {
|
|
1734
|
+
className: Z.hint,
|
|
1691
1735
|
children: "回放会实际操作测试数据,且不会自动恢复。"
|
|
1692
1736
|
}),
|
|
1693
|
-
/* @__PURE__ */
|
|
1737
|
+
/* @__PURE__ */ W(C, {
|
|
1694
1738
|
type: "primary",
|
|
1695
|
-
disabled: !
|
|
1696
|
-
onClick: () => void
|
|
1697
|
-
let e = await
|
|
1698
|
-
h([e, ...m]),
|
|
1739
|
+
disabled: !z,
|
|
1740
|
+
onClick: () => void L(async () => {
|
|
1741
|
+
let e = await I("/run", "POST", { planId: H.id });
|
|
1742
|
+
h([e, ...m]), Ce(e.id), _("reports");
|
|
1699
1743
|
}),
|
|
1700
1744
|
children: "运行计划"
|
|
1701
1745
|
})
|
|
1702
1746
|
]
|
|
1703
|
-
}) : /* @__PURE__ */
|
|
1704
|
-
className:
|
|
1747
|
+
}) : /* @__PURE__ */ G("div", {
|
|
1748
|
+
className: Z.stack,
|
|
1705
1749
|
children: [
|
|
1706
|
-
/* @__PURE__ */
|
|
1750
|
+
/* @__PURE__ */ W(C, {
|
|
1707
1751
|
type: "primary",
|
|
1708
|
-
disabled: !
|
|
1752
|
+
disabled: !z,
|
|
1709
1753
|
onClick: () => {
|
|
1710
|
-
|
|
1754
|
+
F({
|
|
1711
1755
|
id: "",
|
|
1712
1756
|
name: "",
|
|
1713
1757
|
suiteIds: [],
|
|
1714
1758
|
repeat: 1
|
|
1715
|
-
}),
|
|
1759
|
+
}), O(!0);
|
|
1716
1760
|
},
|
|
1717
1761
|
children: "新建计划"
|
|
1718
1762
|
}),
|
|
1719
|
-
!d.plans.length && /* @__PURE__ */
|
|
1720
|
-
/* @__PURE__ */
|
|
1721
|
-
className:
|
|
1722
|
-
children: d.plans.map((e) => /* @__PURE__ */
|
|
1763
|
+
!d.plans.length && /* @__PURE__ */ W(de, { description: "暂无计划" }),
|
|
1764
|
+
/* @__PURE__ */ W("ul", {
|
|
1765
|
+
className: Z.resourceList,
|
|
1766
|
+
children: d.plans.map((e) => /* @__PURE__ */ G("li", { children: [/* @__PURE__ */ W(C, {
|
|
1767
|
+
type: "link",
|
|
1768
|
+
size: "small",
|
|
1769
|
+
className: Z.entryLink,
|
|
1770
|
+
onClick: () => F(e),
|
|
1771
|
+
children: e.name
|
|
1772
|
+
}), /* @__PURE__ */ G("span", { children: [
|
|
1723
1773
|
e.suiteIds.length,
|
|
1724
1774
|
" 个套件 · 重复 ",
|
|
1725
1775
|
e.repeat,
|
|
@@ -1732,56 +1782,59 @@ function ut({ base: e, name: t, onBack: n, onRename: r, draft: i, disabled: a, o
|
|
|
1732
1782
|
{
|
|
1733
1783
|
key: "reports",
|
|
1734
1784
|
label: "报告",
|
|
1735
|
-
children: /* @__PURE__ */
|
|
1736
|
-
className:
|
|
1785
|
+
children: /* @__PURE__ */ G("div", {
|
|
1786
|
+
className: Z.stack,
|
|
1737
1787
|
children: [
|
|
1738
|
-
/* @__PURE__ */
|
|
1739
|
-
className:
|
|
1740
|
-
children: [/* @__PURE__ */
|
|
1788
|
+
/* @__PURE__ */ G("div", {
|
|
1789
|
+
className: Z.buttonRow,
|
|
1790
|
+
children: [/* @__PURE__ */ W(C, {
|
|
1791
|
+
type: "text",
|
|
1741
1792
|
disabled: b,
|
|
1742
|
-
onClick: () => void
|
|
1743
|
-
h(await
|
|
1793
|
+
onClick: () => void L(async () => {
|
|
1794
|
+
h(await I("/runs")), Ee && Te(await I(`/runs/${Ee}`));
|
|
1744
1795
|
}),
|
|
1745
1796
|
children: "刷新报告"
|
|
1746
|
-
}), /* @__PURE__ */
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1797
|
+
}), /* @__PURE__ */ W(C, {
|
|
1798
|
+
type: "primary",
|
|
1799
|
+
danger: !0,
|
|
1800
|
+
disabled: b || !De,
|
|
1801
|
+
onClick: () => void L(async () => {
|
|
1802
|
+
let e = await I("/stop", "POST", {});
|
|
1750
1803
|
h(m.map((t) => t.id === e.id ? e : t));
|
|
1751
1804
|
}),
|
|
1752
1805
|
children: "停止计划"
|
|
1753
1806
|
})]
|
|
1754
1807
|
}),
|
|
1755
|
-
!m.length && /* @__PURE__ */
|
|
1756
|
-
m.length > 0 && /* @__PURE__ */
|
|
1808
|
+
!m.length && /* @__PURE__ */ W(de, { description: "暂无运行报告" }),
|
|
1809
|
+
m.length > 0 && /* @__PURE__ */ W(E, {
|
|
1757
1810
|
"aria-label": "运行报告",
|
|
1758
|
-
value:
|
|
1759
|
-
onChange:
|
|
1811
|
+
value: Se ?? m[0].id,
|
|
1812
|
+
onChange: Ce,
|
|
1760
1813
|
options: m.map((e) => ({
|
|
1761
1814
|
value: e.id,
|
|
1762
|
-
label: `${e.planName} · ${
|
|
1815
|
+
label: `${e.planName} · ${dt[e.state] ?? e.state} · ${e.id.slice(0, 8)}`
|
|
1763
1816
|
}))
|
|
1764
1817
|
}),
|
|
1765
|
-
|
|
1766
|
-
run:
|
|
1818
|
+
we && we.id === Ee && /* @__PURE__ */ W(ft, {
|
|
1819
|
+
run: we,
|
|
1767
1820
|
base: e,
|
|
1768
|
-
onExport: () =>
|
|
1821
|
+
onExport: () => Ae(we, `研发小蜜报告-${we.id}.json`)
|
|
1769
1822
|
})
|
|
1770
1823
|
]
|
|
1771
1824
|
})
|
|
1772
1825
|
}
|
|
1773
1826
|
]
|
|
1774
|
-
})] }) : /* @__PURE__ */
|
|
1827
|
+
})] }) : /* @__PURE__ */ W(C, {
|
|
1775
1828
|
loading: b,
|
|
1776
|
-
onClick:
|
|
1829
|
+
onClick: R,
|
|
1777
1830
|
children: b ? "正在读取测试库" : "重试读取测试库"
|
|
1778
1831
|
})
|
|
1779
1832
|
]
|
|
1780
1833
|
});
|
|
1781
1834
|
}
|
|
1782
1835
|
// src/pages/assistant/components/TestLibraryPanel/index.tsx
|
|
1783
|
-
function
|
|
1784
|
-
let r = `${e.replace(/\/$/, "")}/library`, i =
|
|
1836
|
+
function ht({ bridgeUrl: e, exploration: t, ...n }) {
|
|
1837
|
+
let r = `${e.replace(/\/$/, "")}/library`, i = ut(r), [a, o] = x(), [s, c] = x(), [l, u] = x(), [d, f] = x("libraries"), [p, m] = x(!1), [h, g] = x(""), _ = async (e) => {
|
|
1785
1838
|
let t = await i("/collections", "GET", void 0, e);
|
|
1786
1839
|
e?.aborted || o(t.collections);
|
|
1787
1840
|
}, v = async (e, t) => {
|
|
@@ -1804,8 +1857,8 @@ function dt({ bridgeUrl: e, exploration: t, ...n }) {
|
|
|
1804
1857
|
if (p) return;
|
|
1805
1858
|
let t = a?.find(({ id: e }) => e === l?.id);
|
|
1806
1859
|
(!l || l.name === (t?.name ?? "") || window.confirm("测试库名称尚未保存,确定放弃?")) && (u(void 0), f(e));
|
|
1807
|
-
}, te = /* @__PURE__ */
|
|
1808
|
-
className:
|
|
1860
|
+
}, te = /* @__PURE__ */ G(se, {
|
|
1861
|
+
className: Z.card,
|
|
1809
1862
|
"aria-label": "测试库列表",
|
|
1810
1863
|
styles: { body: {
|
|
1811
1864
|
padding: 0,
|
|
@@ -1814,17 +1867,17 @@ function dt({ bridgeUrl: e, exploration: t, ...n }) {
|
|
|
1814
1867
|
gap: 16
|
|
1815
1868
|
} },
|
|
1816
1869
|
children: [
|
|
1817
|
-
/* @__PURE__ */
|
|
1818
|
-
h && /* @__PURE__ */
|
|
1870
|
+
/* @__PURE__ */ W("h3", { children: "测试库" }),
|
|
1871
|
+
h && /* @__PURE__ */ W(S, {
|
|
1819
1872
|
type: "error",
|
|
1820
1873
|
title: h
|
|
1821
1874
|
}),
|
|
1822
|
-
n.incomingDraft && /* @__PURE__ */
|
|
1875
|
+
n.incomingDraft && /* @__PURE__ */ W(S, {
|
|
1823
1876
|
type: "info",
|
|
1824
1877
|
title: "请选择测试库,继续编辑时间线用例"
|
|
1825
1878
|
}),
|
|
1826
|
-
a ? l ? /* @__PURE__ */
|
|
1827
|
-
className:
|
|
1879
|
+
a ? l ? /* @__PURE__ */ G("form", {
|
|
1880
|
+
className: Z.stack,
|
|
1828
1881
|
onSubmit: (e) => {
|
|
1829
1882
|
e.preventDefault(), l.name.trim() && !p && v(async () => {
|
|
1830
1883
|
let e = await i(l.id ? "/collections/" + encodeURIComponent(l.id) : "/collections", l.id ? "PATCH" : "POST", { name: l.name.trim() });
|
|
@@ -1832,11 +1885,11 @@ function dt({ bridgeUrl: e, exploration: t, ...n }) {
|
|
|
1832
1885
|
});
|
|
1833
1886
|
},
|
|
1834
1887
|
children: [
|
|
1835
|
-
/* @__PURE__ */
|
|
1888
|
+
/* @__PURE__ */ W("label", {
|
|
1836
1889
|
htmlFor: "assistant-library-name",
|
|
1837
1890
|
children: "测试库名称"
|
|
1838
1891
|
}),
|
|
1839
|
-
/* @__PURE__ */
|
|
1892
|
+
/* @__PURE__ */ W(T, {
|
|
1840
1893
|
id: "assistant-library-name",
|
|
1841
1894
|
"aria-required": "true",
|
|
1842
1895
|
"aria-invalid": !l.name.trim(),
|
|
@@ -1849,44 +1902,44 @@ function dt({ bridgeUrl: e, exploration: t, ...n }) {
|
|
|
1849
1902
|
name: e.target.value
|
|
1850
1903
|
})
|
|
1851
1904
|
}),
|
|
1852
|
-
!l.name.trim() && /* @__PURE__ */
|
|
1853
|
-
className:
|
|
1905
|
+
!l.name.trim() && /* @__PURE__ */ W("span", {
|
|
1906
|
+
className: Z.hint,
|
|
1854
1907
|
id: "assistant-library-name-error",
|
|
1855
1908
|
children: "请输入测试库名称"
|
|
1856
1909
|
}),
|
|
1857
|
-
/* @__PURE__ */
|
|
1858
|
-
className:
|
|
1859
|
-
children: [/* @__PURE__ */
|
|
1910
|
+
/* @__PURE__ */ G("div", {
|
|
1911
|
+
className: Z.buttonRow,
|
|
1912
|
+
children: [/* @__PURE__ */ W(C, {
|
|
1860
1913
|
htmlType: "submit",
|
|
1861
1914
|
type: "primary",
|
|
1862
1915
|
loading: p,
|
|
1863
1916
|
disabled: !l.name.trim(),
|
|
1864
1917
|
children: l.id ? "保存" : "创建"
|
|
1865
|
-
}), /* @__PURE__ */
|
|
1918
|
+
}), /* @__PURE__ */ W(C, {
|
|
1866
1919
|
disabled: p,
|
|
1867
1920
|
onClick: () => u(void 0),
|
|
1868
1921
|
children: "取消"
|
|
1869
1922
|
})]
|
|
1870
1923
|
})
|
|
1871
1924
|
]
|
|
1872
|
-
}) : /* @__PURE__ */
|
|
1873
|
-
/* @__PURE__ */
|
|
1925
|
+
}) : /* @__PURE__ */ G(U, { children: [
|
|
1926
|
+
/* @__PURE__ */ W(C, {
|
|
1874
1927
|
type: "primary",
|
|
1875
1928
|
disabled: p || n.disabled,
|
|
1876
1929
|
onClick: () => u({ name: "" }),
|
|
1877
1930
|
children: "新建测试库"
|
|
1878
1931
|
}),
|
|
1879
|
-
!a.length && /* @__PURE__ */
|
|
1880
|
-
/* @__PURE__ */
|
|
1881
|
-
className:
|
|
1882
|
-
children: a.map((e) => /* @__PURE__ */
|
|
1932
|
+
!a.length && /* @__PURE__ */ W(de, { description: "暂无测试库" }),
|
|
1933
|
+
/* @__PURE__ */ W("ul", {
|
|
1934
|
+
className: Z.resourceList,
|
|
1935
|
+
children: a.map((e) => /* @__PURE__ */ G("li", { children: [/* @__PURE__ */ W(C, {
|
|
1883
1936
|
type: "link",
|
|
1884
1937
|
size: "small",
|
|
1885
|
-
className:
|
|
1938
|
+
className: Z.entryLink,
|
|
1886
1939
|
disabled: p || n.recording,
|
|
1887
1940
|
onClick: () => c(e),
|
|
1888
1941
|
children: e.name
|
|
1889
|
-
}), /* @__PURE__ */
|
|
1942
|
+
}), /* @__PURE__ */ G("span", { children: [
|
|
1890
1943
|
e.caseCount,
|
|
1891
1944
|
" 个用例 · ",
|
|
1892
1945
|
e.suiteCount,
|
|
@@ -1896,16 +1949,16 @@ function dt({ bridgeUrl: e, exploration: t, ...n }) {
|
|
|
1896
1949
|
" 个计划"
|
|
1897
1950
|
] })] }, e.id))
|
|
1898
1951
|
})
|
|
1899
|
-
] }) : /* @__PURE__ */
|
|
1952
|
+
] }) : /* @__PURE__ */ W(C, {
|
|
1900
1953
|
loading: p,
|
|
1901
1954
|
onClick: () => void v(_),
|
|
1902
1955
|
children: p ? "正在读取测试库列表" : "重试读取测试库列表"
|
|
1903
1956
|
})
|
|
1904
1957
|
]
|
|
1905
1958
|
});
|
|
1906
|
-
return /* @__PURE__ */
|
|
1959
|
+
return /* @__PURE__ */ G(U, { children: [s && /* @__PURE__ */ W("div", {
|
|
1907
1960
|
hidden: !!l,
|
|
1908
|
-
children: /* @__PURE__ */ ee(
|
|
1961
|
+
children: /* @__PURE__ */ ee(mt, {
|
|
1909
1962
|
...n,
|
|
1910
1963
|
key: s.id,
|
|
1911
1964
|
base: `${r}/collections/${encodeURIComponent(s.id)}`,
|
|
@@ -1920,9 +1973,9 @@ function dt({ bridgeUrl: e, exploration: t, ...n }) {
|
|
|
1920
1973
|
});
|
|
1921
1974
|
}
|
|
1922
1975
|
})
|
|
1923
|
-
}), /* @__PURE__ */
|
|
1976
|
+
}), /* @__PURE__ */ W("div", {
|
|
1924
1977
|
hidden: !!s && !l,
|
|
1925
|
-
children: /* @__PURE__ */
|
|
1978
|
+
children: /* @__PURE__ */ W(pe, {
|
|
1926
1979
|
activeKey: d,
|
|
1927
1980
|
onChange: b,
|
|
1928
1981
|
items: [{
|
|
@@ -1939,22 +1992,22 @@ function dt({ bridgeUrl: e, exploration: t, ...n }) {
|
|
|
1939
1992
|
})] });
|
|
1940
1993
|
}
|
|
1941
1994
|
// src/pages/assistant/components/AutomationPanel/index.tsx
|
|
1942
|
-
function
|
|
1943
|
-
let i = ie(s.subscribe, s.getState),
|
|
1944
|
-
|
|
1995
|
+
function gt({ close: e, bridgeUrl: t, incomingDraft: n, onConsumeDraft: r }) {
|
|
1996
|
+
let i = ie(s.subscribe, s.getState), a = re(null), [o, c] = x(""), [l, u] = x(null), d = re(null), f = (e, t) => {
|
|
1997
|
+
u({
|
|
1945
1998
|
position: e,
|
|
1946
1999
|
edit: t
|
|
1947
|
-
}), requestAnimationFrame(() =>
|
|
2000
|
+
}), requestAnimationFrame(() => d.current?.scrollIntoView({
|
|
1948
2001
|
behavior: "smooth",
|
|
1949
2002
|
block: "nearest"
|
|
1950
2003
|
}));
|
|
1951
|
-
}, [
|
|
2004
|
+
}, [p, m] = x(!1), h = async (e) => {
|
|
1952
2005
|
try {
|
|
1953
|
-
|
|
2006
|
+
c(""), await e();
|
|
1954
2007
|
} catch (e) {
|
|
1955
|
-
|
|
2008
|
+
c(e instanceof Error ? e.message : "操作失败");
|
|
1956
2009
|
}
|
|
1957
|
-
},
|
|
2010
|
+
}, g = (e, t) => s.edit({
|
|
1958
2011
|
...i.draft,
|
|
1959
2012
|
steps: i.draft.steps.map((n, r) => r === e ? {
|
|
1960
2013
|
...n,
|
|
@@ -1962,47 +2015,47 @@ function ft({ close: e, bridgeUrl: t, incomingDraft: n, onConsumeDraft: r }) {
|
|
|
1962
2015
|
supplemented: !0
|
|
1963
2016
|
} : n)
|
|
1964
2017
|
});
|
|
1965
|
-
return /* @__PURE__ */
|
|
1966
|
-
className:
|
|
2018
|
+
return /* @__PURE__ */ G("div", {
|
|
2019
|
+
className: q.section,
|
|
1967
2020
|
"data-assistant-part": "section automation",
|
|
1968
|
-
children: [
|
|
2021
|
+
children: [o && /* @__PURE__ */ W(S, {
|
|
1969
2022
|
closable: !0,
|
|
1970
|
-
onClose: () =>
|
|
2023
|
+
onClose: () => c(""),
|
|
1971
2024
|
type: "error",
|
|
1972
|
-
title:
|
|
1973
|
-
}), /* @__PURE__ */
|
|
1974
|
-
className:
|
|
2025
|
+
title: o
|
|
2026
|
+
}), /* @__PURE__ */ W("div", {
|
|
2027
|
+
className: q.automationLayout,
|
|
1975
2028
|
"data-assistant-part": "automation-layout",
|
|
1976
|
-
children: /* @__PURE__ */
|
|
2029
|
+
children: /* @__PURE__ */ W(ht, {
|
|
1977
2030
|
bridgeUrl: t,
|
|
1978
2031
|
draft: i.draft,
|
|
1979
|
-
disabled:
|
|
2032
|
+
disabled: p || i.recording,
|
|
1980
2033
|
recording: i.recording,
|
|
1981
2034
|
incomingDraft: n,
|
|
1982
2035
|
onConsumeDraft: r,
|
|
1983
2036
|
onEdit: (e) => {
|
|
1984
|
-
s.loadDraft(e),
|
|
2037
|
+
s.loadDraft(e), u(null);
|
|
1985
2038
|
},
|
|
1986
|
-
exploration: /* @__PURE__ */
|
|
2039
|
+
exploration: /* @__PURE__ */ W(lt, {
|
|
1987
2040
|
bridgeUrl: t,
|
|
1988
2041
|
disabled: i.recording,
|
|
1989
|
-
onRunningChange:
|
|
2042
|
+
onRunningChange: m
|
|
1990
2043
|
}),
|
|
1991
|
-
renderEditor: ({ save: t, busy: n, dirty: r }) => /* @__PURE__ */
|
|
1992
|
-
/* @__PURE__ */
|
|
1993
|
-
className:
|
|
2044
|
+
renderEditor: ({ save: t, busy: n, dirty: r, cancel: o }) => /* @__PURE__ */ G(U, { children: [
|
|
2045
|
+
/* @__PURE__ */ G("div", {
|
|
2046
|
+
className: q.field,
|
|
1994
2047
|
"data-assistant-part": "field",
|
|
1995
2048
|
children: [
|
|
1996
|
-
/* @__PURE__ */
|
|
2049
|
+
/* @__PURE__ */ W("label", {
|
|
1997
2050
|
htmlFor: "assistant-case-name",
|
|
1998
2051
|
children: "用例名称"
|
|
1999
2052
|
}),
|
|
2000
|
-
/* @__PURE__ */
|
|
2053
|
+
/* @__PURE__ */ W(T, {
|
|
2001
2054
|
id: "assistant-case-name",
|
|
2002
2055
|
"aria-required": "true",
|
|
2003
2056
|
"aria-invalid": !i.draft.name.trim(),
|
|
2004
2057
|
"aria-describedby": i.draft.name.trim() ? void 0 : "assistant-case-name-error",
|
|
2005
|
-
prefix: /* @__PURE__ */
|
|
2058
|
+
prefix: /* @__PURE__ */ W(Te, {}),
|
|
2006
2059
|
"aria-label": "测试用例名称",
|
|
2007
2060
|
value: i.draft.name,
|
|
2008
2061
|
maxLength: 100,
|
|
@@ -2012,20 +2065,20 @@ function ft({ close: e, bridgeUrl: t, incomingDraft: n, onConsumeDraft: r }) {
|
|
|
2012
2065
|
name: e.target.value
|
|
2013
2066
|
})
|
|
2014
2067
|
}),
|
|
2015
|
-
!i.draft.name.trim() && /* @__PURE__ */
|
|
2016
|
-
className:
|
|
2068
|
+
!i.draft.name.trim() && /* @__PURE__ */ W("span", {
|
|
2069
|
+
className: q.hint,
|
|
2017
2070
|
id: "assistant-case-name-error",
|
|
2018
2071
|
children: "请输入用例名称"
|
|
2019
2072
|
})
|
|
2020
2073
|
]
|
|
2021
2074
|
}),
|
|
2022
|
-
/* @__PURE__ */
|
|
2023
|
-
className:
|
|
2075
|
+
/* @__PURE__ */ G("div", {
|
|
2076
|
+
className: q.field,
|
|
2024
2077
|
"data-assistant-part": "field",
|
|
2025
|
-
children: [/* @__PURE__ */
|
|
2078
|
+
children: [/* @__PURE__ */ W("label", {
|
|
2026
2079
|
htmlFor: "assistant-case-path",
|
|
2027
2080
|
children: "用例入口"
|
|
2028
|
-
}), /* @__PURE__ */
|
|
2081
|
+
}), /* @__PURE__ */ W(T, {
|
|
2029
2082
|
id: "assistant-case-path",
|
|
2030
2083
|
value: i.draft.path,
|
|
2031
2084
|
maxLength: 2e3,
|
|
@@ -2036,8 +2089,8 @@ function ft({ close: e, bridgeUrl: t, incomingDraft: n, onConsumeDraft: r }) {
|
|
|
2036
2089
|
})
|
|
2037
2090
|
})]
|
|
2038
2091
|
}),
|
|
2039
|
-
/* @__PURE__ */
|
|
2040
|
-
className:
|
|
2092
|
+
/* @__PURE__ */ G(se, {
|
|
2093
|
+
className: q.card,
|
|
2041
2094
|
"data-assistant-part": "card record-card",
|
|
2042
2095
|
"aria-label": "录制操作",
|
|
2043
2096
|
styles: { body: {
|
|
@@ -2047,10 +2100,10 @@ function ft({ close: e, bridgeUrl: t, incomingDraft: n, onConsumeDraft: r }) {
|
|
|
2047
2100
|
gap: 16
|
|
2048
2101
|
} },
|
|
2049
2102
|
children: [
|
|
2050
|
-
/* @__PURE__ */
|
|
2051
|
-
className:
|
|
2103
|
+
/* @__PURE__ */ G("div", {
|
|
2104
|
+
className: q.cardHeading,
|
|
2052
2105
|
"data-assistant-part": "card-heading",
|
|
2053
|
-
children: [/* @__PURE__ */
|
|
2106
|
+
children: [/* @__PURE__ */ G("h3", { children: [/* @__PURE__ */ W(Re, {}), "录制操作"] }), /* @__PURE__ */ G(D, {
|
|
2054
2107
|
color: i.recording ? "red" : "default",
|
|
2055
2108
|
children: [
|
|
2056
2109
|
i.recording ? "录制中" : "待录制",
|
|
@@ -2060,20 +2113,22 @@ function ft({ close: e, bridgeUrl: t, incomingDraft: n, onConsumeDraft: r }) {
|
|
|
2060
2113
|
]
|
|
2061
2114
|
})]
|
|
2062
2115
|
}),
|
|
2063
|
-
/* @__PURE__ */
|
|
2064
|
-
className:
|
|
2116
|
+
/* @__PURE__ */ W("div", {
|
|
2117
|
+
className: q.buttonRow,
|
|
2065
2118
|
"data-assistant-part": "button-row",
|
|
2066
|
-
children: i.recording ? /* @__PURE__ */
|
|
2067
|
-
|
|
2119
|
+
children: i.recording ? /* @__PURE__ */ W(C, {
|
|
2120
|
+
type: "primary",
|
|
2121
|
+
danger: !0,
|
|
2122
|
+
icon: /* @__PURE__ */ W(Ie, {}),
|
|
2068
2123
|
disabled: !i.recording,
|
|
2069
2124
|
onClick: () => s.stop(),
|
|
2070
2125
|
children: "结束录制"
|
|
2071
|
-
}) : /* @__PURE__ */
|
|
2072
|
-
icon: /* @__PURE__ */
|
|
2126
|
+
}) : /* @__PURE__ */ W(C, {
|
|
2127
|
+
icon: /* @__PURE__ */ W(Re, {}),
|
|
2073
2128
|
type: "primary",
|
|
2074
2129
|
disabled: n || i.recording,
|
|
2075
|
-
onClick: () => void
|
|
2076
|
-
(!i.draft.steps.length || window.confirm("新录制会替换当前用例的步骤。继续?")) && (
|
|
2130
|
+
onClick: () => void h(() => {
|
|
2131
|
+
(!i.draft.steps.length || window.confirm("新录制会替换当前用例的步骤。继续?")) && (u(null), s.start(), s.edit({
|
|
2077
2132
|
...s.getState().draft,
|
|
2078
2133
|
name: i.draft.name
|
|
2079
2134
|
}), e());
|
|
@@ -2081,13 +2136,13 @@ function ft({ close: e, bridgeUrl: t, incomingDraft: n, onConsumeDraft: r }) {
|
|
|
2081
2136
|
children: "开始录制"
|
|
2082
2137
|
})
|
|
2083
2138
|
}),
|
|
2084
|
-
/* @__PURE__ */
|
|
2085
|
-
className:
|
|
2139
|
+
/* @__PURE__ */ W("p", {
|
|
2140
|
+
className: q.hint,
|
|
2086
2141
|
"data-assistant-part": "hint",
|
|
2087
2142
|
children: "展开、切换页签等准备操作也需录下来。"
|
|
2088
2143
|
}),
|
|
2089
|
-
/* @__PURE__ */
|
|
2090
|
-
className:
|
|
2144
|
+
/* @__PURE__ */ W(ce, {
|
|
2145
|
+
className: q.help,
|
|
2091
2146
|
"data-assistant-part": "help",
|
|
2092
2147
|
ghost: !0,
|
|
2093
2148
|
size: "small",
|
|
@@ -2101,13 +2156,13 @@ function ft({ close: e, bridgeUrl: t, incomingDraft: n, onConsumeDraft: r }) {
|
|
|
2101
2156
|
},
|
|
2102
2157
|
items: [{
|
|
2103
2158
|
key: "details",
|
|
2104
|
-
label: /* @__PURE__ */
|
|
2105
|
-
children: /* @__PURE__ */
|
|
2106
|
-
className:
|
|
2159
|
+
label: /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W(R, {}), "录制范围"] }),
|
|
2160
|
+
children: /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W("p", {
|
|
2161
|
+
className: q.hint,
|
|
2107
2162
|
"data-assistant-part": "hint",
|
|
2108
2163
|
children: "从业务页面的初始状态开始录制。回放目标由宿主配置。"
|
|
2109
|
-
}), /* @__PURE__ */
|
|
2110
|
-
className:
|
|
2164
|
+
}), /* @__PURE__ */ W("p", {
|
|
2165
|
+
className: q.hint,
|
|
2111
2166
|
"data-assistant-part": "hint",
|
|
2112
2167
|
children: "普通字段的输入值会写入用例。密码等敏感输入、文件上传、跨域 iframe、拖动和刷新不记录或不支持。"
|
|
2113
2168
|
})] })
|
|
@@ -2115,8 +2170,8 @@ function ft({ close: e, bridgeUrl: t, incomingDraft: n, onConsumeDraft: r }) {
|
|
|
2115
2170
|
})
|
|
2116
2171
|
]
|
|
2117
2172
|
}),
|
|
2118
|
-
/* @__PURE__ */
|
|
2119
|
-
className:
|
|
2173
|
+
/* @__PURE__ */ G(se, {
|
|
2174
|
+
className: q.card,
|
|
2120
2175
|
"data-assistant-part": "card editor-card",
|
|
2121
2176
|
"aria-label": "编辑用例",
|
|
2122
2177
|
styles: { body: {
|
|
@@ -2126,73 +2181,73 @@ function ft({ close: e, bridgeUrl: t, incomingDraft: n, onConsumeDraft: r }) {
|
|
|
2126
2181
|
gap: 16
|
|
2127
2182
|
} },
|
|
2128
2183
|
children: [
|
|
2129
|
-
/* @__PURE__ */
|
|
2130
|
-
className:
|
|
2184
|
+
/* @__PURE__ */ G("div", {
|
|
2185
|
+
className: q.cardHeading,
|
|
2131
2186
|
"data-assistant-part": "card-heading",
|
|
2132
|
-
children: [/* @__PURE__ */
|
|
2187
|
+
children: [/* @__PURE__ */ G("h3", { children: [/* @__PURE__ */ W(P, {}), "编辑用例"] }), /* @__PURE__ */ G("span", { children: [i.draft.steps.length, " 个步骤"] })]
|
|
2133
2188
|
}),
|
|
2134
|
-
!i.draft.steps.length && /* @__PURE__ */
|
|
2135
|
-
className:
|
|
2189
|
+
!i.draft.steps.length && /* @__PURE__ */ G("div", {
|
|
2190
|
+
className: q.emptySteps,
|
|
2136
2191
|
"data-assistant-part": "empty-steps",
|
|
2137
|
-
children: [/* @__PURE__ */
|
|
2192
|
+
children: [/* @__PURE__ */ W(Te, {}), /* @__PURE__ */ W("span", { children: "暂无操作步骤" })]
|
|
2138
2193
|
}),
|
|
2139
|
-
/* @__PURE__ */
|
|
2140
|
-
className:
|
|
2194
|
+
/* @__PURE__ */ W("ol", {
|
|
2195
|
+
className: q.caseSteps,
|
|
2141
2196
|
"data-assistant-part": "case-steps",
|
|
2142
|
-
children: i.draft.steps.map((e, t) => /* @__PURE__ */
|
|
2143
|
-
/* @__PURE__ */
|
|
2144
|
-
className:
|
|
2197
|
+
children: i.draft.steps.map((e, t) => /* @__PURE__ */ G("li", { children: [
|
|
2198
|
+
/* @__PURE__ */ G("div", {
|
|
2199
|
+
className: q.stepHeading,
|
|
2145
2200
|
"data-assistant-part": "step-heading",
|
|
2146
2201
|
children: [
|
|
2147
|
-
/* @__PURE__ */
|
|
2148
|
-
className:
|
|
2202
|
+
/* @__PURE__ */ W("span", {
|
|
2203
|
+
className: q.stepNumber,
|
|
2149
2204
|
"data-assistant-part": "step-number",
|
|
2150
2205
|
children: String(t + 1).padStart(2, "0")
|
|
2151
2206
|
}),
|
|
2152
|
-
/* @__PURE__ */
|
|
2207
|
+
/* @__PURE__ */ W(D, {
|
|
2153
2208
|
color: e.kind === "unsupported" ? "red" : "blue",
|
|
2154
|
-
children:
|
|
2209
|
+
children: Qe[e.kind]
|
|
2155
2210
|
}),
|
|
2156
|
-
/* @__PURE__ */
|
|
2157
|
-
e.sourceEventId && /* @__PURE__ */
|
|
2158
|
-
e.supplemented && /* @__PURE__ */
|
|
2211
|
+
/* @__PURE__ */ W("strong", { children: e.assertion?.name ?? e.target?.label ?? e.value }),
|
|
2212
|
+
e.sourceEventId && /* @__PURE__ */ G(D, { children: ["源事件 #", e.sourceEventId] }),
|
|
2213
|
+
e.supplemented && /* @__PURE__ */ W(D, {
|
|
2159
2214
|
color: "orange",
|
|
2160
2215
|
children: "人工补充"
|
|
2161
2216
|
})
|
|
2162
2217
|
]
|
|
2163
2218
|
}),
|
|
2164
|
-
e.assertion && /* @__PURE__ */
|
|
2165
|
-
className:
|
|
2219
|
+
e.assertion && /* @__PURE__ */ G("div", {
|
|
2220
|
+
className: q.assertionSummary,
|
|
2166
2221
|
"data-assistant-part": "assertion-summary",
|
|
2167
2222
|
children: [
|
|
2168
|
-
/* @__PURE__ */
|
|
2223
|
+
/* @__PURE__ */ W(D, {
|
|
2169
2224
|
color: "green",
|
|
2170
|
-
children:
|
|
2225
|
+
children: J.assertionSources[e.assertion.source]
|
|
2171
2226
|
}),
|
|
2172
|
-
/* @__PURE__ */
|
|
2173
|
-
|
|
2227
|
+
/* @__PURE__ */ G("span", { children: [
|
|
2228
|
+
J.assertionOperators[e.assertion.operator],
|
|
2174
2229
|
" ",
|
|
2175
2230
|
e.assertion.expected === "" ? "空字符串" : e.assertion.expected
|
|
2176
2231
|
] }),
|
|
2177
|
-
/* @__PURE__ */
|
|
2178
|
-
className:
|
|
2232
|
+
/* @__PURE__ */ G("span", {
|
|
2233
|
+
className: q.hint,
|
|
2179
2234
|
"data-assistant-part": "hint",
|
|
2180
2235
|
children: [
|
|
2181
|
-
(0,
|
|
2236
|
+
(0, J.isRequestAssertion)(e.assertion.source) ? "观察" : "最多等待",
|
|
2182
2237
|
" ",
|
|
2183
2238
|
e.assertion.timeout / 1e3,
|
|
2184
2239
|
" 秒"
|
|
2185
2240
|
]
|
|
2186
2241
|
}),
|
|
2187
|
-
e.assertion.selector && /* @__PURE__ */
|
|
2188
|
-
e.assertion.method && /* @__PURE__ */
|
|
2242
|
+
e.assertion.selector && /* @__PURE__ */ W("code", { children: e.assertion.selector }),
|
|
2243
|
+
e.assertion.method && /* @__PURE__ */ G("code", { children: [
|
|
2189
2244
|
e.assertion.method,
|
|
2190
2245
|
" ",
|
|
2191
2246
|
e.assertion.pathname
|
|
2192
2247
|
] })
|
|
2193
2248
|
]
|
|
2194
2249
|
}),
|
|
2195
|
-
e.kind === "unsupported" && /* @__PURE__ */
|
|
2250
|
+
e.kind === "unsupported" && /* @__PURE__ */ W(rt, {
|
|
2196
2251
|
step: e,
|
|
2197
2252
|
disabled: i.recording || n,
|
|
2198
2253
|
onApply: (e) => s.edit({
|
|
@@ -2200,15 +2255,15 @@ function ft({ close: e, bridgeUrl: t, incomingDraft: n, onConsumeDraft: r }) {
|
|
|
2200
2255
|
steps: i.draft.steps.map((n, r) => r === t ? e : n)
|
|
2201
2256
|
})
|
|
2202
2257
|
}, JSON.stringify(e)),
|
|
2203
|
-
e.value !== void 0 && e.kind !== "unsupported" && /* @__PURE__ */
|
|
2258
|
+
e.value !== void 0 && e.kind !== "unsupported" && /* @__PURE__ */ W(T, {
|
|
2204
2259
|
"aria-label": `第 ${t + 1} 步内容`,
|
|
2205
2260
|
value: e.value,
|
|
2206
2261
|
maxLength: 2e3,
|
|
2207
2262
|
disabled: i.recording || n,
|
|
2208
|
-
onChange: (e) =>
|
|
2263
|
+
onChange: (e) => g(t, { value: e.target.value })
|
|
2209
2264
|
}),
|
|
2210
|
-
e.kind === "check" && /* @__PURE__ */
|
|
2211
|
-
e.target && /* @__PURE__ */
|
|
2265
|
+
e.kind === "check" && /* @__PURE__ */ W("span", { children: e.checked ? "选中" : "取消选中" }),
|
|
2266
|
+
e.target && /* @__PURE__ */ W(ce, {
|
|
2212
2267
|
ghost: !0,
|
|
2213
2268
|
size: "small",
|
|
2214
2269
|
styles: {
|
|
@@ -2221,27 +2276,29 @@ function ft({ close: e, bridgeUrl: t, incomingDraft: n, onConsumeDraft: r }) {
|
|
|
2221
2276
|
},
|
|
2222
2277
|
items: [{
|
|
2223
2278
|
key: "details",
|
|
2224
|
-
label: /* @__PURE__ */
|
|
2225
|
-
children: /* @__PURE__ */
|
|
2279
|
+
label: /* @__PURE__ */ W(U, { children: "定位信息" }),
|
|
2280
|
+
children: /* @__PURE__ */ W(U, { children: /* @__PURE__ */ W("code", { children: e.target.selector }) })
|
|
2226
2281
|
}]
|
|
2227
2282
|
}),
|
|
2228
|
-
/* @__PURE__ */
|
|
2229
|
-
className: [
|
|
2283
|
+
/* @__PURE__ */ G("div", {
|
|
2284
|
+
className: [q.buttonRow, q.stepActions].join(" "),
|
|
2230
2285
|
"data-assistant-part": "button-row step-actions",
|
|
2231
2286
|
children: [
|
|
2232
|
-
/* @__PURE__ */
|
|
2287
|
+
/* @__PURE__ */ W(C, {
|
|
2233
2288
|
size: "small",
|
|
2234
|
-
|
|
2289
|
+
type: "text",
|
|
2290
|
+
icon: /* @__PURE__ */ W(j, {}),
|
|
2235
2291
|
disabled: i.recording || n || !e.assertion && i.draft.steps.length >= 100,
|
|
2236
|
-
onClick: () =>
|
|
2292
|
+
onClick: () => f(t + 1, e.assertion ? t : void 0),
|
|
2237
2293
|
children: e.assertion ? "编辑断言" : "在此步后添加断言"
|
|
2238
2294
|
}),
|
|
2239
|
-
/* @__PURE__ */
|
|
2240
|
-
|
|
2295
|
+
/* @__PURE__ */ G(C, {
|
|
2296
|
+
type: "text",
|
|
2297
|
+
icon: /* @__PURE__ */ W(B, {}),
|
|
2241
2298
|
size: "small",
|
|
2242
2299
|
disabled: i.recording || n || i.draft.steps.length >= 100,
|
|
2243
2300
|
onClick: () => {
|
|
2244
|
-
|
|
2301
|
+
u(null), s.edit({
|
|
2245
2302
|
...i.draft,
|
|
2246
2303
|
steps: [
|
|
2247
2304
|
...i.draft.steps.slice(0, t),
|
|
@@ -2259,13 +2316,14 @@ function ft({ close: e, bridgeUrl: t, incomingDraft: n, onConsumeDraft: r }) {
|
|
|
2259
2316
|
" 步前插入"
|
|
2260
2317
|
]
|
|
2261
2318
|
}),
|
|
2262
|
-
/* @__PURE__ */
|
|
2263
|
-
|
|
2319
|
+
/* @__PURE__ */ G(C, {
|
|
2320
|
+
type: "text",
|
|
2321
|
+
icon: /* @__PURE__ */ W(ye, {}),
|
|
2264
2322
|
danger: !0,
|
|
2265
2323
|
size: "small",
|
|
2266
2324
|
disabled: i.recording || n,
|
|
2267
2325
|
onClick: () => {
|
|
2268
|
-
|
|
2326
|
+
u(null), s.edit({
|
|
2269
2327
|
...i.draft,
|
|
2270
2328
|
steps: i.draft.steps.filter((e, n) => n !== t)
|
|
2271
2329
|
});
|
|
@@ -2280,7 +2338,7 @@ function ft({ close: e, bridgeUrl: t, incomingDraft: n, onConsumeDraft: r }) {
|
|
|
2280
2338
|
})
|
|
2281
2339
|
] }, t))
|
|
2282
2340
|
}),
|
|
2283
|
-
i.draft.timeline && /* @__PURE__ */
|
|
2341
|
+
i.draft.timeline && /* @__PURE__ */ W(ce, {
|
|
2284
2342
|
ghost: !0,
|
|
2285
2343
|
size: "small",
|
|
2286
2344
|
styles: {
|
|
@@ -2293,93 +2351,105 @@ function ft({ close: e, bridgeUrl: t, incomingDraft: n, onConsumeDraft: r }) {
|
|
|
2293
2351
|
},
|
|
2294
2352
|
items: [{
|
|
2295
2353
|
key: "details",
|
|
2296
|
-
label: /* @__PURE__ */
|
|
2354
|
+
label: /* @__PURE__ */ G(U, { children: [
|
|
2297
2355
|
"选段原始证据(",
|
|
2298
2356
|
i.draft.timeline.events.length,
|
|
2299
2357
|
" 条,只读)"
|
|
2300
2358
|
] }),
|
|
2301
|
-
children: /* @__PURE__ */
|
|
2302
|
-
className:
|
|
2359
|
+
children: /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W("p", { children: "接口、异常和性能事件不执行;人工补充与移除步骤不会改写这里的来源记录。" }), /* @__PURE__ */ W("pre", {
|
|
2360
|
+
className: q.json,
|
|
2303
2361
|
"data-assistant-part": "json",
|
|
2304
2362
|
children: JSON.stringify(i.draft.timeline, null, 2)
|
|
2305
2363
|
})] })
|
|
2306
2364
|
}]
|
|
2307
2365
|
}),
|
|
2308
|
-
/* @__PURE__ */
|
|
2309
|
-
ref:
|
|
2310
|
-
className:
|
|
2366
|
+
/* @__PURE__ */ G("div", {
|
|
2367
|
+
ref: d,
|
|
2368
|
+
className: q.assertionArea,
|
|
2311
2369
|
"data-assistant-part": "assertion-area",
|
|
2312
|
-
children: [/* @__PURE__ */
|
|
2313
|
-
className:
|
|
2370
|
+
children: [/* @__PURE__ */ G("div", {
|
|
2371
|
+
className: q.cardHeading,
|
|
2314
2372
|
"data-assistant-part": "card-heading",
|
|
2315
|
-
children: [/* @__PURE__ */
|
|
2373
|
+
children: [/* @__PURE__ */ G("h3", { children: [/* @__PURE__ */ W(j, {}), " 结果断言"] }), /* @__PURE__ */ G(D, { children: [
|
|
2316
2374
|
i.draft.steps.filter((e) => e.kind === "assert" || e.kind === "assert-text").length,
|
|
2317
2375
|
" ",
|
|
2318
2376
|
"条"
|
|
2319
2377
|
] })]
|
|
2320
|
-
}),
|
|
2321
|
-
initial:
|
|
2378
|
+
}), l ? /* @__PURE__ */ W(tt, {
|
|
2379
|
+
initial: l.edit === void 0 ? void 0 : i.draft.steps[l.edit]?.assertion,
|
|
2322
2380
|
steps: i.draft.steps,
|
|
2323
|
-
position:
|
|
2381
|
+
position: l.position,
|
|
2324
2382
|
disabled: n || i.recording,
|
|
2325
|
-
onCancel: () =>
|
|
2383
|
+
onCancel: () => u(null),
|
|
2326
2384
|
onSave: (e, t) => {
|
|
2327
2385
|
let n = [...i.draft.steps];
|
|
2328
|
-
|
|
2386
|
+
l.edit === void 0 ? n.splice(t, 0, {
|
|
2329
2387
|
kind: "assert",
|
|
2330
2388
|
assertion: e,
|
|
2331
2389
|
supplemented: !0
|
|
2332
|
-
}) : n[
|
|
2333
|
-
...n[
|
|
2390
|
+
}) : n[l.edit] = {
|
|
2391
|
+
...n[l.edit],
|
|
2334
2392
|
kind: "assert",
|
|
2335
2393
|
assertion: e,
|
|
2336
2394
|
supplemented: !0
|
|
2337
|
-
}, s.edit((0,
|
|
2395
|
+
}, s.edit((0, J.parseCase)({
|
|
2338
2396
|
...i.draft,
|
|
2339
2397
|
steps: n
|
|
2340
|
-
})),
|
|
2398
|
+
})), u(null);
|
|
2341
2399
|
}
|
|
2342
|
-
}, `${
|
|
2343
|
-
|
|
2400
|
+
}, `${l.position}-${l.edit ?? "new"}`) : /* @__PURE__ */ W(C, {
|
|
2401
|
+
type: "text",
|
|
2402
|
+
icon: /* @__PURE__ */ W(B, {}),
|
|
2344
2403
|
disabled: n || i.recording || i.draft.steps.length >= 100,
|
|
2345
|
-
onClick: () =>
|
|
2404
|
+
onClick: () => f(i.draft.steps.length),
|
|
2346
2405
|
children: "添加断言"
|
|
2347
2406
|
})]
|
|
2348
2407
|
}),
|
|
2349
|
-
/* @__PURE__ */
|
|
2350
|
-
className: [
|
|
2408
|
+
/* @__PURE__ */ G("div", {
|
|
2409
|
+
className: [q.buttonRow, q.cardActions].join(" "),
|
|
2351
2410
|
"data-assistant-part": "button-row card-actions",
|
|
2352
2411
|
children: [
|
|
2353
|
-
/* @__PURE__ */
|
|
2354
|
-
icon: /* @__PURE__ */
|
|
2412
|
+
/* @__PURE__ */ W(C, {
|
|
2413
|
+
icon: /* @__PURE__ */ W(V, {}),
|
|
2414
|
+
type: "primary",
|
|
2355
2415
|
disabled: i.recording || n || !i.draft.name.trim() || !i.draft.steps.length,
|
|
2356
|
-
onClick: () => void
|
|
2416
|
+
onClick: () => void h(() => t((0, J.parseCase)(i.draft))),
|
|
2357
2417
|
children: "保存用例"
|
|
2358
2418
|
}),
|
|
2359
|
-
/* @__PURE__ */
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
let e = (0, Y.parseCase)(i.draft), t = URL.createObjectURL(new Blob([JSON.stringify(e, null, 2)], { type: "application/json" })), n = document.createElement("a");
|
|
2364
|
-
n.href = t, n.download = "页面录制用例.json", document.body.append(n), n.click(), n.remove(), setTimeout(() => URL.revokeObjectURL(t), 3e4);
|
|
2365
|
-
}),
|
|
2366
|
-
children: "导出用例 JSON"
|
|
2419
|
+
/* @__PURE__ */ W(C, {
|
|
2420
|
+
disabled: n || i.recording,
|
|
2421
|
+
onClick: o,
|
|
2422
|
+
children: "取消"
|
|
2367
2423
|
}),
|
|
2368
|
-
/* @__PURE__ */
|
|
2369
|
-
|
|
2370
|
-
|
|
2424
|
+
/* @__PURE__ */ W(et, {
|
|
2425
|
+
label: "用例文件操作",
|
|
2426
|
+
disabled: n || i.recording,
|
|
2427
|
+
items: [{
|
|
2428
|
+
key: "import",
|
|
2429
|
+
label: "导入用例",
|
|
2430
|
+
onClick: () => a.current?.click()
|
|
2431
|
+
}, {
|
|
2432
|
+
key: "export",
|
|
2433
|
+
label: "导出用例 JSON",
|
|
2434
|
+
disabled: !i.draft.steps.length,
|
|
2435
|
+
onClick: () => void h(() => {
|
|
2436
|
+
let e = (0, J.parseCase)(i.draft), t = URL.createObjectURL(new Blob([JSON.stringify(e, null, 2)], { type: "application/json" })), n = document.createElement("a");
|
|
2437
|
+
n.href = t, n.download = "页面录制用例.json", document.body.append(n), n.click(), n.remove(), setTimeout(() => URL.revokeObjectURL(t), 3e4);
|
|
2438
|
+
})
|
|
2439
|
+
}]
|
|
2440
|
+
}),
|
|
2441
|
+
/* @__PURE__ */ W("input", {
|
|
2442
|
+
hidden: !0,
|
|
2443
|
+
type: "file",
|
|
2444
|
+
ref: a,
|
|
2371
2445
|
accept: ".json,application/json",
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
icon: /* @__PURE__ */ G(H, {}),
|
|
2380
|
-
disabled: i.recording || n,
|
|
2381
|
-
children: "导入用例"
|
|
2382
|
-
})
|
|
2446
|
+
onChange: (e) => {
|
|
2447
|
+
let t = e.target.files?.[0];
|
|
2448
|
+
e.target.value = "", !t || i.recording || n || h(async () => {
|
|
2449
|
+
if (t.size > 524288) throw Error("用例不能超过 512 KB");
|
|
2450
|
+
(!r || window.confirm("导入会替换当前未保存草稿。继续?")) && (s.loadDraft((0, J.parseCase)(JSON.parse(await t.text()))), u(null));
|
|
2451
|
+
});
|
|
2452
|
+
}
|
|
2383
2453
|
})
|
|
2384
2454
|
]
|
|
2385
2455
|
})
|
|
@@ -2390,7 +2460,7 @@ function ft({ close: e, bridgeUrl: t, incomingDraft: n, onConsumeDraft: r }) {
|
|
|
2390
2460
|
})]
|
|
2391
2461
|
});
|
|
2392
2462
|
}
|
|
2393
|
-
var
|
|
2463
|
+
var Q = {
|
|
2394
2464
|
json: "_json_62man_1 _json_13kbl_377",
|
|
2395
2465
|
eventMeta: "_eventMeta_62man_4 _eventMeta_13kbl_629",
|
|
2396
2466
|
hint: "_hint_62man_7 _hint_13kbl_515",
|
|
@@ -2403,7 +2473,7 @@ var pt = {
|
|
|
2403
2473
|
error: "_error_62man_58"
|
|
2404
2474
|
};
|
|
2405
2475
|
// src/utils/automation/timeline-case.ts
|
|
2406
|
-
function
|
|
2476
|
+
function _t(t) {
|
|
2407
2477
|
let n = /* @__PURE__ */ new Set();
|
|
2408
2478
|
return t.map((t) => {
|
|
2409
2479
|
if (!Number.isSafeInteger(t.id) || t.id <= 0 || n.has(t.id)) throw Error("事件编号重复或无效,无法选段");
|
|
@@ -2417,12 +2487,12 @@ function mt(t) {
|
|
|
2417
2487
|
};
|
|
2418
2488
|
}).sort((e, t) => e.time - t.time || e.id - t.id);
|
|
2419
2489
|
}
|
|
2420
|
-
function
|
|
2490
|
+
function vt(e, t, n) {
|
|
2421
2491
|
let r = e.findIndex((e) => e.id === t), i = e.findIndex((e) => e.id === n);
|
|
2422
2492
|
return r < 0 || i < r ? [] : e.slice(r, i + 1);
|
|
2423
2493
|
}
|
|
2424
|
-
function
|
|
2425
|
-
let r =
|
|
2494
|
+
function yt(e, t, n) {
|
|
2495
|
+
let r = vt(e, t, n);
|
|
2426
2496
|
if (!r.length) throw Error("请选择按时间先后排列的起点和终点");
|
|
2427
2497
|
let i = r.filter((e) => [
|
|
2428
2498
|
"route",
|
|
@@ -2433,7 +2503,7 @@ function gt(e, t, n) {
|
|
|
2433
2503
|
if (i.length >= 100) throw Error("操作过多,请缩小选段范围(需为前置步骤预留一个位置)");
|
|
2434
2504
|
let a = new URL(i[0].page);
|
|
2435
2505
|
if (!["http:", "https:"].includes(a.protocol) || i.some((e) => new URL(e.page).origin !== a.origin)) throw Error("请选择同一站点内的片段");
|
|
2436
|
-
return (0,
|
|
2506
|
+
return (0, J.parseCase)({
|
|
2437
2507
|
schema: "zhidao-recorded-case",
|
|
2438
2508
|
version: 1,
|
|
2439
2509
|
name: `时间线片段 #${t}–#${n}`,
|
|
@@ -2453,7 +2523,7 @@ function gt(e, t, n) {
|
|
|
2453
2523
|
});
|
|
2454
2524
|
}
|
|
2455
2525
|
// src/pages/assistant/components/TimelinePanel/index.tsx
|
|
2456
|
-
var
|
|
2526
|
+
var bt = {
|
|
2457
2527
|
route: "页面",
|
|
2458
2528
|
click: "点击",
|
|
2459
2529
|
change: "字段",
|
|
@@ -2461,48 +2531,48 @@ var _t = {
|
|
|
2461
2531
|
error: "异常",
|
|
2462
2532
|
performance: "性能"
|
|
2463
2533
|
};
|
|
2464
|
-
function
|
|
2465
|
-
let n = ie(s.subscribe, s.getState), [r, i] = x(null), [a, o] = x(), [c, l] = x(), [u, d] = x("all"), [f, p] = x(""), [m, h] = x(""), g = r ?
|
|
2466
|
-
return /* @__PURE__ */
|
|
2467
|
-
className:
|
|
2534
|
+
function xt({ events: e, onDraft: t }) {
|
|
2535
|
+
let n = ie(s.subscribe, s.getState), [r, i] = x(null), [a, o] = x(), [c, l] = x(), [u, d] = x("all"), [f, p] = x(""), [m, h] = x(""), g = r ? vt(r, a, c) : [], _ = new Set(g.map((e) => e.id)), ee = r ?? e.filter((e) => (u === "all" || e.kind === u) && (e.title + e.page).includes(f));
|
|
2536
|
+
return /* @__PURE__ */ G("div", {
|
|
2537
|
+
className: Q.section,
|
|
2468
2538
|
"data-assistant-part": "section",
|
|
2469
2539
|
children: [
|
|
2470
|
-
/* @__PURE__ */
|
|
2471
|
-
className:
|
|
2540
|
+
/* @__PURE__ */ G("div", {
|
|
2541
|
+
className: Q.sectionHeading,
|
|
2472
2542
|
"data-assistant-part": "section-heading",
|
|
2473
|
-
children: [/* @__PURE__ */
|
|
2474
|
-
className:
|
|
2543
|
+
children: [/* @__PURE__ */ W("span", {
|
|
2544
|
+
className: Q.headingIcon,
|
|
2475
2545
|
"data-assistant-part": "heading-icon",
|
|
2476
|
-
children: /* @__PURE__ */
|
|
2477
|
-
}), /* @__PURE__ */
|
|
2546
|
+
children: /* @__PURE__ */ W(Oe, {})
|
|
2547
|
+
}), /* @__PURE__ */ W("div", { children: /* @__PURE__ */ W("h3", { children: "操作时间线" }) })]
|
|
2478
2548
|
}),
|
|
2479
|
-
t && /* @__PURE__ */
|
|
2480
|
-
className:
|
|
2549
|
+
t && /* @__PURE__ */ G("div", {
|
|
2550
|
+
className: Q.buttonRow,
|
|
2481
2551
|
"data-assistant-part": "button-row",
|
|
2482
|
-
children: [!r && /* @__PURE__ */
|
|
2483
|
-
icon: /* @__PURE__ */
|
|
2552
|
+
children: [!r && /* @__PURE__ */ W(C, {
|
|
2553
|
+
icon: /* @__PURE__ */ W(H, {}),
|
|
2484
2554
|
disabled: n.recording || !e.length,
|
|
2485
2555
|
onClick: () => {
|
|
2486
2556
|
try {
|
|
2487
|
-
i(
|
|
2557
|
+
i(_t(e)), o(void 0), l(void 0), h("");
|
|
2488
2558
|
} catch (e) {
|
|
2489
2559
|
h(e.message);
|
|
2490
2560
|
}
|
|
2491
2561
|
},
|
|
2492
2562
|
children: "开始选段"
|
|
2493
|
-
}), r && /* @__PURE__ */
|
|
2494
|
-
icon: /* @__PURE__ */
|
|
2563
|
+
}), r && /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W(C, {
|
|
2564
|
+
icon: /* @__PURE__ */ W(ve, {}),
|
|
2495
2565
|
onClick: () => {
|
|
2496
2566
|
i(null), o(void 0), l(void 0), h("");
|
|
2497
2567
|
},
|
|
2498
2568
|
children: "退出选段"
|
|
2499
|
-
}), /* @__PURE__ */
|
|
2500
|
-
icon: /* @__PURE__ */
|
|
2569
|
+
}), /* @__PURE__ */ W(C, {
|
|
2570
|
+
icon: /* @__PURE__ */ W(we, {}),
|
|
2501
2571
|
type: "primary",
|
|
2502
2572
|
disabled: !g.length || n.recording,
|
|
2503
2573
|
onClick: () => {
|
|
2504
2574
|
try {
|
|
2505
|
-
t(
|
|
2575
|
+
t(yt(r, a, c));
|
|
2506
2576
|
} catch (e) {
|
|
2507
2577
|
h(e.message);
|
|
2508
2578
|
}
|
|
@@ -2510,8 +2580,8 @@ function vt({ events: e, onDraft: t }) {
|
|
|
2510
2580
|
children: "生成用例草稿"
|
|
2511
2581
|
})] })]
|
|
2512
2582
|
}),
|
|
2513
|
-
r && /* @__PURE__ */
|
|
2514
|
-
className:
|
|
2583
|
+
r && /* @__PURE__ */ G("p", {
|
|
2584
|
+
className: Q.hint,
|
|
2515
2585
|
"aria-live": "polite",
|
|
2516
2586
|
children: [
|
|
2517
2587
|
a ? "#" + a : "选起点",
|
|
@@ -2523,26 +2593,26 @@ function vt({ events: e, onDraft: t }) {
|
|
|
2523
2593
|
g.length > 0 && " · 输入值与定位需补充"
|
|
2524
2594
|
]
|
|
2525
2595
|
}),
|
|
2526
|
-
m && /* @__PURE__ */
|
|
2596
|
+
m && /* @__PURE__ */ W(S, {
|
|
2527
2597
|
type: "warning",
|
|
2528
2598
|
title: m
|
|
2529
2599
|
}),
|
|
2530
|
-
!r && /* @__PURE__ */
|
|
2531
|
-
className:
|
|
2600
|
+
!r && /* @__PURE__ */ G("div", {
|
|
2601
|
+
className: Q.filters,
|
|
2532
2602
|
"data-assistant-part": "filters",
|
|
2533
|
-
children: [/* @__PURE__ */
|
|
2603
|
+
children: [/* @__PURE__ */ W(E, {
|
|
2534
2604
|
"aria-label": "事件类型",
|
|
2535
2605
|
value: u,
|
|
2536
2606
|
onChange: d,
|
|
2537
2607
|
options: [{
|
|
2538
2608
|
value: "all",
|
|
2539
2609
|
label: "全部事件"
|
|
2540
|
-
}, ...Object.entries(
|
|
2610
|
+
}, ...Object.entries(bt).map(([e, t]) => ({
|
|
2541
2611
|
value: e,
|
|
2542
2612
|
label: t
|
|
2543
2613
|
}))]
|
|
2544
|
-
}), /* @__PURE__ */
|
|
2545
|
-
prefix: /* @__PURE__ */
|
|
2614
|
+
}), /* @__PURE__ */ W(T, {
|
|
2615
|
+
prefix: /* @__PURE__ */ W(Fe, {}),
|
|
2546
2616
|
"aria-label": "搜索时间线",
|
|
2547
2617
|
placeholder: "搜索操作或页面",
|
|
2548
2618
|
value: f,
|
|
@@ -2550,35 +2620,35 @@ function vt({ events: e, onDraft: t }) {
|
|
|
2550
2620
|
allowClear: !0
|
|
2551
2621
|
})]
|
|
2552
2622
|
}),
|
|
2553
|
-
!ee.length && /* @__PURE__ */
|
|
2554
|
-
/* @__PURE__ */
|
|
2555
|
-
className:
|
|
2623
|
+
!ee.length && /* @__PURE__ */ W(de, { description: e.length ? "没有匹配的事件" : "暂无时间线记录" }),
|
|
2624
|
+
/* @__PURE__ */ W("ol", {
|
|
2625
|
+
className: Q.timeline,
|
|
2556
2626
|
"data-assistant-part": "timeline",
|
|
2557
|
-
children: ee.slice().sort((e, t) => t.time - e.time || t.id - e.id).map((e) => /* @__PURE__ */
|
|
2558
|
-
className: e.kind === "error" ?
|
|
2627
|
+
children: ee.slice().sort((e, t) => t.time - e.time || t.id - e.id).map((e) => /* @__PURE__ */ G("li", {
|
|
2628
|
+
className: e.kind === "error" ? Q.error : "",
|
|
2559
2629
|
children: [
|
|
2560
|
-
/* @__PURE__ */
|
|
2561
|
-
className:
|
|
2630
|
+
/* @__PURE__ */ G("div", {
|
|
2631
|
+
className: Q.eventMeta,
|
|
2562
2632
|
"data-assistant-part": "event-meta",
|
|
2563
2633
|
children: [
|
|
2564
|
-
/* @__PURE__ */
|
|
2634
|
+
/* @__PURE__ */ W(D, {
|
|
2565
2635
|
color: e.kind === "error" ? "red" : "blue",
|
|
2566
|
-
children:
|
|
2636
|
+
children: bt[e.kind]
|
|
2567
2637
|
}),
|
|
2568
|
-
/* @__PURE__ */
|
|
2569
|
-
/* @__PURE__ */
|
|
2570
|
-
_.has(e.id) && /* @__PURE__ */
|
|
2638
|
+
/* @__PURE__ */ W("time", { children: new Date(e.time).toLocaleTimeString("zh-CN", { hour12: !1 }) }),
|
|
2639
|
+
/* @__PURE__ */ G("small", { children: ["#", e.id] }),
|
|
2640
|
+
_.has(e.id) && /* @__PURE__ */ W(D, {
|
|
2571
2641
|
color: "gold",
|
|
2572
2642
|
children: "已选"
|
|
2573
2643
|
})
|
|
2574
2644
|
]
|
|
2575
2645
|
}),
|
|
2576
|
-
/* @__PURE__ */
|
|
2577
|
-
r && /* @__PURE__ */
|
|
2578
|
-
className:
|
|
2646
|
+
/* @__PURE__ */ W("strong", { children: e.title }),
|
|
2647
|
+
r && /* @__PURE__ */ G("div", {
|
|
2648
|
+
className: Q.buttonRow,
|
|
2579
2649
|
"data-assistant-part": "button-row",
|
|
2580
|
-
children: [/* @__PURE__ */
|
|
2581
|
-
icon: /* @__PURE__ */
|
|
2650
|
+
children: [/* @__PURE__ */ W(C, {
|
|
2651
|
+
icon: /* @__PURE__ */ W(Ee, {}),
|
|
2582
2652
|
size: "small",
|
|
2583
2653
|
"aria-label": `从事件 ${e.id} 开始`,
|
|
2584
2654
|
"aria-pressed": a === e.id,
|
|
@@ -2586,8 +2656,8 @@ function vt({ events: e, onDraft: t }) {
|
|
|
2586
2656
|
o(e.id), l(void 0);
|
|
2587
2657
|
},
|
|
2588
2658
|
children: "设为起点"
|
|
2589
|
-
}), /* @__PURE__ */
|
|
2590
|
-
icon: /* @__PURE__ */
|
|
2659
|
+
}), /* @__PURE__ */ W(C, {
|
|
2660
|
+
icon: /* @__PURE__ */ W(j, {}),
|
|
2591
2661
|
size: "small",
|
|
2592
2662
|
"aria-label": `到事件 ${e.id} 结束`,
|
|
2593
2663
|
"aria-pressed": c === e.id,
|
|
@@ -2596,7 +2666,7 @@ function vt({ events: e, onDraft: t }) {
|
|
|
2596
2666
|
children: "设为终点"
|
|
2597
2667
|
})]
|
|
2598
2668
|
}),
|
|
2599
|
-
/* @__PURE__ */
|
|
2669
|
+
/* @__PURE__ */ W(ce, {
|
|
2600
2670
|
ghost: !0,
|
|
2601
2671
|
size: "small",
|
|
2602
2672
|
styles: {
|
|
@@ -2609,9 +2679,9 @@ function vt({ events: e, onDraft: t }) {
|
|
|
2609
2679
|
},
|
|
2610
2680
|
items: [{
|
|
2611
2681
|
key: "details",
|
|
2612
|
-
label: /* @__PURE__ */
|
|
2613
|
-
children: /* @__PURE__ */
|
|
2614
|
-
className:
|
|
2682
|
+
label: /* @__PURE__ */ G(U, { children: ["详情", e.actionId ? ` · 关联操作 #${e.actionId}` : ""] }),
|
|
2683
|
+
children: /* @__PURE__ */ W(U, { children: /* @__PURE__ */ W("pre", {
|
|
2684
|
+
className: Q.json,
|
|
2615
2685
|
"data-assistant-part": "json",
|
|
2616
2686
|
children: JSON.stringify({
|
|
2617
2687
|
page: e.page,
|
|
@@ -2626,25 +2696,25 @@ function vt({ events: e, onDraft: t }) {
|
|
|
2626
2696
|
]
|
|
2627
2697
|
});
|
|
2628
2698
|
}
|
|
2629
|
-
var
|
|
2699
|
+
var St = { avatar: "_avatar_1modk_1" };
|
|
2630
2700
|
// src/components/AssistantAvatar/index.tsx
|
|
2631
|
-
function
|
|
2632
|
-
return /* @__PURE__ */
|
|
2633
|
-
className: [
|
|
2701
|
+
function Ct({ className: e }) {
|
|
2702
|
+
return /* @__PURE__ */ W("span", {
|
|
2703
|
+
className: [St.avatar, e].filter(Boolean).join(" "),
|
|
2634
2704
|
"data-assistant-part": "avatar",
|
|
2635
2705
|
"aria-hidden": "true",
|
|
2636
|
-
children: /* @__PURE__ */
|
|
2706
|
+
children: /* @__PURE__ */ G("svg", {
|
|
2637
2707
|
viewBox: "0 0 40 40",
|
|
2638
2708
|
fill: "none",
|
|
2639
2709
|
focusable: "false",
|
|
2640
2710
|
children: [
|
|
2641
|
-
/* @__PURE__ */
|
|
2711
|
+
/* @__PURE__ */ W("path", {
|
|
2642
2712
|
d: "M19 5v6M16 5h6",
|
|
2643
2713
|
stroke: "currentColor",
|
|
2644
2714
|
strokeWidth: "2.5",
|
|
2645
2715
|
strokeLinecap: "round"
|
|
2646
2716
|
}),
|
|
2647
|
-
/* @__PURE__ */
|
|
2717
|
+
/* @__PURE__ */ W("rect", {
|
|
2648
2718
|
x: "6",
|
|
2649
2719
|
y: "11",
|
|
2650
2720
|
width: "28",
|
|
@@ -2652,7 +2722,7 @@ function bt({ className: e }) {
|
|
|
2652
2722
|
rx: "11",
|
|
2653
2723
|
fill: "currentColor"
|
|
2654
2724
|
}),
|
|
2655
|
-
/* @__PURE__ */
|
|
2725
|
+
/* @__PURE__ */ W("rect", {
|
|
2656
2726
|
x: "2",
|
|
2657
2727
|
y: "20",
|
|
2658
2728
|
width: "2.5",
|
|
@@ -2660,7 +2730,7 @@ function bt({ className: e }) {
|
|
|
2660
2730
|
rx: "1.25",
|
|
2661
2731
|
fill: "currentColor"
|
|
2662
2732
|
}),
|
|
2663
|
-
/* @__PURE__ */
|
|
2733
|
+
/* @__PURE__ */ W("rect", {
|
|
2664
2734
|
x: "35.5",
|
|
2665
2735
|
y: "20",
|
|
2666
2736
|
width: "2.5",
|
|
@@ -2668,7 +2738,7 @@ function bt({ className: e }) {
|
|
|
2668
2738
|
rx: "1.25",
|
|
2669
2739
|
fill: "currentColor"
|
|
2670
2740
|
}),
|
|
2671
|
-
/* @__PURE__ */
|
|
2741
|
+
/* @__PURE__ */ W("rect", {
|
|
2672
2742
|
x: "11",
|
|
2673
2743
|
y: "17",
|
|
2674
2744
|
width: "18",
|
|
@@ -2676,7 +2746,7 @@ function bt({ className: e }) {
|
|
|
2676
2746
|
rx: "6",
|
|
2677
2747
|
fill: "#244b40"
|
|
2678
2748
|
}),
|
|
2679
|
-
/* @__PURE__ */
|
|
2749
|
+
/* @__PURE__ */ W("rect", {
|
|
2680
2750
|
x: "15",
|
|
2681
2751
|
y: "21",
|
|
2682
2752
|
width: "3",
|
|
@@ -2684,7 +2754,7 @@ function bt({ className: e }) {
|
|
|
2684
2754
|
rx: "1.5",
|
|
2685
2755
|
fill: "currentColor"
|
|
2686
2756
|
}),
|
|
2687
|
-
/* @__PURE__ */
|
|
2757
|
+
/* @__PURE__ */ W("rect", {
|
|
2688
2758
|
x: "22",
|
|
2689
2759
|
y: "21",
|
|
2690
2760
|
width: "3",
|
|
@@ -2692,7 +2762,7 @@ function bt({ className: e }) {
|
|
|
2692
2762
|
rx: "1.5",
|
|
2693
2763
|
fill: "currentColor"
|
|
2694
2764
|
}),
|
|
2695
|
-
/* @__PURE__ */
|
|
2765
|
+
/* @__PURE__ */ W("path", {
|
|
2696
2766
|
d: "m32 3 1.3 3.7L37 8l-3.7 1.3L32 13l-1.3-3.7L27 8l3.7-1.3Z",
|
|
2697
2767
|
fill: "#ffe2ac"
|
|
2698
2768
|
})
|
|
@@ -2700,7 +2770,7 @@ function bt({ className: e }) {
|
|
|
2700
2770
|
})
|
|
2701
2771
|
});
|
|
2702
2772
|
}
|
|
2703
|
-
var
|
|
2773
|
+
var wt = {
|
|
2704
2774
|
window: "_window_gvvdi_1",
|
|
2705
2775
|
expanded: "_expanded_gvvdi_26",
|
|
2706
2776
|
moving: "_moving_gvvdi_32",
|
|
@@ -2711,13 +2781,13 @@ var xt = {
|
|
|
2711
2781
|
resize: "_resize_gvvdi_110"
|
|
2712
2782
|
};
|
|
2713
2783
|
// src/layouts/FloatingPanel/useOverlayScrollbars.ts
|
|
2714
|
-
function
|
|
2784
|
+
function Tt(e, t) {
|
|
2715
2785
|
y(() => {
|
|
2716
2786
|
let n = e.current;
|
|
2717
2787
|
if (!n || !t) return;
|
|
2718
2788
|
let r = /* @__PURE__ */ new Map(), i = 0, a = () => {
|
|
2719
2789
|
for (let [e, t] of r) n.contains(e) || (t.destroy(), r.delete(e));
|
|
2720
|
-
for (let e of n.querySelectorAll("[data-assistant-part~=\"body\"],[data-assistant-part~=\"json\"],.ant-tabs-content-holder,.ant-tabs-body-holder")) r.has(e) || r.set(e,
|
|
2790
|
+
for (let e of n.querySelectorAll("[data-assistant-part~=\"body\"],[data-assistant-part~=\"json\"],.ant-tabs-content-holder,.ant-tabs-body-holder")) r.has(e) || r.set(e, Be({
|
|
2721
2791
|
target: e,
|
|
2722
2792
|
elements: { viewport: e }
|
|
2723
2793
|
}, {
|
|
@@ -2744,25 +2814,25 @@ function St(e, t) {
|
|
|
2744
2814
|
}, [e, t]);
|
|
2745
2815
|
}
|
|
2746
2816
|
// src/layouts/FloatingPanel/index.tsx
|
|
2747
|
-
var
|
|
2817
|
+
var Et = 12, Dt = (e) => {
|
|
2748
2818
|
let t = Math.min(Math.max(360, e.width), window.innerWidth - 24), n = Math.min(Math.max(380, e.height), window.innerHeight - 24);
|
|
2749
2819
|
return {
|
|
2750
2820
|
width: t,
|
|
2751
2821
|
height: n,
|
|
2752
|
-
x: Math.max(
|
|
2753
|
-
y: Math.max(
|
|
2822
|
+
x: Math.max(Et, Math.min(e.x, window.innerWidth - t - Et)),
|
|
2823
|
+
y: Math.max(Et, Math.min(e.y, window.innerHeight - n - Et))
|
|
2754
2824
|
};
|
|
2755
|
-
},
|
|
2756
|
-
let { open: t, onMinimize: n, children: r, developer: i } = e, [a, o] = x(() =>
|
|
2825
|
+
}, Ot = (e) => {
|
|
2826
|
+
let { open: t, onMinimize: n, children: r, developer: i } = e, [a, o] = x(() => Dt({
|
|
2757
2827
|
x: window.innerWidth - 564,
|
|
2758
2828
|
y: window.innerHeight - 744,
|
|
2759
2829
|
width: 540,
|
|
2760
2830
|
height: 720
|
|
2761
2831
|
})), [s, c] = x(!1), [l, u] = x(!1), d = re(null);
|
|
2762
|
-
|
|
2832
|
+
Tt(d, t);
|
|
2763
2833
|
let f = re(null);
|
|
2764
2834
|
y(() => {
|
|
2765
|
-
let e = () => o((e) =>
|
|
2835
|
+
let e = () => o((e) => Dt(e));
|
|
2766
2836
|
return window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
|
|
2767
2837
|
}, []), y(() => {
|
|
2768
2838
|
t && d.current?.focus({ preventScroll: !0 });
|
|
@@ -2778,10 +2848,10 @@ var Ct = 12, wt = (e) => {
|
|
|
2778
2848
|
let t = f.current;
|
|
2779
2849
|
if (!t) return;
|
|
2780
2850
|
let n = e.clientX - t.x, r = e.clientY - t.y;
|
|
2781
|
-
o(
|
|
2851
|
+
o(Dt(t.resize ? {
|
|
2782
2852
|
...t.rect,
|
|
2783
|
-
width: Math.min(t.rect.width + n, window.innerWidth - t.rect.x -
|
|
2784
|
-
height: Math.min(t.rect.height + r, window.innerHeight - t.rect.y -
|
|
2853
|
+
width: Math.min(t.rect.width + n, window.innerWidth - t.rect.x - Et),
|
|
2854
|
+
height: Math.min(t.rect.height + r, window.innerHeight - t.rect.y - Et)
|
|
2785
2855
|
} : {
|
|
2786
2856
|
...t.rect,
|
|
2787
2857
|
x: t.rect.x + n,
|
|
@@ -2790,7 +2860,7 @@ var Ct = 12, wt = (e) => {
|
|
|
2790
2860
|
}, h = () => {
|
|
2791
2861
|
f.current = null, u(!1);
|
|
2792
2862
|
};
|
|
2793
|
-
return /* @__PURE__ */
|
|
2863
|
+
return /* @__PURE__ */ G("section", {
|
|
2794
2864
|
ref: d,
|
|
2795
2865
|
id: "research-assistant-window",
|
|
2796
2866
|
role: "dialog",
|
|
@@ -2800,10 +2870,10 @@ var Ct = 12, wt = (e) => {
|
|
|
2800
2870
|
hidden: !t,
|
|
2801
2871
|
"data-research-assistant": !0,
|
|
2802
2872
|
className: [
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
s &&
|
|
2806
|
-
l &&
|
|
2873
|
+
wt.root,
|
|
2874
|
+
wt.window,
|
|
2875
|
+
s && wt.expanded,
|
|
2876
|
+
l && wt.moving
|
|
2807
2877
|
].filter(Boolean).join(" "),
|
|
2808
2878
|
"data-assistant-part": "window",
|
|
2809
2879
|
"data-expanded": s,
|
|
@@ -2817,11 +2887,11 @@ var Ct = 12, wt = (e) => {
|
|
|
2817
2887
|
e.key === "Escape" && e.target === e.currentTarget && n();
|
|
2818
2888
|
},
|
|
2819
2889
|
children: [
|
|
2820
|
-
/* @__PURE__ */
|
|
2821
|
-
className:
|
|
2890
|
+
/* @__PURE__ */ G("header", {
|
|
2891
|
+
className: wt.header,
|
|
2822
2892
|
"data-assistant-part": "header",
|
|
2823
|
-
children: [/* @__PURE__ */
|
|
2824
|
-
className:
|
|
2893
|
+
children: [/* @__PURE__ */ G("div", {
|
|
2894
|
+
className: wt.drag,
|
|
2825
2895
|
"data-assistant-part": "drag",
|
|
2826
2896
|
tabIndex: 0,
|
|
2827
2897
|
role: "group",
|
|
@@ -2841,37 +2911,37 @@ var Ct = 12, wt = (e) => {
|
|
|
2841
2911
|
].includes(e.key)) return;
|
|
2842
2912
|
e.preventDefault();
|
|
2843
2913
|
let t = e.shiftKey ? 40 : 10;
|
|
2844
|
-
o((n) =>
|
|
2914
|
+
o((n) => Dt({
|
|
2845
2915
|
...n,
|
|
2846
2916
|
x: n.x + (e.key === "ArrowLeft" ? -t : e.key === "ArrowRight" ? t : 0),
|
|
2847
2917
|
y: n.y + (e.key === "ArrowUp" ? -t : e.key === "ArrowDown" ? t : 0)
|
|
2848
2918
|
}));
|
|
2849
2919
|
},
|
|
2850
|
-
children: [/* @__PURE__ */
|
|
2920
|
+
children: [/* @__PURE__ */ W(Ct, {}), /* @__PURE__ */ W("div", { children: /* @__PURE__ */ G("h2", {
|
|
2851
2921
|
id: "research-assistant-title",
|
|
2852
|
-
children: ["研发小蜜 ", /* @__PURE__ */
|
|
2922
|
+
children: ["研发小蜜 ", /* @__PURE__ */ W("span", { children: i ? "开发助手" : "问题反馈" })]
|
|
2853
2923
|
}) })]
|
|
2854
|
-
}), /* @__PURE__ */
|
|
2855
|
-
className:
|
|
2924
|
+
}), /* @__PURE__ */ G("div", {
|
|
2925
|
+
className: wt.windowActions,
|
|
2856
2926
|
"data-assistant-part": "window-actions",
|
|
2857
|
-
children: [/* @__PURE__ */
|
|
2927
|
+
children: [/* @__PURE__ */ W(C, {
|
|
2858
2928
|
type: "text",
|
|
2859
2929
|
"aria-label": s ? "还原小窗" : "放大分析",
|
|
2860
2930
|
title: s ? "还原小窗" : "放大分析",
|
|
2861
2931
|
onClick: () => c((e) => !e),
|
|
2862
|
-
children:
|
|
2863
|
-
}), /* @__PURE__ */
|
|
2932
|
+
children: W(s ? I : L, {})
|
|
2933
|
+
}), /* @__PURE__ */ W(C, {
|
|
2864
2934
|
type: "text",
|
|
2865
2935
|
"aria-label": "最小化研发小蜜",
|
|
2866
2936
|
title: "最小化",
|
|
2867
2937
|
onClick: n,
|
|
2868
|
-
children: /* @__PURE__ */
|
|
2938
|
+
children: /* @__PURE__ */ W(z, {})
|
|
2869
2939
|
})]
|
|
2870
2940
|
})]
|
|
2871
2941
|
}),
|
|
2872
2942
|
r,
|
|
2873
|
-
!s && /* @__PURE__ */
|
|
2874
|
-
className:
|
|
2943
|
+
!s && /* @__PURE__ */ W("div", {
|
|
2944
|
+
className: wt.resize,
|
|
2875
2945
|
"data-assistant-part": "resize",
|
|
2876
2946
|
role: "group",
|
|
2877
2947
|
tabIndex: 0,
|
|
@@ -2887,10 +2957,10 @@ var Ct = 12, wt = (e) => {
|
|
|
2887
2957
|
"ArrowRight",
|
|
2888
2958
|
"ArrowUp",
|
|
2889
2959
|
"ArrowDown"
|
|
2890
|
-
].includes(e.key) && (e.preventDefault(), o((t) =>
|
|
2960
|
+
].includes(e.key) && (e.preventDefault(), o((t) => Dt({
|
|
2891
2961
|
...t,
|
|
2892
|
-
width: Math.min(t.width + (e.key === "ArrowLeft" ? -20 : e.key === "ArrowRight" ? 20 : 0), window.innerWidth - t.x -
|
|
2893
|
-
height: Math.min(t.height + (e.key === "ArrowUp" ? -20 : e.key === "ArrowDown" ? 20 : 0), window.innerHeight - t.y -
|
|
2962
|
+
width: Math.min(t.width + (e.key === "ArrowLeft" ? -20 : e.key === "ArrowRight" ? 20 : 0), window.innerWidth - t.x - Et),
|
|
2963
|
+
height: Math.min(t.height + (e.key === "ArrowUp" ? -20 : e.key === "ArrowDown" ? 20 : 0), window.innerHeight - t.y - Et)
|
|
2894
2964
|
})));
|
|
2895
2965
|
}
|
|
2896
2966
|
})
|
|
@@ -2910,30 +2980,30 @@ var Ct = 12, wt = (e) => {
|
|
|
2910
2980
|
memoryChart: "_memoryChart_1y43c_62"
|
|
2911
2981
|
};
|
|
2912
2982
|
// src/pages/assistant/components/PerformancePanel/index.tsx
|
|
2913
|
-
function
|
|
2983
|
+
function kt({ metrics: e, data: t, now: n, paused: r, offline: i }) {
|
|
2914
2984
|
let a = f(e, t, n), s = t.heapSamples, c = s.at(-1), l = Math.min(...s.map((e) => e.used)), u = Math.max(...s.map((e) => e.used)), d = s[0]?.time ?? n, p = s.map((e) => `${4 + (e.time - d) / Math.max(1, (c?.time ?? n) - d) * 592},${76 - (e.used - l) / Math.max(1048576, u - l) * 60}`).join(" ");
|
|
2915
|
-
return /* @__PURE__ */
|
|
2985
|
+
return /* @__PURE__ */ G("div", {
|
|
2916
2986
|
className: $.section,
|
|
2917
2987
|
"data-assistant-part": "section",
|
|
2918
2988
|
children: [
|
|
2919
|
-
/* @__PURE__ */
|
|
2989
|
+
/* @__PURE__ */ G("div", {
|
|
2920
2990
|
className: $.sectionHeading,
|
|
2921
2991
|
"data-assistant-part": "section-heading",
|
|
2922
2992
|
children: [
|
|
2923
|
-
/* @__PURE__ */
|
|
2993
|
+
/* @__PURE__ */ W("span", {
|
|
2924
2994
|
className: $.headingIcon,
|
|
2925
2995
|
"data-assistant-part": "heading-icon",
|
|
2926
|
-
children: /* @__PURE__ */
|
|
2996
|
+
children: /* @__PURE__ */ W(N, {})
|
|
2927
2997
|
}),
|
|
2928
|
-
/* @__PURE__ */
|
|
2929
|
-
/* @__PURE__ */
|
|
2930
|
-
!a.length && /* @__PURE__ */
|
|
2998
|
+
/* @__PURE__ */ W("div", { children: /* @__PURE__ */ W("h3", { children: "性能诊断" }) }),
|
|
2999
|
+
/* @__PURE__ */ W(D, { children: i ? "快照分析" : r ? "采集已暂停" : "自动监测中" }),
|
|
3000
|
+
!a.length && /* @__PURE__ */ W(D, { children: "未触发告警" })
|
|
2931
3001
|
]
|
|
2932
3002
|
}),
|
|
2933
|
-
/* @__PURE__ */
|
|
3003
|
+
/* @__PURE__ */ W("div", {
|
|
2934
3004
|
className: $.issueList,
|
|
2935
3005
|
"data-assistant-part": "issue-list",
|
|
2936
|
-
children: a.map((e) => /* @__PURE__ */
|
|
3006
|
+
children: a.map((e) => /* @__PURE__ */ G(se, {
|
|
2937
3007
|
className: [$.card, $.performanceIssue].join(" "),
|
|
2938
3008
|
"data-assistant-part": "card performance-issue",
|
|
2939
3009
|
styles: { body: {
|
|
@@ -2943,16 +3013,16 @@ function Et({ metrics: e, data: t, now: n, paused: r, offline: i }) {
|
|
|
2943
3013
|
gap: 16
|
|
2944
3014
|
} },
|
|
2945
3015
|
children: [
|
|
2946
|
-
/* @__PURE__ */
|
|
3016
|
+
/* @__PURE__ */ W("div", {
|
|
2947
3017
|
className: $.cardHeading,
|
|
2948
3018
|
"data-assistant-part": "card-heading",
|
|
2949
|
-
children: /* @__PURE__ */
|
|
3019
|
+
children: /* @__PURE__ */ G("h3", { children: [/* @__PURE__ */ W(D, {
|
|
2950
3020
|
color: e.severity === "error" ? "red" : "orange",
|
|
2951
3021
|
children: e.severity === "error" ? "较高风险" : "需关注"
|
|
2952
3022
|
}), e.title] })
|
|
2953
3023
|
}),
|
|
2954
|
-
/* @__PURE__ */
|
|
2955
|
-
/* @__PURE__ */
|
|
3024
|
+
/* @__PURE__ */ W("p", { children: e.evidence }),
|
|
3025
|
+
/* @__PURE__ */ W(ce, {
|
|
2956
3026
|
ghost: !0,
|
|
2957
3027
|
size: "small",
|
|
2958
3028
|
styles: {
|
|
@@ -2965,19 +3035,19 @@ function Et({ metrics: e, data: t, now: n, paused: r, offline: i }) {
|
|
|
2965
3035
|
},
|
|
2966
3036
|
items: [{
|
|
2967
3037
|
key: "details",
|
|
2968
|
-
label: /* @__PURE__ */
|
|
2969
|
-
children: /* @__PURE__ */
|
|
2970
|
-
/* @__PURE__ */
|
|
2971
|
-
/* @__PURE__ */
|
|
3038
|
+
label: /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W(A, {}), " 排查建议与触发依据"] }),
|
|
3039
|
+
children: /* @__PURE__ */ G(U, { children: [
|
|
3040
|
+
/* @__PURE__ */ W("ol", { children: e.suggestions.map((e) => /* @__PURE__ */ W("li", { children: e }, e)) }),
|
|
3041
|
+
/* @__PURE__ */ W("p", {
|
|
2972
3042
|
className: $.hint,
|
|
2973
3043
|
"data-assistant-part": "hint",
|
|
2974
3044
|
children: e.rule
|
|
2975
3045
|
}),
|
|
2976
|
-
/* @__PURE__ */
|
|
3046
|
+
/* @__PURE__ */ G("a", {
|
|
2977
3047
|
href: e.url,
|
|
2978
3048
|
target: "_blank",
|
|
2979
3049
|
rel: "noreferrer",
|
|
2980
|
-
children: [/* @__PURE__ */
|
|
3050
|
+
children: [/* @__PURE__ */ W(Ae, {}), " 查看官方排查文档"]
|
|
2981
3051
|
})
|
|
2982
3052
|
] })
|
|
2983
3053
|
}]
|
|
@@ -2985,7 +3055,7 @@ function Et({ metrics: e, data: t, now: n, paused: r, offline: i }) {
|
|
|
2985
3055
|
]
|
|
2986
3056
|
}, e.id))
|
|
2987
3057
|
}),
|
|
2988
|
-
/* @__PURE__ */
|
|
3058
|
+
/* @__PURE__ */ G(se, {
|
|
2989
3059
|
className: $.card,
|
|
2990
3060
|
"data-assistant-part": "card",
|
|
2991
3061
|
styles: { body: {
|
|
@@ -2994,51 +3064,51 @@ function Et({ metrics: e, data: t, now: n, paused: r, offline: i }) {
|
|
|
2994
3064
|
flexDirection: "column",
|
|
2995
3065
|
gap: 16
|
|
2996
3066
|
} },
|
|
2997
|
-
children: [/* @__PURE__ */
|
|
3067
|
+
children: [/* @__PURE__ */ G("div", {
|
|
2998
3068
|
className: $.cardHeading,
|
|
2999
3069
|
"data-assistant-part": "card-heading",
|
|
3000
|
-
children: [/* @__PURE__ */
|
|
3001
|
-
}), s.length > 1 ? /* @__PURE__ */
|
|
3070
|
+
children: [/* @__PURE__ */ W("h3", { children: "JS 堆内存趋势" }), /* @__PURE__ */ W("span", { children: c ? o(c.used) : "暂无采样" })]
|
|
3071
|
+
}), s.length > 1 ? /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ G("svg", {
|
|
3002
3072
|
className: $.memoryChart,
|
|
3003
3073
|
"data-assistant-part": "memory-chart",
|
|
3004
3074
|
viewBox: "0 0 600 90",
|
|
3005
3075
|
role: "img",
|
|
3006
3076
|
"aria-label": `内存趋势,最低 ${o(l)},最高 ${o(u)},当前 ${o(c.used)}`,
|
|
3007
|
-
children: [/* @__PURE__ */
|
|
3077
|
+
children: [/* @__PURE__ */ W("path", {
|
|
3008
3078
|
d: "M4 76 H596",
|
|
3009
3079
|
stroke: "currentColor",
|
|
3010
3080
|
opacity: ".2"
|
|
3011
|
-
}), /* @__PURE__ */
|
|
3081
|
+
}), /* @__PURE__ */ W("polyline", {
|
|
3012
3082
|
points: p,
|
|
3013
3083
|
fill: "none",
|
|
3014
3084
|
stroke: "currentColor",
|
|
3015
3085
|
strokeWidth: "2",
|
|
3016
3086
|
vectorEffect: "non-scaling-stroke"
|
|
3017
3087
|
})]
|
|
3018
|
-
}), /* @__PURE__ */
|
|
3088
|
+
}), /* @__PURE__ */ G("div", {
|
|
3019
3089
|
className: $.cardHeading,
|
|
3020
3090
|
"data-assistant-part": "card-heading",
|
|
3021
|
-
children: [/* @__PURE__ */
|
|
3091
|
+
children: [/* @__PURE__ */ G("span", { children: [
|
|
3022
3092
|
new Date(d).toLocaleTimeString(),
|
|
3023
3093
|
" · ",
|
|
3024
3094
|
o(l)
|
|
3025
|
-
] }), /* @__PURE__ */
|
|
3095
|
+
] }), /* @__PURE__ */ G("span", { children: [
|
|
3026
3096
|
new Date(c.time).toLocaleTimeString(),
|
|
3027
3097
|
" · 峰值 ",
|
|
3028
3098
|
o(u)
|
|
3029
3099
|
] })]
|
|
3030
|
-
})] }) : /* @__PURE__ */
|
|
3100
|
+
})] }) : /* @__PURE__ */ W("p", {
|
|
3031
3101
|
className: $.hint,
|
|
3032
3102
|
"data-assistant-part": "hint",
|
|
3033
3103
|
children: c ? "正在积累连续采样,持续增长风险至少需要观察 60 秒。" : "暂无连续采样,可能因浏览器不支持、采集暂停或快照过旧。"
|
|
3034
3104
|
})]
|
|
3035
3105
|
}),
|
|
3036
|
-
/* @__PURE__ */
|
|
3106
|
+
/* @__PURE__ */ G("h3", {
|
|
3037
3107
|
className: $.subheading,
|
|
3038
3108
|
"data-assistant-part": "subheading",
|
|
3039
|
-
children: [/* @__PURE__ */
|
|
3109
|
+
children: [/* @__PURE__ */ W(N, {}), " 页面指标"]
|
|
3040
3110
|
}),
|
|
3041
|
-
/* @__PURE__ */
|
|
3111
|
+
/* @__PURE__ */ W("div", {
|
|
3042
3112
|
className: $.metrics,
|
|
3043
3113
|
"data-assistant-part": "metrics",
|
|
3044
3114
|
children: [
|
|
@@ -3050,112 +3120,112 @@ function Et({ metrics: e, data: t, now: n, paused: r, offline: i }) {
|
|
|
3050
3120
|
["load", "页面加载"],
|
|
3051
3121
|
["longTasks", "长任务次数"],
|
|
3052
3122
|
["longTaskDuration", "长任务总耗时"]
|
|
3053
|
-
].map(([t, n]) => /* @__PURE__ */
|
|
3123
|
+
].map(([t, n]) => /* @__PURE__ */ G("div", { children: [/* @__PURE__ */ G("span", { children: [
|
|
3054
3124
|
n,
|
|
3055
3125
|
" · ",
|
|
3056
3126
|
t
|
|
3057
|
-
] }), /* @__PURE__ */
|
|
3127
|
+
] }), /* @__PURE__ */ W("strong", { children: e[t] == null ? "不可用" : t === "CLS" ? e[t].toFixed(4) : `${Math.round(e[t])}${t === "longTasks" ? " 次" : " ms"}` })] }, t))
|
|
3058
3128
|
}),
|
|
3059
|
-
/* @__PURE__ */
|
|
3129
|
+
/* @__PURE__ */ G("details", {
|
|
3060
3130
|
className: $.hint,
|
|
3061
3131
|
children: [
|
|
3062
|
-
/* @__PURE__ */
|
|
3063
|
-
/* @__PURE__ */
|
|
3064
|
-
/* @__PURE__ */
|
|
3132
|
+
/* @__PURE__ */ W("summary", { children: "采集范围" }),
|
|
3133
|
+
/* @__PURE__ */ G("p", { children: [i ? "仅分析快照数据,旧快照可能没有连续采样。" : "前台每 5 秒采样,最多保留 15 分钟。", "堆内存为估算值,请用 DevTools 堆快照确认泄漏。"] }),
|
|
3134
|
+
/* @__PURE__ */ W("p", { children: "LCP / CLS 按文档统计,业务路由切换不重置。尚未采集完整 INP。" })
|
|
3065
3135
|
]
|
|
3066
3136
|
})
|
|
3067
3137
|
]
|
|
3068
3138
|
});
|
|
3069
3139
|
}
|
|
3070
3140
|
// src/pages/assistant/index.tsx
|
|
3071
|
-
function
|
|
3072
|
-
return /* @__PURE__ */
|
|
3073
|
-
className:
|
|
3141
|
+
function At({ value: e }) {
|
|
3142
|
+
return /* @__PURE__ */ W("pre", {
|
|
3143
|
+
className: K.json,
|
|
3074
3144
|
"data-assistant-part": "json",
|
|
3075
3145
|
children: JSON.stringify(e, null, 2)
|
|
3076
3146
|
});
|
|
3077
3147
|
}
|
|
3078
|
-
var
|
|
3079
|
-
function
|
|
3148
|
+
var jt = (e) => new Date(e).toLocaleTimeString("zh-CN", { hour12: !1 });
|
|
3149
|
+
function Mt({ developer: e = !0, bridgeUrl: r = "/__laya-pilot", diagnosticsOnly: i = !1 } = {}) {
|
|
3080
3150
|
let a = ie(m.subscribe, m.getState), o = ie(s.subscribe, s.getState), [u, p] = x(!1), [h, _] = x(i ? "diagnostics" : "feedback"), [ee, b] = x("timeline"), [te, ne] = x(), ae = re(null), se = () => {
|
|
3081
3151
|
p(!1), requestAnimationFrame(() => ae.current?.focus({ preventScroll: !0 }));
|
|
3082
|
-
}, [
|
|
3083
|
-
Ee(!1), p(!0),
|
|
3152
|
+
}, [w, le] = x(""), [ue, fe] = x(""), [E, O] = x(null), [A, j] = x("live"), [_e, M] = x(c), [F, we] = x(!1), [Te, Ee] = x(!1), I = v(() => {
|
|
3153
|
+
Ee(!1), p(!0), M(c());
|
|
3084
3154
|
}, []);
|
|
3085
|
-
|
|
3086
|
-
|
|
3155
|
+
Ze(ae, I, v((e) => {
|
|
3156
|
+
we(e), e && Ee(!1);
|
|
3087
3157
|
}, []));
|
|
3088
|
-
let
|
|
3089
|
-
m.clear(), i && s.clear(),
|
|
3158
|
+
let L = v(() => {
|
|
3159
|
+
m.clear(), i && s.clear(), j("live"), O(null), fe("内存记录已清空");
|
|
3090
3160
|
}, [i]);
|
|
3091
3161
|
y(() => {
|
|
3092
|
-
if (i) return window.addEventListener("gz-research-assistant:clear-data",
|
|
3093
|
-
}, [i,
|
|
3162
|
+
if (i) return window.addEventListener("gz-research-assistant:clear-data", L), () => window.removeEventListener("gz-research-assistant:clear-data", L);
|
|
3163
|
+
}, [i, L]), y(() => {
|
|
3094
3164
|
if (!u) return;
|
|
3095
|
-
let e = setInterval(() =>
|
|
3165
|
+
let e = setInterval(() => M(c()), 2e3);
|
|
3096
3166
|
return () => clearInterval(e);
|
|
3097
3167
|
}, [u]);
|
|
3098
|
-
let
|
|
3099
|
-
className:
|
|
3168
|
+
let R = A === "imported" ? E : A === "frozen" ? a.frozen : null, Ae = R?.events ?? a.events, z = R?.requests ?? a.requests, B = R?.metrics ?? a.metrics, V = R?.environment ?? _e, H = R ?? a.frozen, Fe = /* @__PURE__ */ G("div", {
|
|
3169
|
+
className: K.section,
|
|
3100
3170
|
"data-assistant-part": "section",
|
|
3101
3171
|
children: [
|
|
3102
|
-
/* @__PURE__ */
|
|
3103
|
-
className:
|
|
3172
|
+
/* @__PURE__ */ G("div", {
|
|
3173
|
+
className: K.stats,
|
|
3104
3174
|
"data-assistant-part": "stats",
|
|
3105
3175
|
children: [
|
|
3106
|
-
/* @__PURE__ */
|
|
3107
|
-
className:
|
|
3176
|
+
/* @__PURE__ */ G("div", { children: [/* @__PURE__ */ G("strong", { children: [Ae.length, /* @__PURE__ */ W("small", { children: "条" })] }), /* @__PURE__ */ G("span", {
|
|
3177
|
+
className: K.statLabel,
|
|
3108
3178
|
"data-assistant-part": "stat-label",
|
|
3109
|
-
children: [/* @__PURE__ */
|
|
3179
|
+
children: [/* @__PURE__ */ W(Oe, {}), "操作与事件"]
|
|
3110
3180
|
})] }),
|
|
3111
|
-
/* @__PURE__ */
|
|
3112
|
-
className:
|
|
3181
|
+
/* @__PURE__ */ G("div", { children: [/* @__PURE__ */ G("strong", { children: [z.length, /* @__PURE__ */ W("small", { children: "条" })] }), /* @__PURE__ */ G("span", {
|
|
3182
|
+
className: K.statLabel,
|
|
3113
3183
|
"data-assistant-part": "stat-label",
|
|
3114
|
-
children: [/* @__PURE__ */
|
|
3184
|
+
children: [/* @__PURE__ */ W(k, {}), "接口记录"]
|
|
3115
3185
|
})] }),
|
|
3116
|
-
/* @__PURE__ */
|
|
3117
|
-
className:
|
|
3118
|
-
children: [/* @__PURE__ */
|
|
3119
|
-
className:
|
|
3186
|
+
/* @__PURE__ */ G("div", {
|
|
3187
|
+
className: z.some((e) => e.failed) ? K.hasErrors : "",
|
|
3188
|
+
children: [/* @__PURE__ */ G("strong", { children: [z.filter((e) => e.failed).length, /* @__PURE__ */ W("small", { children: "条" })] }), /* @__PURE__ */ G("span", {
|
|
3189
|
+
className: K.statLabel,
|
|
3120
3190
|
"data-assistant-part": "stat-label",
|
|
3121
|
-
children: [/* @__PURE__ */
|
|
3191
|
+
children: [/* @__PURE__ */ W(ze, {}), "失败接口"]
|
|
3122
3192
|
})]
|
|
3123
3193
|
})
|
|
3124
3194
|
]
|
|
3125
3195
|
}),
|
|
3126
|
-
/* @__PURE__ */
|
|
3127
|
-
className: [
|
|
3196
|
+
/* @__PURE__ */ G("div", {
|
|
3197
|
+
className: [K.buttonRow, K.actions].join(" "),
|
|
3128
3198
|
"data-assistant-part": "button-row actions",
|
|
3129
|
-
children: [/* @__PURE__ */
|
|
3199
|
+
children: [/* @__PURE__ */ W(C, {
|
|
3130
3200
|
type: "primary",
|
|
3131
|
-
icon: /* @__PURE__ */
|
|
3201
|
+
icon: /* @__PURE__ */ W(ge, {}),
|
|
3132
3202
|
onClick: () => {
|
|
3133
|
-
g("用户手动截取现场"),
|
|
3203
|
+
g("用户手动截取现场"), j("frozen"), fe("已冻结现场。后续操作不会改变这份快照。");
|
|
3134
3204
|
},
|
|
3135
3205
|
children: "截取当前现场"
|
|
3136
|
-
}), /* @__PURE__ */
|
|
3137
|
-
icon: /* @__PURE__ */
|
|
3206
|
+
}), /* @__PURE__ */ W(C, {
|
|
3207
|
+
icon: /* @__PURE__ */ W(xe, {}),
|
|
3138
3208
|
onClick: () => {
|
|
3139
|
-
let e =
|
|
3140
|
-
t(e,
|
|
3209
|
+
let e = H ?? n();
|
|
3210
|
+
t(e, w), fe(`已导出 ${jt(e.capturedAt)} 的快照,请将 JSON 文件发送给研发人员。`);
|
|
3141
3211
|
},
|
|
3142
3212
|
children: "导出快照 JSON"
|
|
3143
3213
|
})]
|
|
3144
3214
|
}),
|
|
3145
|
-
/* @__PURE__ */
|
|
3146
|
-
className:
|
|
3215
|
+
/* @__PURE__ */ G("p", {
|
|
3216
|
+
className: K.hint,
|
|
3147
3217
|
"data-assistant-part": "hint",
|
|
3148
|
-
children: [
|
|
3218
|
+
children: [H ? `导出:${H.reason} · ${jt(H.capturedAt)}` : "导出:当前现场", " · 现场仅存于内存,刷新或关闭前请导出"]
|
|
3149
3219
|
}),
|
|
3150
|
-
/* @__PURE__ */
|
|
3151
|
-
className:
|
|
3220
|
+
/* @__PURE__ */ G("div", {
|
|
3221
|
+
className: K.field,
|
|
3152
3222
|
"data-assistant-part": "field",
|
|
3153
|
-
children: [/* @__PURE__ */
|
|
3223
|
+
children: [/* @__PURE__ */ G("label", {
|
|
3154
3224
|
htmlFor: "research-feedback",
|
|
3155
|
-
children: [/* @__PURE__ */
|
|
3156
|
-
}), /* @__PURE__ */
|
|
3225
|
+
children: [/* @__PURE__ */ W(P, {}), "问题描述"]
|
|
3226
|
+
}), /* @__PURE__ */ W(T.TextArea, {
|
|
3157
3227
|
id: "research-feedback",
|
|
3158
|
-
value:
|
|
3228
|
+
value: w,
|
|
3159
3229
|
onChange: (e) => le(e.target.value),
|
|
3160
3230
|
maxLength: 1e3,
|
|
3161
3231
|
showCount: !0,
|
|
@@ -3163,7 +3233,7 @@ function kt({ developer: e = !0, bridgeUrl: r = "/__laya-pilot", diagnosticsOnly
|
|
|
3163
3233
|
placeholder: "例如:保存表单时报错"
|
|
3164
3234
|
})]
|
|
3165
3235
|
}),
|
|
3166
|
-
/* @__PURE__ */
|
|
3236
|
+
/* @__PURE__ */ W(ce, {
|
|
3167
3237
|
ghost: !0,
|
|
3168
3238
|
size: "small",
|
|
3169
3239
|
styles: {
|
|
@@ -3176,40 +3246,40 @@ function kt({ developer: e = !0, bridgeUrl: r = "/__laya-pilot", diagnosticsOnly
|
|
|
3176
3246
|
},
|
|
3177
3247
|
items: [{
|
|
3178
3248
|
key: "details",
|
|
3179
|
-
label: /* @__PURE__ */
|
|
3180
|
-
children: /* @__PURE__ */
|
|
3249
|
+
label: /* @__PURE__ */ W(U, { children: "快照包含哪些内容" }),
|
|
3250
|
+
children: /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W("p", { children: "最近 15 分钟内最多 300 条事件、60 条接口记录,页面地址与布局信息、浏览器环境、性能指标及已脱敏的 JSON 正文。页面状态快照不包含屏幕截图或输入框值。" }), /* @__PURE__ */ W("p", { children: "数据只在当前页面内存中保存,不自动上传。字段脱敏无法识别所有业务敏感内容,分享前可先查看导出的 JSON。" })] })
|
|
3181
3251
|
}]
|
|
3182
3252
|
})
|
|
3183
3253
|
]
|
|
3184
|
-
}),
|
|
3185
|
-
events:
|
|
3254
|
+
}), Ie = /* @__PURE__ */ W(xt, {
|
|
3255
|
+
events: Ae,
|
|
3186
3256
|
onDraft: i ? void 0 : (e) => {
|
|
3187
3257
|
ne(e), _("automation");
|
|
3188
3258
|
}
|
|
3189
|
-
}, 0 +
|
|
3190
|
-
className:
|
|
3259
|
+
}, 0 + A + (R?.capturedAt ?? "live")), Re = /* @__PURE__ */ G("div", {
|
|
3260
|
+
className: K.section,
|
|
3191
3261
|
"data-assistant-part": "section",
|
|
3192
3262
|
children: [
|
|
3193
|
-
/* @__PURE__ */
|
|
3194
|
-
className:
|
|
3263
|
+
/* @__PURE__ */ G("div", {
|
|
3264
|
+
className: K.sectionHeading,
|
|
3195
3265
|
"data-assistant-part": "section-heading",
|
|
3196
3266
|
children: [
|
|
3197
|
-
/* @__PURE__ */
|
|
3198
|
-
className:
|
|
3267
|
+
/* @__PURE__ */ W("span", {
|
|
3268
|
+
className: K.headingIcon,
|
|
3199
3269
|
"data-assistant-part": "heading-icon",
|
|
3200
|
-
children: /* @__PURE__ */
|
|
3270
|
+
children: /* @__PURE__ */ W(k, {})
|
|
3201
3271
|
}),
|
|
3202
|
-
/* @__PURE__ */
|
|
3203
|
-
/* @__PURE__ */
|
|
3272
|
+
/* @__PURE__ */ W("div", { children: /* @__PURE__ */ W("h3", { children: "接口记录" }) }),
|
|
3273
|
+
/* @__PURE__ */ G(D, { children: [z.length, " 条"] })
|
|
3204
3274
|
]
|
|
3205
3275
|
}),
|
|
3206
|
-
/* @__PURE__ */
|
|
3207
|
-
className:
|
|
3208
|
-
children: [/* @__PURE__ */
|
|
3276
|
+
/* @__PURE__ */ G("details", {
|
|
3277
|
+
className: K.hint,
|
|
3278
|
+
children: [/* @__PURE__ */ W("summary", { children: "采集范围" }), "Fetch / XHR 正文最多读取 16 KB,认证接口不采集正文。 耗时截至 Fetch 响应头到达或 XHR 请求结束。"]
|
|
3209
3279
|
}),
|
|
3210
|
-
!
|
|
3211
|
-
|
|
3212
|
-
className:
|
|
3280
|
+
!z.length && /* @__PURE__ */ W(de, { description: "暂无接口记录" }),
|
|
3281
|
+
z.slice().sort((e, t) => e.time - t.time).map((e) => /* @__PURE__ */ W(ce, {
|
|
3282
|
+
className: K.request,
|
|
3213
3283
|
"data-assistant-part": "request",
|
|
3214
3284
|
ghost: !0,
|
|
3215
3285
|
size: "small",
|
|
@@ -3223,208 +3293,211 @@ function kt({ developer: e = !0, bridgeUrl: r = "/__laya-pilot", diagnosticsOnly
|
|
|
3223
3293
|
},
|
|
3224
3294
|
items: [{
|
|
3225
3295
|
key: "details",
|
|
3226
|
-
label: /* @__PURE__ */
|
|
3227
|
-
className:
|
|
3296
|
+
label: /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ G("span", {
|
|
3297
|
+
className: K.requestMeta,
|
|
3228
3298
|
"data-assistant-part": "request-meta",
|
|
3229
3299
|
children: [
|
|
3230
|
-
/* @__PURE__ */
|
|
3300
|
+
/* @__PURE__ */ W(D, {
|
|
3231
3301
|
color: e.failed ? "red" : "green",
|
|
3232
3302
|
children: e.status || "失败"
|
|
3233
3303
|
}),
|
|
3234
|
-
/* @__PURE__ */
|
|
3304
|
+
/* @__PURE__ */ W("b", { children: e.method }),
|
|
3235
3305
|
" ",
|
|
3236
|
-
/* @__PURE__ */
|
|
3237
|
-
/* @__PURE__ */
|
|
3306
|
+
/* @__PURE__ */ G("span", { children: [
|
|
3307
|
+
/* @__PURE__ */ W(Ce, {}),
|
|
3238
3308
|
Math.round(e.duration),
|
|
3239
3309
|
" ms"
|
|
3240
3310
|
] })
|
|
3241
3311
|
]
|
|
3242
|
-
}), /* @__PURE__ */
|
|
3243
|
-
className:
|
|
3312
|
+
}), /* @__PURE__ */ W("span", {
|
|
3313
|
+
className: K.requestUrl,
|
|
3244
3314
|
"data-assistant-part": "request-url",
|
|
3245
3315
|
children: e.url
|
|
3246
3316
|
})] }),
|
|
3247
|
-
children: /* @__PURE__ */
|
|
3317
|
+
children: /* @__PURE__ */ W(U, { children: /* @__PURE__ */ W(At, { value: e }) })
|
|
3248
3318
|
}]
|
|
3249
3319
|
}, e.id))
|
|
3250
3320
|
]
|
|
3251
|
-
}),
|
|
3252
|
-
metrics:
|
|
3253
|
-
data:
|
|
3254
|
-
now:
|
|
3321
|
+
}), Be = R ? R.performance ?? l() : a.performance, Ve = R ? Date.parse(R.capturedAt) : a.performanceUpdatedAt, He = f(B, Be, Ve), Ue = f(a.metrics, a.performance, a.performanceUpdatedAt).length, We = /* @__PURE__ */ W(kt, {
|
|
3322
|
+
metrics: B,
|
|
3323
|
+
data: Be,
|
|
3324
|
+
now: Ve,
|
|
3255
3325
|
paused: a.paused,
|
|
3256
|
-
offline: !!
|
|
3257
|
-
}),
|
|
3258
|
-
className:
|
|
3326
|
+
offline: !!R
|
|
3327
|
+
}), Ge = /* @__PURE__ */ G("div", {
|
|
3328
|
+
className: K.section,
|
|
3259
3329
|
"data-assistant-part": "section",
|
|
3260
3330
|
children: [
|
|
3261
|
-
/* @__PURE__ */
|
|
3262
|
-
className:
|
|
3331
|
+
/* @__PURE__ */ G("div", {
|
|
3332
|
+
className: K.sectionHeading,
|
|
3263
3333
|
"data-assistant-part": "section-heading",
|
|
3264
|
-
children: [/* @__PURE__ */
|
|
3265
|
-
className:
|
|
3334
|
+
children: [/* @__PURE__ */ W("span", {
|
|
3335
|
+
className: K.headingIcon,
|
|
3266
3336
|
"data-assistant-part": "heading-icon",
|
|
3267
|
-
children: /* @__PURE__ */
|
|
3268
|
-
}), /* @__PURE__ */
|
|
3337
|
+
children: /* @__PURE__ */ W(be, {})
|
|
3338
|
+
}), /* @__PURE__ */ W("div", { children: /* @__PURE__ */ W("h3", { children: "环境与数据" }) })]
|
|
3269
3339
|
}),
|
|
3270
|
-
/* @__PURE__ */
|
|
3271
|
-
/* @__PURE__ */
|
|
3272
|
-
/* @__PURE__ */
|
|
3273
|
-
/* @__PURE__ */
|
|
3274
|
-
/* @__PURE__ */
|
|
3275
|
-
/* @__PURE__ */
|
|
3276
|
-
/* @__PURE__ */
|
|
3277
|
-
/* @__PURE__ */
|
|
3278
|
-
/* @__PURE__ */
|
|
3340
|
+
/* @__PURE__ */ G("dl", { children: [
|
|
3341
|
+
/* @__PURE__ */ W("dt", { children: "网络状态" }),
|
|
3342
|
+
/* @__PURE__ */ W("dd", { children: V.online == null ? "未知" : V.online ? "在线" : "离线" }),
|
|
3343
|
+
/* @__PURE__ */ W("dt", { children: "浏览器语言" }),
|
|
3344
|
+
/* @__PURE__ */ W("dd", { children: V.language || "未知" }),
|
|
3345
|
+
/* @__PURE__ */ W("dt", { children: "时区" }),
|
|
3346
|
+
/* @__PURE__ */ W("dd", { children: V.timezone || "未知" }),
|
|
3347
|
+
/* @__PURE__ */ W("dt", { children: "设备内存" }),
|
|
3348
|
+
/* @__PURE__ */ W("dd", { children: typeof V.deviceMemoryGB == "number" ? `${V.deviceMemoryGB} GB` : "不可用" })
|
|
3279
3349
|
] }),
|
|
3280
|
-
/* @__PURE__ */
|
|
3281
|
-
/* @__PURE__ */
|
|
3282
|
-
/* @__PURE__ */
|
|
3283
|
-
className:
|
|
3350
|
+
/* @__PURE__ */ G("details", { children: [
|
|
3351
|
+
/* @__PURE__ */ W("summary", { children: "完整环境与采集范围" }),
|
|
3352
|
+
/* @__PURE__ */ W("p", {
|
|
3353
|
+
className: K.hint,
|
|
3284
3354
|
children: "不采集 Cookie、localStorage、sessionStorage 的值。"
|
|
3285
3355
|
}),
|
|
3286
|
-
/* @__PURE__ */
|
|
3356
|
+
/* @__PURE__ */ W(At, { value: V })
|
|
3287
3357
|
] }),
|
|
3288
|
-
|
|
3358
|
+
R && /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W("h3", { children: "现场页面状态" }), /* @__PURE__ */ W(At, { value: R.page })] })
|
|
3289
3359
|
]
|
|
3290
|
-
}),
|
|
3291
|
-
className:
|
|
3360
|
+
}), Ke = /* @__PURE__ */ W("div", {
|
|
3361
|
+
className: K.section,
|
|
3292
3362
|
"data-assistant-part": "section",
|
|
3293
|
-
children: /* @__PURE__ */
|
|
3363
|
+
children: /* @__PURE__ */ W(de, { description: "知识问答尚未接入" })
|
|
3294
3364
|
});
|
|
3295
|
-
return /* @__PURE__ */
|
|
3365
|
+
return /* @__PURE__ */ G("div", {
|
|
3296
3366
|
"data-research-assistant": !0,
|
|
3297
|
-
children: [/* @__PURE__ */
|
|
3298
|
-
className:
|
|
3367
|
+
children: [/* @__PURE__ */ G("div", {
|
|
3368
|
+
className: K.dock,
|
|
3299
3369
|
"data-assistant-part": "dock",
|
|
3300
3370
|
"data-recording": o.recording,
|
|
3301
3371
|
hidden: u,
|
|
3302
|
-
children: [/* @__PURE__ */
|
|
3303
|
-
open: Te && !
|
|
3304
|
-
trigger:
|
|
3305
|
-
onOpenChange: (e) => Ee(e && !
|
|
3306
|
-
title: o.recording ? `研发小蜜 · 录制中 ${o.draft.steps.length} 步` :
|
|
3307
|
-
children: /* @__PURE__ */
|
|
3308
|
-
dot: o.recording || !!a.frozen ||
|
|
3372
|
+
children: [/* @__PURE__ */ W(me, {
|
|
3373
|
+
open: Te && !F && !u,
|
|
3374
|
+
trigger: F ? [] : "hover",
|
|
3375
|
+
onOpenChange: (e) => Ee(e && !F && !u),
|
|
3376
|
+
title: o.recording ? `研发小蜜 · 录制中 ${o.draft.steps.length} 步` : Ue ? `研发小蜜 · ${Ue} 项性能告警` : a.frozen ? "研发小蜜 · 已保留异常现场" : "研发小蜜",
|
|
3377
|
+
children: /* @__PURE__ */ W(oe, {
|
|
3378
|
+
dot: o.recording || !!a.frozen || Ue > 0,
|
|
3309
3379
|
color: o.recording ? "red" : "orange",
|
|
3310
3380
|
offset: [-5, 5],
|
|
3311
|
-
children: /* @__PURE__ */
|
|
3381
|
+
children: /* @__PURE__ */ W(C, {
|
|
3312
3382
|
ref: ae,
|
|
3313
|
-
className:
|
|
3383
|
+
className: K.launcher,
|
|
3314
3384
|
"data-assistant-part": "launcher",
|
|
3315
3385
|
"data-draggable": !0,
|
|
3316
3386
|
"aria-label": "打开研发小蜜",
|
|
3317
3387
|
"aria-expanded": u,
|
|
3318
3388
|
"aria-controls": "research-assistant-window",
|
|
3319
|
-
onClick:
|
|
3320
|
-
icon: /* @__PURE__ */
|
|
3389
|
+
onClick: I,
|
|
3390
|
+
icon: /* @__PURE__ */ W(Ct, { className: K.launcherAvatar })
|
|
3321
3391
|
})
|
|
3322
3392
|
})
|
|
3323
|
-
}), /* @__PURE__ */
|
|
3324
|
-
className:
|
|
3393
|
+
}), /* @__PURE__ */ W("span", {
|
|
3394
|
+
className: K.srOnly,
|
|
3325
3395
|
"data-assistant-part": "sr-only",
|
|
3326
3396
|
role: "status",
|
|
3327
|
-
children: o.recording ? `录制中 ${o.draft.steps.length} 步` :
|
|
3397
|
+
children: o.recording ? `录制中 ${o.draft.steps.length} 步` : Ue ? `${Ue} 项性能告警` : a.frozen ? "已保留异常现场" : ""
|
|
3328
3398
|
})]
|
|
3329
|
-
}), /* @__PURE__ */
|
|
3399
|
+
}), /* @__PURE__ */ W(Ot, {
|
|
3330
3400
|
open: u,
|
|
3331
3401
|
onMinimize: se,
|
|
3332
3402
|
developer: e,
|
|
3333
|
-
children: /* @__PURE__ */
|
|
3403
|
+
children: /* @__PURE__ */ G("div", {
|
|
3334
3404
|
"data-research-assistant": !0,
|
|
3335
|
-
className:
|
|
3405
|
+
className: K.body,
|
|
3336
3406
|
"data-assistant-part": "body",
|
|
3337
3407
|
children: [
|
|
3338
|
-
/* @__PURE__ */
|
|
3339
|
-
className:
|
|
3408
|
+
/* @__PURE__ */ G("div", {
|
|
3409
|
+
className: K.toolbar,
|
|
3340
3410
|
"data-assistant-part": "toolbar",
|
|
3341
|
-
children: [/* @__PURE__ */
|
|
3342
|
-
className: [
|
|
3411
|
+
children: [/* @__PURE__ */ G("span", { children: [/* @__PURE__ */ W("i", { className: a.paused ? K.paused : "" }), R ? "查看离线现场" : a.paused ? "采集已暂停" : "正在采集"] }), /* @__PURE__ */ G("div", {
|
|
3412
|
+
className: [K.buttonRow, K.toolbarActions].join(" "),
|
|
3343
3413
|
"data-assistant-part": "button-row toolbar-actions",
|
|
3344
|
-
children: [/* @__PURE__ */
|
|
3414
|
+
children: [/* @__PURE__ */ W(C, {
|
|
3345
3415
|
type: "text",
|
|
3346
3416
|
size: "small",
|
|
3347
|
-
icon: a.paused ? /* @__PURE__ */
|
|
3417
|
+
icon: a.paused ? /* @__PURE__ */ W(Ne, {}) : /* @__PURE__ */ W(Me, {}),
|
|
3348
3418
|
onClick: () => m.pause(!a.paused),
|
|
3349
3419
|
children: a.paused ? "继续采集" : "暂停采集"
|
|
3350
|
-
}), /* @__PURE__ */
|
|
3351
|
-
size: "small",
|
|
3420
|
+
}), /* @__PURE__ */ W(C, {
|
|
3352
3421
|
type: "text",
|
|
3353
|
-
|
|
3354
|
-
|
|
3422
|
+
danger: !0,
|
|
3423
|
+
size: "small",
|
|
3424
|
+
icon: /* @__PURE__ */ W(ye, {}),
|
|
3425
|
+
onClick: L,
|
|
3355
3426
|
children: "清空记录"
|
|
3356
3427
|
})]
|
|
3357
3428
|
})]
|
|
3358
3429
|
}),
|
|
3359
|
-
|
|
3430
|
+
ue && /* @__PURE__ */ W(S, {
|
|
3360
3431
|
closable: !0,
|
|
3361
|
-
title:
|
|
3432
|
+
title: ue,
|
|
3362
3433
|
type: "info",
|
|
3363
|
-
onClose: () =>
|
|
3434
|
+
onClose: () => fe("")
|
|
3364
3435
|
}),
|
|
3365
|
-
|
|
3436
|
+
R?.feedback && /* @__PURE__ */ W(S, {
|
|
3366
3437
|
title: "快照中的问题描述",
|
|
3367
|
-
description:
|
|
3438
|
+
description: R.feedback,
|
|
3368
3439
|
type: "info"
|
|
3369
3440
|
}),
|
|
3370
|
-
e && /* @__PURE__ */
|
|
3371
|
-
className:
|
|
3441
|
+
e && /* @__PURE__ */ G("div", {
|
|
3442
|
+
className: K.sources,
|
|
3372
3443
|
"data-assistant-part": "sources",
|
|
3373
3444
|
children: [
|
|
3374
|
-
/* @__PURE__ */
|
|
3445
|
+
/* @__PURE__ */ W(C, {
|
|
3375
3446
|
size: "small",
|
|
3376
|
-
icon: /* @__PURE__ */
|
|
3377
|
-
"aria-pressed":
|
|
3378
|
-
type:
|
|
3379
|
-
onClick: () =>
|
|
3447
|
+
icon: /* @__PURE__ */ W(Oe, {}),
|
|
3448
|
+
"aria-pressed": A === "live",
|
|
3449
|
+
type: A === "live" ? "primary" : "text",
|
|
3450
|
+
onClick: () => j("live"),
|
|
3380
3451
|
children: "实时记录"
|
|
3381
3452
|
}),
|
|
3382
|
-
(!i || a.frozen) && /* @__PURE__ */
|
|
3453
|
+
(!i || a.frozen) && /* @__PURE__ */ W(C, {
|
|
3383
3454
|
size: "small",
|
|
3384
|
-
icon: /* @__PURE__ */
|
|
3455
|
+
icon: /* @__PURE__ */ W(ge, {}),
|
|
3385
3456
|
disabled: !a.frozen,
|
|
3386
|
-
"aria-pressed":
|
|
3387
|
-
type:
|
|
3388
|
-
onClick: () =>
|
|
3457
|
+
"aria-pressed": A === "frozen",
|
|
3458
|
+
type: A === "frozen" ? "primary" : "text",
|
|
3459
|
+
onClick: () => j("frozen"),
|
|
3389
3460
|
children: "已冻结现场"
|
|
3390
3461
|
}),
|
|
3391
|
-
/* @__PURE__ */
|
|
3462
|
+
/* @__PURE__ */ W(he, {
|
|
3392
3463
|
accept: ".json,application/json",
|
|
3393
3464
|
showUploadList: !1,
|
|
3394
3465
|
beforeUpload: async (e) => {
|
|
3395
3466
|
try {
|
|
3396
3467
|
if (e.size > 2097152) throw Error("快照不能超过 2 MB");
|
|
3397
|
-
|
|
3468
|
+
O(d(await e.text())), j("imported"), _("diagnostics"), b("timeline"), fe("已载入本地快照,未上传文件");
|
|
3398
3469
|
} catch (e) {
|
|
3399
|
-
|
|
3470
|
+
fe(e instanceof Error ? e.message : "快照读取失败");
|
|
3400
3471
|
}
|
|
3401
|
-
return
|
|
3472
|
+
return he.LIST_IGNORE;
|
|
3402
3473
|
},
|
|
3403
|
-
children: /* @__PURE__ */
|
|
3474
|
+
children: /* @__PURE__ */ W(C, {
|
|
3475
|
+
type: "text",
|
|
3404
3476
|
size: "small",
|
|
3405
|
-
icon: /* @__PURE__ */
|
|
3477
|
+
icon: /* @__PURE__ */ W(Le, {}),
|
|
3406
3478
|
children: "导入快照"
|
|
3407
3479
|
})
|
|
3408
3480
|
}),
|
|
3409
|
-
|
|
3481
|
+
E && /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W(C, {
|
|
3410
3482
|
size: "small",
|
|
3411
|
-
icon: /* @__PURE__ */
|
|
3412
|
-
"aria-pressed":
|
|
3413
|
-
type:
|
|
3414
|
-
onClick: () =>
|
|
3483
|
+
icon: /* @__PURE__ */ W(De, {}),
|
|
3484
|
+
"aria-pressed": A === "imported",
|
|
3485
|
+
type: A === "imported" ? "primary" : "text",
|
|
3486
|
+
onClick: () => j("imported"),
|
|
3415
3487
|
children: "导入的现场"
|
|
3416
|
-
}), /* @__PURE__ */
|
|
3488
|
+
}), /* @__PURE__ */ W(C, {
|
|
3489
|
+
type: "text",
|
|
3417
3490
|
"aria-label": "关闭导入现场",
|
|
3418
3491
|
size: "small",
|
|
3419
|
-
icon: /* @__PURE__ */
|
|
3492
|
+
icon: /* @__PURE__ */ W(ve, {}),
|
|
3420
3493
|
onClick: () => {
|
|
3421
|
-
|
|
3494
|
+
O(null), j("live");
|
|
3422
3495
|
}
|
|
3423
3496
|
})] })
|
|
3424
3497
|
]
|
|
3425
3498
|
}),
|
|
3426
|
-
/* @__PURE__ */
|
|
3427
|
-
className:
|
|
3499
|
+
/* @__PURE__ */ W(pe, {
|
|
3500
|
+
className: K.mainTabs,
|
|
3428
3501
|
"data-assistant-part": "main-tabs",
|
|
3429
3502
|
"data-diagnostics-only": i || void 0,
|
|
3430
3503
|
activeKey: h,
|
|
@@ -3433,14 +3506,14 @@ function kt({ developer: e = !0, bridgeUrl: r = "/__laya-pilot", diagnosticsOnly
|
|
|
3433
3506
|
{
|
|
3434
3507
|
key: "feedback",
|
|
3435
3508
|
label: "问题反馈",
|
|
3436
|
-
icon: /* @__PURE__ */
|
|
3437
|
-
children:
|
|
3509
|
+
icon: /* @__PURE__ */ W(je, { "aria-hidden": !0 }),
|
|
3510
|
+
children: Fe
|
|
3438
3511
|
},
|
|
3439
3512
|
...e ? [{
|
|
3440
3513
|
key: "automation",
|
|
3441
3514
|
label: "自动化测试",
|
|
3442
|
-
icon: /* @__PURE__ */
|
|
3443
|
-
children: /* @__PURE__ */
|
|
3515
|
+
icon: /* @__PURE__ */ W(Se, { "aria-hidden": !0 }),
|
|
3516
|
+
children: /* @__PURE__ */ W(gt, {
|
|
3444
3517
|
close: se,
|
|
3445
3518
|
bridgeUrl: r,
|
|
3446
3519
|
incomingDraft: te,
|
|
@@ -3448,10 +3521,10 @@ function kt({ developer: e = !0, bridgeUrl: r = "/__laya-pilot", diagnosticsOnly
|
|
|
3448
3521
|
})
|
|
3449
3522
|
}, {
|
|
3450
3523
|
key: "diagnostics",
|
|
3451
|
-
label: !
|
|
3452
|
-
icon: /* @__PURE__ */
|
|
3453
|
-
children: /* @__PURE__ */
|
|
3454
|
-
className:
|
|
3524
|
+
label: !R && Ue > 0 ? `诊断(${Ue})` : "诊断",
|
|
3525
|
+
icon: /* @__PURE__ */ W(ke, { "aria-hidden": !0 }),
|
|
3526
|
+
children: /* @__PURE__ */ W(pe, {
|
|
3527
|
+
className: K.diagnosticTabs,
|
|
3455
3528
|
"data-assistant-part": "diagnostic-tabs",
|
|
3456
3529
|
activeKey: ee,
|
|
3457
3530
|
onChange: b,
|
|
@@ -3459,26 +3532,26 @@ function kt({ developer: e = !0, bridgeUrl: r = "/__laya-pilot", diagnosticsOnly
|
|
|
3459
3532
|
{
|
|
3460
3533
|
key: "timeline",
|
|
3461
3534
|
label: "时间线",
|
|
3462
|
-
icon: /* @__PURE__ */
|
|
3463
|
-
children:
|
|
3535
|
+
icon: /* @__PURE__ */ W(Oe, { "aria-hidden": !0 }),
|
|
3536
|
+
children: Ie
|
|
3464
3537
|
},
|
|
3465
3538
|
{
|
|
3466
3539
|
key: "network",
|
|
3467
3540
|
label: "接口",
|
|
3468
|
-
icon: /* @__PURE__ */
|
|
3541
|
+
icon: /* @__PURE__ */ W(k, { "aria-hidden": !0 }),
|
|
3469
3542
|
children: Re
|
|
3470
3543
|
},
|
|
3471
3544
|
{
|
|
3472
3545
|
key: "performance",
|
|
3473
|
-
label:
|
|
3474
|
-
icon: /* @__PURE__ */
|
|
3475
|
-
children:
|
|
3546
|
+
label: He.length ? `性能 (${He.length})` : "性能",
|
|
3547
|
+
icon: /* @__PURE__ */ W(N, { "aria-hidden": !0 }),
|
|
3548
|
+
children: We
|
|
3476
3549
|
},
|
|
3477
3550
|
{
|
|
3478
3551
|
key: "data",
|
|
3479
3552
|
label: "环境与数据",
|
|
3480
|
-
icon: /* @__PURE__ */
|
|
3481
|
-
children:
|
|
3553
|
+
icon: /* @__PURE__ */ W(be, { "aria-hidden": !0 }),
|
|
3554
|
+
children: Ge
|
|
3482
3555
|
}
|
|
3483
3556
|
]
|
|
3484
3557
|
})
|
|
@@ -3486,8 +3559,8 @@ function kt({ developer: e = !0, bridgeUrl: r = "/__laya-pilot", diagnosticsOnly
|
|
|
3486
3559
|
{
|
|
3487
3560
|
key: "knowledge",
|
|
3488
3561
|
label: "知识问答",
|
|
3489
|
-
icon: /* @__PURE__ */
|
|
3490
|
-
children:
|
|
3562
|
+
icon: /* @__PURE__ */ W(Pe, { "aria-hidden": !0 }),
|
|
3563
|
+
children: Ke
|
|
3491
3564
|
}
|
|
3492
3565
|
].filter((e) => !i || e.key === "diagnostics")
|
|
3493
3566
|
})
|
|
@@ -3497,7 +3570,7 @@ function kt({ developer: e = !0, bridgeUrl: r = "/__laya-pilot", diagnosticsOnly
|
|
|
3497
3570
|
});
|
|
3498
3571
|
}
|
|
3499
3572
|
// src/components/AssistantErrorBoundary/index.tsx
|
|
3500
|
-
var
|
|
3573
|
+
var Nt = class extends _ {
|
|
3501
3574
|
state = { failed: !1 };
|
|
3502
3575
|
static getDerivedStateFromError() {
|
|
3503
3576
|
return { failed: !0 };
|
|
@@ -3510,7 +3583,7 @@ var At = class extends _ {
|
|
|
3510
3583
|
}
|
|
3511
3584
|
};
|
|
3512
3585
|
// src/App.tsx
|
|
3513
|
-
function
|
|
3586
|
+
function Pt({ developer: e, bridgeUrl: t = "/__laya-pilot", runtimeOptions: n, themeMode: r = "gold-dark", popupContainer: a, diagnosticsOnly: o }) {
|
|
3514
3587
|
let { isBusinessFailure: c, ignoreRequest: l } = n ?? {};
|
|
3515
3588
|
y(() => {
|
|
3516
3589
|
if (m.isActive()) throw Error("每页只能启动一个研发小蜜;npm 组件和浏览器扩展已管理采集,请勿额外调用 startAssistant");
|
|
@@ -3532,9 +3605,9 @@ function jt({ developer: e, bridgeUrl: t = "/__laya-pilot", runtimeOptions: n, t
|
|
|
3532
3605
|
themeMode: r,
|
|
3533
3606
|
includeCustom: !1
|
|
3534
3607
|
}), [r]);
|
|
3535
|
-
return /* @__PURE__ */
|
|
3608
|
+
return /* @__PURE__ */ W(ae, {
|
|
3536
3609
|
hashPriority: "high",
|
|
3537
|
-
children: /* @__PURE__ */
|
|
3610
|
+
children: /* @__PURE__ */ W(le, {
|
|
3538
3611
|
themeMode: r,
|
|
3539
3612
|
theme: {
|
|
3540
3613
|
inherit: !1,
|
|
@@ -3566,12 +3639,12 @@ function jt({ developer: e, bridgeUrl: t = "/__laya-pilot", runtimeOptions: n, t
|
|
|
3566
3639
|
tooltip: {},
|
|
3567
3640
|
empty: {},
|
|
3568
3641
|
flex: {},
|
|
3569
|
-
children: /* @__PURE__ */
|
|
3642
|
+
children: /* @__PURE__ */ W("div", {
|
|
3570
3643
|
"data-research-assistant": !0,
|
|
3571
3644
|
"data-assistant-part": "scope",
|
|
3572
|
-
className:
|
|
3645
|
+
className: Ye.scope,
|
|
3573
3646
|
style: u,
|
|
3574
|
-
children: /* @__PURE__ */
|
|
3647
|
+
children: /* @__PURE__ */ W(Mt, {
|
|
3575
3648
|
developer: e,
|
|
3576
3649
|
bridgeUrl: t,
|
|
3577
3650
|
diagnosticsOnly: o
|
|
@@ -3580,56 +3653,56 @@ function jt({ developer: e, bridgeUrl: t = "/__laya-pilot", runtimeOptions: n, t
|
|
|
3580
3653
|
})
|
|
3581
3654
|
});
|
|
3582
3655
|
}
|
|
3583
|
-
function
|
|
3584
|
-
return e.enabled === !1 ? null : /* @__PURE__ */
|
|
3656
|
+
function Ft(e = {}) {
|
|
3657
|
+
return e.enabled === !1 ? null : /* @__PURE__ */ W(Nt, { children: /* @__PURE__ */ W(Pt, { ...e }) }, e.sessionKey);
|
|
3585
3658
|
}
|
|
3586
3659
|
// src/inject.tsx
|
|
3587
|
-
var
|
|
3588
|
-
if (!
|
|
3589
|
-
let { enabled: e = !0, sessionKey: t, themeMode: n } =
|
|
3660
|
+
var It = (e) => typeof e == "function" ? e() : e, Lt = {}, Rt, zt, Bt, Vt = () => {
|
|
3661
|
+
if (!zt) return;
|
|
3662
|
+
let { enabled: e = !0, sessionKey: t, themeMode: n } = Lt;
|
|
3590
3663
|
try {
|
|
3591
|
-
|
|
3592
|
-
developer:
|
|
3593
|
-
bridgeUrl:
|
|
3594
|
-
runtimeOptions:
|
|
3595
|
-
diagnosticsOnly:
|
|
3596
|
-
enabled:
|
|
3597
|
-
sessionKey:
|
|
3598
|
-
themeMode:
|
|
3599
|
-
popupContainer:
|
|
3664
|
+
zt.render(/* @__PURE__ */ W(Ft, {
|
|
3665
|
+
developer: Lt.developer,
|
|
3666
|
+
bridgeUrl: Lt.bridgeUrl,
|
|
3667
|
+
runtimeOptions: Lt.runtimeOptions,
|
|
3668
|
+
diagnosticsOnly: Lt.diagnosticsOnly,
|
|
3669
|
+
enabled: It(e),
|
|
3670
|
+
sessionKey: It(t),
|
|
3671
|
+
themeMode: It(n),
|
|
3672
|
+
popupContainer: Rt
|
|
3600
3673
|
}));
|
|
3601
3674
|
} catch (e) {
|
|
3602
|
-
|
|
3675
|
+
zt.render(null), console.error("[研发小蜜] 读取应用配置失败,已停用当前小蜜会话", e);
|
|
3603
3676
|
}
|
|
3604
|
-
},
|
|
3605
|
-
let e =
|
|
3606
|
-
|
|
3677
|
+
}, Ht = () => {
|
|
3678
|
+
let e = Bt;
|
|
3679
|
+
Bt = void 0;
|
|
3607
3680
|
try {
|
|
3608
3681
|
e?.();
|
|
3609
3682
|
} catch (e) {
|
|
3610
3683
|
console.error("[研发小蜜] 释放应用状态订阅失败", e);
|
|
3611
3684
|
} finally {
|
|
3612
|
-
|
|
3685
|
+
zt?.unmount(), zt = void 0, Rt?.remove(), Rt = void 0;
|
|
3613
3686
|
}
|
|
3614
|
-
},
|
|
3615
|
-
if (!(
|
|
3616
|
-
|
|
3687
|
+
}, Ut = () => {
|
|
3688
|
+
if (!(zt || typeof document > "u")) {
|
|
3689
|
+
Rt = document.createElement("div"), Rt.dataset.researchAssistantMount = "npm", document.body.append(Rt), zt = Ve(Rt);
|
|
3617
3690
|
try {
|
|
3618
|
-
|
|
3691
|
+
Vt(), Bt = Lt.subscribe?.(Vt);
|
|
3619
3692
|
} catch (e) {
|
|
3620
|
-
|
|
3693
|
+
Ht(), console.error("[研发小蜜] 初始化失败", e);
|
|
3621
3694
|
}
|
|
3622
3695
|
}
|
|
3623
|
-
},
|
|
3696
|
+
}, Wt = {
|
|
3624
3697
|
inject(e = {}) {
|
|
3625
|
-
|
|
3698
|
+
Ht(), Lt = e, Ut();
|
|
3626
3699
|
},
|
|
3627
|
-
start:
|
|
3628
|
-
stop:
|
|
3700
|
+
start: Ut,
|
|
3701
|
+
stop: Ht,
|
|
3629
3702
|
destroy() {
|
|
3630
|
-
|
|
3703
|
+
Ht(), Lt = {};
|
|
3631
3704
|
}
|
|
3632
3705
|
};
|
|
3633
|
-
export {
|
|
3706
|
+
export { Ft as ResearchAssistant, m as assistantRuntime, n as captureSnapshot, t as downloadSnapshot, g as freezeSnapshot, h as parseAssertion, u as parseCase, d as parseSnapshot, s as recorder, r as reportError, Wt as researchAssistant, i as startAssistant };
|
|
3634
3707
|
|
|
3635
3708
|
//# sourceMappingURL=index.js.map
|