1
0
Fork 0
mirror of https://github.com/openstf/stf synced 2025-10-06 03:50:04 +02:00

APKs can now be drag & dropped to the device screen, which will install the application. Still lacking UI, and the app doesn't get launched.

This commit is contained in:
Simo Kinnunen 2014-03-20 22:00:01 +09:00
parent 5771507fc9
commit dfe3d97de3
12 changed files with 280 additions and 8 deletions

View file

@ -1,4 +1,4 @@
module.exports = function ControlServiceFactory($rootScope, socket, TransactionService) {
module.exports = function ControlServiceFactory($rootScope, $upload, socket, TransactionService) {
var controlService = {
}
@ -87,6 +87,28 @@ module.exports = function ControlServiceFactory($rootScope, socket, TransactionS
socket.emit('device.identify', channel, tx.channel)
return tx
}
this.install = function(files) {
return $upload.upload({
url: '/api/v1/resources'
, method: 'POST'
, file: files[0]
})
.success(function(data) {
console.log('success', arguments)
var tx = TransactionService.create(devices)
socket.emit('device.install', channel, tx.channel, {
url: data.url
})
return tx
})
.error(function() {
console.log('error', arguments)
})
.progress(function() {
console.log('progress', arguments)
})
}
}
controlService.forOne = function(device, channel) {