diff --git a/app/package.json b/app/package.json index 3884466..6e34809 100644 --- a/app/package.json +++ b/app/package.json @@ -28,7 +28,7 @@ }, "homepage": "https://github.com/hjacobs/kube-ops-view#readme", "dependencies": { - "pixi.js": "^4.7.3", + "pixi.js": "^4.8.5", "babel-runtime": "^6.26.0", "babel-polyfill": "^6.26.0" }, diff --git a/app/src/app.js b/app/src/app.js index b9aa116..668c290 100644 --- a/app/src/app.js +++ b/app/src/app.js @@ -1,6 +1,6 @@ import Tooltip from './tooltip.js' import Cluster from './cluster.js' -import {Pod, ALL_PODS, sortByName, sortByMemory, sortByCPU, sortByAge} from './pod.js' +import {Pod, ALL_PODS, sortByName, sortByMemory, sortByCPU, sortByAge, sortByStatus} from './pod.js' import SelectBox from './selectbox' import {Theme, ALL_THEMES} from './themes.js' import {DESATURATION_FILTER} from './filters.js' @@ -324,6 +324,9 @@ export default class App { }, { text: 'SORT: CPU', value: sortByCPU + }, + { + text: 'SORT: STATUS', value: sortByStatus } ] //setting default sort diff --git a/app/src/pod.js b/app/src/pod.js index 5c03964..aa0a10a 100644 --- a/app/src/pod.js +++ b/app/src/pod.js @@ -34,7 +34,11 @@ const sortByCPU = (a, b) => { return bCpu - aCpu } -export {ALL_PODS, sortByAge, sortByCPU, sortByMemory, sortByName} +const sortByStatus = (a, b) => { + return (a.phase).localeCompare(b.phase) +} + +export {ALL_PODS, sortByAge, sortByCPU, sortByMemory, sortByName, sortByStatus} export class Pod extends PIXI.Graphics {