Add sorting by status (#201)

* add sorting by status

* bump pixi.js to 4.8.5
This commit is contained in:
Tomek Święcicki
2019-01-27 23:07:04 +01:00
committed by Henning Jacobs
parent a169563d7d
commit 34bb4d6917
3 changed files with 10 additions and 3 deletions

View File

@@ -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"
},

View File

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

View File

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