mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-19 00:23:25 +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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user