mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Provide link to configMap from pod details (#352)
Signed-off-by: Dan Slinky <dan-slinky@cookpad.jp>
This commit is contained in:
parent
2a4704716d
commit
2c3dc8370d
@ -171,6 +171,9 @@ export class Pod extends WorkloadKubeObject {
|
|||||||
medium?: string;
|
medium?: string;
|
||||||
sizeLimit?: string;
|
sizeLimit?: string;
|
||||||
};
|
};
|
||||||
|
configMap: {
|
||||||
|
name: string;
|
||||||
|
}
|
||||||
secret: {
|
secret: {
|
||||||
secretName: string;
|
secretName: string;
|
||||||
defaultMode: number;
|
defaultMode: number;
|
||||||
|
|||||||
@ -6,7 +6,7 @@ import { disposeOnUnmount, observer } from "mobx-react";
|
|||||||
import { Link } from "react-router-dom";
|
import { Link } from "react-router-dom";
|
||||||
import { autorun, observable, reaction, toJS } from "mobx";
|
import { autorun, observable, reaction, toJS } from "mobx";
|
||||||
import { Trans } from "@lingui/macro";
|
import { Trans } from "@lingui/macro";
|
||||||
import { IPodMetrics, nodesApi, Pod, podsApi, pvcApi } from "../../api/endpoints";
|
import { IPodMetrics, nodesApi, Pod, podsApi, pvcApi, configMapApi } from "../../api/endpoints";
|
||||||
import { DrawerItem, DrawerTitle } from "../drawer";
|
import { DrawerItem, DrawerTitle } from "../drawer";
|
||||||
import { Badge } from "../badge";
|
import { Badge } from "../badge";
|
||||||
import { autobind, cssNames, interval } from "../../utils";
|
import { autobind, cssNames, interval } from "../../utils";
|
||||||
@ -176,6 +176,7 @@ export class PodDetails extends React.Component<Props> {
|
|||||||
<DrawerTitle title={<Trans>Volumes</Trans>}/>
|
<DrawerTitle title={<Trans>Volumes</Trans>}/>
|
||||||
{volumes.map(volume => {
|
{volumes.map(volume => {
|
||||||
const claimName = volume.persistentVolumeClaim ? volume.persistentVolumeClaim.claimName : null;
|
const claimName = volume.persistentVolumeClaim ? volume.persistentVolumeClaim.claimName : null;
|
||||||
|
const configMap = volume.configMap ? volume.configMap.name : null;
|
||||||
const type = Object.keys(volume)[1]
|
const type = Object.keys(volume)[1]
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -187,6 +188,20 @@ export class PodDetails extends React.Component<Props> {
|
|||||||
<DrawerItem name={<Trans>Type</Trans>}>
|
<DrawerItem name={<Trans>Type</Trans>}>
|
||||||
{type}
|
{type}
|
||||||
</DrawerItem>
|
</DrawerItem>
|
||||||
|
{ type == "configMap" && (
|
||||||
|
<div>
|
||||||
|
{configMap && (
|
||||||
|
<DrawerItem name={<Trans>Name</Trans>}>
|
||||||
|
<Link
|
||||||
|
to={getDetailsUrl(configMapApi.getUrl({
|
||||||
|
name: configMap,
|
||||||
|
namespace: pod.getNs(),
|
||||||
|
}))}>{configMap}
|
||||||
|
</Link>
|
||||||
|
</DrawerItem>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
{ type === "emptyDir" && (
|
{ type === "emptyDir" && (
|
||||||
<div>
|
<div>
|
||||||
{ volume.emptyDir.medium && (
|
{ volume.emptyDir.medium && (
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user