Implement endpoints section (#246)

Signed-off-by: Lauri Nevala <lauri.nevala@gmail.com>
This commit is contained in:
Lauri Nevala authored and GitHub committed 2020-04-13 18:20:19 +03:00
1 parent bd1b8069fd
commit f12b2b6a99
15 files changed
+522 -1

No files matched your search

@@ -7,21 +7,31 @@ import { DrawerItem, DrawerTitle } from "../drawer";
import { Badge } from "../badge";
import { KubeEventDetails } from "../+events/kube-event-details";
import { KubeObjectDetailsProps } from "../kube-object";
import { Service, serviceApi } from "../../api/endpoints";
import { Service, serviceApi, endpointApi } from "../../api/endpoints";
import { _i18n } from "../../i18n";
import { apiManager } from "../../api/api-manager";
import { KubeObjectMeta } from "../kube-object/kube-object-meta";
import { ServicePorts } from "./service-ports";
import { endpointStore } from "../+network-endpoints/endpoints.store";
import { ServiceDetailsEndpoint } from "./service-details-endpoint";
interface Props extends KubeObjectDetailsProps<Service> {
}
@observer
export class ServiceDetails extends React.Component<Props> {
componentDidMount() {
if (!endpointStore.isLoaded) {
endpointStore.loadAll();
}
endpointApi.watch()
}
render() {
const { object: service } = this.props;
if (!service) return;
const { spec } = service;
const endpoint = endpointStore.getByName(service.getName(), service.getNs())
return (
<div className="ServicesDetails">
<KubeObjectMeta object={service}/>
@@ -59,6 +69,9 @@ export class ServiceDetails extends React.Component<Props> {
{spec.loadBalancerIP}
</DrawerItem>
)}
<DrawerTitle title={_i18n._(t`Endpoint`)}/>
<ServiceDetailsEndpoint endpoint={endpoint} />
<KubeEventDetails object={service}/>
</div>