@cloudtower/eagle 4100.0.1 → 4100.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (236) hide show
  1. package/dist/cjs/core/AccordionCard/index.js +1 -1
  2. package/dist/cjs/core/Alert/alert.style.js +2 -2
  3. package/dist/cjs/core/Avatar/index.js +1 -1
  4. package/dist/cjs/core/Banner/banner.style.js +4 -4
  5. package/dist/cjs/core/BasicCTError/BasicCTError.style.js +1 -1
  6. package/dist/cjs/core/BlankState/style.js +1 -1
  7. package/dist/cjs/core/Breadcrumb/index.js +1 -1
  8. package/dist/cjs/core/Button/index.js +1 -1
  9. package/dist/cjs/core/ButtonGroup/index.js +2 -2
  10. package/dist/cjs/core/Card/CardBody.js +1 -1
  11. package/dist/cjs/core/Card/CardTitle.js +1 -1
  12. package/dist/cjs/core/Card/CardWrapper.js +2 -2
  13. package/dist/cjs/core/Cascader/cascader.style.js +11 -11
  14. package/dist/cjs/core/Checkbox/checkbox.style.js +1 -1
  15. package/dist/cjs/core/DetailCard/index.js +1 -1
  16. package/dist/cjs/core/DonutChart/index.js +2 -2
  17. package/dist/cjs/core/DropdownMenu/index.js +1 -1
  18. package/dist/cjs/core/ExpandableList/ExpandIcon.js +1 -1
  19. package/dist/cjs/core/ExpandableList/ExpandableContainer.js +1 -1
  20. package/dist/cjs/core/ExpandableList/ExpandableItem.js +2 -2
  21. package/dist/cjs/core/ExpandableList/RoundOrder.js +1 -1
  22. package/dist/cjs/core/FailedLoad/index.js +1 -1
  23. package/dist/cjs/core/FormItem/index.js +1 -1
  24. package/dist/cjs/core/Icon/index.js +1 -1
  25. package/dist/cjs/core/ImmersiveDialog/styles.js +14 -14
  26. package/dist/cjs/core/Input/index.js +1 -1
  27. package/dist/cjs/core/InputGroup/index.js +1 -1
  28. package/dist/cjs/core/InputInteger/index.js +1 -1
  29. package/dist/cjs/core/InputNumber/index.js +1 -1
  30. package/dist/cjs/core/InputPassword/index.js +1 -1
  31. package/dist/cjs/core/InputTagItem/index.js +1 -1
  32. package/dist/cjs/core/LegacySelect/select.style.js +1 -1
  33. package/dist/cjs/core/Legend/index.js +5 -5
  34. package/dist/cjs/core/LineChart/LineChartActions.js +2 -2
  35. package/dist/cjs/core/LineChart/TooltipFormatter.js +1 -1
  36. package/dist/cjs/core/LineChart/styled.js +9 -9
  37. package/dist/cjs/core/Link/index.js +1 -1
  38. package/dist/cjs/core/Loading/style.js +4 -4
  39. package/dist/cjs/core/LocalUpload/LocalUpload.style.js +2 -2
  40. package/dist/cjs/core/LogView/LogView.js +354 -0
  41. package/dist/cjs/core/LogView/LogView.style.js +31 -0
  42. package/dist/cjs/core/LogView/LogView.utils.js +154 -0
  43. package/dist/cjs/core/MediumDialog/MediumDialog.js +1 -1
  44. package/dist/cjs/core/Metric/styled.js +8 -8
  45. package/dist/cjs/core/Nav/index.js +1 -1
  46. package/dist/cjs/core/Nav/style.js +2 -2
  47. package/dist/cjs/core/Overflow/index.js +2 -2
  48. package/dist/cjs/core/Pagination/index.js +2 -2
  49. package/dist/cjs/core/Progress/components.js +2 -2
  50. package/dist/cjs/core/Progress/index.js +2 -2
  51. package/dist/cjs/core/Progress/progress.style.js +4 -4
  52. package/dist/cjs/core/Progress/progress.widgets.js +2 -2
  53. package/dist/cjs/core/Radio/index.js +3 -3
  54. package/dist/cjs/core/SearchInput/SearchInput.style.js +5 -5
  55. package/dist/cjs/core/SegmentControl/index.js +4 -4
  56. package/dist/cjs/core/Select/select.style.js +4 -4
  57. package/dist/cjs/core/Select/select.widgets.js +3 -3
  58. package/dist/cjs/core/SimplePagination/index.js +2 -2
  59. package/dist/cjs/core/Skeleton/Content.js +1 -1
  60. package/dist/cjs/core/SmallDialog/SmallDialog.style.js +7 -7
  61. package/dist/cjs/core/StatusCapsule/index.js +2 -2
  62. package/dist/cjs/core/StepProgress/index.js +1 -1
  63. package/dist/cjs/core/Steps/style.js +5 -5
  64. package/dist/cjs/core/Styled/index.js +40 -40
  65. package/dist/cjs/core/Switch/index.js +2 -2
  66. package/dist/cjs/core/Tab/Tab.js +1 -1
  67. package/dist/cjs/core/Tab/Tab.style.js +4 -4
  68. package/dist/cjs/core/Table/TableSkeleton.js +1 -1
  69. package/dist/cjs/core/Table/TableWidget.js +1 -1
  70. package/dist/cjs/core/Table/index.js +3 -3
  71. package/dist/cjs/core/TableForm/Columns/FormItem.js +1 -1
  72. package/dist/cjs/core/TableForm/style.js +7 -7
  73. package/dist/cjs/core/Tag/SplitTag.js +1 -1
  74. package/dist/cjs/core/Tag/style.js +5 -5
  75. package/dist/cjs/core/Time/index.js +1 -1
  76. package/dist/cjs/core/TimeZoneSelect/index.js +7 -7
  77. package/dist/cjs/core/Timeline/Timeline.style.js +5 -5
  78. package/dist/cjs/core/Token/index.js +4 -4
  79. package/dist/cjs/core/Token/style.js +1 -1
  80. package/dist/cjs/core/Tooltip/EllipsisTooltipContent.js +1 -1
  81. package/dist/cjs/core/Tooltip/index.js +1 -1
  82. package/dist/cjs/core/Truncate/index.js +1 -1
  83. package/dist/cjs/core/Typo/index.js +109 -57
  84. package/dist/cjs/core/WizardDialog/styles.js +4 -4
  85. package/dist/cjs/coreX/BarChart/index.js +1 -1
  86. package/dist/cjs/coreX/BatchOperation/index.js +2 -2
  87. package/dist/cjs/coreX/ChartWithTooltip/index.js +6 -6
  88. package/dist/cjs/coreX/CheckPointList/checkpointlist.style.js +3 -3
  89. package/dist/cjs/coreX/CircleLoading/index.js +1 -1
  90. package/dist/cjs/coreX/CronCalendar/index.js +4 -4
  91. package/dist/cjs/coreX/CronPlan/index.js +4 -4
  92. package/dist/cjs/coreX/DateRangePicker/DateRangePicker.style.js +12 -12
  93. package/dist/cjs/coreX/DateRangePicker/RelativeTime.js +1 -1
  94. package/dist/cjs/coreX/Dialogs/DeleteDialog/DeleteDialog.js +2 -2
  95. package/dist/cjs/coreX/Dialogs/RejectDialog/RejectDialog.js +6 -6
  96. package/dist/cjs/coreX/GoBackButton/index.js +1 -1
  97. package/dist/cjs/coreX/I18nNameTag/index.js +1 -1
  98. package/dist/cjs/coreX/InfoRowList/InfoRow.js +1 -1
  99. package/dist/cjs/coreX/InfoRowList/InfoRowList.js +4 -4
  100. package/dist/cjs/coreX/KubeConfigModal/KubeConfigModal.style.js +8 -8
  101. package/dist/cjs/coreX/NamesTooltip/index.js +3 -3
  102. package/dist/cjs/coreX/OverflowTooltip/index.js +4 -4
  103. package/dist/cjs/coreX/Sider/index.js +3 -3
  104. package/dist/cjs/coreX/SummaryTable/index.js +5 -5
  105. package/dist/cjs/coreX/SwitchWithText/index.js +1 -1
  106. package/dist/cjs/coreX/TabMenu/index.js +2 -2
  107. package/dist/cjs/coreX/UnderlineTootip/index.js +1 -1
  108. package/dist/cjs/coreX/UnitWithChart/index.js +3 -3
  109. package/dist/cjs/index.js +3 -0
  110. package/dist/cjs/stats1.html +1 -1
  111. package/dist/components.css +3509 -3151
  112. package/dist/esm/core/AccordionCard/index.js +1 -1
  113. package/dist/esm/core/Alert/alert.style.js +2 -2
  114. package/dist/esm/core/Avatar/index.js +1 -1
  115. package/dist/esm/core/Banner/banner.style.js +4 -4
  116. package/dist/esm/core/BasicCTError/BasicCTError.style.js +1 -1
  117. package/dist/esm/core/BlankState/style.js +1 -1
  118. package/dist/esm/core/Breadcrumb/index.js +1 -1
  119. package/dist/esm/core/Button/index.js +1 -1
  120. package/dist/esm/core/ButtonGroup/index.js +2 -2
  121. package/dist/esm/core/Card/CardBody.js +1 -1
  122. package/dist/esm/core/Card/CardTitle.js +1 -1
  123. package/dist/esm/core/Card/CardWrapper.js +2 -2
  124. package/dist/esm/core/Cascader/cascader.style.js +11 -11
  125. package/dist/esm/core/Checkbox/checkbox.style.js +1 -1
  126. package/dist/esm/core/DetailCard/index.js +1 -1
  127. package/dist/esm/core/DonutChart/index.js +2 -2
  128. package/dist/esm/core/DropdownMenu/index.js +1 -1
  129. package/dist/esm/core/ExpandableList/ExpandIcon.js +1 -1
  130. package/dist/esm/core/ExpandableList/ExpandableContainer.js +1 -1
  131. package/dist/esm/core/ExpandableList/ExpandableItem.js +2 -2
  132. package/dist/esm/core/ExpandableList/RoundOrder.js +1 -1
  133. package/dist/esm/core/FailedLoad/index.js +1 -1
  134. package/dist/esm/core/FormItem/index.js +1 -1
  135. package/dist/esm/core/Icon/index.js +1 -1
  136. package/dist/esm/core/ImmersiveDialog/styles.js +14 -14
  137. package/dist/esm/core/Input/index.js +1 -1
  138. package/dist/esm/core/InputGroup/index.js +1 -1
  139. package/dist/esm/core/InputInteger/index.js +1 -1
  140. package/dist/esm/core/InputNumber/index.js +1 -1
  141. package/dist/esm/core/InputPassword/index.js +1 -1
  142. package/dist/esm/core/InputTagItem/index.js +1 -1
  143. package/dist/esm/core/LegacySelect/select.style.js +1 -1
  144. package/dist/esm/core/Legend/index.js +5 -5
  145. package/dist/esm/core/LineChart/LineChartActions.js +2 -2
  146. package/dist/esm/core/LineChart/TooltipFormatter.js +1 -1
  147. package/dist/esm/core/LineChart/styled.js +9 -9
  148. package/dist/esm/core/Link/index.js +1 -1
  149. package/dist/esm/core/Loading/style.js +4 -4
  150. package/dist/esm/core/LocalUpload/LocalUpload.style.js +2 -2
  151. package/dist/esm/core/LogView/LogView.js +348 -0
  152. package/dist/esm/core/LogView/LogView.style.js +25 -0
  153. package/dist/esm/core/LogView/LogView.utils.js +144 -0
  154. package/dist/esm/core/MediumDialog/MediumDialog.js +1 -1
  155. package/dist/esm/core/Metric/styled.js +8 -8
  156. package/dist/esm/core/Nav/index.js +1 -1
  157. package/dist/esm/core/Nav/style.js +2 -2
  158. package/dist/esm/core/Overflow/index.js +2 -2
  159. package/dist/esm/core/Pagination/index.js +2 -2
  160. package/dist/esm/core/Progress/components.js +2 -2
  161. package/dist/esm/core/Progress/index.js +2 -2
  162. package/dist/esm/core/Progress/progress.style.js +4 -4
  163. package/dist/esm/core/Progress/progress.widgets.js +2 -2
  164. package/dist/esm/core/Radio/index.js +3 -3
  165. package/dist/esm/core/SearchInput/SearchInput.style.js +5 -5
  166. package/dist/esm/core/SegmentControl/index.js +4 -4
  167. package/dist/esm/core/Select/select.style.js +4 -4
  168. package/dist/esm/core/Select/select.widgets.js +3 -3
  169. package/dist/esm/core/SimplePagination/index.js +2 -2
  170. package/dist/esm/core/Skeleton/Content.js +1 -1
  171. package/dist/esm/core/SmallDialog/SmallDialog.style.js +7 -7
  172. package/dist/esm/core/StatusCapsule/index.js +2 -2
  173. package/dist/esm/core/StepProgress/index.js +1 -1
  174. package/dist/esm/core/Steps/style.js +5 -5
  175. package/dist/esm/core/Styled/index.js +40 -40
  176. package/dist/esm/core/Switch/index.js +2 -2
  177. package/dist/esm/core/Tab/Tab.js +1 -1
  178. package/dist/esm/core/Tab/Tab.style.js +4 -4
  179. package/dist/esm/core/Table/TableSkeleton.js +1 -1
  180. package/dist/esm/core/Table/TableWidget.js +1 -1
  181. package/dist/esm/core/Table/index.js +3 -3
  182. package/dist/esm/core/TableForm/Columns/FormItem.js +1 -1
  183. package/dist/esm/core/TableForm/style.js +7 -7
  184. package/dist/esm/core/Tag/SplitTag.js +1 -1
  185. package/dist/esm/core/Tag/style.js +5 -5
  186. package/dist/esm/core/Time/index.js +1 -1
  187. package/dist/esm/core/TimeZoneSelect/index.js +7 -7
  188. package/dist/esm/core/Timeline/Timeline.style.js +5 -5
  189. package/dist/esm/core/Token/index.js +4 -4
  190. package/dist/esm/core/Token/style.js +1 -1
  191. package/dist/esm/core/Tooltip/EllipsisTooltipContent.js +1 -1
  192. package/dist/esm/core/Tooltip/index.js +1 -1
  193. package/dist/esm/core/Truncate/index.js +1 -1
  194. package/dist/esm/core/Typo/index.js +109 -58
  195. package/dist/esm/core/WizardDialog/styles.js +4 -4
  196. package/dist/esm/coreX/BarChart/index.js +1 -1
  197. package/dist/esm/coreX/BatchOperation/index.js +2 -2
  198. package/dist/esm/coreX/ChartWithTooltip/index.js +6 -6
  199. package/dist/esm/coreX/CheckPointList/checkpointlist.style.js +3 -3
  200. package/dist/esm/coreX/CircleLoading/index.js +1 -1
  201. package/dist/esm/coreX/CronCalendar/index.js +4 -4
  202. package/dist/esm/coreX/CronPlan/index.js +4 -4
  203. package/dist/esm/coreX/DateRangePicker/DateRangePicker.style.js +12 -12
  204. package/dist/esm/coreX/DateRangePicker/RelativeTime.js +1 -1
  205. package/dist/esm/coreX/Dialogs/DeleteDialog/DeleteDialog.js +2 -2
  206. package/dist/esm/coreX/Dialogs/RejectDialog/RejectDialog.js +6 -6
  207. package/dist/esm/coreX/GoBackButton/index.js +1 -1
  208. package/dist/esm/coreX/I18nNameTag/index.js +1 -1
  209. package/dist/esm/coreX/InfoRowList/InfoRow.js +1 -1
  210. package/dist/esm/coreX/InfoRowList/InfoRowList.js +4 -4
  211. package/dist/esm/coreX/KubeConfigModal/KubeConfigModal.style.js +8 -8
  212. package/dist/esm/coreX/NamesTooltip/index.js +3 -3
  213. package/dist/esm/coreX/OverflowTooltip/index.js +4 -4
  214. package/dist/esm/coreX/Sider/index.js +3 -3
  215. package/dist/esm/coreX/SummaryTable/index.js +5 -5
  216. package/dist/esm/coreX/SwitchWithText/index.js +1 -1
  217. package/dist/esm/coreX/TabMenu/index.js +2 -2
  218. package/dist/esm/coreX/UnderlineTootip/index.js +1 -1
  219. package/dist/esm/coreX/UnitWithChart/index.js +3 -3
  220. package/dist/esm/index.js +2 -1
  221. package/dist/esm/stats1.html +1 -1
  222. package/dist/linaria.merged.scss +2617 -2505
  223. package/dist/src/core/LogView/LogView.d.ts +3 -0
  224. package/dist/src/core/LogView/LogView.style.d.ts +6 -0
  225. package/dist/src/core/LogView/LogView.types.d.ts +103 -0
  226. package/dist/src/core/LogView/LogView.utils.d.ts +23 -0
  227. package/dist/src/core/LogView/index.d.ts +2 -0
  228. package/dist/src/core/Typo/index.d.ts +51 -1
  229. package/dist/src/core/index.d.ts +1 -0
  230. package/dist/stories/docs/core/LogView.stories.d.ts +156 -0
  231. package/dist/style.css +3513 -3156
  232. package/dist/token.css +229 -455
  233. package/dist/variables.scss +1 -1
  234. package/docs/core/LogView/guide.md +187 -0
  235. package/docs/llms.txt +3 -1
  236. package/package.json +14 -5
@@ -0,0 +1,348 @@
1
+ import React__default, { useRef, useState, useEffect, useMemo, useCallback } from 'react';
2
+ import { cx } from '@linaria/core';
3
+ import { Terminal } from '@xterm/xterm';
4
+ import { SearchAddon } from '@xterm/addon-search';
5
+ import { FitAddon } from '@xterm/addon-fit';
6
+ import { Search16OntintIcon, ArrowChevronUp16OntintIcon, ArrowChevronUp16BlueIcon, ArrowChevronDown16OntintIcon, ArrowChevronDown16BlueIcon, XmarkCloseCircleFill16OntintIcon, XmarkCloseCircleFill16OntintLightIcon } from '@cloudtower/icons-react';
7
+ import useParrotTranslation from '../../hooks/useParrotTranslation.js';
8
+ import { LogViewContainer, LogViewInnerContaier, SearchInputStyle, LogTerminal, CustomContentOverlay } from './LogView.style.js';
9
+ import { isMacOS, customShortcutsForMac, customShortcutsForWin, isCustomKeyboardAction, scrollLines, scrollPages, copySelectLines, selectAll, eventsource } from './LogView.utils.js';
10
+ import { Color } from '../../styles/token/color.js';
11
+ import { Show } from '../../coreX/Show/index.js';
12
+ import { SearchInput } from '../SearchInput/SearchInput.js';
13
+
14
+ var __defProp = Object.defineProperty;
15
+ var __defProps = Object.defineProperties;
16
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
17
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
18
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
19
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
20
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
21
+ var __spreadValues = (a, b) => {
22
+ for (var prop in b || (b = {}))
23
+ if (__hasOwnProp.call(b, prop))
24
+ __defNormalProp(a, prop, b[prop]);
25
+ if (__getOwnPropSymbols)
26
+ for (var prop of __getOwnPropSymbols(b)) {
27
+ if (__propIsEnum.call(b, prop))
28
+ __defNormalProp(a, prop, b[prop]);
29
+ }
30
+ return a;
31
+ };
32
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
33
+ const useLogViewEventSource = ({
34
+ enabled,
35
+ terminal,
36
+ options,
37
+ setHasData,
38
+ setEventSourceError
39
+ }) => {
40
+ const reconnectFnRef = useRef(null);
41
+ const optionsRef = useRef(options);
42
+ optionsRef.current = options;
43
+ const {
44
+ url,
45
+ closeEventName,
46
+ errorEventName,
47
+ messageEventName,
48
+ openEventName,
49
+ reconnect,
50
+ reconnectWait
51
+ } = options;
52
+ useEffect(() => {
53
+ var _a, _b;
54
+ let closeEventSource;
55
+ if (!enabled) {
56
+ setEventSourceError(null);
57
+ reconnectFnRef.current = null;
58
+ return;
59
+ }
60
+ if (!terminal)
61
+ return;
62
+ const setupEventSource = () => {
63
+ var _a2;
64
+ closeEventSource == null ? void 0 : closeEventSource();
65
+ setEventSourceError(null);
66
+ closeEventSource = eventsource(
67
+ ((_a2 = optionsRef.current) == null ? void 0 : _a2.url) || "",
68
+ __spreadProps(__spreadValues({}, optionsRef.current), {
69
+ onOpen: (...props) => {
70
+ var _a3, _b2;
71
+ (_b2 = (_a3 = optionsRef.current) == null ? void 0 : _a3.onOpen) == null ? void 0 : _b2.call(_a3, ...props);
72
+ },
73
+ onClose: (...props) => {
74
+ var _a3, _b2;
75
+ (_b2 = (_a3 = optionsRef.current) == null ? void 0 : _a3.onClose) == null ? void 0 : _b2.call(_a3, ...props);
76
+ },
77
+ onMessage: (...props) => {
78
+ var _a3, _b2;
79
+ (_b2 = (_a3 = optionsRef.current) == null ? void 0 : _a3.onMessage) == null ? void 0 : _b2.call(_a3, ...props);
80
+ setEventSourceError(null);
81
+ },
82
+ // 注入数据检测
83
+ formatMessage: (data) => {
84
+ var _a3;
85
+ const formatMessage = (_a3 = optionsRef.current) == null ? void 0 : _a3.formatMessage;
86
+ const message = formatMessage ? formatMessage(data) : data;
87
+ if (typeof message === "string" && message.length > 0)
88
+ setHasData(true);
89
+ return message;
90
+ },
91
+ // 增强错误处理
92
+ onError: (err) => {
93
+ var _a3, _b2;
94
+ setEventSourceError(err);
95
+ (_b2 = (_a3 = optionsRef.current) == null ? void 0 : _a3.onError) == null ? void 0 : _b2.call(_a3, err);
96
+ }
97
+ }),
98
+ terminal
99
+ );
100
+ };
101
+ reconnectFnRef.current = setupEventSource;
102
+ (_b = (_a = optionsRef.current) == null ? void 0 : _a.onSetupEventSource) == null ? void 0 : _b.call(_a, {
103
+ setupFn: setupEventSource
104
+ });
105
+ setupEventSource();
106
+ return () => {
107
+ closeEventSource == null ? void 0 : closeEventSource();
108
+ if (reconnectFnRef.current === setupEventSource)
109
+ reconnectFnRef.current = null;
110
+ };
111
+ }, [
112
+ enabled,
113
+ terminal,
114
+ url,
115
+ closeEventName,
116
+ errorEventName,
117
+ messageEventName,
118
+ openEventName,
119
+ reconnect,
120
+ reconnectWait
121
+ ]);
122
+ return {
123
+ reconnectFnRef
124
+ };
125
+ };
126
+ const LogView = ({
127
+ className,
128
+ content = "",
129
+ showSearch = true,
130
+ eventSource = false,
131
+ eventSourceOptions = {},
132
+ rows = 23,
133
+ scrollback = 9999999,
134
+ searchHighlightLimit = 1e3,
135
+ enableKeyboardShortcuts = true,
136
+ emptyRenderer,
137
+ errorRenderer,
138
+ searchInputProps
139
+ }) => {
140
+ const { t } = useParrotTranslation();
141
+ const terminalContainerRef = useRef(null);
142
+ const terminalRef = useRef({ enableKeyboardShortcuts });
143
+ terminalRef.current.enableKeyboardShortcuts = enableKeyboardShortcuts;
144
+ const [readyTerminal, setReadyTerminal] = useState(null);
145
+ const [hasData, setHasData] = useState(!!content);
146
+ const [searchCount, setSearchCount] = useState(0);
147
+ const [current, setCurrent] = useState(1);
148
+ const [eventSourceError, setEventSourceError] = useState(null);
149
+ useEffect(() => {
150
+ var _a;
151
+ if (!terminalContainerRef.current)
152
+ return;
153
+ const terminal = new Terminal({
154
+ fontFamily: "Roboto Mono, monospace",
155
+ fontSize: 12,
156
+ scrollOnUserInput: false,
157
+ lineHeight: 1.5,
158
+ theme: {
159
+ background: "#00122E",
160
+ foreground: "#FFFFFF",
161
+ cursor: "#FFFFFF"
162
+ },
163
+ rows,
164
+ convertEol: true,
165
+ cursorBlink: false,
166
+ disableStdin: true,
167
+ allowProposedApi: true,
168
+ scrollback
169
+ });
170
+ terminal.attachCustomKeyEventHandler((event) => {
171
+ if (!terminalRef.current.enableKeyboardShortcuts)
172
+ return true;
173
+ const target = event.target;
174
+ const isXtermEvent = target instanceof HTMLElement && target.closest(".xterm");
175
+ if (!isXtermEvent)
176
+ return true;
177
+ const shortcuts = isMacOS() ? customShortcutsForMac : customShortcutsForWin;
178
+ if (event.type === "keydown" && isCustomKeyboardAction(event, shortcuts)) {
179
+ event.stopPropagation();
180
+ event.preventDefault();
181
+ const keyActions = {
182
+ arrowup: () => scrollLines("up", terminal),
183
+ arrowdown: () => scrollLines("down", terminal),
184
+ pageup: () => scrollPages("up", terminal),
185
+ pagedown: () => scrollPages("down", terminal),
186
+ c: () => copySelectLines(terminal),
187
+ a: () => selectAll(terminal)
188
+ };
189
+ const action = keyActions[event.key.toLowerCase()];
190
+ if (action)
191
+ action();
192
+ return false;
193
+ }
194
+ return true;
195
+ });
196
+ const search = new SearchAddon({
197
+ highlightLimit: searchHighlightLimit
198
+ });
199
+ terminal.loadAddon(search);
200
+ const fit = new FitAddon();
201
+ terminal.loadAddon(fit);
202
+ terminalRef.current = {
203
+ searchAddon: search,
204
+ fitAddon: fit
205
+ };
206
+ terminal.open(terminalContainerRef.current);
207
+ setReadyTerminal(terminal);
208
+ try {
209
+ fit.fit();
210
+ } catch (e) {
211
+ console.error("Error fitting terminal:", e);
212
+ }
213
+ if (content) {
214
+ terminal.write(content);
215
+ terminalRef.current.previousContent = content;
216
+ setHasData(true);
217
+ } else {
218
+ setHasData(false);
219
+ }
220
+ (_a = terminalRef.current.searchAddon) == null ? void 0 : _a.onDidChangeResults(
221
+ ({ resultCount, resultIndex }) => {
222
+ setSearchCount(resultCount);
223
+ setCurrent(resultIndex + 1);
224
+ }
225
+ );
226
+ return () => {
227
+ terminal.dispose();
228
+ };
229
+ }, [rows, scrollback, searchHighlightLimit]);
230
+ useEffect(() => {
231
+ if (!readyTerminal || !terminalContainerRef.current)
232
+ return;
233
+ const fitTerminal = () => {
234
+ var _a;
235
+ if ((_a = terminalRef.current) == null ? void 0 : _a.fitAddon)
236
+ try {
237
+ terminalRef.current.fitAddon.fit();
238
+ } catch (e) {
239
+ console.error("Error resizing terminal:", e);
240
+ }
241
+ };
242
+ if (typeof ResizeObserver !== "undefined") {
243
+ const resizeObserver = new ResizeObserver(fitTerminal);
244
+ resizeObserver.observe(terminalContainerRef.current);
245
+ return () => {
246
+ resizeObserver.disconnect();
247
+ };
248
+ }
249
+ window.addEventListener("resize", fitTerminal);
250
+ return () => {
251
+ window.removeEventListener("resize", fitTerminal);
252
+ };
253
+ }, [readyTerminal]);
254
+ useEffect(() => {
255
+ var _a;
256
+ if (!readyTerminal)
257
+ return;
258
+ if (content) {
259
+ const previousContent = (_a = terminalRef.current) == null ? void 0 : _a.previousContent;
260
+ if (content !== previousContent) {
261
+ if (previousContent && content.startsWith(previousContent)) {
262
+ const appendedContent = content.slice(previousContent.length);
263
+ if (appendedContent)
264
+ readyTerminal.write(appendedContent);
265
+ } else {
266
+ readyTerminal.clear();
267
+ readyTerminal.write(content);
268
+ }
269
+ }
270
+ terminalRef.current = __spreadProps(__spreadValues({}, terminalRef.current), {
271
+ previousContent: content
272
+ });
273
+ setHasData(true);
274
+ } else if (!eventSource) {
275
+ readyTerminal.clear();
276
+ terminalRef.current = __spreadProps(__spreadValues({}, terminalRef.current), { previousContent: "" });
277
+ setHasData(false);
278
+ }
279
+ }, [readyTerminal, content, eventSource]);
280
+ const { searchNext, searchPrevious } = useMemo(() => {
281
+ const searchOptions = {
282
+ caseSensitive: false,
283
+ decorations: {
284
+ activeMatchColorOverviewRuler: "#000000",
285
+ matchOverviewRuler: "#000000",
286
+ activeMatchBackground: Color.chart.yellow["yellow-5"],
287
+ matchBackground: Color.chart.yellow["yellow-1"]
288
+ }
289
+ };
290
+ return {
291
+ searchNext: (search) => {
292
+ var _a, _b;
293
+ (_b = (_a = terminalRef.current) == null ? void 0 : _a.searchAddon) == null ? void 0 : _b.findNext(search || "", searchOptions);
294
+ },
295
+ searchPrevious: (search) => {
296
+ var _a, _b;
297
+ (_b = (_a = terminalRef.current) == null ? void 0 : _a.searchAddon) == null ? void 0 : _b.findPrevious(
298
+ search || "",
299
+ searchOptions
300
+ );
301
+ }
302
+ };
303
+ }, []);
304
+ const { reconnectFnRef: eventSourceReconnectFnRef } = useLogViewEventSource({
305
+ enabled: eventSource,
306
+ terminal: readyTerminal,
307
+ options: eventSourceOptions,
308
+ setHasData,
309
+ setEventSourceError
310
+ });
311
+ const reconnect = useCallback(() => {
312
+ if (eventSourceReconnectFnRef.current) {
313
+ setEventSourceError(null);
314
+ eventSourceReconnectFnRef.current();
315
+ }
316
+ }, []);
317
+ const renderCustomContent = () => {
318
+ if (eventSourceError && errorRenderer && readyTerminal)
319
+ return /* @__PURE__ */ React__default.createElement(CustomContentOverlay, null, errorRenderer(readyTerminal, eventSourceError, reconnect));
320
+ if (!hasData && emptyRenderer && readyTerminal)
321
+ return /* @__PURE__ */ React__default.createElement(CustomContentOverlay, null, emptyRenderer(readyTerminal));
322
+ return null;
323
+ };
324
+ return /* @__PURE__ */ React__default.createElement(LogViewContainer, { className: cx("log-view-container", className) }, /* @__PURE__ */ React__default.createElement(LogViewInnerContaier, { className: "log-view-inner-container" }, /* @__PURE__ */ React__default.createElement(Show, { condition: showSearch }, /* @__PURE__ */ React__default.createElement(
325
+ SearchInput,
326
+ __spreadValues({
327
+ type: "text",
328
+ className: SearchInputStyle,
329
+ width: "100%",
330
+ debounceWait: 100,
331
+ placeholder: t("common.search_log"),
332
+ searchIcon: Search16OntintIcon,
333
+ prefixIcon: ArrowChevronUp16OntintIcon,
334
+ prefixHoverIcon: ArrowChevronUp16BlueIcon,
335
+ nextIcon: ArrowChevronDown16OntintIcon,
336
+ nextHoverIcon: ArrowChevronDown16BlueIcon,
337
+ clearIcon: XmarkCloseCircleFill16OntintIcon,
338
+ clearHoverIcon: XmarkCloseCircleFill16OntintLightIcon,
339
+ total: searchCount,
340
+ current,
341
+ onChange: searchNext,
342
+ onSearchNext: searchNext,
343
+ onSearchPrev: searchPrevious
344
+ }, searchInputProps)
345
+ )), /* @__PURE__ */ React__default.createElement(LogTerminal, { className: "log-terminal", ref: terminalContainerRef }, renderCustomContent())));
346
+ };
347
+
348
+ export { LogView };
@@ -0,0 +1,25 @@
1
+ import { styled } from '@linaria/react';
2
+
3
+ const LogViewContainer = /*#__PURE__*/styled('div')({
4
+ name: "LogViewContainer",
5
+ class: "E_4100_0_3_l1v1luhz",
6
+ propsAsIs: false
7
+ });
8
+ const LogViewInnerContaier = /*#__PURE__*/styled('div')({
9
+ name: "LogViewInnerContaier",
10
+ class: "E_4100_0_3_lranxiw",
11
+ propsAsIs: false
12
+ });
13
+ const LogTerminal = /*#__PURE__*/styled('div')({
14
+ name: "LogTerminal",
15
+ class: "E_4100_0_3_l1y3zqy5",
16
+ propsAsIs: false
17
+ });
18
+ const CustomContentOverlay = /*#__PURE__*/styled('div')({
19
+ name: "CustomContentOverlay",
20
+ class: "E_4100_0_3_c1x4mn5u",
21
+ propsAsIs: false
22
+ });
23
+ const SearchInputStyle = "E_4100_0_3_s4pilip";
24
+
25
+ export { CustomContentOverlay, LogTerminal, LogViewContainer, LogViewInnerContaier, SearchInputStyle };
@@ -0,0 +1,144 @@
1
+ import { EventSource } from 'eventsource';
2
+
3
+ var __defProp = Object.defineProperty;
4
+ var __defProps = Object.defineProperties;
5
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
6
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
9
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
10
+ var __spreadValues = (a, b) => {
11
+ for (var prop in b || (b = {}))
12
+ if (__hasOwnProp.call(b, prop))
13
+ __defNormalProp(a, prop, b[prop]);
14
+ if (__getOwnPropSymbols)
15
+ for (var prop of __getOwnPropSymbols(b)) {
16
+ if (__propIsEnum.call(b, prop))
17
+ __defNormalProp(a, prop, b[prop]);
18
+ }
19
+ return a;
20
+ };
21
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
22
+ const eventsource = (url, options, terminal) => {
23
+ const {
24
+ initOptions,
25
+ onOpen,
26
+ onClose,
27
+ onError,
28
+ formatMessage,
29
+ closeEventName = "close",
30
+ openEventName = "open",
31
+ errorEventName = "error",
32
+ messageEventName = "message",
33
+ onMessage
34
+ } = options;
35
+ let aborted = false;
36
+ let eventSource = null;
37
+ const close = () => {
38
+ aborted = true;
39
+ if (eventSource) {
40
+ eventSource.close();
41
+ eventSource = null;
42
+ }
43
+ };
44
+ const start = () => {
45
+ var _a;
46
+ try {
47
+ eventSource = new EventSource(url, initOptions);
48
+ eventSource.addEventListener(openEventName, (e) => {
49
+ onOpen && onOpen(e, eventSource, {
50
+ terminal
51
+ });
52
+ });
53
+ eventSource.addEventListener(errorEventName, (err) => {
54
+ var _a2;
55
+ onError && onError(err);
56
+ if (!aborted && options.reconnect && (eventSource == null ? void 0 : eventSource.readyState) === EventSource.CLOSED) {
57
+ const timeout = (_a2 = options.reconnectWait) != null ? _a2 : 1;
58
+ setTimeout(start, timeout * 1e3);
59
+ }
60
+ });
61
+ eventSource.addEventListener(messageEventName, (e) => {
62
+ onMessage && onMessage(e);
63
+ let msg = formatMessage ? formatMessage(e.data) : e.data;
64
+ if (typeof msg !== "string") {
65
+ return;
66
+ }
67
+ msg = msg.endsWith("\n") ? msg : `${msg}
68
+ `;
69
+ terminal.write(msg);
70
+ });
71
+ eventSource.addEventListener(closeEventName, (e) => {
72
+ var _a2;
73
+ onClose == null ? void 0 : onClose(e);
74
+ close();
75
+ if (!aborted && options.reconnect) {
76
+ const timeout = (_a2 = options.reconnectWait) != null ? _a2 : 1;
77
+ setTimeout(start, timeout * 1e3);
78
+ }
79
+ });
80
+ } catch (err) {
81
+ console.error("Error connecting to EventSource:", err);
82
+ if (!aborted && options.reconnect) {
83
+ const timeout = (_a = options.reconnectWait) != null ? _a : 1;
84
+ setTimeout(start, timeout * 1e3);
85
+ }
86
+ }
87
+ };
88
+ start();
89
+ return close;
90
+ };
91
+ const macBasic = {
92
+ ctrlKey: false,
93
+ shiftKey: false
94
+ };
95
+ const customShortcutsForMac = [
96
+ __spreadProps(__spreadValues({}, macBasic), { metaKey: false, key: "arrowup" }),
97
+ __spreadProps(__spreadValues({}, macBasic), { metaKey: false, key: "arrowdown" }),
98
+ __spreadProps(__spreadValues({}, macBasic), { metaKey: false, key: "pageup" }),
99
+ __spreadProps(__spreadValues({}, macBasic), { metaKey: false, key: "pagedown" }),
100
+ __spreadProps(__spreadValues({}, macBasic), { metaKey: true, key: "c" }),
101
+ __spreadProps(__spreadValues({}, macBasic), { metaKey: true, key: "a" })
102
+ ];
103
+ const winBasic = {
104
+ metaKey: false,
105
+ shiftKey: false
106
+ };
107
+ const customShortcutsForWin = [
108
+ __spreadProps(__spreadValues({}, winBasic), { ctrlKey: false, key: "pageup" }),
109
+ __spreadProps(__spreadValues({}, winBasic), { ctrlKey: false, key: "pagedown" }),
110
+ __spreadProps(__spreadValues({}, winBasic), { ctrlKey: true, key: "arrowup" }),
111
+ __spreadProps(__spreadValues({}, winBasic), { ctrlKey: true, key: "arrowdown" }),
112
+ __spreadProps(__spreadValues({}, winBasic), { ctrlKey: true, key: "c" }),
113
+ __spreadProps(__spreadValues({}, winBasic), { ctrlKey: true, key: "a" })
114
+ ];
115
+ const isCustomKeyboardAction = (event, actions) => actions.some(
116
+ (a) => a.ctrlKey === event.ctrlKey && a.shiftKey == event.shiftKey && a.metaKey === event.metaKey && a.key.toLocaleLowerCase() === event.key.toLocaleLowerCase()
117
+ );
118
+ const isMacOS = () => {
119
+ return navigator.platform.indexOf("Mac") !== -1 || navigator.userAgent.indexOf("Mac") !== -1;
120
+ };
121
+ const scrollPages = (direction, terminal) => {
122
+ if (terminal) {
123
+ const pageCount = direction === "up" ? -1 : 1;
124
+ terminal.scrollPages(pageCount);
125
+ }
126
+ };
127
+ const scrollLines = (direction, terminal) => {
128
+ if (terminal) {
129
+ const lineCount = direction === "up" ? -1 : 1;
130
+ terminal.scrollLines(lineCount);
131
+ }
132
+ };
133
+ const selectAll = (terminal) => {
134
+ if (terminal) {
135
+ terminal.selectAll();
136
+ }
137
+ };
138
+ const copySelectLines = (terminal) => {
139
+ if (terminal) {
140
+ navigator.clipboard.writeText(terminal.getSelection());
141
+ }
142
+ };
143
+
144
+ export { copySelectLines, customShortcutsForMac, customShortcutsForWin, eventsource, isCustomKeyboardAction, isMacOS, scrollLines, scrollPages, selectAll };
@@ -28,7 +28,7 @@ var __objRest = (source, exclude) => {
28
28
  }
29
29
  return target;
30
30
  };
31
- const MediumDialogStyle = "E_m5foqp8";
31
+ const MediumDialogStyle = "E_4100_0_3_m5foqp8";
32
32
  const MediumDialog = _a => {
33
33
  var _b = _a,
34
34
  {
@@ -1,23 +1,23 @@
1
1
  import { styled } from '@linaria/react';
2
2
 
3
- const MetricLegendTabStyle = "E_mp64wfi";
4
- const LegendStyle = "E_l1oyigan";
5
- const LegendItemStyle = "E_l1noi4n1";
6
- const ColorBlockStyle = "E_cz19rz6";
7
- const ExtraResource = "E_e17r5r9c";
3
+ const MetricLegendTabStyle = "E_4100_0_3_mp64wfi";
4
+ const LegendStyle = "E_4100_0_3_l1oyigan";
5
+ const LegendItemStyle = "E_4100_0_3_l1noi4n1";
6
+ const ColorBlockStyle = "E_4100_0_3_cz19rz6";
7
+ const ExtraResource = "E_4100_0_3_e17r5r9c";
8
8
  const MetricWrapper = /*#__PURE__*/styled('div')({
9
9
  name: "MetricWrapper",
10
- class: "E_m1y1hhnr",
10
+ class: "E_4100_0_3_m1y1hhnr",
11
11
  propsAsIs: false
12
12
  });
13
13
  const TooltipWrapper = /*#__PURE__*/styled('div')({
14
14
  name: "TooltipWrapper",
15
- class: "E_tnvijvs",
15
+ class: "E_4100_0_3_tnvijvs",
16
16
  propsAsIs: false
17
17
  });
18
18
  const TooltipColumn = /*#__PURE__*/styled('div')({
19
19
  name: "TooltipColumn",
20
- class: "E_t1ub2aex",
20
+ class: "E_4100_0_3_t1ub2aex",
21
21
  propsAsIs: false
22
22
  });
23
23
 
@@ -3,7 +3,7 @@ import React__default from 'react';
3
3
  import { Typo } from '../Typo/index.js';
4
4
  import { Header, NavCenterStyle } from './style.js';
5
5
 
6
- const MinWidth = "E_m196gn1d";
6
+ const MinWidth = "E_4100_0_3_m196gn1d";
7
7
  const Nav = ({
8
8
  left,
9
9
  right,
@@ -2,9 +2,9 @@ import { styled } from '@linaria/react';
2
2
 
3
3
  const Header = /*#__PURE__*/styled('header')({
4
4
  name: "Header",
5
- class: "E_h12yihis",
5
+ class: "E_4100_0_3_h12yihis",
6
6
  propsAsIs: false
7
7
  });
8
- const NavCenterStyle = "E_ncaepor";
8
+ const NavCenterStyle = "E_4100_0_3_ncaepor";
9
9
 
10
10
  export { Header, NavCenterStyle };
@@ -2,8 +2,8 @@ import cs from 'classnames';
2
2
  import React__default, { useRef, useState, useCallback, useLayoutEffect } from 'react';
3
3
  import useElementResize from '../../hooks/useElementResize.js';
4
4
 
5
- const OverflowWrapper = "E_owd0kml";
6
- const HiddenStyle = "E_h1jsgezc";
5
+ const OverflowWrapper = "E_4100_0_3_owd0kml";
6
+ const HiddenStyle = "E_4100_0_3_h1jsgezc";
7
7
  const Overflow = props => {
8
8
  const {
9
9
  children,
@@ -6,8 +6,8 @@ import { Dropdown, Menu } from 'antd';
6
6
  import cs from 'classnames';
7
7
  import React__default, { useRef, useEffect, useMemo } from 'react';
8
8
 
9
- const PaginationStyle = "E_phljevk";
10
- const DropdownOverlayStyle = "E_d12rtyeg";
9
+ const PaginationStyle = "E_4100_0_3_phljevk";
10
+ const DropdownOverlayStyle = "E_4100_0_3_d12rtyeg";
11
11
  const Pagination = props => {
12
12
  const {
13
13
  current,
@@ -42,7 +42,7 @@ const _exp = /*#__PURE__*/() => ({
42
42
  }) => color || "";
43
43
  const IconFieldText = /*#__PURE__*/styled('div')({
44
44
  name: "IconFieldText",
45
- class: "E_i14c7jc8",
45
+ class: "E_4100_0_3_i14c7jc8",
46
46
  propsAsIs: false,
47
47
  vars: {
48
48
  "i14c7jc8-0": [_exp()]
@@ -59,7 +59,7 @@ const StatusIconMap = {
59
59
  };
60
60
  const IconFieldWrapper = /*#__PURE__*/styled('div')({
61
61
  name: "IconFieldWrapper",
62
- class: "E_i1ibuolf",
62
+ class: "E_4100_0_3_i1ibuolf",
63
63
  propsAsIs: false
64
64
  });
65
65
  const IconField = _a => {
@@ -39,7 +39,7 @@ var __objRest = (source, exclude) => {
39
39
  };
40
40
  const Row = /*#__PURE__*/styled('div')({
41
41
  name: "Row",
42
- class: "E_r77hffu",
42
+ class: "E_4100_0_3_r77hffu",
43
43
  propsAsIs: false
44
44
  });
45
45
  const _exp = /*#__PURE__*/() => ({
@@ -47,7 +47,7 @@ const _exp = /*#__PURE__*/() => ({
47
47
  }) => type === "rich" ? "6px" : "4px";
48
48
  const ProgressContainer = /*#__PURE__*/styled('div')({
49
49
  name: "ProgressContainer",
50
- class: "E_p1cmxsf7",
50
+ class: "E_4100_0_3_p1cmxsf7",
51
51
  propsAsIs: false,
52
52
  vars: {
53
53
  "p1cmxsf7-0": [_exp()]
@@ -1,6 +1,6 @@
1
- const DescriptionStyle = "E_d1u4ndxc";
2
- const FlexFullContentStyle = "E_f6xb0iv";
3
- const BaseProgressStyle = "E_b1dhu7ov";
4
- const ProgressStyle = "E_p1as1j2z";
1
+ const DescriptionStyle = "E_4100_0_3_d1u4ndxc";
2
+ const FlexFullContentStyle = "E_4100_0_3_f6xb0iv";
3
+ const BaseProgressStyle = "E_4100_0_3_b1dhu7ov";
4
+ const ProgressStyle = "E_4100_0_3_p1as1j2z";
5
5
 
6
6
  export { BaseProgressStyle, DescriptionStyle, FlexFullContentStyle, ProgressStyle };
@@ -33,11 +33,11 @@ var __objRest = (source, exclude) => {
33
33
  }
34
34
  return target;
35
35
  };
36
- const titleAreaStyle = "E_t1gvlxt5";
36
+ const titleAreaStyle = "E_4100_0_3_t1gvlxt5";
37
37
  const _exp2 = /*#__PURE__*/() => props => props.gap;
38
38
  const AreaWrapper = /*#__PURE__*/styled('div')({
39
39
  name: "AreaWrapper",
40
- class: "E_a1ji6r68",
40
+ class: "E_4100_0_3_a1ji6r68",
41
41
  propsAsIs: false,
42
42
  vars: {
43
43
  "a1ji6r68-0": [_exp2(), "px"]
@@ -30,9 +30,9 @@ var __objRest = (source, exclude) => {
30
30
  }
31
31
  return target;
32
32
  };
33
- const RadioStyle = "E_rapgekc";
34
- const RadioGroupStyle = "E_rp906go";
35
- const RadioButtonStyle = "E_rcc63c8";
33
+ const RadioStyle = "E_4100_0_3_rapgekc";
34
+ const RadioGroupStyle = "E_4100_0_3_rp906go";
35
+ const RadioButtonStyle = "E_4100_0_3_rcc63c8";
36
36
  const KitRadioGroupContext = React__default.createContext({});
37
37
  const Radio = _a => {
38
38
  var _b = _a,