1
0
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:
Alex Andreev 2021-07-22 11:24:25 +03:00
parent fe33296ba5
commit 895b81fd72
7 changed files with 7 additions and 7 deletions

View File

@ -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) {

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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) {

View File

@ -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);

View File

@ -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);