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

@@ -4,6 +4,10 @@
&.volumes {
flex-grow: 2;
}
&.warning {
@include table-cell-warning;
}
}
}
}
@@ -4,10 +4,9 @@ import React from "react";
import { observer } from "mobx-react";
import { Trans } from "@lingui/macro";
import { KubeObjectListLayout } from "../kube-object";
import { KubeObjectMenu, KubeObjectMenuProps } from "../kube-object/kube-object-menu";
import { podSecurityPoliciesStore } from "./pod-security-policies.store";
import { PodSecurityPolicy, pspApi } from "../../api/endpoints";
import { apiManager } from "../../api/api-manager";
import { KubeObjectStatusIcon } from "../kube-object-status-icon";
enum sortBy {
name = "name",
@@ -38,6 +37,7 @@ export class PodSecurityPolicies extends React.Component {
renderHeaderTitle={<Trans>Pod Security Policies</Trans>}
renderTableHeader={[
{ title: <Trans>Name</Trans>, className: "name", sortBy: sortBy.name },
{ className: "warning" },
{ title: <Trans>Privileged</Trans>, className: "privileged", sortBy: sortBy.privileged },
{ title: <Trans>Volumes</Trans>, className: "volumes", sortBy: sortBy.volumes },
{ title: <Trans>Age</Trans>, className: "age", sortBy: sortBy.age },
@@ -45,6 +45,7 @@ export class PodSecurityPolicies extends React.Component {
renderTableContents={(item: PodSecurityPolicy) => {
return [
item.getName(),
<KubeObjectStatusIcon object={item} />,
item.isPrivileged() ? <Trans>Yes</Trans> : <Trans>No</Trans>,
item.getVolumes().join(", "),
item.getAge(),