Stop using table map feature

This commit is contained in:
Juan Cruz Viotti 2015-01-06 14:07:35 -03:00
parent 19e151e521
commit 57c86f920c
2 changed files with 26 additions and 16 deletions

View File

@ -33,20 +33,25 @@ exports.list = permissions.user ->
resin.models.application.getAll (error, applications) ->
errors.handle(error) if error?
log.out ui.widgets.table.horizontal applications, (application) ->
application.device_type = application.device_display_name
application.all_devices = application.devices_length
return application
, [ 'ID', 'Name', 'Device Type', 'Online Devices', 'All Devices' ]
log.out ui.widgets.table.horizontal applications, _.identity, [
'ID'
'Name'
'Device Display Name'
'Online Devices'
'Devices Length'
]
exports.info = permissions.user (params) ->
resin.models.application.get params.id, (error, application) ->
errors.handle(error) if error?
log.out ui.widgets.table.vertical application, (application) ->
application.device_type = application.device_display_name
return application
, [ 'ID', 'Name', 'Device Type', 'Git Repository', 'Commit' ]
log.out ui.widgets.table.vertical application, _.identity, [
'ID'
'Name'
'Device Display Name'
'Git Repository'
'Commit'
]
exports.restart = permissions.user (params) ->
resin.models.application.restart params.id, (error) ->

View File

@ -16,10 +16,16 @@ exports.list = permissions.user ->
example.id = index + 1
return example
log.out ui.widgets.table.horizontal examplesData, (example) ->
examplesData = _.map examplesData, (example) ->
example.author ?= 'Unknown'
return example
, [ 'ID', 'Display Name', 'Repository', 'Author' ]
log.out ui.widgets.table.horizontal examplesData, _.identity, [
'ID'
'Display Name'
'Repository'
'Author'
]
exports.info = permissions.user (params) ->
id = params.id - 1
@ -29,11 +35,10 @@ exports.info = permissions.user (params) ->
error = new Error("Unknown example: #{id}")
errors.handle(error)
log.out ui.widgets.table.vertical example, (example) ->
example.id = id
example.author ?= 'Unknown'
return example
, [
example.id = id
example.author ?= 'Unknown'
log.out ui.widgets.table.vertical example, _.identity, [
'ID'
'Display Name'
'Description'