Skip to content
This repository was archived by the owner on Jul 30, 2025. It is now read-only.

Commit 1f33956

Browse files
committed
fix(plugins/plugin-kubectl): improve content of kubectl Events summary
there is no sense in showing Name, and Message should be higher up in the UI
1 parent ba4f4b3 commit 1f33956

File tree

1 file changed

+8
-6
lines changed
  • plugins/plugin-kubectl/src/lib/view/modes/Summary/impl

1 file changed

+8
-6
lines changed

plugins/plugin-kubectl/src/lib/view/modes/Summary/impl/Event.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,16 @@
2828
*
2929
*/
3030

31+
import { i18n } from '@kui-shell/core'
3132
import prettyPrintMillis from 'pretty-ms'
33+
3234
import toDescriptionList from './convert'
3335
import { Event } from '../../../../model/resource'
3436

37+
const strings = i18n('plugin-kubectl', 'events')
38+
3539
export default function EventSummary(event: Event) {
3640
const {
37-
metadata,
3841
involvedObject,
3942
source,
4043
reason: Reason,
@@ -46,15 +49,14 @@ export default function EventSummary(event: Event) {
4649
} = event
4750

4851
return toDescriptionList({
49-
'Last seen': prettyPrintMillis(Date.now() - new Date(lastTimestamp).getTime()),
52+
'Last seen': strings('ago', prettyPrintMillis(Date.now() - new Date(lastTimestamp).getTime())),
5053
Object: `${involvedObject.kind}/${involvedObject.name}`,
54+
Message,
5155
Type,
5256
Reason,
5357
Subobject: involvedObject.fieldPath,
5458
Source: `${source.component || ''}${source.host ? (source.component ? ', ' : '') + source.host : ''}`,
55-
Message,
56-
'First seen': prettyPrintMillis(Date.now() - new Date(firstTimestamp).getTime()),
57-
Count,
58-
Name: metadata.name
59+
'First seen': strings('ago', prettyPrintMillis(Date.now() - new Date(firstTimestamp).getTime())),
60+
Count
5961
})
6062
}

0 commit comments

Comments
 (0)