react-terminal-viewer-cicd 3.0.0-beta.45 → 3.0.0-beta.47
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/esm/Addon/WorkerLog/LogWorker.js +1 -1
- package/dist/esm/PipelineLogViewer/PipelineLogViewer.d.ts.map +1 -1
- package/dist/esm/PipelineLogViewer/PipelineLogViewer.js +34 -8
- package/dist/esm/PipelineLogViewer/components/GroupHeader.d.ts.map +1 -1
- package/dist/esm/PipelineLogViewer/components/GroupHeader.js +1 -1
- package/dist/esm/PipelineLogViewer/hooks/useLogFetcher.d.ts.map +1 -1
- package/dist/esm/PipelineLogViewer/hooks/useLogFetcher.js +12 -9
- package/dist/esm/PipelineLogViewer/hooks/useStickyHeader.d.ts.map +1 -1
- package/dist/esm/PipelineLogViewer/hooks/useStickyHeader.js +24 -15
- package/dist/esm/PipelineLogViewer/index.less +5 -10
- package/dist/worker/src/PipelineLogViewer/hooks/useGroupSnapshotCache.d.ts +38 -0
- package/dist/worker/src/PipelineLogViewer/hooks/useProactiveGroupSnapshot.d.ts +17 -0
- package/dist/worker/src/PipelineLogViewer/utils/pipelineLineNumberColumn.d.ts +7 -0
- package/dist/worker/src/PipelineLogViewer/utils/processAnsiLogs.d.ts +3 -0
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
function LogWorker() {
|
|
2
2
|
var workerPath = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '/worker';
|
|
3
3
|
var worker = null;
|
|
4
|
-
var version = "3.0.0-beta.
|
|
4
|
+
var version = "3.0.0-beta.47" || '0.0.0';
|
|
5
5
|
var path = workerPath.includes('http') ? "".concat(workerPath, "/log.worker.js") : "".concat(window.location.origin).concat(workerPath, "/log.worker.js");
|
|
6
6
|
var blob = new Blob(["importScripts(\"".concat(path, "?v=").concat(version, "\")")], {
|
|
7
7
|
type: 'application/javascript'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PipelineLogViewer.d.ts","sourceRoot":"","sources":["../../../src/PipelineLogViewer/PipelineLogViewer.tsx"],"names":[],"mappings":"AAoBA,OAAO,KASN,MAAM,OAAO,CAAC;AAiBf,OAAO,cAAc,CAAC;AACtB,OAAO,KAAK,EAGV,sBAAsB,EACtB,oBAAoB,EACrB,MAAM,SAAS,CAAC;AAwEjB,QAAA,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"PipelineLogViewer.d.ts","sourceRoot":"","sources":["../../../src/PipelineLogViewer/PipelineLogViewer.tsx"],"names":[],"mappings":"AAoBA,OAAO,KASN,MAAM,OAAO,CAAC;AAiBf,OAAO,cAAc,CAAC;AACtB,OAAO,KAAK,EAGV,sBAAsB,EACtB,oBAAoB,EACrB,MAAM,SAAS,CAAC;AAwEjB,QAAA,MAAM,iBAAiB,qGAq0CtB,CAAC;AAIF,eAAe,iBAAiB,CAAC"}
|
|
@@ -322,10 +322,36 @@ var PipelineLogViewer = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
322
322
|
stickyHeaderRef.current = stickyHeader;
|
|
323
323
|
|
|
324
324
|
// ===================================================================
|
|
325
|
-
// Virtuoso ref
|
|
325
|
+
// Virtuoso ref & 容器宽度监听 (兼容 Chrome 100)
|
|
326
326
|
// ===================================================================
|
|
327
327
|
var virtuosoRef = useRef(null);
|
|
328
328
|
var containerRef = useRef(null);
|
|
329
|
+
var _useState5 = useState(false),
|
|
330
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
331
|
+
isNarrowContainer = _useState6[0],
|
|
332
|
+
setIsNarrowContainer = _useState6[1];
|
|
333
|
+
useEffect(function () {
|
|
334
|
+
var el = containerRef.current;
|
|
335
|
+
if (!el) return;
|
|
336
|
+
var observer = new ResizeObserver(function (entries) {
|
|
337
|
+
var _iterator = _createForOfIteratorHelper(entries),
|
|
338
|
+
_step;
|
|
339
|
+
try {
|
|
340
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
341
|
+
var entry = _step.value;
|
|
342
|
+
setIsNarrowContainer(entry.contentRect.width <= 1200);
|
|
343
|
+
}
|
|
344
|
+
} catch (err) {
|
|
345
|
+
_iterator.e(err);
|
|
346
|
+
} finally {
|
|
347
|
+
_iterator.f();
|
|
348
|
+
}
|
|
349
|
+
});
|
|
350
|
+
observer.observe(el);
|
|
351
|
+
return function () {
|
|
352
|
+
return observer.disconnect();
|
|
353
|
+
};
|
|
354
|
+
}, []);
|
|
329
355
|
|
|
330
356
|
// ===================================================================
|
|
331
357
|
// 行号宽度自适应
|
|
@@ -414,11 +440,11 @@ var PipelineLogViewer = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
414
440
|
bufStart = _logFetcherResult$cur2.currentStartRow,
|
|
415
441
|
bufEnd = _logFetcherResult$cur2.currentEndRow;
|
|
416
442
|
var jumpTarget = null;
|
|
417
|
-
var
|
|
418
|
-
|
|
443
|
+
var _iterator2 = _createForOfIteratorHelper(groups),
|
|
444
|
+
_step2;
|
|
419
445
|
try {
|
|
420
|
-
for (
|
|
421
|
-
var group =
|
|
446
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
447
|
+
var group = _step2.value;
|
|
422
448
|
if (groupManager.collapsedGroups.has(group.name)) {
|
|
423
449
|
var _group$end;
|
|
424
450
|
var groupEnd = (_group$end = group.end) !== null && _group$end !== void 0 ? _group$end : bufEnd;
|
|
@@ -429,9 +455,9 @@ var PipelineLogViewer = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
429
455
|
}
|
|
430
456
|
}
|
|
431
457
|
} catch (err) {
|
|
432
|
-
|
|
458
|
+
_iterator2.e(err);
|
|
433
459
|
} finally {
|
|
434
|
-
|
|
460
|
+
_iterator2.f();
|
|
435
461
|
}
|
|
436
462
|
if (jumpTarget !== null) {
|
|
437
463
|
collapseAirdropActiveRef.current = true;
|
|
@@ -1413,7 +1439,7 @@ var PipelineLogViewer = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
1413
1439
|
// ===================================================================
|
|
1414
1440
|
// 渲染
|
|
1415
1441
|
// ===================================================================
|
|
1416
|
-
var rootClassName = [className, 'pipeline-log-viewer'].filter(Boolean).join(' ');
|
|
1442
|
+
var rootClassName = [className, 'pipeline-log-viewer', isNarrowContainer ? 'pipeline-log-viewer--narrow' : ''].filter(Boolean).join(' ');
|
|
1417
1443
|
return /*#__PURE__*/React.createElement("div", {
|
|
1418
1444
|
className: rootClassName,
|
|
1419
1445
|
ref: containerRef
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GroupHeader.d.ts","sourceRoot":"","sources":["../../../../src/PipelineLogViewer/components/GroupHeader.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAiB,MAAM,OAAO,CAAC;AAGtC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAK1C,UAAU,gBAAgB;IACxB,WAAW;IACX,KAAK,EAAE,SAAS,CAAC;IACjB,WAAW;IACX,SAAS,EAAE,OAAO,CAAC;IACnB,gCAAgC;IAChC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,eAAe;IACf,QAAQ,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,mBAAmB;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;IACnD,sCAAsC;IACtC,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;;
|
|
1
|
+
{"version":3,"file":"GroupHeader.d.ts","sourceRoot":"","sources":["../../../../src/PipelineLogViewer/components/GroupHeader.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAiB,MAAM,OAAO,CAAC;AAGtC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAK1C,UAAU,gBAAgB;IACxB,WAAW;IACX,KAAK,EAAE,SAAS,CAAC;IACjB,WAAW;IACX,SAAS,EAAE,OAAO,CAAC;IACnB,gCAAgC;IAChC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,eAAe;IACf,QAAQ,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,mBAAmB;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;IACnD,sCAAsC;IACtC,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;;AAkFD,wBAAuC"}
|
|
@@ -61,7 +61,7 @@ var GroupHeader = function GroupHeader(_ref) {
|
|
|
61
61
|
}, statusIcon), /*#__PURE__*/React.createElement("span", {
|
|
62
62
|
className: "pipeline-log-group-header__title"
|
|
63
63
|
}, /*#__PURE__*/React.createElement("span", {
|
|
64
|
-
className: "pipeline-log-group-header__title-inner"
|
|
64
|
+
className: "pipeline-log-group-header__title-inner".concat(loading ? ' pipeline-log-group-header__title-inner--loading' : '')
|
|
65
65
|
}, /*#__PURE__*/React.createElement("span", {
|
|
66
66
|
className: "pipeline-log-group-header__name"
|
|
67
67
|
}, group.name), loading && /*#__PURE__*/React.createElement("span", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLogFetcher.d.ts","sourceRoot":"","sources":["../../../../src/PipelineLogViewer/hooks/useLogFetcher.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EACV,YAAY,EACZ,cAAc,EACd,SAAS,EACT,aAAa,EACb,QAAQ,EACR,iBAAiB,EAClB,MAAM,UAAU,CAAC;AAElB,UAAU,oBAAoB;IAC5B,MAAM,EAAE,iBAAiB,CAAC;IAC1B,SAAS,EAAE,CAAC,MAAM,EAAE,cAAc,KAAK,OAAO,CAAC,aAAa,CAAC,CAAC;IAC9D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,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QG;AACH,iBAAS,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,mBAAmB,CAkgBzE;AAED,eAAe,aAAa,CAAC"}
|
|
@@ -628,23 +628,26 @@ function useLogFetcher(options) {
|
|
|
628
628
|
}
|
|
629
629
|
return _context5.abrupt("return");
|
|
630
630
|
case 2:
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
631
|
+
tasks = []; // 防打扰:若用户在向上查阅历史,暂停日志自动追加(不阻断分组列表刷新)
|
|
632
|
+
if (!isUserBrowsingHistory) {
|
|
633
|
+
tasks.push(initLoad({
|
|
634
|
+
silent: true
|
|
635
|
+
}));
|
|
634
636
|
}
|
|
635
|
-
tasks = [initLoad({
|
|
636
|
-
silent: true
|
|
637
|
-
})];
|
|
638
637
|
if (runningPollSync) {
|
|
639
638
|
tasks.push(runningPollSync());
|
|
640
639
|
}
|
|
641
|
-
|
|
640
|
+
if (!(tasks.length > 0)) {
|
|
641
|
+
_context5.next = 8;
|
|
642
|
+
break;
|
|
643
|
+
}
|
|
644
|
+
_context5.next = 8;
|
|
642
645
|
return Promise.all(tasks).catch(function (err) {
|
|
643
646
|
console.error('[PipelineLogViewer] running poll failed:', err);
|
|
644
647
|
});
|
|
645
|
-
case 7:
|
|
646
|
-
if (!cancelled && mountedRef.current) scheduleNext();
|
|
647
648
|
case 8:
|
|
649
|
+
if (!cancelled && mountedRef.current) scheduleNext();
|
|
650
|
+
case 9:
|
|
648
651
|
case "end":
|
|
649
652
|
return _context5.stop();
|
|
650
653
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useStickyHeader.d.ts","sourceRoot":"","sources":["../../../../src/PipelineLogViewer/hooks/useStickyHeader.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE1C,UAAU,sBAAsB;IAC9B,WAAW;IACX,MAAM,EAAE,SAAS,EAAE,CAAC;CACrB;AAED,UAAU,qBAAqB;IAC7B,0CAA0C;IAC1C,WAAW,EAAE,SAAS,GAAG,IAAI,CAAC;IAC9B;;;;OAIG;IACH,kBAAkB,EAAE,CAAC,cAAc,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;CACzE;AA6CD;;GAEG;AACH,iBAAS,eAAe,CAAC,OAAO,EAAE,sBAAsB,GAAG,qBAAqB,
|
|
1
|
+
{"version":3,"file":"useStickyHeader.d.ts","sourceRoot":"","sources":["../../../../src/PipelineLogViewer/hooks/useStickyHeader.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE1C,UAAU,sBAAsB;IAC9B,WAAW;IACX,MAAM,EAAE,SAAS,EAAE,CAAC;CACrB;AAED,UAAU,qBAAqB;IAC7B,0CAA0C;IAC1C,WAAW,EAAE,SAAS,GAAG,IAAI,CAAC;IAC9B;;;;OAIG;IACH,kBAAkB,EAAE,CAAC,cAAc,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;CACzE;AA6CD;;GAEG;AACH,iBAAS,eAAe,CAAC,OAAO,EAAE,sBAAsB,GAAG,qBAAqB,CAoD/E;AAED,eAAe,eAAe,CAAC"}
|
|
@@ -14,7 +14,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
14
14
|
// 与下一组 start 计算有效区间
|
|
15
15
|
// ============================================================================
|
|
16
16
|
|
|
17
|
-
import { useCallback, useEffect, useState } from 'react';
|
|
17
|
+
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
18
18
|
/** 提前探测行数:让吸顶分组在边界前更早感知切换趋势 */
|
|
19
19
|
var STICKY_LEAD_ROWS = 2;
|
|
20
20
|
/**
|
|
@@ -59,19 +59,8 @@ function useStickyHeader(options) {
|
|
|
59
59
|
_useState2 = _slicedToArray(_useState, 2),
|
|
60
60
|
stickyGroup = _useState2[0],
|
|
61
61
|
setStickyGroup = _useState2[1];
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
useEffect(function () {
|
|
65
|
-
if (stickyGroup) {
|
|
66
|
-
var updatedGroup = groups.find(function (g) {
|
|
67
|
-
return g.name === stickyGroup.name;
|
|
68
|
-
});
|
|
69
|
-
if (updatedGroup && updatedGroup.status !== stickyGroup.status) {
|
|
70
|
-
setStickyGroup(updatedGroup);
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
}, [groups, stickyGroup]);
|
|
74
|
-
var handleRangeChanged = useCallback(function (absoluteTopRow, bufferEnd) {
|
|
62
|
+
var lastParamsRef = useRef(null);
|
|
63
|
+
var evaluateSticky = useCallback(function (absoluteTopRow, bufferEnd) {
|
|
75
64
|
if (groups.length === 0) {
|
|
76
65
|
setStickyGroup(null);
|
|
77
66
|
return;
|
|
@@ -88,8 +77,28 @@ function useStickyHeader(options) {
|
|
|
88
77
|
setStickyGroup(null);
|
|
89
78
|
return;
|
|
90
79
|
}
|
|
91
|
-
setStickyGroup(
|
|
80
|
+
setStickyGroup(function (prev) {
|
|
81
|
+
// 如果吸顶分组名和状态没变,直接返回原引用以避免不必要的重新渲染
|
|
82
|
+
if ((prev === null || prev === void 0 ? void 0 : prev.name) === nextStickyGroup.name && (prev === null || prev === void 0 ? void 0 : prev.status) === nextStickyGroup.status) {
|
|
83
|
+
return prev;
|
|
84
|
+
}
|
|
85
|
+
return nextStickyGroup;
|
|
86
|
+
});
|
|
92
87
|
}, [groups]);
|
|
88
|
+
var handleRangeChanged = useCallback(function (absoluteTopRow, bufferEnd) {
|
|
89
|
+
lastParamsRef.current = {
|
|
90
|
+
absoluteTopRow: absoluteTopRow,
|
|
91
|
+
bufferEnd: bufferEnd
|
|
92
|
+
};
|
|
93
|
+
evaluateSticky(absoluteTopRow, bufferEnd);
|
|
94
|
+
}, [evaluateSticky]);
|
|
95
|
+
|
|
96
|
+
// 当外部的 groups 更新时,重新触发计算,避免只在滚动时才能展示新分组的吸顶头
|
|
97
|
+
useEffect(function () {
|
|
98
|
+
if (lastParamsRef.current) {
|
|
99
|
+
evaluateSticky(lastParamsRef.current.absoluteTopRow, lastParamsRef.current.bufferEnd);
|
|
100
|
+
}
|
|
101
|
+
}, [evaluateSticky]);
|
|
93
102
|
return {
|
|
94
103
|
stickyGroup: stickyGroup,
|
|
95
104
|
handleRangeChanged: handleRangeChanged
|
|
@@ -19,9 +19,6 @@
|
|
|
19
19
|
overflow: hidden;
|
|
20
20
|
color: #b5bbc6;
|
|
21
21
|
background: #1e1e1e;
|
|
22
|
-
/* 供搜索栏换行:嵌入侧栏等窄容器时 @media 不触发,用容器宽度判断 */
|
|
23
|
-
container-type: inline-size;
|
|
24
|
-
container-name: plv;
|
|
25
22
|
}
|
|
26
23
|
|
|
27
24
|
/* --------------------------------------------------------------------------
|
|
@@ -78,9 +75,8 @@
|
|
|
78
75
|
display: inline-block;
|
|
79
76
|
width: 0.8em;
|
|
80
77
|
text-align: center;
|
|
81
|
-
transform: translateY(-4px);
|
|
78
|
+
transform: translateY(-4px) scale(1.5);
|
|
82
79
|
transform-origin: center center;
|
|
83
|
-
scale: 1.5;
|
|
84
80
|
}
|
|
85
81
|
|
|
86
82
|
.pipeline-log-loading-dot:nth-child(1) {
|
|
@@ -137,7 +133,7 @@
|
|
|
137
133
|
/* 与旧版 grid「1fr | auto | auto」一致:前缀吃剩余宽度,搜索框为 auto 列不横向撑满 */
|
|
138
134
|
.pipeline-log-search-bar__input-prefix {
|
|
139
135
|
display: flex;
|
|
140
|
-
flex: 1 1
|
|
136
|
+
flex: 1 1 auto; /* 改为 auto,让 flexbox 根据实际内容宽度计算是否需要换行,避免内容过长时与搜索框重叠 */
|
|
141
137
|
flex-wrap: wrap;
|
|
142
138
|
gap: 6px;
|
|
143
139
|
align-items: center;
|
|
@@ -272,9 +268,9 @@ input.pipeline-log-search-bar__input {
|
|
|
272
268
|
|
|
273
269
|
/*
|
|
274
270
|
* 容器 / 视口 ≤1200px:首行仅前缀(元数据等),第二行搜索框 + 后缀同一行(避免 ~900px 仍单行重叠)。
|
|
275
|
-
*
|
|
271
|
+
* 兼容 Chrome 100:使用 .pipeline-log-viewer--narrow 替代 @container
|
|
276
272
|
*/
|
|
277
|
-
|
|
273
|
+
.pipeline-log-viewer--narrow {
|
|
278
274
|
.pipeline-log-search-bar__input-prefix {
|
|
279
275
|
flex-basis: 100%;
|
|
280
276
|
}
|
|
@@ -487,8 +483,7 @@ input.pipeline-log-search-bar__input {
|
|
|
487
483
|
}
|
|
488
484
|
|
|
489
485
|
/* 仅有 loading 时与 name 并排分配宽度,保证 icon 紧跟在可见名称(或省略号)后 */
|
|
490
|
-
.pipeline-log-group-header__title-inner
|
|
491
|
-
.pipeline-log-group-header__name {
|
|
486
|
+
.pipeline-log-group-header__title-inner--loading .pipeline-log-group-header__name {
|
|
492
487
|
flex: 1 1 0%;
|
|
493
488
|
}
|
|
494
489
|
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { LogEntry } from '../types';
|
|
2
|
+
/** 单个分组的日志快照 */
|
|
3
|
+
export interface GroupSnapshot {
|
|
4
|
+
/** 分组名称(唯一索引) */
|
|
5
|
+
groupName: string;
|
|
6
|
+
/** 快照覆盖的起始绝对行号 */
|
|
7
|
+
startRow: number;
|
|
8
|
+
/** 快照覆盖的结束绝对行号 */
|
|
9
|
+
endRow: number;
|
|
10
|
+
/** 该分组范围内的日志条目(已经过 ANSI 处理) */
|
|
11
|
+
logs: LogEntry[];
|
|
12
|
+
/** 快照创建时间戳(用于可能的 LRU 淘汰) */
|
|
13
|
+
createdAt: number;
|
|
14
|
+
}
|
|
15
|
+
interface UseGroupSnapshotCacheReturn {
|
|
16
|
+
/** 按分组名获取快照 */
|
|
17
|
+
getSnapshot: (groupName: string) => GroupSnapshot | undefined;
|
|
18
|
+
/** 写入/更新分组快照 */
|
|
19
|
+
setSnapshot: (snapshot: GroupSnapshot) => void;
|
|
20
|
+
/** 删除指定分组快照(折叠时清理) */
|
|
21
|
+
removeSnapshot: (groupName: string) => void;
|
|
22
|
+
/** 清空所有快照(collapseAll / expandAll / reset 时) */
|
|
23
|
+
clearAll: () => void;
|
|
24
|
+
/** 当前所有快照的不可变 Map(供 useDisplayLogs 作为依赖) */
|
|
25
|
+
snapshots: Map<string, GroupSnapshot>;
|
|
26
|
+
/** 判断某绝对行号是否落在任一快照区间内 */
|
|
27
|
+
isRowInSnapshot: (absoluteRow: number) => boolean;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* 分组日志快照缓存 Hook
|
|
31
|
+
*
|
|
32
|
+
* 核心策略:
|
|
33
|
+
* 1. 使用 Map<string, GroupSnapshot> 按分组名存储快照
|
|
34
|
+
* 2. 每次写入/删除都产生新的 Map 引用以触发 React 重渲染
|
|
35
|
+
* 3. 同时维护 ref 供同步读取(避免 stale closure)
|
|
36
|
+
*/
|
|
37
|
+
declare function useGroupSnapshotCache(): UseGroupSnapshotCacheReturn;
|
|
38
|
+
export default useGroupSnapshotCache;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { FetchLogParams, GroupData, LogDataResult } from '../types';
|
|
2
|
+
import type { GroupSnapshot } from './useGroupSnapshotCache';
|
|
3
|
+
interface UseProactiveGroupSnapshotOptions {
|
|
4
|
+
groups: GroupData[];
|
|
5
|
+
collapsedGroups: Set<string>;
|
|
6
|
+
currentStartRow: number;
|
|
7
|
+
currentEndRow: number;
|
|
8
|
+
loading: boolean;
|
|
9
|
+
snapshotCache: {
|
|
10
|
+
snapshots: Map<string, GroupSnapshot>;
|
|
11
|
+
setSnapshot: (snapshot: GroupSnapshot) => void;
|
|
12
|
+
};
|
|
13
|
+
fetchLogs: (params: FetchLogParams) => Promise<LogDataResult>;
|
|
14
|
+
pageSize: number;
|
|
15
|
+
}
|
|
16
|
+
export default function useProactiveGroupSnapshot({ groups, collapsedGroups, currentStartRow, currentEndRow, loading, snapshotCache, fetchLogs, pageSize, }: UseProactiveGroupSnapshotOptions): void;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { DisplayLogLine, GroupData } from '../types';
|
|
2
|
+
/** 控制日志:END_stepId_...(与 PipelineLogViewer itemContent 一致) */
|
|
3
|
+
export declare function isPipelineEndMarkerText(text: string): boolean;
|
|
4
|
+
/** 控制日志:START_stepId_... */
|
|
5
|
+
export declare function isPipelineStartMarkerText(text: string): boolean;
|
|
6
|
+
export declare function maxPipelineLineNumberCellDigitValueInDisplayIndexRange(displayLogs: DisplayLogLine[], fromIndex: number, toIndex: number, groups: GroupData[], pipelineMinAbsoluteRow: number): number;
|
|
7
|
+
export declare function lineNumberColumnWidthPxForMaxValue(maxValue: number): number;
|