Fixed device redirect when not usable.

This commit is contained in:
Gunther Brunner
2014-05-29 02:27:08 +09:00
parent aa8f8fd999
commit 12fc884f78
10 changed files with 62 additions and 64 deletions

View File

@@ -99,16 +99,16 @@ module.exports = function DeviceServiceFactory($http, socket) {
// For convenience, add the sorting priority to each state
function getStateSorting(state) {
return {
'using': 1,
'available': 2,
'ready': 3,
'present': 4,
'busy': 5,
'absent': 6,
'preparing': 7,
'unauthorized': 8,
'offline': 9
}[state] || 10
'using': 10,
'available': 9,
'ready': 8,
'present': 7,
'busy': 6,
'absent': 5,
'preparing': 4,
'unauthorized': 3,
'offline': 2
}[state] || 1
}
function get(data) {