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