Implement KubeObjectStatusText extension API (#1188)

Signed-off-by: Lauri Nevala <lauri.nevala@gmail.com>
This commit is contained in:
Lauri Nevala authored and GitHub committed 2020-11-11 08:57:15 +02:00
1 parent d15692a50e
commit 85c4a10114
64 files changed
+4050 -66

No files matched your search

@@ -7,7 +7,6 @@ import { Trans } from "@lingui/macro";
import { podsStore } from "./pods.store";
import { Pod } from "../../api/endpoints";
import { autobind, bytesToUnits, cssNames, interval, prevDefault } from "../../utils";
import { KubeEventIcon } from "../+events/kube-event-icon";
import { LineProgress } from "../line-progress";
import { KubeObject } from "../../api/kube-object";
import { Table, TableCell, TableHead, TableRow } from "../table";
@@ -15,6 +14,7 @@ import { showDetails } from "../../navigation";
import { reaction } from "mobx";
import { Spinner } from "../spinner";
import { DrawerTitle } from "../drawer";
import { KubeObjectStatusIcon } from "../kube-object-status-icon";
enum sortBy {
name = "name",
@@ -107,7 +107,7 @@ export class PodDetailsList extends React.Component<Props> {
onClick={prevDefault(() => showDetails(pod.selfLink, false))}
>
<TableCell className="name">{pod.getName()}</TableCell>
<TableCell className="warning">{pod.hasIssues() && <KubeEventIcon object={pod}/>}</TableCell>
<TableCell className="warning"><KubeObjectStatusIcon object={pod}/></TableCell>
<TableCell className="namespace">{pod.getNs()}</TableCell>
<TableCell className="cpu">{this.renderCpuUsage(`cpu-${pod.getId()}`, metrics.cpu)}</TableCell>
<TableCell className="memory">{this.renderMemoryUsage(`memory-${pod.getId()}`, metrics.memory)}</TableCell>
@@ -13,12 +13,13 @@ import { KubeObjectListLayout } from "../kube-object";
import { Pod } from "../../api/endpoints";
import { StatusBrick } from "../status-brick";
import { cssNames, stopPropagation } from "../../utils";
import { KubeEventIcon } from "../+events/kube-event-icon";
import { getDetailsUrl } from "../../navigation";
import toPairs from "lodash/toPairs";
import startCase from "lodash/startCase";
import kebabCase from "lodash/kebabCase";
import { lookupApiLink } from "../../api/kube-api";
import { KubeObjectStatusIcon } from "../kube-object-status-icon";
enum sortBy {
name = "name",
@@ -100,7 +101,7 @@ export class Pods extends React.Component<Props> {
]}
renderTableContents={(pod: Pod) => [
pod.getName(),
pod.hasIssues() && <KubeEventIcon object={pod}/>,
<KubeObjectStatusIcon object={pod} />,
pod.getNs(),
this.renderContainersStatus(pod),
pod.getRestartsCount(),