mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Fix all Age, LastSeen, and FirstSeen displays (#4990)
This commit is contained in:
1 parent
c9cab22558
commit
b08daa811d
48 files changed
+458
-344
No files matched your search
@@ -16,6 +16,7 @@ import { Table, TableCell, TableHead, TableRow } from "../table";
|
||||
import { KubeObjectStatusIcon } from "../kube-object-status-icon";
|
||||
import { replicaSetStore } from "../+workloads-replicasets/replicasets.store";
|
||||
import { showDetails } from "../kube-detail-params";
|
||||
import { KubeObjectAge } from "../kube-object/age";
|
||||
|
||||
|
||||
enum sortBy {
|
||||
@@ -71,25 +72,23 @@ export class DeploymentReplicaSets extends React.Component<DeploymentReplicaSets
|
||||
<TableCell className="actions"/>
|
||||
</TableHead>
|
||||
{
|
||||
replicaSets.map(replica => {
|
||||
return (
|
||||
<TableRow
|
||||
key={replica.getId()}
|
||||
sortItem={replica}
|
||||
nowrap
|
||||
onClick={prevDefault(() => showDetails(replica.selfLink, false))}
|
||||
>
|
||||
<TableCell className="name">{replica.getName()}</TableCell>
|
||||
<TableCell className="warning"><KubeObjectStatusIcon key="icon" object={replica}/></TableCell>
|
||||
<TableCell className="namespace">{replica.getNs()}</TableCell>
|
||||
<TableCell className="pods">{this.getPodsLength(replica)}</TableCell>
|
||||
<TableCell className="age">{replica.getAge()}</TableCell>
|
||||
<TableCell className="actions" onClick={stopPropagation}>
|
||||
<ReplicaSetMenu object={replica}/>
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
);
|
||||
})
|
||||
replicaSets.map(replica => (
|
||||
<TableRow
|
||||
key={replica.getId()}
|
||||
sortItem={replica}
|
||||
nowrap
|
||||
onClick={prevDefault(() => showDetails(replica.selfLink, false))}
|
||||
>
|
||||
<TableCell className="name">{replica.getName()}</TableCell>
|
||||
<TableCell className="warning"><KubeObjectStatusIcon key="icon" object={replica} /></TableCell>
|
||||
<TableCell className="namespace">{replica.getNs()}</TableCell>
|
||||
<TableCell className="pods">{this.getPodsLength(replica)}</TableCell>
|
||||
<TableCell className="age"><KubeObjectAge key="age" object={replica} /></TableCell>
|
||||
<TableCell className="actions" onClick={stopPropagation}>
|
||||
<ReplicaSetMenu object={replica} />
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
))
|
||||
}
|
||||
</Table>
|
||||
</div>
|
||||
|
||||
@@ -87,6 +87,7 @@ const dummyDeployment: Deployment = {
|
||||
getName: jest.fn(),
|
||||
getNs: jest.fn(),
|
||||
getAge: jest.fn(),
|
||||
getCreationTimestamp: jest.fn(),
|
||||
getTimeDiffFromNow: jest.fn(),
|
||||
getFinalizers: jest.fn(),
|
||||
getLabels: jest.fn(),
|
||||
|
||||
@@ -17,6 +17,7 @@ import kebabCase from "lodash/kebabCase";
|
||||
import orderBy from "lodash/orderBy";
|
||||
import { KubeObjectStatusIcon } from "../kube-object-status-icon";
|
||||
import type { DeploymentsRouteParams } from "../../../common/routes";
|
||||
import { KubeObjectAge } from "../kube-object/age";
|
||||
|
||||
enum columnId {
|
||||
name = "name",
|
||||
@@ -59,7 +60,7 @@ export class Deployments extends React.Component<DeploymentsProps> {
|
||||
[columnId.name]: deployment => deployment.getName(),
|
||||
[columnId.namespace]: deployment => deployment.getNs(),
|
||||
[columnId.replicas]: deployment => deployment.getReplicas(),
|
||||
[columnId.age]: deployment => deployment.getTimeDiffFromNow(),
|
||||
[columnId.age]: deployment => -deployment.getCreationTimestamp(),
|
||||
[columnId.condition]: deployment => deployment.getConditionsText(),
|
||||
}}
|
||||
searchFilters={[
|
||||
@@ -82,7 +83,7 @@ export class Deployments extends React.Component<DeploymentsProps> {
|
||||
deployment.getNs(),
|
||||
this.renderPods(deployment),
|
||||
deployment.getReplicas(),
|
||||
deployment.getAge(),
|
||||
<KubeObjectAge key="age" object={deployment} />,
|
||||
this.renderConditions(deployment),
|
||||
]}
|
||||
/>
|
||||
|
||||
Reference in new issue
Block a user