Add sorting by status (#201)
* add sorting by status * bump pixi.js to 4.8.5
This commit is contained in:
committed by
Henning Jacobs
parent
a169563d7d
commit
34bb4d6917
@@ -28,7 +28,7 @@
|
|||||||
},
|
},
|
||||||
"homepage": "https://github.com/hjacobs/kube-ops-view#readme",
|
"homepage": "https://github.com/hjacobs/kube-ops-view#readme",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"pixi.js": "^4.7.3",
|
"pixi.js": "^4.8.5",
|
||||||
"babel-runtime": "^6.26.0",
|
"babel-runtime": "^6.26.0",
|
||||||
"babel-polyfill": "^6.26.0"
|
"babel-polyfill": "^6.26.0"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import Tooltip from './tooltip.js'
|
import Tooltip from './tooltip.js'
|
||||||
import Cluster from './cluster.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 SelectBox from './selectbox'
|
||||||
import {Theme, ALL_THEMES} from './themes.js'
|
import {Theme, ALL_THEMES} from './themes.js'
|
||||||
import {DESATURATION_FILTER} from './filters.js'
|
import {DESATURATION_FILTER} from './filters.js'
|
||||||
@@ -324,6 +324,9 @@ export default class App {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: 'SORT: CPU', value: sortByCPU
|
text: 'SORT: CPU', value: sortByCPU
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: 'SORT: STATUS', value: sortByStatus
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
//setting default sort
|
//setting default sort
|
||||||
|
|||||||
@@ -34,7 +34,11 @@ const sortByCPU = (a, b) => {
|
|||||||
return bCpu - aCpu
|
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 {
|
export class Pod extends PIXI.Graphics {
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user