mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
* fix lint Signed-off-by: Roman <ixrock@gmail.com> * fixes & refactoring Signed-off-by: Roman <ixrock@gmail.com> * fix lint, micro-refactoring Signed-off-by: Roman <ixrock@gmail.com> * more refactoring, clean up, responding to comments Signed-off-by: Roman <ixrock@gmail.com> * fix: remove extra check for cluster.allowedApi from processing buffered watch-api events Signed-off-by: Roman <ixrock@gmail.com> * refactoring, detaching NamespaceStore from KubeObjectStore Signed-off-by: Roman <ixrock@gmail.com> * fix: wait for contextReady in NamespaceStore Signed-off-by: Roman <ixrock@gmail.com> * refactoring & fixes Signed-off-by: Roman <ixrock@gmail.com> * fix lint Signed-off-by: Roman <ixrock@gmail.com> * fixes: reloading context stores on NamespaceSelect-change Signed-off-by: Roman <ixrock@gmail.com> * optimize loading all resources when "all namespaces" selected -> single request per resource (when have rights) Signed-off-by: Roman <ixrock@gmail.com> * use native k8s api watches Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com> * retry watch when it makes sense Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com> * workaround for browser connection limits Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com> * cleanup Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com> * cleanup Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com> * use always random subdomain for getResponse Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com> * resubscribe stores on contextNamespace change Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com> * fix Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com> * modify watch event before calling callback Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com> Co-authored-by: Roman <ixrock@gmail.com>
66 lines
1.8 KiB
TypeScript
66 lines
1.8 KiB
TypeScript
import "./kube-event-details.scss";
|
|
|
|
import React from "react";
|
|
import { observer } from "mobx-react";
|
|
import { KubeObject } from "../../api/kube-object";
|
|
import { DrawerItem, DrawerTitle } from "../drawer";
|
|
import { cssNames } from "../../utils";
|
|
import { eventStore } from "./event.store";
|
|
|
|
export interface KubeEventDetailsProps {
|
|
object: KubeObject;
|
|
}
|
|
|
|
@observer
|
|
export class KubeEventDetails extends React.Component<KubeEventDetailsProps> {
|
|
async componentDidMount() {
|
|
eventStore.reloadAll();
|
|
}
|
|
|
|
render() {
|
|
const { object } = this.props;
|
|
const events = eventStore.getEventsByObject(object);
|
|
|
|
if (!events.length) {
|
|
return (
|
|
<DrawerTitle className="flex gaps align-center">
|
|
<span>Events</span>
|
|
</DrawerTitle>
|
|
);
|
|
}
|
|
|
|
return (
|
|
<div>
|
|
<DrawerTitle className="flex gaps align-center">
|
|
<span>Events</span>
|
|
</DrawerTitle>
|
|
<div className="KubeEventDetails">
|
|
{events.map(evt => {
|
|
const { message, count, lastTimestamp, involvedObject } = evt;
|
|
|
|
return (
|
|
<div className="event" key={evt.getId()}>
|
|
<div className={cssNames("title", { warning: evt.isWarning() })}>
|
|
{message}
|
|
</div>
|
|
<DrawerItem name="Source">
|
|
{evt.getSource()}
|
|
</DrawerItem>
|
|
<DrawerItem name="Count">
|
|
{count}
|
|
</DrawerItem>
|
|
<DrawerItem name="Sub-object">
|
|
{involvedObject.fieldPath}
|
|
</DrawerItem>
|
|
<DrawerItem name="Last seen">
|
|
{lastTimestamp}
|
|
</DrawerItem>
|
|
</div>
|
|
);
|
|
})}
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|
|
}
|