mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Refactoring
Signed-off-by: Lauri Nevala <lauri.nevala@gmail.com>
This commit is contained in:
parent
061a786e26
commit
bbd0d9c456
@ -71,19 +71,19 @@ export class Deployments extends React.Component<Props> {
|
|||||||
renderHeaderTitle={<Trans>Deployments</Trans>}
|
renderHeaderTitle={<Trans>Deployments</Trans>}
|
||||||
renderTableHeader={[
|
renderTableHeader={[
|
||||||
{ title: <Trans>Name</Trans>, className: "name", sortBy: sortBy.name },
|
{ title: <Trans>Name</Trans>, className: "name", sortBy: sortBy.name },
|
||||||
|
{ className: "warning" },
|
||||||
{ title: <Trans>Namespace</Trans>, className: "namespace", sortBy: sortBy.namespace },
|
{ title: <Trans>Namespace</Trans>, className: "namespace", sortBy: sortBy.namespace },
|
||||||
{ title: <Trans>Pods</Trans>, className: "pods" },
|
{ title: <Trans>Pods</Trans>, className: "pods" },
|
||||||
{ title: <Trans>Replicas</Trans>, className: "replicas", sortBy: sortBy.replicas },
|
{ title: <Trans>Replicas</Trans>, className: "replicas", sortBy: sortBy.replicas },
|
||||||
{ className: "warning" },
|
|
||||||
{ title: <Trans>Age</Trans>, className: "age", sortBy: sortBy.age },
|
{ title: <Trans>Age</Trans>, className: "age", sortBy: sortBy.age },
|
||||||
{ title: <Trans>Conditions</Trans>, className: "conditions", sortBy: sortBy.condition },
|
{ title: <Trans>Conditions</Trans>, className: "conditions", sortBy: sortBy.condition },
|
||||||
]}
|
]}
|
||||||
renderTableContents={(deployment: Deployment) => [
|
renderTableContents={(deployment: Deployment) => [
|
||||||
deployment.getName(),
|
deployment.getName(),
|
||||||
|
<KubeObjectStatusIcon object={deployment}/>,
|
||||||
deployment.getNs(),
|
deployment.getNs(),
|
||||||
this.renderPods(deployment),
|
this.renderPods(deployment),
|
||||||
deployment.getReplicas(),
|
deployment.getReplicas(),
|
||||||
<KubeObjectStatusIcon object={deployment}/>,
|
|
||||||
deployment.getAge(),
|
deployment.getAge(),
|
||||||
this.renderConditions(deployment),
|
this.renderConditions(deployment),
|
||||||
]}
|
]}
|
||||||
|
|||||||
@ -68,22 +68,6 @@ export class Pods extends React.Component<Props> {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
renderPodStatus(pod: Pod) {
|
|
||||||
return {
|
|
||||||
className: kebabCase(pod.getStatusMessage()),
|
|
||||||
children: (
|
|
||||||
<span>
|
|
||||||
{pod.getStatusMessage()}
|
|
||||||
</span>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
renderPodStatusIcons(pod: Pod) {
|
|
||||||
return (
|
|
||||||
<KubeObjectStatusIcon object={pod} />
|
|
||||||
)
|
|
||||||
}
|
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<KubeObjectListLayout
|
<KubeObjectListLayout
|
||||||
@ -117,7 +101,7 @@ export class Pods extends React.Component<Props> {
|
|||||||
]}
|
]}
|
||||||
renderTableContents={(pod: Pod) => [
|
renderTableContents={(pod: Pod) => [
|
||||||
pod.getName(),
|
pod.getName(),
|
||||||
this.renderPodStatusIcons(pod),
|
<KubeObjectStatusIcon object={pod} />,
|
||||||
pod.getNs(),
|
pod.getNs(),
|
||||||
this.renderContainersStatus(pod),
|
this.renderContainersStatus(pod),
|
||||||
pod.getRestartsCount(),
|
pod.getRestartsCount(),
|
||||||
@ -132,7 +116,7 @@ export class Pods extends React.Component<Props> {
|
|||||||
}),
|
}),
|
||||||
pod.getQosClass(),
|
pod.getQosClass(),
|
||||||
pod.getAge(),
|
pod.getAge(),
|
||||||
this.renderPodStatus(pod)
|
{ title: pod.getStatusMessage(), className: kebabCase(pod.getStatusMessage()) }
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user