mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
64 lines
1.8 KiB
TypeScript
64 lines
1.8 KiB
TypeScript
/**
|
|
* Copyright (c) OpenLens Authors. All rights reserved.
|
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
|
*/
|
|
|
|
import styles from "./ingress-class-details.module.scss";
|
|
|
|
import React from "react";
|
|
import { observer } from "mobx-react";
|
|
import { DrawerItem, DrawerTitle } from "../drawer";
|
|
import type { IngressClass } from "../../../common/k8s-api/endpoints";
|
|
import type { KubeObjectDetailsProps } from "../kube-object-details";
|
|
import { withInjectables } from "@ogre-tools/injectable-react";
|
|
|
|
export interface IngressClassDetailsProps extends KubeObjectDetailsProps<IngressClass> {
|
|
}
|
|
|
|
@observer
|
|
class NonInjectedIngressDetails extends React.Component<IngressClassDetailsProps> {
|
|
renderParameters() {
|
|
const { object: ingressClass } = this.props;
|
|
|
|
if (!ingressClass.spec.parameters) return;
|
|
|
|
return (
|
|
<>
|
|
<DrawerTitle>Parameters</DrawerTitle>
|
|
<DrawerItem name="Name">
|
|
{ingressClass.getCtrlName()}
|
|
</DrawerItem>
|
|
<DrawerItem name="Namespace">
|
|
{ingressClass.getCtrlNs()}
|
|
</DrawerItem>
|
|
<DrawerItem name="Scope">
|
|
{ingressClass.getCtrlScope()}
|
|
</DrawerItem>
|
|
<DrawerItem name="Kind">
|
|
{ingressClass.getCtrlKind()}
|
|
</DrawerItem>
|
|
<DrawerItem name="API Group">
|
|
{ingressClass.getCtrlApiGroup()}
|
|
</DrawerItem>
|
|
</>
|
|
);
|
|
}
|
|
|
|
render() {
|
|
const { object: ingressClass } = this.props;
|
|
|
|
return (
|
|
<div className={styles.IngressClassDetails}>
|
|
<DrawerItem name="Controller">
|
|
{ingressClass.getController()}
|
|
</DrawerItem>
|
|
{this.renderParameters()}
|
|
</div>
|
|
);
|
|
}
|
|
}
|
|
|
|
export const IngressClassDetails = withInjectables<{}, IngressClassDetailsProps>(NonInjectedIngressDetails, {
|
|
getProps: (di, props) => (props),
|
|
});
|