mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Sort statuses allowing 'running' to be first
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
parent
fe33296ba5
commit
895b81fd72
@ -34,7 +34,7 @@ export class CronJobStore extends KubeObjectStore<CronJob> {
|
||||
}
|
||||
|
||||
getStatuses(cronJobs?: CronJob[]) {
|
||||
const status = { suspended: 0, scheduled: 0 };
|
||||
const status = { scheduled: 0, suspended: 0 };
|
||||
|
||||
cronJobs.forEach(cronJob => {
|
||||
if (cronJob.spec.suspend) {
|
||||
|
||||
@ -49,7 +49,7 @@ export class DaemonSetStore extends KubeObjectStore<DaemonSet> {
|
||||
}
|
||||
|
||||
getStatuses(daemonSets?: DaemonSet[]) {
|
||||
const status = { failed: 0, pending: 0, running: 0 };
|
||||
const status = { running: 0, failed: 0, pending: 0 };
|
||||
|
||||
daemonSets.forEach(daemonSet => {
|
||||
const pods = this.getChildPods(daemonSet);
|
||||
|
||||
@ -50,7 +50,7 @@ export class DeploymentStore extends KubeObjectStore<Deployment> {
|
||||
}
|
||||
|
||||
getStatuses(deployments?: Deployment[]) {
|
||||
const status = { failed: 0, pending: 0, running: 0 };
|
||||
const status = { running: 0, failed: 0, pending: 0 };
|
||||
|
||||
deployments.forEach(deployment => {
|
||||
const pods = this.getChildPods(deployment);
|
||||
|
||||
@ -46,7 +46,7 @@ export class JobStore extends KubeObjectStore<Job> {
|
||||
}
|
||||
|
||||
getStatuses(jobs?: Job[]) {
|
||||
const status = { failed: 0, pending: 0, running: 0, succeeded: 0 };
|
||||
const status = { running: 0, succeeded: 0, failed: 0, pending: 0 };
|
||||
|
||||
jobs.forEach(job => {
|
||||
const pods = this.getChildPods(job);
|
||||
|
||||
@ -80,7 +80,7 @@ export class PodsStore extends KubeObjectStore<Pod> {
|
||||
}
|
||||
|
||||
getStatuses(pods: Pod[]) {
|
||||
return countBy(pods.map(pod => pod.getStatus()));
|
||||
return countBy(pods.map(pod => pod.getStatus()).sort().reverse());
|
||||
}
|
||||
|
||||
getPodKubeMetrics(pod: Pod) {
|
||||
|
||||
@ -49,7 +49,7 @@ export class ReplicaSetStore extends KubeObjectStore<ReplicaSet> {
|
||||
}
|
||||
|
||||
getStatuses(replicaSets: ReplicaSet[]) {
|
||||
const status = { failed: 0, pending: 0, running: 0 };
|
||||
const status = { running: 0, failed: 0, pending: 0 };
|
||||
|
||||
replicaSets.forEach(replicaSet => {
|
||||
const pods = this.getChildPods(replicaSet);
|
||||
|
||||
@ -49,7 +49,7 @@ export class StatefulSetStore extends KubeObjectStore<StatefulSet> {
|
||||
}
|
||||
|
||||
getStatuses(statefulSets: StatefulSet[]) {
|
||||
const status = { failed: 0, pending: 0, running: 0 };
|
||||
const status = { running: 0, failed: 0, pending: 0 };
|
||||
|
||||
statefulSets.forEach(statefulSet => {
|
||||
const pods = this.getChildPods(statefulSet);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user