File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
frontend/src/components/resourceMap/KubeObjectGlance Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ import { useTranslation } from 'react-i18next';
2121import { KubeObject } from '../../../lib/k8s/cluster' ;
2222import Deployment from '../../../lib/k8s/deployment' ;
2323import Endpoints from '../../../lib/k8s/endpoints' ;
24- import Event from '../../../lib/k8s/event' ;
24+ import Event , { KubeEvent } from '../../../lib/k8s/event' ;
2525import HPA from '../../../lib/k8s/hpa' ;
2626import Pod from '../../../lib/k8s/pod' ;
2727import ReplicaSet from '../../../lib/k8s/replicaSet' ;
@@ -41,7 +41,9 @@ export const KubeObjectGlance = memo(({ resource }: { resource: KubeObject }) =>
4141 const { t } = useTranslation ( ) ;
4242 const [ events , setEvents ] = useState < Event [ ] > ( [ ] ) ;
4343 useEffect ( ( ) => {
44- Event . objectEvents ( resource ) . then ( it => setEvents ( it ) ) ;
44+ Event . objectEvents ( resource ) . then ( fetchedEvents =>
45+ setEvents ( fetchedEvents . map ( ( event : KubeEvent ) => new Event ( event ) ) )
46+ ) ;
4547 } , [ ] ) ;
4648
4749 const kind = resource . kind ;
You can’t perform that action at this time.
0 commit comments