Skip to content
This repository was archived by the owner on Oct 3, 2020. It is now read-only.

Commit 34bb4d6

Browse files
tomislaterhjacobs
authored andcommitted
Add sorting by status (#201)
* add sorting by status * bump pixi.js to 4.8.5
1 parent a169563 commit 34bb4d6

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
},
2929
"homepage": "https://github.com/hjacobs/kube-ops-view#readme",
3030
"dependencies": {
31-
"pixi.js": "^4.7.3",
31+
"pixi.js": "^4.8.5",
3232
"babel-runtime": "^6.26.0",
3333
"babel-polyfill": "^6.26.0"
3434
},

app/src/app.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Tooltip from './tooltip.js'
22
import Cluster from './cluster.js'
3-
import {Pod, ALL_PODS, sortByName, sortByMemory, sortByCPU, sortByAge} from './pod.js'
3+
import {Pod, ALL_PODS, sortByName, sortByMemory, sortByCPU, sortByAge, sortByStatus} from './pod.js'
44
import SelectBox from './selectbox'
55
import {Theme, ALL_THEMES} from './themes.js'
66
import {DESATURATION_FILTER} from './filters.js'
@@ -324,6 +324,9 @@ export default class App {
324324
},
325325
{
326326
text: 'SORT: CPU', value: sortByCPU
327+
},
328+
{
329+
text: 'SORT: STATUS', value: sortByStatus
327330
}
328331
]
329332
//setting default sort

app/src/pod.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,11 @@ const sortByCPU = (a, b) => {
3434
return bCpu - aCpu
3535
}
3636

37-
export {ALL_PODS, sortByAge, sortByCPU, sortByMemory, sortByName}
37+
const sortByStatus = (a, b) => {
38+
return (a.phase).localeCompare(b.phase)
39+
}
40+
41+
export {ALL_PODS, sortByAge, sortByCPU, sortByMemory, sortByName, sortByStatus}
3842

3943
export class Pod extends PIXI.Graphics {
4044

0 commit comments

Comments
 (0)