@alauda/console-events 0.0.0-stage → 0.1.0-next.20261204.1796373547
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/README.md +32 -2
- package/index.d.ts +70 -0
- package/index.js +504 -0
- package/index.js.map +1 -0
- package/package.json +39 -4
package/README.md
CHANGED
|
@@ -1,3 +1,33 @@
|
|
|
1
|
-
#
|
|
1
|
+
# `@alauda/console-events`
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
`@alauda/console-events` 是可发布的关系感知实时事件 Feed。源码 workspace 保持 private;
|
|
4
|
+
`yarn build:npm` 生成 `dist/package/`,并由现有 registry 发布清单选择。它不是 Module Federation
|
|
5
|
+
shared singleton,也不进入 Host 产品镜像。
|
|
6
|
+
|
|
7
|
+
公共合同见 [`ui.console-events-public-surface`](../../docs/specs/50-ui/console-events-public-surface.md)。
|
|
8
|
+
只从包根入口导入:
|
|
9
|
+
|
|
10
|
+
```tsx
|
|
11
|
+
import {
|
|
12
|
+
K8sRealtimeEventFeed,
|
|
13
|
+
defaultK8sRealtimeEventMessages,
|
|
14
|
+
labelsToSelector,
|
|
15
|
+
realtimeAllEventsHref,
|
|
16
|
+
type K8sRealtimeEventMessages,
|
|
17
|
+
type RealtimeAllEventsTarget,
|
|
18
|
+
type RealtimeEvent,
|
|
19
|
+
type RelatedObjectMap,
|
|
20
|
+
} from '@alauda/console-events';
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
不要从 `src/**` 或 `dist/**` 深层导入。组件拥有 Event/Pod live query、Deployment ReplicaSet 关联、
|
|
24
|
+
排序、500 条上限、`fieldSelector` 优先级和只读 JSON 详情。调用方拥有路由和权限。`realtimeAllEventsHref` 只按调用方给出的 scope 格式化 All Events 地址。
|
|
25
|
+
|
|
26
|
+
事件专属文案使用包内英文默认值。可选 `messages` 按字段浅合并覆盖。`common.retry` 与
|
|
27
|
+
`yamlEditor.*` 只读取 Host shared catalog,不通过 `messages` 复制。仓内页面不传 `messages`。
|
|
28
|
+
connecting、relisting、polling 和后台 refetch 保持静默;只有初次失败和 watch 降级显示 Retry。
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
yarn build:npm --package @alauda/console-events
|
|
32
|
+
yarn check:npm --package @alauda/console-events
|
|
33
|
+
```
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import type { K8sResource } from '@alauda/core-plugin-sdk';
|
|
3
|
+
|
|
4
|
+
export declare const defaultK8sRealtimeEventMessages: K8sRealtimeEventMessages;
|
|
5
|
+
|
|
6
|
+
export declare const K8sRealtimeEventFeed: FC<K8sRealtimeEventFeedProps>;
|
|
7
|
+
|
|
8
|
+
export declare interface K8sRealtimeEventFeedProps {
|
|
9
|
+
readonly cluster: string;
|
|
10
|
+
readonly namespace: string;
|
|
11
|
+
readonly invokedObjects?: RelatedObjectMap;
|
|
12
|
+
readonly podMatchLabels?: Readonly<Record<string, string>>;
|
|
13
|
+
readonly podLabelSelector?: string;
|
|
14
|
+
/** Direct involved-object selector; when provided it takes priority over Pod relation discovery. */
|
|
15
|
+
readonly fieldSelector?: string;
|
|
16
|
+
readonly allEventsHref?: string;
|
|
17
|
+
readonly allEventsUnavailableReason?: string;
|
|
18
|
+
/** Resource adapters can reject stale identities before sorting and applying the display limit. */
|
|
19
|
+
readonly filterEvent?: (event: RealtimeEvent) => boolean;
|
|
20
|
+
readonly maxEvents?: number;
|
|
21
|
+
readonly messages?: Partial<K8sRealtimeEventMessages>;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export declare interface K8sRealtimeEventMessages {
|
|
25
|
+
readonly allEvents: string;
|
|
26
|
+
readonly latestEventsPrefix: string;
|
|
27
|
+
readonly latestEventsSuffix: string;
|
|
28
|
+
readonly eventDetails: string;
|
|
29
|
+
readonly noData: string;
|
|
30
|
+
readonly resource: string;
|
|
31
|
+
readonly eventOccurrences: (count: number, time: string) => string;
|
|
32
|
+
readonly viewEventDetails: (reason: string) => string;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export declare function labelsToSelector(labels: Readonly<Record<string, string>> | undefined): string | undefined;
|
|
36
|
+
|
|
37
|
+
/** Formats the legacy All Events destination. Callers still decide whether navigation is allowed. */
|
|
38
|
+
export declare function realtimeAllEventsHref(target: RealtimeAllEventsTarget): string | undefined;
|
|
39
|
+
|
|
40
|
+
export declare interface RealtimeAllEventsTarget {
|
|
41
|
+
readonly view: 'applications' | 'clusters';
|
|
42
|
+
readonly project?: string;
|
|
43
|
+
readonly cluster: string;
|
|
44
|
+
readonly namespace?: string;
|
|
45
|
+
readonly kind?: string;
|
|
46
|
+
readonly names?: readonly string[];
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export declare interface RealtimeEvent extends K8sResource {
|
|
50
|
+
readonly type?: 'Normal' | 'Warning' | string;
|
|
51
|
+
readonly reason?: string;
|
|
52
|
+
readonly message?: string;
|
|
53
|
+
readonly count?: number;
|
|
54
|
+
readonly firstTimestamp?: string;
|
|
55
|
+
readonly lastTimestamp?: string;
|
|
56
|
+
readonly eventTime?: string;
|
|
57
|
+
readonly series?: {
|
|
58
|
+
readonly lastObservedTime?: string;
|
|
59
|
+
};
|
|
60
|
+
readonly involvedObject?: {
|
|
61
|
+
readonly apiVersion?: string;
|
|
62
|
+
readonly kind?: string;
|
|
63
|
+
readonly name?: string;
|
|
64
|
+
readonly uid?: string;
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export declare type RelatedObjectMap = Readonly<Record<string, readonly string[]>>;
|
|
69
|
+
|
|
70
|
+
export { }
|
package/index.js
ADDED
|
@@ -0,0 +1,504 @@
|
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo, useRef, useState } from "react";
|
|
3
|
+
import DescriptionOutlined from "@mui/icons-material/DescriptionOutlined";
|
|
4
|
+
import OpenInNewRounded from "@mui/icons-material/OpenInNewRounded";
|
|
5
|
+
import ScheduleRounded from "@mui/icons-material/ScheduleRounded";
|
|
6
|
+
import { Alert, Box, Button, Dialog, DialogContent, IconButton, Link, Paper, Stack, Tooltip, Typography } from "@mui/material";
|
|
7
|
+
import { CodeEditor } from "@alauda/react-code-editor";
|
|
8
|
+
import { AsyncBoundary, InfoNotice, ModalDialogTitle, ResourceKindBadge, ResourceStatus, adaptResourceTableListState, formatLocalDateTime } from "@alauda/console-ui";
|
|
9
|
+
import { POD_DESCRIPTOR, Theme, useK8sResourceListLiveQuery, useSharedTranslation } from "@alauda/core-plugin-sdk";
|
|
10
|
+
function mergeRelatedObjects(invokedObjects, pods) {
|
|
11
|
+
const merged = new Map();
|
|
12
|
+
for (const [kind, names] of Object.entries(invokedObjects ?? {}))merged.set(kind, new Set(names.filter(Boolean)));
|
|
13
|
+
const podNames = pods.map((pod)=>pod.metadata?.name).filter((name)=>Boolean(name));
|
|
14
|
+
if (podNames.length) {
|
|
15
|
+
const names = merged.get('Pod') ?? new Set();
|
|
16
|
+
podNames.forEach((name)=>names.add(name));
|
|
17
|
+
merged.set('Pod', names);
|
|
18
|
+
}
|
|
19
|
+
return Object.fromEntries([
|
|
20
|
+
...merged.entries()
|
|
21
|
+
].map(([kind, names])=>[
|
|
22
|
+
kind,
|
|
23
|
+
[
|
|
24
|
+
...names
|
|
25
|
+
]
|
|
26
|
+
]));
|
|
27
|
+
}
|
|
28
|
+
function replicaSetParentName(name) {
|
|
29
|
+
const parts = name.split('-');
|
|
30
|
+
return parts.length > 1 ? parts.slice(0, -1).join('-') : void 0;
|
|
31
|
+
}
|
|
32
|
+
function isRelatedEvent(event, relatedObjects) {
|
|
33
|
+
const kind = event.involvedObject?.kind;
|
|
34
|
+
const name = event.involvedObject?.name;
|
|
35
|
+
if (!kind || !name) return false;
|
|
36
|
+
if (relatedObjects[kind]?.includes(name)) return true;
|
|
37
|
+
if ('ReplicaSet' !== kind) return false;
|
|
38
|
+
const parent = replicaSetParentName(name);
|
|
39
|
+
return Boolean(parent && relatedObjects.Deployment?.includes(parent));
|
|
40
|
+
}
|
|
41
|
+
function eventFirstTime(event) {
|
|
42
|
+
const creationTimestamp = 'string' == typeof event.metadata?.creationTimestamp ? event.metadata.creationTimestamp : void 0;
|
|
43
|
+
return event.firstTimestamp ?? event.eventTime ?? creationTimestamp;
|
|
44
|
+
}
|
|
45
|
+
function eventLastTime(event) {
|
|
46
|
+
const creationTimestamp = 'string' == typeof event.metadata?.creationTimestamp ? event.metadata.creationTimestamp : void 0;
|
|
47
|
+
return event.lastTimestamp ?? event.series?.lastObservedTime ?? event.eventTime ?? creationTimestamp;
|
|
48
|
+
}
|
|
49
|
+
function eventName(event) {
|
|
50
|
+
return event.metadata?.name ?? event.involvedObject?.name ?? '';
|
|
51
|
+
}
|
|
52
|
+
function sortRealtimeEvents(events) {
|
|
53
|
+
return [
|
|
54
|
+
...events
|
|
55
|
+
].sort((left, right)=>{
|
|
56
|
+
const last = String(eventLastTime(right) ?? '').localeCompare(String(eventLastTime(left) ?? ''));
|
|
57
|
+
if (0 !== last) return last;
|
|
58
|
+
const first = String(eventFirstTime(right) ?? '').localeCompare(String(eventFirstTime(left) ?? ''));
|
|
59
|
+
if (0 !== first) return first;
|
|
60
|
+
return eventName(left).localeCompare(eventName(right));
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
function selectRelatedRealtimeEvents(events, relatedObjects, maxEvents = 500) {
|
|
64
|
+
const filtered = Object.keys(relatedObjects).length ? events.filter((event)=>isRelatedEvent(event, relatedObjects)) : [
|
|
65
|
+
...events
|
|
66
|
+
];
|
|
67
|
+
return sortRealtimeEvents(filtered).slice(0, maxEvents);
|
|
68
|
+
}
|
|
69
|
+
function labelsToSelector(labels) {
|
|
70
|
+
if (!labels) return;
|
|
71
|
+
const entries = Object.entries(labels).filter(([key, value])=>key && void 0 !== value);
|
|
72
|
+
return entries.length ? entries.sort(([left], [right])=>left.localeCompare(right)).map(([key, value])=>`${key}=${value}`).join(',') : void 0;
|
|
73
|
+
}
|
|
74
|
+
function fill(template, values) {
|
|
75
|
+
return template.replace(/\{\{\s*([A-Za-z0-9_]+)\s*\}\}/gu, (_match, key)=>String(values[key] ?? ''));
|
|
76
|
+
}
|
|
77
|
+
const defaultK8sRealtimeEventMessages = {
|
|
78
|
+
allEvents: 'All Events',
|
|
79
|
+
latestEventsPrefix: 'The current page only displays the latest 500 event information. If you need to view more and more detailed event information, please check through the',
|
|
80
|
+
latestEventsSuffix: 'page.',
|
|
81
|
+
eventDetails: 'Event details',
|
|
82
|
+
noData: 'No data',
|
|
83
|
+
resource: 'Resource',
|
|
84
|
+
eventOccurrences: (count, time)=>fill('{{count}} occurrences, first seen {{time}}', {
|
|
85
|
+
count,
|
|
86
|
+
time
|
|
87
|
+
}),
|
|
88
|
+
viewEventDetails: (reason)=>fill('View event details: {{reason}}', {
|
|
89
|
+
reason
|
|
90
|
+
})
|
|
91
|
+
};
|
|
92
|
+
const EVENT_DESCRIPTOR = {
|
|
93
|
+
group: '',
|
|
94
|
+
version: 'v1',
|
|
95
|
+
kind: 'Event',
|
|
96
|
+
resource: 'events',
|
|
97
|
+
namespaced: true
|
|
98
|
+
};
|
|
99
|
+
function queryRefreshing(query, enabled) {
|
|
100
|
+
return enabled && (query.isPending || query.isFetching || 'connecting' === query.liveState || 'relisting' === query.liveState || 'polling' === query.liveState);
|
|
101
|
+
}
|
|
102
|
+
function EventLimitNotice({ href, unavailableReason, messages }) {
|
|
103
|
+
const link = href ? /*#__PURE__*/ jsxs(Link, {
|
|
104
|
+
href: href,
|
|
105
|
+
target: "_blank",
|
|
106
|
+
rel: "noreferrer",
|
|
107
|
+
sx: {
|
|
108
|
+
fontWeight: Theme.Typography.Button.FontWeight,
|
|
109
|
+
whiteSpace: 'nowrap'
|
|
110
|
+
},
|
|
111
|
+
children: [
|
|
112
|
+
messages.allEvents,
|
|
113
|
+
" ",
|
|
114
|
+
/*#__PURE__*/ jsx(OpenInNewRounded, {
|
|
115
|
+
sx: {
|
|
116
|
+
fontSize: Theme.Typography.Body.FontSize,
|
|
117
|
+
verticalAlign: 'text-bottom'
|
|
118
|
+
}
|
|
119
|
+
})
|
|
120
|
+
]
|
|
121
|
+
}) : /*#__PURE__*/ jsx(Button, {
|
|
122
|
+
disabled: true,
|
|
123
|
+
children: messages.allEvents
|
|
124
|
+
});
|
|
125
|
+
return /*#__PURE__*/ jsxs(InfoNotice, {
|
|
126
|
+
children: [
|
|
127
|
+
messages.latestEventsPrefix,
|
|
128
|
+
' ',
|
|
129
|
+
link,
|
|
130
|
+
' ',
|
|
131
|
+
messages.latestEventsSuffix,
|
|
132
|
+
unavailableReason ? /*#__PURE__*/ jsxs(Fragment, {
|
|
133
|
+
children: [
|
|
134
|
+
' ',
|
|
135
|
+
/*#__PURE__*/ jsx("span", {
|
|
136
|
+
children: unavailableReason
|
|
137
|
+
})
|
|
138
|
+
]
|
|
139
|
+
}) : null
|
|
140
|
+
]
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
function eventStatus(type) {
|
|
144
|
+
return {
|
|
145
|
+
key: type ?? 'unknown',
|
|
146
|
+
label: type ?? '-',
|
|
147
|
+
tone: 'Warning' === type ? 'warning' : 'success'
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
function ignoreReadOnlyEditorChange() {}
|
|
151
|
+
const K8sRealtimeEventFeed = ({ cluster, namespace, invokedObjects, podMatchLabels, podLabelSelector, fieldSelector, allEventsHref, allEventsUnavailableReason, filterEvent, maxEvents = 500, messages: messageOverrides })=>{
|
|
152
|
+
const { t } = useSharedTranslation();
|
|
153
|
+
const messages = {
|
|
154
|
+
...defaultK8sRealtimeEventMessages,
|
|
155
|
+
...messageOverrides
|
|
156
|
+
};
|
|
157
|
+
const editorLabels = useMemo(()=>({
|
|
158
|
+
copy: t('yamlEditor.copyComplete'),
|
|
159
|
+
copied: t('yamlEditor.copied'),
|
|
160
|
+
copyFailed: t('yamlEditor.copyFailed'),
|
|
161
|
+
find: t('yamlEditor.search'),
|
|
162
|
+
format: t('yamlEditor.format'),
|
|
163
|
+
fullscreen: t('yamlEditor.fullscreen'),
|
|
164
|
+
exitFullscreen: t('yamlEditor.exitFullscreen'),
|
|
165
|
+
undo: t('yamlEditor.undo'),
|
|
166
|
+
redo: t('yamlEditor.redo'),
|
|
167
|
+
loading: t('yamlEditor.loading'),
|
|
168
|
+
valid: t('yamlEditor.syntaxPassed'),
|
|
169
|
+
errors: (count)=>t('yamlEditor.diagnosticErrors', {
|
|
170
|
+
count
|
|
171
|
+
}),
|
|
172
|
+
lineColumn: (line, column)=>t('yamlEditor.cursorPosition', {
|
|
173
|
+
line,
|
|
174
|
+
column
|
|
175
|
+
})
|
|
176
|
+
}), [
|
|
177
|
+
t
|
|
178
|
+
]);
|
|
179
|
+
const podSelector = podLabelSelector ?? labelsToSelector(podMatchLabels);
|
|
180
|
+
const eventQuery = useK8sResourceListLiveQuery({
|
|
181
|
+
cluster,
|
|
182
|
+
namespace,
|
|
183
|
+
definition: EVENT_DESCRIPTOR,
|
|
184
|
+
query: {
|
|
185
|
+
...fieldSelector ? {
|
|
186
|
+
fieldSelector
|
|
187
|
+
} : {},
|
|
188
|
+
limit: String(maxEvents)
|
|
189
|
+
}
|
|
190
|
+
}, {
|
|
191
|
+
enabled: Boolean(cluster && namespace)
|
|
192
|
+
});
|
|
193
|
+
const podQuery = useK8sResourceListLiveQuery({
|
|
194
|
+
cluster,
|
|
195
|
+
namespace,
|
|
196
|
+
definition: POD_DESCRIPTOR,
|
|
197
|
+
query: podSelector ? {
|
|
198
|
+
labelSelector: podSelector
|
|
199
|
+
} : void 0
|
|
200
|
+
}, {
|
|
201
|
+
enabled: Boolean(cluster && namespace && podSelector && !fieldSelector)
|
|
202
|
+
});
|
|
203
|
+
const relatedObjects = useMemo(()=>fieldSelector ? {} : mergeRelatedObjects(invokedObjects, podQuery.data?.items ?? []), [
|
|
204
|
+
fieldSelector,
|
|
205
|
+
invokedObjects,
|
|
206
|
+
podQuery.data?.items
|
|
207
|
+
]);
|
|
208
|
+
const fetchedRows = useMemo(()=>selectRelatedRealtimeEvents(filterEvent ? (eventQuery.data?.items ?? []).filter(filterEvent) : eventQuery.data?.items ?? [], relatedObjects, maxEvents), [
|
|
209
|
+
eventQuery.data?.items,
|
|
210
|
+
filterEvent,
|
|
211
|
+
maxEvents,
|
|
212
|
+
relatedObjects
|
|
213
|
+
]);
|
|
214
|
+
const podEnabled = Boolean(podSelector && !fieldSelector);
|
|
215
|
+
const refreshing = queryRefreshing(eventQuery, Boolean(cluster && namespace)) || queryRefreshing(podQuery, Boolean(cluster && namespace && podEnabled));
|
|
216
|
+
const retainedRows = useRef(fetchedRows);
|
|
217
|
+
if (fetchedRows.length > 0) retainedRows.current = fetchedRows;
|
|
218
|
+
const rows = fetchedRows.length > 0 || !refreshing ? fetchedRows : retainedRows.current;
|
|
219
|
+
const queryError = eventQuery.error ?? (podEnabled ? podQuery.error : void 0);
|
|
220
|
+
const backgroundError = eventQuery.backgroundError ?? (podEnabled ? podQuery.backgroundError : void 0);
|
|
221
|
+
const listModel = adaptResourceTableListState({
|
|
222
|
+
rows,
|
|
223
|
+
isPending: 0 === rows.length && (eventQuery.isPending || podEnabled && podQuery.isPending),
|
|
224
|
+
isFetching: false,
|
|
225
|
+
error: rows.length > 0 ? void 0 : queryError,
|
|
226
|
+
backgroundError
|
|
227
|
+
});
|
|
228
|
+
const [selectedEvent, setSelectedEvent] = useState();
|
|
229
|
+
const retry = ()=>{
|
|
230
|
+
Promise.all([
|
|
231
|
+
eventQuery.refetch(),
|
|
232
|
+
podEnabled ? podQuery.refetch() : Promise.resolve()
|
|
233
|
+
]);
|
|
234
|
+
};
|
|
235
|
+
const state = cluster && namespace ? listModel.state : 'empty';
|
|
236
|
+
return /*#__PURE__*/ jsxs(Stack, {
|
|
237
|
+
sx: {
|
|
238
|
+
gap: Theme.Spacing.S,
|
|
239
|
+
minWidth: 0
|
|
240
|
+
},
|
|
241
|
+
children: [
|
|
242
|
+
/*#__PURE__*/ jsx(EventLimitNotice, {
|
|
243
|
+
href: allEventsHref,
|
|
244
|
+
unavailableReason: allEventsUnavailableReason,
|
|
245
|
+
messages: messages
|
|
246
|
+
}),
|
|
247
|
+
'initial-loading' === state ? /*#__PURE__*/ jsx(Box, {
|
|
248
|
+
"data-testid": "realtime-event-loading",
|
|
249
|
+
sx: {
|
|
250
|
+
p: Theme.Spacing.S,
|
|
251
|
+
bgcolor: Theme.Action.Hover,
|
|
252
|
+
borderRadius: Theme.Shape.Radius
|
|
253
|
+
},
|
|
254
|
+
children: /*#__PURE__*/ jsx(Paper, {
|
|
255
|
+
variant: "outlined",
|
|
256
|
+
sx: {
|
|
257
|
+
minHeight: 96,
|
|
258
|
+
display: 'flex',
|
|
259
|
+
alignItems: 'center',
|
|
260
|
+
justifyContent: 'center',
|
|
261
|
+
borderRadius: Theme.Shape.Radius
|
|
262
|
+
},
|
|
263
|
+
children: /*#__PURE__*/ jsx(AsyncBoundary, {
|
|
264
|
+
state: "loading"
|
|
265
|
+
})
|
|
266
|
+
})
|
|
267
|
+
}) : null,
|
|
268
|
+
'empty' === state ? /*#__PURE__*/ jsx(Box, {
|
|
269
|
+
"data-testid": "realtime-event-empty",
|
|
270
|
+
role: "status",
|
|
271
|
+
"aria-label": messages.noData,
|
|
272
|
+
sx: {
|
|
273
|
+
p: Theme.Spacing.S,
|
|
274
|
+
bgcolor: Theme.Action.Hover,
|
|
275
|
+
borderRadius: Theme.Shape.Radius
|
|
276
|
+
},
|
|
277
|
+
children: /*#__PURE__*/ jsx(Paper, {
|
|
278
|
+
"data-testid": "realtime-event-empty-panel",
|
|
279
|
+
variant: "outlined",
|
|
280
|
+
sx: {
|
|
281
|
+
minHeight: 78,
|
|
282
|
+
display: 'flex',
|
|
283
|
+
alignItems: 'center',
|
|
284
|
+
justifyContent: 'center',
|
|
285
|
+
borderRadius: Theme.Shape.Radius,
|
|
286
|
+
bgcolor: Theme.Surface.Container
|
|
287
|
+
},
|
|
288
|
+
children: /*#__PURE__*/ jsx(Typography, {
|
|
289
|
+
color: "text.disabled",
|
|
290
|
+
children: messages.noData
|
|
291
|
+
})
|
|
292
|
+
})
|
|
293
|
+
}) : null,
|
|
294
|
+
'initial-loading' !== state && 'empty' !== state ? /*#__PURE__*/ jsxs(Stack, {
|
|
295
|
+
"data-testid": "realtime-event-feed",
|
|
296
|
+
sx: {
|
|
297
|
+
gap: Theme.Spacing.S,
|
|
298
|
+
p: Theme.Spacing.S,
|
|
299
|
+
bgcolor: Theme.Action.Hover,
|
|
300
|
+
borderRadius: Theme.Shape.Radius
|
|
301
|
+
},
|
|
302
|
+
children: [
|
|
303
|
+
'error' === listModel.state || 'background-error' === listModel.state || 'degraded' === listModel.state ? /*#__PURE__*/ jsx(Alert, {
|
|
304
|
+
severity: 'error' === listModel.state ? 'error' : 'warning',
|
|
305
|
+
action: /*#__PURE__*/ jsx(Button, {
|
|
306
|
+
color: "inherit",
|
|
307
|
+
onClick: retry,
|
|
308
|
+
children: t('common.retry')
|
|
309
|
+
}),
|
|
310
|
+
children: listModel.error
|
|
311
|
+
}) : null,
|
|
312
|
+
listModel.rows.map((event)=>{
|
|
313
|
+
const reason = event.reason ?? '-';
|
|
314
|
+
const lastTime = eventLastTime(event);
|
|
315
|
+
const firstTime = eventFirstTime(event);
|
|
316
|
+
return /*#__PURE__*/ jsx(Paper, {
|
|
317
|
+
"data-testid": "realtime-event-card",
|
|
318
|
+
variant: "outlined",
|
|
319
|
+
sx: {
|
|
320
|
+
p: Theme.Spacing.M,
|
|
321
|
+
borderRadius: Theme.Shape.Radius
|
|
322
|
+
},
|
|
323
|
+
children: /*#__PURE__*/ jsxs(Stack, {
|
|
324
|
+
sx: {
|
|
325
|
+
gap: Theme.Spacing.S
|
|
326
|
+
},
|
|
327
|
+
children: [
|
|
328
|
+
/*#__PURE__*/ jsxs(Stack, {
|
|
329
|
+
direction: {
|
|
330
|
+
xs: 'column',
|
|
331
|
+
md: 'row'
|
|
332
|
+
},
|
|
333
|
+
sx: {
|
|
334
|
+
gap: Theme.Spacing.S,
|
|
335
|
+
alignItems: {
|
|
336
|
+
md: 'center'
|
|
337
|
+
}
|
|
338
|
+
},
|
|
339
|
+
children: [
|
|
340
|
+
/*#__PURE__*/ jsxs(Stack, {
|
|
341
|
+
direction: "row",
|
|
342
|
+
sx: {
|
|
343
|
+
flex: {
|
|
344
|
+
xs: '0 1 auto',
|
|
345
|
+
md: '1 1 420px'
|
|
346
|
+
},
|
|
347
|
+
minWidth: 0,
|
|
348
|
+
alignItems: 'center',
|
|
349
|
+
gap: Theme.Spacing.XS
|
|
350
|
+
},
|
|
351
|
+
children: [
|
|
352
|
+
/*#__PURE__*/ jsx(ResourceKindBadge, {
|
|
353
|
+
kind: event.involvedObject?.kind ?? '',
|
|
354
|
+
decorative: false,
|
|
355
|
+
label: event.involvedObject?.kind ?? messages.resource
|
|
356
|
+
}),
|
|
357
|
+
/*#__PURE__*/ jsx(Typography, {
|
|
358
|
+
noWrap: true,
|
|
359
|
+
children: event.involvedObject?.name ?? '-'
|
|
360
|
+
}),
|
|
361
|
+
/*#__PURE__*/ jsx(Tooltip, {
|
|
362
|
+
title: messages.eventDetails,
|
|
363
|
+
children: /*#__PURE__*/ jsx(IconButton, {
|
|
364
|
+
"aria-label": messages.viewEventDetails(reason),
|
|
365
|
+
onClick: ()=>setSelectedEvent(event),
|
|
366
|
+
children: /*#__PURE__*/ jsx(DescriptionOutlined, {
|
|
367
|
+
fontSize: "small"
|
|
368
|
+
})
|
|
369
|
+
})
|
|
370
|
+
})
|
|
371
|
+
]
|
|
372
|
+
}),
|
|
373
|
+
/*#__PURE__*/ jsx(Stack, {
|
|
374
|
+
sx: {
|
|
375
|
+
flex: {
|
|
376
|
+
xs: '0 1 auto',
|
|
377
|
+
md: '1 1 220px'
|
|
378
|
+
},
|
|
379
|
+
minWidth: 0
|
|
380
|
+
},
|
|
381
|
+
children: /*#__PURE__*/ jsx(ResourceStatus, {
|
|
382
|
+
status: eventStatus(event.type),
|
|
383
|
+
appearance: "dot"
|
|
384
|
+
})
|
|
385
|
+
}),
|
|
386
|
+
/*#__PURE__*/ jsxs(Stack, {
|
|
387
|
+
direction: "row",
|
|
388
|
+
sx: {
|
|
389
|
+
ml: {
|
|
390
|
+
md: 'auto'
|
|
391
|
+
},
|
|
392
|
+
flexShrink: 0,
|
|
393
|
+
alignItems: 'center',
|
|
394
|
+
gap: Theme.Spacing.XXS
|
|
395
|
+
},
|
|
396
|
+
children: [
|
|
397
|
+
/*#__PURE__*/ jsx(ScheduleRounded, {
|
|
398
|
+
fontSize: "small"
|
|
399
|
+
}),
|
|
400
|
+
/*#__PURE__*/ jsx(Typography, {
|
|
401
|
+
children: formatLocalDateTime(lastTime)
|
|
402
|
+
})
|
|
403
|
+
]
|
|
404
|
+
})
|
|
405
|
+
]
|
|
406
|
+
}),
|
|
407
|
+
/*#__PURE__*/ jsxs(Stack, {
|
|
408
|
+
direction: {
|
|
409
|
+
xs: 'column',
|
|
410
|
+
md: 'row'
|
|
411
|
+
},
|
|
412
|
+
sx: {
|
|
413
|
+
gap: Theme.Spacing.S,
|
|
414
|
+
alignItems: {
|
|
415
|
+
md: 'flex-start'
|
|
416
|
+
}
|
|
417
|
+
},
|
|
418
|
+
children: [
|
|
419
|
+
/*#__PURE__*/ jsxs(Typography, {
|
|
420
|
+
sx: {
|
|
421
|
+
flex: 1,
|
|
422
|
+
minWidth: 0,
|
|
423
|
+
overflowWrap: 'anywhere',
|
|
424
|
+
display: '-webkit-box',
|
|
425
|
+
WebkitLineClamp: 2,
|
|
426
|
+
WebkitBoxOrient: 'vertical',
|
|
427
|
+
overflow: 'hidden'
|
|
428
|
+
},
|
|
429
|
+
children: [
|
|
430
|
+
reason,
|
|
431
|
+
": ",
|
|
432
|
+
event.message ?? '-'
|
|
433
|
+
]
|
|
434
|
+
}),
|
|
435
|
+
/*#__PURE__*/ jsx(Typography, {
|
|
436
|
+
variant: "body2",
|
|
437
|
+
sx: {
|
|
438
|
+
color: Theme.Text.Help,
|
|
439
|
+
flexShrink: 0,
|
|
440
|
+
whiteSpace: 'nowrap'
|
|
441
|
+
},
|
|
442
|
+
children: messages.eventOccurrences(event.count ?? 1, formatLocalDateTime(firstTime))
|
|
443
|
+
})
|
|
444
|
+
]
|
|
445
|
+
})
|
|
446
|
+
]
|
|
447
|
+
})
|
|
448
|
+
}, event.metadata?.uid ?? event.metadata?.name ?? `${event.involvedObject?.kind}/${event.involvedObject?.name}/${lastTime}`);
|
|
449
|
+
})
|
|
450
|
+
]
|
|
451
|
+
}) : null,
|
|
452
|
+
/*#__PURE__*/ jsxs(Dialog, {
|
|
453
|
+
open: Boolean(selectedEvent),
|
|
454
|
+
onClose: ()=>setSelectedEvent(void 0),
|
|
455
|
+
fullWidth: true,
|
|
456
|
+
maxWidth: "md",
|
|
457
|
+
children: [
|
|
458
|
+
/*#__PURE__*/ jsx(ModalDialogTitle, {
|
|
459
|
+
onClose: ()=>setSelectedEvent(void 0),
|
|
460
|
+
closeLabel: "Close",
|
|
461
|
+
children: messages.eventDetails
|
|
462
|
+
}),
|
|
463
|
+
/*#__PURE__*/ jsx(DialogContent, {
|
|
464
|
+
dividers: true,
|
|
465
|
+
children: selectedEvent ? /*#__PURE__*/ jsx(CodeEditor, {
|
|
466
|
+
value: JSON.stringify(selectedEvent, null, 2),
|
|
467
|
+
onChange: ignoreReadOnlyEditorChange,
|
|
468
|
+
language: "json",
|
|
469
|
+
modelPath: `inmemory://events/${encodeURIComponent(selectedEvent.metadata?.uid ?? selectedEvent.metadata?.name ?? 'event')}.json`,
|
|
470
|
+
ariaLabel: messages.eventDetails,
|
|
471
|
+
readOnly: true,
|
|
472
|
+
height: 480,
|
|
473
|
+
actions: [
|
|
474
|
+
'find',
|
|
475
|
+
'copy'
|
|
476
|
+
],
|
|
477
|
+
labels: editorLabels
|
|
478
|
+
}) : null
|
|
479
|
+
})
|
|
480
|
+
]
|
|
481
|
+
})
|
|
482
|
+
]
|
|
483
|
+
});
|
|
484
|
+
};
|
|
485
|
+
function realtimeAllEventsHref(target) {
|
|
486
|
+
if (!target.cluster) return;
|
|
487
|
+
const params = new URLSearchParams();
|
|
488
|
+
params.set('cluster', target.cluster);
|
|
489
|
+
if (target.namespace) params.set('namespace', target.namespace);
|
|
490
|
+
if (target.kind) params.set('kind', target.kind);
|
|
491
|
+
const names = [
|
|
492
|
+
...new Set((target.names ?? []).filter((name)=>name.length > 0))
|
|
493
|
+
];
|
|
494
|
+
if (names.length > 0) params.set('name', names.join(','));
|
|
495
|
+
const query = params.toString();
|
|
496
|
+
if ('applications' === target.view) {
|
|
497
|
+
if (!target.project) return;
|
|
498
|
+
return `/applications/${encodeURIComponent(target.project)}/event?${query}`;
|
|
499
|
+
}
|
|
500
|
+
return `/clusters/${encodeURIComponent(target.cluster)}/maintenance-center/event?${query}`;
|
|
501
|
+
}
|
|
502
|
+
export { K8sRealtimeEventFeed, defaultK8sRealtimeEventMessages, labelsToSelector, realtimeAllEventsHref };
|
|
503
|
+
|
|
504
|
+
//# sourceMappingURL=index.js.map
|
package/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/event-domain.ts","../../src/messages.ts","../../src/K8sRealtimeEventFeed.tsx","../../src/all-events-href.ts"],"sourcesContent":["import type { K8sResource } from '@alauda/core-plugin-sdk';\n\nexport interface RealtimeEvent extends K8sResource {\n readonly type?: 'Normal' | 'Warning' | string;\n readonly reason?: string;\n readonly message?: string;\n readonly count?: number;\n readonly firstTimestamp?: string;\n readonly lastTimestamp?: string;\n readonly eventTime?: string;\n readonly series?: { readonly lastObservedTime?: string };\n readonly involvedObject?: {\n readonly apiVersion?: string;\n readonly kind?: string;\n readonly name?: string;\n readonly uid?: string;\n };\n}\n\nexport type RelatedObjectMap = Readonly<Record<string, readonly string[]>>;\n\nexport interface RelatedEventResource extends K8sResource {}\n\nexport function mergeRelatedObjects(\n invokedObjects: RelatedObjectMap | undefined,\n pods: readonly RelatedEventResource[],\n): RelatedObjectMap {\n const merged = new Map<string, Set<string>>();\n for (const [kind, names] of Object.entries(invokedObjects ?? {})) {\n merged.set(kind, new Set(names.filter(Boolean)));\n }\n const podNames = pods.map(pod => pod.metadata?.name).filter((name): name is string => Boolean(name));\n if (podNames.length) {\n const names = merged.get('Pod') ?? new Set<string>();\n podNames.forEach(name => names.add(name));\n merged.set('Pod', names);\n }\n return Object.fromEntries([...merged.entries()].map(([kind, names]) => [kind, [...names]]));\n}\n\nfunction replicaSetParentName(name: string): string | undefined {\n const parts = name.split('-');\n return parts.length > 1 ? parts.slice(0, -1).join('-') : undefined;\n}\n\nexport function isRelatedEvent(\n event: RealtimeEvent,\n relatedObjects: RelatedObjectMap,\n): boolean {\n const kind = event.involvedObject?.kind;\n const name = event.involvedObject?.name;\n if (!kind || !name) return false;\n if (relatedObjects[kind]?.includes(name)) return true;\n if (kind !== 'ReplicaSet') return false;\n const parent = replicaSetParentName(name);\n return Boolean(parent && relatedObjects.Deployment?.includes(parent));\n}\n\nexport function eventFirstTime(event: RealtimeEvent): string | undefined {\n const creationTimestamp = typeof event.metadata?.creationTimestamp === 'string'\n ? event.metadata.creationTimestamp\n : undefined;\n return event.firstTimestamp\n ?? event.eventTime\n ?? creationTimestamp;\n}\n\nexport function eventLastTime(event: RealtimeEvent): string | undefined {\n const creationTimestamp = typeof event.metadata?.creationTimestamp === 'string'\n ? event.metadata.creationTimestamp\n : undefined;\n return event.lastTimestamp\n ?? event.series?.lastObservedTime\n ?? event.eventTime\n ?? creationTimestamp;\n}\n\nfunction eventName(event: RealtimeEvent): string {\n return event.metadata?.name ?? event.involvedObject?.name ?? '';\n}\n\nexport function sortRealtimeEvents(events: readonly RealtimeEvent[]): RealtimeEvent[] {\n return [...events].sort((left, right) => {\n const last = String(eventLastTime(right) ?? '').localeCompare(String(eventLastTime(left) ?? ''));\n if (last !== 0) return last;\n const first = String(eventFirstTime(right) ?? '').localeCompare(String(eventFirstTime(left) ?? ''));\n if (first !== 0) return first;\n return eventName(left).localeCompare(eventName(right));\n });\n}\n\nexport function selectRelatedRealtimeEvents(\n events: readonly RealtimeEvent[],\n relatedObjects: RelatedObjectMap,\n maxEvents = 500,\n): RealtimeEvent[] {\n const filtered = Object.keys(relatedObjects).length\n ? events.filter(event => isRelatedEvent(event, relatedObjects))\n : [...events];\n return sortRealtimeEvents(filtered).slice(0, maxEvents);\n}\n\nexport function labelsToSelector(labels: Readonly<Record<string, string>> | undefined): string | undefined {\n if (!labels) return undefined;\n const entries = Object.entries(labels).filter(([key, value]) => key && value !== undefined);\n return entries.length ? entries.sort(([left], [right]) => left.localeCompare(right)).map(([key, value]) => `${key}=${value}`).join(',') : undefined;\n}\n","export interface K8sRealtimeEventMessages {\n readonly allEvents: string;\n readonly latestEventsPrefix: string;\n readonly latestEventsSuffix: string;\n readonly eventDetails: string;\n readonly noData: string;\n readonly resource: string;\n readonly eventOccurrences: (count: number, time: string) => string;\n readonly viewEventDetails: (reason: string) => string;\n}\n\nfunction fill(template: string, values: Readonly<Record<string, string | number>>): string {\n return template.replace(/\\{\\{\\s*([A-Za-z0-9_]+)\\s*\\}\\}/gu, (_match, key: string) => String(values[key] ?? ''));\n}\n\nexport const defaultK8sRealtimeEventMessages: K8sRealtimeEventMessages = {\n allEvents: 'All Events',\n latestEventsPrefix: 'The current page only displays the latest 500 event information. If you need to view more and more detailed event information, please check through the',\n latestEventsSuffix: 'page.',\n eventDetails: 'Event details',\n noData: 'No data',\n resource: 'Resource',\n eventOccurrences: (count, time) => fill('{{count}} occurrences, first seen {{time}}', { count, time }),\n viewEventDetails: reason => fill('View event details: {{reason}}', { reason }),\n};\n","import { useMemo, useRef, useState, type FC, type ReactNode } from 'react';\nimport DescriptionOutlinedIcon from '@mui/icons-material/DescriptionOutlined';\nimport OpenInNewRoundedIcon from '@mui/icons-material/OpenInNewRounded';\nimport ScheduleRoundedIcon from '@mui/icons-material/ScheduleRounded';\nimport { Alert, Box, Button, Dialog, DialogContent, IconButton, Link, Paper, Stack, Tooltip, Typography } from '@mui/material';\nimport { CodeEditor, type CodeEditorLabels } from '@alauda/react-code-editor';\nimport {\n AsyncBoundary,\n adaptResourceTableListState,\n formatLocalDateTime,\n InfoNotice,\n ModalDialogTitle,\n ResourceKindBadge,\n ResourceStatus,\n} from '@alauda/console-ui';\nimport {\n POD_DESCRIPTOR,\n Theme,\n useK8sResourceListLiveQuery,\n useSharedTranslation,\n type K8sLiveState,\n} from '@alauda/core-plugin-sdk';\nimport {\n eventFirstTime,\n eventLastTime,\n labelsToSelector,\n mergeRelatedObjects,\n selectRelatedRealtimeEvents,\n type RealtimeEvent,\n type RelatedEventResource,\n type RelatedObjectMap,\n} from './event-domain';\nimport {\n defaultK8sRealtimeEventMessages,\n type K8sRealtimeEventMessages,\n} from './messages';\n\nconst EVENT_DESCRIPTOR = {\n group: '',\n version: 'v1',\n kind: 'Event',\n resource: 'events',\n namespaced: true,\n} as const;\n\nexport interface K8sRealtimeEventFeedProps {\n readonly cluster: string;\n readonly namespace: string;\n readonly invokedObjects?: RelatedObjectMap;\n readonly podMatchLabels?: Readonly<Record<string, string>>;\n readonly podLabelSelector?: string;\n /** Direct involved-object selector; when provided it takes priority over Pod relation discovery. */\n readonly fieldSelector?: string;\n readonly allEventsHref?: string;\n readonly allEventsUnavailableReason?: string;\n /** Resource adapters can reject stale identities before sorting and applying the display limit. */\n readonly filterEvent?: (event: RealtimeEvent) => boolean;\n readonly maxEvents?: number;\n readonly messages?: Partial<K8sRealtimeEventMessages>;\n}\n\nfunction queryRefreshing(query: { readonly isPending: boolean; readonly isFetching: boolean; readonly liveState: K8sLiveState }, enabled: boolean): boolean {\n return enabled && (query.isPending || query.isFetching || query.liveState === 'connecting' || query.liveState === 'relisting' || query.liveState === 'polling');\n}\n\nfunction EventLimitNotice({\n href,\n unavailableReason,\n messages,\n}: {\n readonly href?: string;\n readonly unavailableReason?: string;\n readonly messages: K8sRealtimeEventMessages;\n}): ReactNode {\n const link = href ? (\n <Link href={href} target=\"_blank\" rel=\"noreferrer\" sx={{ fontWeight: Theme.Typography.Button.FontWeight, whiteSpace: 'nowrap' }}>\n {messages.allEvents} <OpenInNewRoundedIcon sx={{ fontSize: Theme.Typography.Body.FontSize, verticalAlign: 'text-bottom' }} />\n </Link>\n ) : (\n <Button disabled>{messages.allEvents}</Button>\n );\n return (\n <InfoNotice>\n {messages.latestEventsPrefix}{' '}\n {link}{' '}\n {messages.latestEventsSuffix}\n {unavailableReason ? <>{' '}<span>{unavailableReason}</span></> : null}\n </InfoNotice>\n );\n}\n\nfunction eventStatus(type: string | undefined) {\n return {\n key: type ?? 'unknown',\n label: type ?? '-',\n tone: type === 'Warning' ? 'warning' as const : 'success' as const,\n };\n}\n\nfunction ignoreReadOnlyEditorChange(): void {\n // CodeEditor requires an onChange callback even when it is read-only.\n}\n\nexport const K8sRealtimeEventFeed: FC<K8sRealtimeEventFeedProps> = ({\n cluster,\n namespace,\n invokedObjects,\n podMatchLabels,\n podLabelSelector,\n fieldSelector,\n allEventsHref,\n allEventsUnavailableReason,\n filterEvent,\n maxEvents = 500,\n messages: messageOverrides,\n}) => {\n const { t } = useSharedTranslation();\n const messages = { ...defaultK8sRealtimeEventMessages, ...messageOverrides };\n const editorLabels = useMemo<CodeEditorLabels>(() => ({\n copy: t('yamlEditor.copyComplete'),\n copied: t('yamlEditor.copied'),\n copyFailed: t('yamlEditor.copyFailed'),\n find: t('yamlEditor.search'),\n format: t('yamlEditor.format'),\n fullscreen: t('yamlEditor.fullscreen'),\n exitFullscreen: t('yamlEditor.exitFullscreen'),\n undo: t('yamlEditor.undo'),\n redo: t('yamlEditor.redo'),\n loading: t('yamlEditor.loading'),\n valid: t('yamlEditor.syntaxPassed'),\n errors: count => t('yamlEditor.diagnosticErrors', { count }),\n lineColumn: (line, column) => t('yamlEditor.cursorPosition', { line, column }),\n }), [t]);\n const podSelector = podLabelSelector ?? labelsToSelector(podMatchLabels);\n const eventQuery = useK8sResourceListLiveQuery<RealtimeEvent>(\n {\n cluster,\n namespace,\n definition: EVENT_DESCRIPTOR,\n query: { ...(fieldSelector ? { fieldSelector } : {}), limit: String(maxEvents) },\n },\n { enabled: Boolean(cluster && namespace) },\n );\n const podQuery = useK8sResourceListLiveQuery<RelatedEventResource>(\n {\n cluster,\n namespace,\n definition: POD_DESCRIPTOR,\n query: podSelector ? { labelSelector: podSelector } : undefined,\n },\n { enabled: Boolean(cluster && namespace && podSelector && !fieldSelector) },\n );\n const relatedObjects = useMemo(\n () => fieldSelector ? {} : mergeRelatedObjects(invokedObjects, podQuery.data?.items ?? []),\n [fieldSelector, invokedObjects, podQuery.data?.items],\n );\n const fetchedRows = useMemo(\n () => selectRelatedRealtimeEvents(\n filterEvent ? (eventQuery.data?.items ?? []).filter(filterEvent) : eventQuery.data?.items ?? [],\n relatedObjects,\n maxEvents,\n ),\n [eventQuery.data?.items, filterEvent, maxEvents, relatedObjects],\n );\n const podEnabled = Boolean(podSelector && !fieldSelector);\n const refreshing = queryRefreshing(eventQuery, Boolean(cluster && namespace)) || queryRefreshing(podQuery, Boolean(cluster && namespace && podEnabled));\n const retainedRows = useRef(fetchedRows);\n if (fetchedRows.length > 0) retainedRows.current = fetchedRows;\n const rows = fetchedRows.length > 0 || !refreshing ? fetchedRows : retainedRows.current;\n const queryError = eventQuery.error ?? (podEnabled ? podQuery.error : undefined);\n const backgroundError = eventQuery.backgroundError ?? (podEnabled ? podQuery.backgroundError : undefined);\n const listModel = adaptResourceTableListState({\n rows,\n isPending: rows.length === 0 && (eventQuery.isPending || (podEnabled && podQuery.isPending)),\n isFetching: false,\n error: rows.length > 0 ? undefined : queryError,\n backgroundError,\n });\n const [selectedEvent, setSelectedEvent] = useState<RealtimeEvent>();\n const retry = () => {\n void Promise.all([eventQuery.refetch(), podEnabled ? podQuery.refetch() : Promise.resolve()]);\n };\n const state = !cluster || !namespace ? 'empty' : listModel.state;\n\n return (\n <Stack sx={{ gap: Theme.Spacing.S, minWidth: 0 }}>\n <EventLimitNotice href={allEventsHref} unavailableReason={allEventsUnavailableReason} messages={messages} />\n {state === 'initial-loading' ? (\n <Box data-testid=\"realtime-event-loading\" sx={{ p: Theme.Spacing.S, bgcolor: Theme.Action.Hover, borderRadius: Theme.Shape.Radius }}>\n <Paper variant=\"outlined\" sx={{ minHeight: 96, display: 'flex', alignItems: 'center', justifyContent: 'center', borderRadius: Theme.Shape.Radius }}>\n <AsyncBoundary state=\"loading\" />\n </Paper>\n </Box>\n ) : null}\n {state === 'empty' ? (\n <Box\n data-testid=\"realtime-event-empty\"\n role=\"status\"\n aria-label={messages.noData}\n sx={{\n p: Theme.Spacing.S,\n bgcolor: Theme.Action.Hover,\n borderRadius: Theme.Shape.Radius,\n }}\n >\n <Paper\n data-testid=\"realtime-event-empty-panel\"\n variant=\"outlined\"\n sx={{\n minHeight: 78,\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n borderRadius: Theme.Shape.Radius,\n bgcolor: Theme.Surface.Container,\n }}\n >\n <Typography color=\"text.disabled\">{messages.noData}</Typography>\n </Paper>\n </Box>\n ) : null}\n {state !== 'initial-loading' && state !== 'empty' ? (\n <Stack data-testid=\"realtime-event-feed\" sx={{ gap: Theme.Spacing.S, p: Theme.Spacing.S, bgcolor: Theme.Action.Hover, borderRadius: Theme.Shape.Radius }}>\n {listModel.state === 'error' || listModel.state === 'background-error' || listModel.state === 'degraded' ? (\n <Alert severity={listModel.state === 'error' ? 'error' : 'warning'} action={<Button color=\"inherit\" onClick={retry}>{t('common.retry')}</Button>}>{listModel.error}</Alert>\n ) : null}\n {listModel.rows.map(event => {\n const reason = event.reason ?? '-';\n const lastTime = eventLastTime(event);\n const firstTime = eventFirstTime(event);\n return (\n <Paper\n key={event.metadata?.uid ?? event.metadata?.name ?? `${event.involvedObject?.kind}/${event.involvedObject?.name}/${lastTime}`}\n data-testid=\"realtime-event-card\"\n variant=\"outlined\"\n sx={{ p: Theme.Spacing.M, borderRadius: Theme.Shape.Radius }}\n >\n <Stack sx={{ gap: Theme.Spacing.S }}>\n <Stack direction={{ xs: 'column', md: 'row' }} sx={{ gap: Theme.Spacing.S, alignItems: { md: 'center' } }}>\n <Stack direction=\"row\" sx={{ flex: { xs: '0 1 auto', md: '1 1 420px' }, minWidth: 0, alignItems: 'center', gap: Theme.Spacing.XS }}>\n <ResourceKindBadge\n kind={event.involvedObject?.kind ?? ''}\n decorative={false}\n label={event.involvedObject?.kind ?? messages.resource}\n />\n <Typography noWrap>{event.involvedObject?.name ?? '-'}</Typography>\n <Tooltip title={messages.eventDetails}>\n <IconButton aria-label={messages.viewEventDetails(reason)} onClick={() => setSelectedEvent(event)}>\n <DescriptionOutlinedIcon fontSize=\"small\" />\n </IconButton>\n </Tooltip>\n </Stack>\n <Stack sx={{ flex: { xs: '0 1 auto', md: '1 1 220px' }, minWidth: 0 }}>\n <ResourceStatus status={eventStatus(event.type)} appearance=\"dot\" />\n </Stack>\n <Stack direction=\"row\" sx={{ ml: { md: 'auto' }, flexShrink: 0, alignItems: 'center', gap: Theme.Spacing.XXS }}>\n <ScheduleRoundedIcon fontSize=\"small\" />\n <Typography>{formatLocalDateTime(lastTime)}</Typography>\n </Stack>\n </Stack>\n <Stack direction={{ xs: 'column', md: 'row' }} sx={{ gap: Theme.Spacing.S, alignItems: { md: 'flex-start' } }}>\n <Typography sx={{ flex: 1, minWidth: 0, overflowWrap: 'anywhere', display: '-webkit-box', WebkitLineClamp: 2, WebkitBoxOrient: 'vertical', overflow: 'hidden' }}>\n {reason}: {event.message ?? '-'}\n </Typography>\n <Typography variant=\"body2\" sx={{ color: Theme.Text.Help, flexShrink: 0, whiteSpace: 'nowrap' }}>\n {messages.eventOccurrences(event.count ?? 1, formatLocalDateTime(firstTime))}\n </Typography>\n </Stack>\n </Stack>\n </Paper>\n );\n })}\n </Stack>\n ) : null}\n <Dialog open={Boolean(selectedEvent)} onClose={() => setSelectedEvent(undefined)} fullWidth maxWidth=\"md\">\n <ModalDialogTitle onClose={() => setSelectedEvent(undefined)} closeLabel=\"Close\">\n {messages.eventDetails}\n </ModalDialogTitle>\n <DialogContent dividers>\n {selectedEvent ? (\n <CodeEditor\n value={JSON.stringify(selectedEvent, null, 2)}\n onChange={ignoreReadOnlyEditorChange}\n language=\"json\"\n modelPath={`inmemory://events/${encodeURIComponent(selectedEvent.metadata?.uid ?? selectedEvent.metadata?.name ?? 'event')}.json`}\n ariaLabel={messages.eventDetails}\n readOnly\n height={480}\n actions={['find', 'copy']}\n labels={editorLabels}\n />\n ) : null}\n </DialogContent>\n </Dialog>\n </Stack>\n );\n};\n","export interface RealtimeAllEventsTarget {\n readonly view: 'applications' | 'clusters';\n readonly project?: string;\n readonly cluster: string;\n readonly namespace?: string;\n readonly kind?: string;\n readonly names?: readonly string[];\n}\n\n/** Formats the legacy All Events destination. Callers still decide whether navigation is allowed. */\nexport function realtimeAllEventsHref(target: RealtimeAllEventsTarget): string | undefined {\n if (!target.cluster) return undefined;\n const params = new URLSearchParams();\n params.set('cluster', target.cluster);\n if (target.namespace) params.set('namespace', target.namespace);\n if (target.kind) params.set('kind', target.kind);\n const names = [...new Set((target.names ?? []).filter(name => name.length > 0))];\n if (names.length > 0) params.set('name', names.join(','));\n const query = params.toString();\n if (target.view === 'applications') {\n if (!target.project) return undefined;\n return `/applications/${encodeURIComponent(target.project)}/event?${query}`;\n }\n return `/clusters/${encodeURIComponent(target.cluster)}/maintenance-center/event?${query}`;\n}\n"],"names":["mergeRelatedObjects","invokedObjects","pods","merged","Map","kind","names","Object","Set","Boolean","podNames","pod","name","replicaSetParentName","parts","undefined","isRelatedEvent","event","relatedObjects","parent","eventFirstTime","creationTimestamp","eventLastTime","eventName","sortRealtimeEvents","events","left","right","last","String","first","selectRelatedRealtimeEvents","maxEvents","filtered","labelsToSelector","labels","entries","key","value","fill","template","values","_match","defaultK8sRealtimeEventMessages","count","time","reason","EVENT_DESCRIPTOR","queryRefreshing","query","enabled","EventLimitNotice","href","unavailableReason","messages","link","Link","Theme","OpenInNewRoundedIcon","Button","InfoNotice","eventStatus","type","ignoreReadOnlyEditorChange","K8sRealtimeEventFeed","cluster","namespace","podMatchLabels","podLabelSelector","fieldSelector","allEventsHref","allEventsUnavailableReason","filterEvent","messageOverrides","t","useSharedTranslation","editorLabels","useMemo","line","column","podSelector","eventQuery","useK8sResourceListLiveQuery","podQuery","POD_DESCRIPTOR","fetchedRows","podEnabled","refreshing","retainedRows","useRef","rows","queryError","backgroundError","listModel","adaptResourceTableListState","selectedEvent","setSelectedEvent","useState","retry","Promise","state","Stack","Box","Paper","AsyncBoundary","Typography","Alert","lastTime","firstTime","ResourceKindBadge","Tooltip","IconButton","DescriptionOutlinedIcon","ResourceStatus","ScheduleRoundedIcon","formatLocalDateTime","Dialog","ModalDialogTitle","DialogContent","CodeEditor","JSON","encodeURIComponent","realtimeAllEventsHref","target","params","URLSearchParams"],"mappings":";;;;;;;;;AAuBO,SAASA,oBACdC,cAA4C,EAC5CC,IAAqC;IAErC,MAAMC,SAAS,IAAIC;IACnB,KAAK,MAAM,CAACC,MAAMC,MAAM,IAAIC,OAAO,OAAO,CAACN,kBAAkB,CAAC,GAC5DE,OAAO,GAAG,CAACE,MAAM,IAAIG,IAAIF,MAAM,MAAM,CAACG;IAExC,MAAMC,WAAWR,KAAK,GAAG,CAACS,CAAAA,MAAOA,IAAI,QAAQ,EAAE,MAAM,MAAM,CAAC,CAACC,OAAyBH,QAAQG;IAC9F,IAAIF,SAAS,MAAM,EAAE;QACnB,MAAMJ,QAAQH,OAAO,GAAG,CAAC,UAAU,IAAIK;QACvCE,SAAS,OAAO,CAACE,CAAAA,OAAQN,MAAM,GAAG,CAACM;QACnCT,OAAO,GAAG,CAAC,OAAOG;IACpB;IACA,OAAOC,OAAO,WAAW,CAAC;WAAIJ,OAAO,OAAO;KAAG,CAAC,GAAG,CAAC,CAAC,CAACE,MAAMC,MAAM,GAAK;YAACD;YAAM;mBAAIC;aAAM;SAAC;AAC3F;AAEA,SAASO,qBAAqBD,IAAY;IACxC,MAAME,QAAQF,KAAK,KAAK,CAAC;IACzB,OAAOE,M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O,EAAE,0BAA0B,EAAE1E,OAAO;AAC5F"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,41 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alauda/console-events",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0-next.20261204.1796373547",
|
|
4
|
+
"description": "Relationship-aware Kubernetes event feed for ACP Console plugins.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./index.js",
|
|
7
|
+
"module": "./index.js",
|
|
8
|
+
"types": "./index.d.ts",
|
|
9
|
+
"sideEffects": false,
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./index.d.ts",
|
|
13
|
+
"import": "./index.js",
|
|
14
|
+
"default": "./index.js"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"index.js",
|
|
19
|
+
"index.js.map",
|
|
20
|
+
"index.d.ts",
|
|
21
|
+
"*.js",
|
|
22
|
+
"*.js.map",
|
|
23
|
+
"README.md"
|
|
24
|
+
],
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"@alauda/console-ui": "^0.0.0-0",
|
|
27
|
+
"@alauda/react-code-editor": "0.1.0-next.20261024.1792773002",
|
|
28
|
+
"@mui/icons-material": "^9.2.0"
|
|
29
|
+
},
|
|
30
|
+
"peerDependencies": {
|
|
31
|
+
"@alauda/core-plugin-sdk": "^0.1.0-0",
|
|
32
|
+
"@emotion/react": "^11.0.0",
|
|
33
|
+
"@emotion/styled": "^11.0.0",
|
|
34
|
+
"@mui/material": "^9.2.0",
|
|
35
|
+
"react": "^18.0.0 || ^19.0.0",
|
|
36
|
+
"react-dom": "^18.0.0 || ^19.0.0"
|
|
37
|
+
},
|
|
38
|
+
"publishConfig": {
|
|
39
|
+
"access": "public"
|
|
40
|
+
}
|
|
41
|
+
}
|