mirror of
https://github.com/balena-io/balena-cli.git
synced 2025-01-31 00:24:15 +00:00
Fix TypeError when running 'balena apps'
Change-type: patch Signed-off-by: Paulo Castro <paulo@balena.io>
This commit is contained in:
parent
3b5f3c6665
commit
d47fe0609f
@ -82,6 +82,7 @@ exports.list =
|
|||||||
permission: 'user'
|
permission: 'user'
|
||||||
primary: true
|
primary: true
|
||||||
action: (params, options, done) ->
|
action: (params, options, done) ->
|
||||||
|
_ = require('lodash')
|
||||||
balena = require('balena-sdk').fromSharedOptions()
|
balena = require('balena-sdk').fromSharedOptions()
|
||||||
visuals = require('resin-cli-visuals')
|
visuals = require('resin-cli-visuals')
|
||||||
|
|
||||||
@ -94,8 +95,8 @@ exports.list =
|
|||||||
$expand: owns__device: $select: 'is_online'
|
$expand: owns__device: $select: 'is_online'
|
||||||
.then (applications) ->
|
.then (applications) ->
|
||||||
applications.forEach (application) ->
|
applications.forEach (application) ->
|
||||||
application.device_count = application.owns__device.length
|
application.device_count = _.size(application.owns__device)
|
||||||
application.online_devices = application.owns__device.filter((d) -> d.is_online == true).length
|
application.online_devices = _.filter(application.owns__device, (d) -> d.is_online == true).length
|
||||||
|
|
||||||
console.log visuals.table.horizontal applications, [
|
console.log visuals.table.horizontal applications, [
|
||||||
'id'
|
'id'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user